mensaje de alerta al cargar proyectados
This commit is contained in:
@@ -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))
|
|
||||||
Dim Cantidad As Decimal = dtRow("Cantidad").ToString.ToDecimal
|
If Codigo <> "" Then
|
||||||
If Not ObjInventarios.AddMovimientosProyectados(CvePS, Cantidad, RblProyeccionOpcion.SelectedValue.ToEntero()) Then
|
Dim CvePS As Integer = DtProductosEmpresas.FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", Codigo)).ToEntero
|
||||||
TieneError = True
|
Dim Cantidad As Decimal = dtRow("Cantidad").ToString.ToDecimal
|
||||||
Exit For
|
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
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user