From b1f41ac4f24d1233da51d255fc438c3ae0b296ab Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 7 Nov 2020 10:58:51 -0700 Subject: [PATCH] mensaje de alerta al cargar proyectados --- Inventarios/KardexAlmacenHorizontal.aspx.vb | 24 +++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index f53140e8f..31f4b7296 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -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}
", 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