Cambios visuales y errores al momento de guardar los usuarios

This commit is contained in:
Hector
2021-08-03 18:40:17 -07:00
parent 5287254bdb
commit 76da800a00
2 changed files with 160 additions and 143 deletions

View File

@@ -506,6 +506,7 @@ Partial Class Inventarios_InventarioFisico
FechaInicio = GvRow.DataKey("FechaInicio").ToEntero
FechaFin = GvRow.DataKey("FechaFin").ToEntero
DdlSubProyecto.SelectedValue = GvRow.DataKey("CveSubProyecto").ToEntero
chkUsarApp.Checked = Convert.ToBoolean(GvRow.DataKey("ConAplicacion").ToString)
CargaGvAlmacen()
CargaGvClasificacion()
CargaGvProductosServicios()
@@ -576,66 +577,71 @@ Partial Class Inventarios_InventarioFisico
Dim ErrorClasif As Boolean = False
Dim ObjInventario As New ClsInventarios
Dim CveInventarioFisico As Integer
Dim aplicacion As Boolean = chkUsarApp.Checked
ObjInventario.IniciaTransacSQL()
If HdnModalidad.Value = "A" Then
If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, TxtObservaciones.Text, 0, DdlSubProyecto.SelectedValue.ToEntero) Then
If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, TxtObservaciones.Text, 0, DdlSubProyecto.SelectedValue.ToEntero, aplicacion) Then
CveInventarioFisico = ObjInventario.CveInventarioFisico
If CveInventarioFisico > 0 Then
For Each Gvr As GridViewRow In GvAlmacen.Rows
If Not ObjInventario.AddInventarioFisicoAlmacenes(CveInventarioFisico, Gvr.DataKey("CveAlmacen").ToEntero) Then
ErrorClasif = True
Exit For
For Each Gvr As GridViewRow In GvAlmacen.Rows
If Not ObjInventario.AddInventarioFisicoAlmacenes(CveInventarioFisico, Gvr.DataKey("CveAlmacen").ToEntero) Then
ErrorClasif = True
Exit For
End If
Next
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvClasificacion.Rows
If Not ObjInventario.AddInventarioFisicoClasificaciones(CveInventarioFisico, Gvr.DataKey("CveClasificacion").ToEntero, UsuarioActual.CveUsuario, True) Then
ErrorClasif = True
Exit For
End If
Next
For Each Gvr As GridViewRow In GvClasificacionExcluida.Rows
If Not ObjInventario.AddInventarioFisicoClasificaciones(CveInventarioFisico, Gvr.DataKey("CveClasificacion").ToEntero, UsuarioActual.CveUsuario, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
Next
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvClasificacion.Rows
If Not ObjInventario.AddInventarioFisicoClasificaciones(CveInventarioFisico, Gvr.DataKey("CveClasificacion").ToEntero, UsuarioActual.CveUsuario, True) Then
ErrorClasif = True
Exit For
End If
Next
For Each Gvr As GridViewRow In GvClasificacionExcluida.Rows
If Not ObjInventario.AddInventarioFisicoClasificaciones(CveInventarioFisico, Gvr.DataKey("CveClasificacion").ToEntero, UsuarioActual.CveUsuario, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvPS.Rows
If Not ObjInventario.AddInventarioFisicoProductosServicios(CveInventarioFisico, Gvr.DataKey("CvePS").ToEntero, True) Then
ErrorClasif = True
Exit For
End If
Next
For Each Gvr As GridViewRow In GvPSExcluye.Rows
If Not ObjInventario.AddInventarioFisicoProductosServicios(CveInventarioFisico, Gvr.DataKey("CvePS").ToEntero, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvPS.Rows
If Not ObjInventario.AddInventarioFisicoProductosServicios(CveInventarioFisico, Gvr.DataKey("CvePS").ToEntero, True) Then
ErrorClasif = True
Exit For
End If
Next
For Each Gvr As GridViewRow In GvPSExcluye.Rows
If Not ObjInventario.AddInventarioFisicoProductosServicios(CveInventarioFisico, Gvr.DataKey("CvePS").ToEntero, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvProveedor.Rows
If Not ObjInventario.AddInventarioFisicoProveedores(CveInventarioFisico, Gvr.DataKey("CveProveedor").ToEntero, True) Then
ErrorClasif = True
Exit For
End If
Next
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvProveedor.Rows
If Not ObjInventario.AddInventarioFisicoProveedores(HdnID.Value, Gvr.DataKey("CveProveedor").ToEntero, True) Then
ErrorClasif = True
Exit For
End If
Next
End If
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In gvUsuarios.Rows
If Not ObjInventario.AddInventarioFisicoUsuarios(HdnID.Value, Gvr.DataKey("CveUsuario").ToEntero, True, False, False) Then
ErrorClasif = True
Exit For
End If
Next
If ErrorClasif = False Then
For Each Gvr As GridViewRow In gvUsuarios.Rows
If Not ObjInventario.AddInventarioFisicoUsuarios(CveInventarioFisico, Gvr.DataKey("CveUsuario").ToEntero, True, False, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
Else
ErrorClasif = False
End If
If ErrorClasif = False And CveInventarioFisico > 0 Then
@@ -650,96 +656,97 @@ Partial Class Inventarios_InventarioFisico
End If
Else
If HdnID.Value.ToEntero > 0 Then
If ObjInventario.UpdateInventarioFisico(HdnID.Value.ToEntero, TxtTitulo.Text, TxtObservaciones.Text, DdlSubProyecto.SelectedValue.ToEntero) Then
If ObjInventario.UpdateInventarioFisico(HdnID.Value, TxtTitulo.Text, TxtObservaciones.Text, DdlSubProyecto.SelectedValue.ToEntero) Then
If Not ObjInventario.RemoveInventarioFisicoAlamacen(HdnID.Value.ToEntero) Then
ErrorClasif = True
End If
If Not ObjInventario.RemoveInventarioFisicoClasificacion(HdnID.Value.ToEntero) Then
ErrorClasif = True
End If
If Not ObjInventario.RemoveInventarioFisicoAlamacen(HdnID.Value) Then
ErrorClasif = True
If Not ObjInventario.RemoveInventarioFisicoProductosServicios(HdnID.Value.ToEntero) Then
ErrorClasif = True
End If
If Not ObjInventario.RemoveInventarioFisicoProveedores(HdnID.Value.ToEntero) Then
ErrorClasif = True
End If
If Not ObjInventario.RemoveInventarioFisicoUsuarios(HdnID.Value.ToEntero) Then
ErrorClasif = True
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvAlmacen.Rows
If Not ObjInventario.AddInventarioFisicoAlmacenes(HdnID.Value.ToEntero, Gvr.DataKey("CveAlmacen").ToEntero) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvClasificacion.Rows
If Not ObjInventario.AddInventarioFisicoClasificaciones(HdnID.Value.ToEntero, Gvr.DataKey("CveClasificacion").ToEntero, UsuarioActual.CveUsuario, True) Then
ErrorClasif = True
Exit For
End If
Next
For Each Gvr As GridViewRow In GvClasificacionExcluida.Rows
If Not ObjInventario.AddInventarioFisicoClasificaciones(HdnID.Value.ToEntero, Gvr.DataKey("CveClasificacion").ToEntero, UsuarioActual.CveUsuario, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvPS.Rows
If Not ObjInventario.AddInventarioFisicoProductosServicios(HdnID.Value.ToEntero, Gvr.DataKey("CvePS").ToEntero, True) Then
ErrorClasif = True
Exit For
End If
Next
For Each Gvr As GridViewRow In GvPSExcluye.Rows
If Not ObjInventario.AddInventarioFisicoProductosServicios(HdnID.Value.ToEntero, Gvr.DataKey("CvePS").ToEntero, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvProveedor.Rows
If Not ObjInventario.AddInventarioFisicoProveedores(HdnID.Value.ToEntero, Gvr.DataKey("CveProveedor").ToEntero, True) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
Dim cerrado As Boolean = False
Dim bloqueado As Boolean = False
For Each Gvr As GridViewRow In gvUsuarios.Rows
cerrado = Convert.ToBoolean(Gvr.DataKey("Cerrado").ToString)
bloqueado = Gvr.FCCheckBox("chkBloqueado").Checked
If Not ObjInventario.AddInventarioFisicoUsuarios(HdnID.Value.ToEntero, Gvr.DataKey("CveUsuario").ToEntero, True, cerrado, bloqueado) Then
ErrorClasif = True
Exit For
End If
Next
End If
Else
ErrorClasif = False
End If
If Not ObjInventario.RemoveInventarioFisicoClasificacion(HdnID.Value) Then
ErrorClasif = True
End If
If Not ObjInventario.RemoveInventarioFisicoProductosServicios(HdnID.Value) Then
ErrorClasif = True
End If
If Not ObjInventario.RemoveInventarioFisicoProveedores(HdnID.Value) Then
ErrorClasif = True
End If
If Not ObjInventario.RemoveInventarioFisicoUsuarios(HdnID.Value) Then
ErrorClasif = True
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvAlmacen.Rows
If Not ObjInventario.AddInventarioFisicoAlmacenes(HdnID.Value, Gvr.DataKey("CveAlmacen").ToEntero) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvClasificacion.Rows
If Not ObjInventario.AddInventarioFisicoClasificaciones(HdnID.Value, Gvr.DataKey("CveClasificacion").ToEntero, UsuarioActual.CveUsuario, True) Then
ErrorClasif = True
Exit For
End If
Next
For Each Gvr As GridViewRow In GvClasificacionExcluida.Rows
If Not ObjInventario.AddInventarioFisicoClasificaciones(HdnID.Value, Gvr.DataKey("CveClasificacion").ToEntero, UsuarioActual.CveUsuario, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvPS.Rows
If Not ObjInventario.AddInventarioFisicoProductosServicios(HdnID.Value, Gvr.DataKey("CvePS").ToEntero, True) Then
ErrorClasif = True
Exit For
End If
Next
For Each Gvr As GridViewRow In GvPSExcluye.Rows
If Not ObjInventario.AddInventarioFisicoProductosServicios(HdnID.Value, Gvr.DataKey("CvePS").ToEntero, False) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
For Each Gvr As GridViewRow In GvProveedor.Rows
If Not ObjInventario.AddInventarioFisicoProveedores(HdnID.Value, Gvr.DataKey("CveProveedor").ToEntero, True) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False Then
Dim cerrado As Boolean = False
Dim bloqueado As Boolean = False
For Each Gvr As GridViewRow In gvUsuarios.Rows
cerrado = Convert.ToBoolean(Gvr.DataKey("Cerrado").ToString)
bloqueado = Gvr.FCCheckBox("chkBloqueado").Checked
If Not ObjInventario.AddInventarioFisicoUsuarios(HdnID.Value, Gvr.DataKey("CveUsuario").ToEntero, True, cerrado, bloqueado) Then
ErrorClasif = True
Exit For
End If
Next
End If
If ErrorClasif = False And HdnID.Value > 0 Then
ObjInventario.Commit()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)