CatEstatusOrdenServicio aun no listo
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
|
||||
<ajax:TabPanel runat="server" ID="tabCatalogo" HeaderText="Catálogo">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UpCatalogo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
@@ -85,29 +85,290 @@
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveEstatus" Value="-1" />
|
||||
<ajax:TabContainer runat="server" ActiveTabIndex="0" Width="100%" CssClass="tabBodyOverride">
|
||||
<ajax:TabPanel runat="server" ID="TabCatalogo" HeaderText="Estatus">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveEstatus" Value="-1" />
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveEstatusOrdenServicio,TipoEstatus,TipoEstatusTexto,EstatusOrdenServicio,EstatusBool,Estado" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="EstatusOrdenServicio" HeaderText="Estatus Orden Servicio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Estado" HeaderText="Estado" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TipoEstatusTexto" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="Edit_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveEstatusOrdenServicio,TipoEstatus,TipoEstatusTexto,EstatusOrdenServicio,EstatusBool,Estado" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="EstatusOrdenServicio" HeaderText="Estatus Orden Servicio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Estado" HeaderText="Estado" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TipoEstatusTexto" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="Edit_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel runat="server" ID="TabConfiguracion" HeaderText="Configuracion">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UPPEmp" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvEstatusUsuariosREQ" GridLines="None" CssClass="table table-striped table-advance table-hover" Width="100%" runat="server" AutoGenerateColumns="False" DataKeyNames="CveUsuario" EmptyDataText="No se encontraron Usuarios Registrados" ToolTip="Listado de Usuarios">
|
||||
<HeaderStyle VerticalAlign="Middle" />
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Estatus</HeaderTemplate>
|
||||
<ItemStyle Width="150px" BorderStyle="None" />
|
||||
<ItemTemplate>
|
||||
<asp:Label Font-Bold="true" Width="250px" ID="LblUsuario" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus1" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios1" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior1" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites1" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus2" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios2" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior2" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites2" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus3" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios3" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior3" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites3" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus4" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios4" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior4" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites4" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus5" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios5" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior5" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites5" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus6" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios6" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior6" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites6" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus7" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios7" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior7" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites7" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus8" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios8" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior8" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites8" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus9" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios9" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior9" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites9" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<table style="text-align: center; width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<asp:CheckBox ID="chkEstatus10" runat="server" /><asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios10" />
|
||||
</td>
|
||||
<td style="width: 50%; text-align: left">
|
||||
<asp:Label ID="lblSuperior10" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
<asp:Label ID="lblLimites10" Font-Size="7" Font-Italic="true" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:Button ID="btnGuardarEstatusUsuariosREQ" Text="Guardar" runat="server" Visible="true" CssClass="btn btn-primary" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UPSuperior" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField runat="server" ID="IDhdnCveEstatusUsuarios" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="IDCellYellow" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="IDimg" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="hdnCveEstatusUsuarios" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="hdnCveSuperior" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="hdnCveEstatusSiguiente" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HiddenField1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="hdnCveUsuario" ClientIDMode="Static" />
|
||||
|
||||
<div id="DivSuperior" style="width: 200px; background-color: White; border: solid 1px black; color: Black; display: none; position: absolute;">
|
||||
<table border="0" style="width: 200px" cellpadding="0" cellspacing="0">
|
||||
<tr class="Titulos">
|
||||
<td style="width: 400px">Opciones </td>
|
||||
<td style="padding-right: 4px; padding-top: 4px" valign="top">
|
||||
<img alt="" src="/Imagenes/close.gif" style="cursor: pointer;" onclick="$('#DivSuperior').hide(1000);" /></td>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
<td colspan="2">
|
||||
<table style="height: 80px; width: 100%">
|
||||
<tr>
|
||||
<td style="vertical-align: top; text-align: left; width: 100%">
|
||||
<asp:CheckBox ID="chkMostrarLimites" Font-Bold="true" Style="display: none" ClientIDMode="Static" Text="Usar Limites" runat="server" /><br />
|
||||
<div id="DivLimites" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Inferior</td>
|
||||
<td>
|
||||
<asp:TextBox ID="txtLimiteInferior" Width="80px" runat="server" ClientIDMode="Static"></asp:TextBox></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Superior</td>
|
||||
<td>
|
||||
<asp:TextBox ID="txtLimiteSuperior" Width="80px" runat="server" ClientIDMode="Static"></asp:TextBox></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<table style="text-align: center" runat="server" id="tblSuperior">
|
||||
<tr>
|
||||
<td style="font-weight: bold">Superior</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:DropDownList ID="ddlSuperior" Width="170px" ClientIDMode="Static" runat="server" DataValueField="CveUsuario" DataTextField="Nombre"></asp:DropDownList></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="height: 25px">
|
||||
<td align="center" colspan="2">
|
||||
<asp:Button ID="BtnGuardarSuperior" runat="server" ClientIDMode="Static" OnClientClick="$('#DivSuperior').hide(1000);" Text="Guardar" />
|
||||
<input id="BtnCancelarObs" type="button" value="Cancelar" onclick="$('#DivSuperior').hide(1000);" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
|
||||
<%--POPUP AGREGAR--%>
|
||||
<div id="divAddEstatusOS" class="modal ADS fade" role="dialog">
|
||||
|
||||
@@ -26,14 +26,31 @@ Partial Class OS_CatEstatusOrdenServicio
|
||||
ViewState("CveEstatuOS") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DTEstatusUsuarios As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTEstatusUsuarios"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTEstatusUsuarios") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CreaGrid("Req")
|
||||
CreaGrid("OC")
|
||||
CargaGridEstatusUsuarios()
|
||||
ViewState("Orden") = ""
|
||||
'ViewState("TipoSeleccionado") = DdlTipo.SelectedValue
|
||||
|
||||
CveEstatuOS = -1
|
||||
CargaDatos()
|
||||
|
||||
'CargaProyectos()
|
||||
CargaUsuarios()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -154,4 +171,128 @@ Partial Class OS_CatEstatusOrdenServicio
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "Configuracion"
|
||||
Protected Sub ibOpciones1_Click(sender As Object, e As ImageClickEventArgs)
|
||||
Dim imgBtn As ImageButton = DirectCast(sender, System.Web.UI.WebControls.ImageButton)
|
||||
|
||||
ddlSuperior.Items.Clear()
|
||||
|
||||
If imgBtn.CommandArgument <> "" Then
|
||||
'chkMostrarLimites.Visible = If(GlobalDTOCEstatus.FiltraParametros("CveEstatusSiguiente = " + imgBtn.CommandArgument)(0)("TipoTermino").ToString.ToEntero = 3, False, True)
|
||||
chkMostrarLimites.Style("display") = If(GlobalDTOCEstatus(UsuarioActual.CveEmpresa).FiltraParametros("CveEstatusSiguiente = " + imgBtn.CommandArgument)(0)("TipoTermino").ToString.ToEntero = 3, "none", "inline")
|
||||
|
||||
|
||||
'ddlSuperior.DataSource = DTEstatusUsuarios.FiltraParametros(String.Format("CveEstatus = {0}", imgBtn.CommandArgument), "Nombre DESC")
|
||||
ddlSuperior.DataBind()
|
||||
ddlSuperior.Items.Insert(0, New ListItem("Todos los Superiores", "-1"))
|
||||
Try
|
||||
ddlSuperior.SelectedValue = hdnCveSuperior.Value
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
tblSuperior.Visible = True
|
||||
Else
|
||||
tblSuperior.Visible = False
|
||||
End If
|
||||
|
||||
UPSuperior.Update()
|
||||
UPPEmp.Update()
|
||||
RegistraScript("$('#DivSuperior').show(1000); PosicionaObjeto('" + imgBtn.ClientID + "','DivSuperior'); chkMostrarLimitesCambio();")
|
||||
End Sub
|
||||
Private Sub CreaGrid(Tipo As String)
|
||||
Dim i As Integer = 1
|
||||
|
||||
For Each Row As DataRow In GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).Rows
|
||||
|
||||
GvEstatusUsuariosREQ.Columns(i).HeaderText = Row("EstatusOrdenServicio").ToString.ToUpper
|
||||
GvEstatusUsuariosREQ.Columns(i).FooterText = Row("CveEstatusOrdenServicio").ToString
|
||||
|
||||
i += 1
|
||||
Next
|
||||
|
||||
While i <= 10
|
||||
GvEstatusUsuariosREQ.Columns(i).Visible = False
|
||||
i += 1
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaGridEstatusUsuarios()
|
||||
GvEstatusUsuariosREQ.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
GvEstatusUsuariosREQ.DataBind()
|
||||
UPPEmp.Update()
|
||||
End Sub
|
||||
|
||||
Public Sub CargaUsuarios()
|
||||
ddlSuperior.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
|
||||
ddlSuperior.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub btnGuardarEstatusUsuariosREQ_Click(sender As Object, e As EventArgs) Handles btnGuardarEstatusUsuariosREQ.Click
|
||||
Dim objEstatusOC As New ClsOS
|
||||
objEstatusOC.IniciaTransacSQL()
|
||||
Dim HuboErrores As Boolean = False
|
||||
Dim CveSubProyecto = 59
|
||||
|
||||
|
||||
For Each Row As GridViewRow In GvEstatusUsuariosREQ.Rows
|
||||
|
||||
Dim r As Integer = 1
|
||||
For i = 0 To Row.Cells.Count - 1
|
||||
|
||||
Dim CveEstatus As Integer = If(IsNumeric(GvEstatusUsuariosREQ.Columns(i).FooterText), GvEstatusUsuariosREQ.Columns(i).FooterText.ToEntero, 0)
|
||||
|
||||
If CveEstatus > 0 Then
|
||||
|
||||
If Row.FCCheckBox("chkEstatus" + r.ToString).Checked = False And Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero > 0 Then
|
||||
'Eliminar el registro existente
|
||||
If Not objEstatusOC.RemoveEstatusUsuarios(Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero) Then
|
||||
HuboErrores = True
|
||||
Exit For
|
||||
End If
|
||||
ElseIf Row.FCCheckBox("chkEstatus" + r.ToString).Checked = True Then
|
||||
'And Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero = -1
|
||||
'Guardado masivo cuando sea SubProyecto "Todos"
|
||||
If CveSubProyecto = -2 Then
|
||||
For Each dr As DataRow In GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).Rows
|
||||
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, Row.DataKey("CveUsuario").ToString.ToEntero, CveSubProyecto) Then
|
||||
HuboErrores = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If HuboErrores Then
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'Insertar el nuevo registro
|
||||
Else
|
||||
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, Row.DataKey("CveUsuario").ToString.ToEntero, CveSubProyecto) Then
|
||||
HuboErrores = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
r += 1
|
||||
End If
|
||||
Next
|
||||
|
||||
'Si tubo algun error terminamos el proceso (FOR)
|
||||
If HuboErrores Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not HuboErrores Then
|
||||
objEstatusOC.Commit()
|
||||
Alert("Se guardaron los Cambios exitosamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
objEstatusOC.RollBack()
|
||||
Alert("Ocurrió un error al guardar los cambios. Por favor vuelva a intentar", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
objEstatusOC.Dispose()
|
||||
CargaGridEstatusUsuarios()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user