Cambios visuales y errores al momento de guardar los usuarios
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", gvIF.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", gvIF.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="gvIF" runat="server" EmptyDataText="Aun no hay registros." DataKeyNames="CveInventarioFisico,InventarioFisico,Observaciones,FechaInicio,FechaFin,CveSubProyecto" AutoGenerateColumns="False" ShowHeader="True" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||
<asp:GridView ID="gvIF" runat="server" EmptyDataText="Aun no hay registros." DataKeyNames="CveInventarioFisico,InventarioFisico,Observaciones,FechaInicio,FechaFin,CveSubProyecto,ConAplicacion" AutoGenerateColumns="False" ShowHeader="True" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField
|
||||
DataNavigateUrlFields="CveInventarioFisico" DataNavigateUrlFormatString="~/Inventarios/InventarioFisicoDetalle.aspx?CveInventarioFisico={0}" Target="_blank" HeaderText="Inventario Físico" DataTextField="InventarioFisico" ItemStyle-HorizontalAlign="Left"></asp:HyperLinkField>
|
||||
@@ -125,16 +125,13 @@
|
||||
<asp:UpdatePanel ID="UpBodyInventarioFisico" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTitulo" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTitulos" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTitulo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Titulo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtTitulo.ClientID.ToString()%>">Titulo:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:CheckBox runat="server" ID="chkUsarApp" AutoPostBack="true" Text="Usar en App:"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtObservaciones" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="500"></asp:TextBox>
|
||||
@@ -422,8 +419,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6" runat="server" id="divUsuarios" >
|
||||
<div class="row" style="border-top: 1px solid #e5e5e5;">
|
||||
<div class="col-md-12" style="margin-top:15px;">
|
||||
<div class="col-md-6">
|
||||
<asp:CheckBox runat="server" ID="chkUsarApp" AutoPostBack="true" Text="Usar en App:"/>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6" runat="server" id="divUsuarios" visible="false">
|
||||
<div class="portlet light xspadding bordered" id="idUsuarios">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
@@ -474,11 +476,19 @@
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user