From 12ac2b0561724091985a760596fc809c7e2f0e92 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 26 Jul 2024 17:49:58 -0700 Subject: [PATCH] =?UTF-8?q?--=20validaci=C3=B3n=20de=20carga=20excel,=20cu?= =?UTF-8?q?ando=20no=20existe=20el=20PS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/TraspasoAlmacen.aspx.vb | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 68399421d..852727307 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -2953,16 +2953,14 @@ Partial Class Inventarios_TraspasoAlmacen Dim RowPS As DataRow = DtPS.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Codigo").ToString())) - Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero() - Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString().ToEntero() - - Dim Cantidad As Decimal = RowExcel("Cantidad").ToString().ToDecimal() - Dim Serie As String = RowExcel("Serie").ToString() - Dim Lote As String = RowExcel("Lote").ToString() - Dim FechaCaducidad As Date = If(RowExcel("FechaCaducidad").ToString = "", MinFecha, RowExcel("FechaCaducidad").ToString.ToDate) - Dim Observaciones As String = RowExcel("Observaciones").ToString() - - If CveProducto > 0 Then + If RowPS IsNot Nothing Then + Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero() + Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString().ToEntero() + Dim Cantidad As Decimal = RowExcel("Cantidad").ToString().ToDecimal() + Dim Serie As String = RowExcel("Serie").ToString() + Dim Lote As String = RowExcel("Lote").ToString() + Dim FechaCaducidad As Date = If(RowExcel("FechaCaducidad").ToString = "", MinFecha, RowExcel("FechaCaducidad").ToString.ToDate) + Dim Observaciones As String = RowExcel("Observaciones").ToString() Dim Valido As Boolean = True Dim ValidarLote As Boolean = True @@ -3001,10 +2999,9 @@ Partial Class Inventarios_TraspasoAlmacen RowsNoCargados = RowsNoCargados + 1 ProductosNoCargados.AppendFormat("{0},", RowPS("PSCodigo").ToString()) End If - Else RowsNoCargados = RowsNoCargados + 1 - ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString()) + ProductosNoCargados.AppendFormat("{0}, ", RowExcel("Producto").ToString()) End If End If Next