mensaje de alerta al cargar proyectados

This commit is contained in:
rrene
2020-11-07 10:58:51 -07:00
parent acf451c328
commit b1f41ac4f2

View File

@@ -393,6 +393,7 @@ Partial Class Inventarios_KardexAlmacen
Private Sub AgregarProyeccion(dt As DataTable) Private Sub AgregarProyeccion(dt As DataTable)
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
Dim StrCodigo As New StringBuilder
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
ObjInventarios.IniciaTransacSQL() ObjInventarios.IniciaTransacSQL()
@@ -400,25 +401,36 @@ Partial Class Inventarios_KardexAlmacen
Dim DtProductosEmpresas As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) Dim DtProductosEmpresas As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
For Each dtRow As DataRow In dt.Rows For Each dtRow As DataRow In dt.Rows
Dim Codigo As String = dtRow("Código").ToString Dim Codigo As String = dtRow("Código").ToString
Dim CvePS As Integer = DtProductosEmpresas.FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", Codigo))
If Codigo <> "" Then
Dim CvePS As Integer = DtProductosEmpresas.FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", Codigo)).ToEntero
Dim Cantidad As Decimal = dtRow("Cantidad").ToString.ToDecimal Dim Cantidad As Decimal = dtRow("Cantidad").ToString.ToDecimal
If Not ObjInventarios.AddMovimientosProyectados(CvePS, Cantidad, RblProyeccionOpcion.SelectedValue.ToEntero()) Then If CvePS <= 0 Then
TieneError = True TieneError = True
StrCodigo.AppendFormat(" {0}<br/>", Codigo)
Exit For
ElseIf Not ObjInventarios.AddMovimientosProyectados(CvePS, Cantidad, RblProyeccionOpcion.SelectedValue.ToEntero()) Then
TieneError = True
StrCodigo.Append("Ocurrio un error al registrar")
Exit For Exit For
End If End If
End If
Next Next
Else Else
TieneError = True TieneError = True
End If End If
If TieneError Then If TieneError Then
Alert("Ocurrio un error al registrar el Código no encontrado: " & StrCodigo.ToString, TipoMensaje.MsgError)
ObjInventarios.RollBack() ObjInventarios.RollBack()
Else Else
ObjInventarios.Commit() ObjInventarios.Commit()
Alert("Se ha agregado la proyección de productos correctamente")
End If End If
ObjInventarios.Dispose() ObjInventarios.Dispose()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivProyeccion")) RegistraScript(String.Format("$('#{0}').modal('hide');", "DivProyeccion"))
Alert("Se ha agregado la proyección de productos correctamente")
End Sub End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable