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