Exel anexos horizontales, AF

This commit is contained in:
Rakcsle Supertramp
2020-09-02 12:00:59 -07:00
parent a7bd0a3798
commit d5a4849d27
14 changed files with 1213 additions and 365 deletions

View File

@@ -55,17 +55,19 @@
<asp:UpdatePanel ID="UpFiltro" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-4 ">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-table font-green"></i>
<span class="caption-subject bold uppercase"><asp:Label runat="server" ID="LblSubProyecto2"></asp:Label></span>
<span class="caption-subject bold uppercase">
<asp:Label runat="server" ID="LblSubProyecto2"></asp:Label></span>
</div>
<div class="actions">
<div class="btn-group">
<%--<asp:Button ID="BtnCargarClientes" runat="server" ClientIDMode="Static" Text="CargarClientes" Style="display: none;" class="btn btn-success" />--%>
</div>
</div>
</div>
@@ -74,33 +76,43 @@
<div class="portlet-body form">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoServicio" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataTextField="Nombre" DataValueField="CveTipoServicio" ></asp:DropDownList>
<label for="<%= DdlTipoServicio.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblTipo" Text="Tipo"></asp:Label>
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AutoPostBack="true" OnSelectedIndexChanged="DdlSubProyecto_SelectedIndexChanged"></asp:DropDownList>
<label for="<%= DdlSubProyecto.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblSubProyecto" Text=""></asp:Label>
</label>
<i></i>
<asp:RequiredFieldValidator ID="RFVDdlTipoServicio" runat="server" InitialValue="-1" ControlToValidate="DdlTipoServicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo servicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RFVDdlSubProyecto" runat="server" InitialValue="-1" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtDescripcion" runat="server" MaxLength="30"></asp:TextBox>
<asp:Label AssociatedControlID="TxtDescripcion" runat="server" Text="Descripción:"></asp:Label>
<asp:RequiredFieldValidator ID="RFVTxtDescripcion" runat="server" ControlToValidate="TxtDescripcion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:DropDownList ID="DdlAF" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataTextField="CodDesc" DataValueField="CveActivoFijo" ></asp:DropDownList>
<label for="<%= DdlAF.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblAF" Text="Equipo A.F."></asp:Label>
</label>
<i></i>
<asp:RequiredFieldValidator ID="RFVDdlAF" runat="server" InitialValue="-1" ControlToValidate="DdlAF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo A.F.''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtDuracion" runat="server" MaxLength="30"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDuracion" FilterType="Numbers,Custom" InvalidChars="-*+" ValidChars="1234567890." />
<asp:Label AssociatedControlID="TxtDuracion" runat="server" Text="Duración:"></asp:Label>
<asp:RequiredFieldValidator ID="RFVTxtDuracion" runat="server" ControlToValidate="TxtDuracion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Duración''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:DropDownList ID="DdlTipoServicio" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataTextField="Nombre" DataValueField="CveTipoServicio"></asp:DropDownList>
<label for="<%= DdlTipoServicio.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblTipoServicio" Text="Tipo"></asp:Label>
</label>
<i></i>
<asp:RequiredFieldValidator ID="RFVDdlTipoServicio" runat="server" InitialValue="-1" ControlToValidate="DdlAF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo A.F.''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtServicio" runat="server" MaxLength="50"></asp:TextBox>
<asp:Label AssociatedControlID="TxtServicio" runat="server" Text="Servicio"></asp:Label>
<asp:RequiredFieldValidator ID="RFVTxtServicio" runat="server" ControlToValidate="TxtServicio" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Servicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<i></i>
</div>
</div>
@@ -108,6 +120,95 @@
</div>
<div class="col-md-4 ">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-table font-green"></i>
<span class="caption-subject bold uppercase">
<asp:Label runat="server" ID="Label1"></asp:Label></span>
</div>
<div class="actions">
<div class="btn-group">
<%--<asp:Button ID="BtnCargarClientes" runat="server" ClientIDMode="Static" Text="CargarClientes" Style="display: none;" class="btn btn-success" />--%>
</div>
</div>
</div>
<div class="portlet-body form">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPrioridad" CssClass="form-control input-sm select2me" Width="100%" runat="server" >
<asp:ListItem Value="1">Baja</asp:ListItem>
<asp:ListItem Value="2">Media</asp:ListItem>
<asp:ListItem Value="3">Alta</asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlPrioridad.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblPrioridad" Text="Prioridad"></asp:Label>
</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="<%= txtFechaI.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblFechaInicio" Text="Fecha Inicio"></asp:Label>
</label>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
<asp:TextBox Width="100px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<i></i>
</div>
<div runat="server" id="DVFechaFin" visible="false" class="form-group form-md-line-input input-iconright">
<label for="<%= txtFechaF.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblFechaFin" Text="Fecha Fin"></asp:Label>
</label>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
<asp:TextBox Width="100px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<%--<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>--%>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<%--<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>--%>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div runat="server" id="DVEstatus" visible="true" class="form-group form-md-line-input input-iconright" >
<asp:DropDownList ID="DdlOrdenesTrabajoEstatus" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataTextField="EstatusOT" DataValueField="CveEstatusOT" >
</asp:DropDownList>
<label for="<%= DdlOrdenesTrabajoEstatus.ClientID.ToString()%>">
<asp:Label runat="server" ID="Label2" Text="Estatus"></asp:Label>
</label>
</div>
</div>
</div>
</div>
</div>
@@ -116,156 +217,121 @@
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%" Visible="false">
<ajax:TabPanel ID="TabMaterial" runat="server" HeaderText="Material">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos" ToolTip="Listado de metricas" CssClass="table table-smallpadding Widthall"
DataKeyNames="CveActivoFijo,Unidad,CvePersonaResponsable"
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel runat="server" ID="UpGvMaterial" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvMaterial" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos" ToolTip="" CssClass="table table-smallpadding Widthall"
DataKeyNames="CveTipoServicioMaterial,CveTipoServicio,Cantidad,CveUM,CvePS,Tipo"
GridLines="None">
<Columns>
<asp:BoundField DataField="Cantidad" ItemStyle-Width="15%" HeaderText="Cantidad" />
<asp:BoundField DataField="Abreviatura" ItemStyle-Width="15%" HeaderText="U.M." />
<asp:TemplateField ItemStyle-Width="45%" HeaderText="Producto">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS") %>' Width="220px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Unidad">
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabActividades" runat="server" HeaderText="Actividades" >
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel runat="server" ID="UpGvActividades" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvActividades" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos" ToolTip="" CssClass="table table-smallpadding Widthall"
DataKeyNames="CveTipoServicioActividad,CveActividad,Duracion" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="">
<ItemStyle Width="20px" />
<ItemTemplate>
<asp:CheckBox runat="server" ID="Chk" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Horas">
<ItemStyle Width="100px" />
<ItemTemplate>
<asp:TextBox runat="server" ID="TxtHoras" Width="100px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtHoras" FilterType="Custom" ValidChars="1234567890." />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Nombre" ItemStyle-Width="30%" HeaderText="Actividad" />
<asp:BoundField DataField="Puesto" ItemStyle-Width="30%" HeaderText="Puesto" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabCheckList" runat="server" HeaderText="Check List">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel runat="server" ID="UpGvCheckList" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCheckList" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos" ToolTip="" CssClass="table table-smallpadding Widthall"
DataKeyNames="CveCheckListActividad,CheckListActividadGrupo,CveCheckList,CveTipoServicio"
GridLines="None">
<Columns>
<asp:TemplateField HeaderText="">
<ItemStyle Width="20px" />
<ItemTemplate>
<asp:CheckBox runat="server" ID="Chk" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="No.">
<ItemStyle Width="100px" />
<ItemTemplate>
<asp:Literal ID="LtlNROW" runat="server" Text='<%# Eval("NROW")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Componentes Inspección">
<ItemStyle Width="350px" />
<ItemTemplate>
<asp:Literal ID="LtlDescripcion" runat="server" Text='<%# Eval("Unidad")%>'></asp:Literal>
<asp:Literal ID="LtlCheckListActividad" runat="server" Text='<%# Eval("CheckListActividad")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica1" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica1" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica2" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica2" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica3" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica3" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica4" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica4" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica5" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica5" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica6" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica6" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica7" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica7" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica8" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica8" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica9" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica9" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica10" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica10" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica11" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica11" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica12" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica12" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica13" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica13" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica14" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica14" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="90px" />
<ItemTemplate>
<asp:TextBox ID="TxtMetrica15" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtMetrica15" FilterType="Numbers,Custom" FilterMode="ValidChars" ValidChars="0123456789." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Operador">
<ItemStyle Width="350px" />
<ItemTemplate>
<asp:DropDownList ID="DDLPersonal" CssClass="form-control input-sm select2me" runat="server" Width="100%" DataTextField="Nombre" DataValueField="CvePersonal"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40px" HeaderText="Opciones" Visible="false">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarMetricaValor" OnClick="LnkEliminarMetricaValor_Click" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-xs 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>
@@ -275,6 +341,17 @@
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<div id="ModalDescargaReporte" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
@@ -318,13 +395,15 @@
</div>
</div>
<br />
<div class="row">
<div class="col-md-12" style="text-align:center">
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" CssClass="btn btn-primary" OnClick="BtnGuardar_Click" Visible="false" />
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" CssClass="btn btn-primary" OnClick="BtnGuardar_Click" Visible="true" />
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -36,6 +36,7 @@ Partial Class AF_OrdenTrabajo
If Request("CveOrdenTrabajo") IsNot Nothing Then
CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero
Tab.Visible = True
End If
CargaCombos()
@@ -50,6 +51,15 @@ Partial Class AF_OrdenTrabajo
#Region " CARGA COMBOS "
Protected Sub CargaCombos()
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1)
DdlAF.DataBind()
Dim ObjAF As New ClsAF
If ObjAF.GetTiposServicios(-1, -1, -1, UsuarioActual.CveEmpresa) Then
@@ -58,10 +68,21 @@ Partial Class AF_OrdenTrabajo
DdlTipoServicio.DataSource = Nothing
End If
If ObjAF.GetOrdenesTrabajoEstatus(UsuarioActual.CveEmpresa) Then
DdlOrdenesTrabajoEstatus.DataSource = ObjAF.DtResultados
Else
DdlOrdenesTrabajoEstatus.DataSource = Nothing
End If
ObjAF.Dispose()
DdlTipoServicio.DataBind()
DdlOrdenesTrabajoEstatus.DataBind()
DdlTipoServicio.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
DdlOrdenesTrabajoEstatus.SelectedValueExist(1)
UpFiltro.Update()
@@ -95,16 +116,6 @@ Partial Class AF_OrdenTrabajo
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
End If
End Sub
#End Region
Protected Sub LnkEliminarMetricaValor_Click(sender As Object, e As EventArgs)
@@ -114,6 +125,34 @@ Partial Class AF_OrdenTrabajo
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
If CveOrdenTrabajo <= 0 Then
Dim ObjAF As New ClsAF
ObjAF.IniciaTransacSQL()
Dim ErrorProceso As Boolean = False
If Not ObjAF.AddOrdenesTrabajo(DdlTipoServicio.SelectedValue.ToEntero, DdlAF.SelectedValue.ToEntero, TxtServicio.Text.Trim, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, txtFechaI.Text.ToDate, MaxFecha, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
ErrorProceso = True
End If
If Not ErrorProceso Then
ObjAF.Commit()
Alert($"Orden de trabajo guardada corectamente <a href='./OrdenTrabajo.aspx?CveOrdenTrabajo={ObjAF.CveOrdenTrabajo}' class='Texto'> Folio {ObjAF.FolioOT}</a>")
Else
ObjAF.RollBack()
End If
ObjAF.Dispose()
Else
End If
@@ -282,4 +321,55 @@ Partial Class AF_OrdenTrabajo
#Region "FOLIOS"
Private Function CargaFolios() As Boolean
Dim Respuesta As Boolean = False
If DdlSubProyecto.SelectedValue.ToEntero() <= 0 Then
Alert("No se tienen asignadas sucursales", TipoMensaje.MsgError)
Return False
Exit Function
End If
Dim ObjFolios As New ClsGralFolios()
If ObjFolios.GetFolios("OT", UsuarioActual.CveEmpresa) Then
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyecto.SelectedValue))
If DT.Rows.Count > 0 Then
Respuesta = True
Else
Alert("No tiene registrados Folios para " & DdlSubProyecto.SelectedItem.Text & " ", TipoMensaje.MsgAdvertencia)
End If
DT.Dispose()
End If
ObjFolios.Dispose()
Return Respuesta
End Function
#End Region
Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
If CargaFolios() Then
BtnGuardar.Enabled = True
Else
BtnGuardar.Enabled = False
End If
UpGuardar.Update()
End Sub
End Class

View File

@@ -81,36 +81,24 @@
<div class="portlet-body form">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTipoServicio" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:Label AssociatedControlID="TxtTipoServicio" runat="server" Text="Tipo:"></asp:Label>
<asp:RequiredFieldValidator ID="RFVTxtTipoServicio" runat="server" ControlToValidate="TxtTipoServicio" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtDescripcion" runat="server" MaxLength="30"></asp:TextBox>
<asp:Label AssociatedControlID="TxtDescripcion" runat="server" Text="Descripción:"></asp:Label>
<asp:RequiredFieldValidator ID="RFVDdlTipoMantenimiento" InitialValue="-1" runat="server" ControlToValidate="TxtDescripcion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoMantenimiento" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataTextField="TipoMantenimiento" DataValueField="CveTipoMantenimiento"></asp:DropDownList>
<label for="<%= DdlTipoMantenimiento.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblTipo" Text="Tipo Mantenimiento:"></asp:Label>
<asp:Label runat="server" ID="LblTipo" Text="Tipo :"></asp:Label>
</label>
<i></i>
<asp:RequiredFieldValidator ID="RFVDdlTipoServicio" runat="server" InitialValue="-1" ControlToValidate="DdlTipoMantenimiento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Mantenimientp''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div>
<%-- <div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtDuracion" runat="server" MaxLength="5"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDuracion" FilterType="Numbers,Custom" InvalidChars="-*+" ValidChars="1234567890." />
<asp:Label AssociatedControlID="TxtDuracion" runat="server" Text="Duración:"></asp:Label>
<asp:RequiredFieldValidator ID="RFVTxtDuracion" runat="server" ControlToValidate="TxtDuracion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Duración''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTipoServicio" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:Label AssociatedControlID="TxtTipoServicio" runat="server" Text="Descripción:"></asp:Label>
<asp:RequiredFieldValidator ID="RFVTxtTipoServicio" runat="server" ControlToValidate="TxtTipoServicio" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<i></i>
</div>--%>
</div>
</div>
@@ -133,7 +121,7 @@
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div class="col-md-6">
@@ -181,13 +169,14 @@
<ContentTemplate>
<asp:GridView ID="GvActividades" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos" ToolTip="" CssClass="table table-smallpadding Widthall"
DataKeyNames="CveActividad" GridLines="None">
OnRowDataBound="GvActividades_RowDataBound"
DataKeyNames="CveTipoServicioActividad,CveActividad,Duracion" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="">
<ItemStyle Width="20px" />
<ItemTemplate>
<asp:CheckBox runat="server" ID="Chk" />
<asp:CheckBox runat="server" ID="Chk" OnCheckedChanged="Chk_CheckedChanged" />
</ItemTemplate>
</asp:TemplateField>
@@ -217,19 +206,35 @@
<ajax:TabPanel ID="TabCheckList" runat="server" HeaderText="Check List">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div class="col-md-6">
<asp:UpdatePanel runat="server" ID="UpGvCheckList" UpdateMode="Conditional" >
<ContentTemplate>
<asp:GridView ID="GvCheckList" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos" ToolTip="" CssClass="table table-smallpadding Widthall"
DataKeyNames=""
OnRowDataBound="GvCheckList_RowDataBound"
DataKeyNames="CveCheckListActividad,CheckListActividadGrupo,CveCheckList,CveTipoServicio"
GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Unidad">
<asp:TemplateField HeaderText="">
<ItemStyle Width="20px" />
<ItemTemplate>
<asp:CheckBox runat="server" ID="Chk" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="No.">
<ItemStyle Width="100px" />
<ItemTemplate>
<asp:Literal ID="LtlNROW" runat="server" Text='<%# Eval("NROW")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Componentes Inspección">
<ItemStyle Width="350px" />
<ItemTemplate>
<asp:Literal ID="LtlDescripcion" runat="server" Text='<%# Eval("Unidad")%>'></asp:Literal>
<asp:Literal ID="LtlCheckListActividad" runat="server" Text='<%# Eval("CheckListActividad")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>

View File

@@ -67,6 +67,9 @@ Partial Class AF_TipoOrdenTrabajo
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -77,57 +80,23 @@ Partial Class AF_TipoOrdenTrabajo
CveTipoServicio = Request("CveTipoServicio").ToEntero
End If
CargaCombos()
If CveTipoServicio = -1 Then
CrearTablas()
CargaActividades()
CargaCheckList()
Else
CargaDatos()
End If
CargaCombos()
End If
End Sub
Property IndexMaterial As Integer
Get
If ViewState("IndexMaterial") Is Nothing Then
Return -1
Else
Return ViewState("IndexMaterial").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("IndexMaterial") = value
End Set
End Property
Property IndexActividades As Integer
Get
If ViewState("IndexActividades") Is Nothing Then
Return -1
Else
Return ViewState("IndexActividades").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("IndexActividades") = value
End Set
End Property
Property IndexCheckList As Integer
Get
If ViewState("IndexCheckList") Is Nothing Then
Return -1
Else
Return ViewState("IndexCheckList").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("IndexCheckList") = value
End Set
End Property
@@ -157,10 +126,6 @@ Partial Class AF_TipoOrdenTrabajo
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If CveTipoServicio <= 0 Then
CargaActividades()
End If
End Sub
@@ -221,6 +186,25 @@ Partial Class AF_TipoOrdenTrabajo
Private Sub CargaDatos()
Dim ErrorProceso As Boolean = False
Dim ObjAf As New ClsAF
If ObjAf.GetTiposServicios(CveTipoServicio, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjAf.DtResultados.Rows.Count > 0 Then
TxtTipoServicio.Text = ObjAf.DtResultados(0)("Nombre").ToString
DdlTipoMantenimiento.SelectedValueExist(ObjAf.DtResultados(0)("CveTipoMantenimiento").ToString)
End If
Else
ErrorProceso = True
End If
ObjAf.Dispose()
CargaMateriales()
CargaActividades()
CargaCheckList()
@@ -233,7 +217,9 @@ Partial Class AF_TipoOrdenTrabajo
Dim ObjAF As New ClsAF
If ObjAF.GetTiposServiciosMaterial(-1, CveTipoServicio) Then
If ObjAF.GetTiposServiciosMaterial(-1, CveTipoServicio, UsuarioActual.CveEmpresa) Then
DTMateriales = ObjAF.DtResultados
GvMaterial.DataSource = DTMateriales
Else
@@ -256,20 +242,26 @@ Partial Class AF_TipoOrdenTrabajo
Dim ObjAF As New ClsAF
If CveTipoServicio <= 0 Then
If CveTipoServicio > 0 Then
If ObjAF.GetActividades(-1, -1, -1, UsuarioActual.CveEmpresa) Then
If ObjAF.GetTiposServiciosActividades(-1, CveTipoServicio, -1) Then
GvActividades.DataSource = ObjAF.DtResultados
Else
GvActividades.DataSource = Nothing
End If
Else
If ObjAF.GetActividades(-1, -1, -1, UsuarioActual.CveEmpresa) Then
GvActividades.DataSource = ObjAF.DtResultados
Else
GvActividades.DataSource = Nothing
End If
End If
ObjAF.Dispose()
GvActividades.DataBind()
UpGvActividades.Update()
End Sub
@@ -278,17 +270,51 @@ Partial Class AF_TipoOrdenTrabajo
Dim ObjAF As New ClsAF
If CveTipoServicio > 0 Then
If ObjAF.GetCheckList(-1, CveTipoServicio, -1, UsuarioActual.CveEmpresa) Then
GvCheckList.DataSource = ObjAF.DtResultados
Else
GvCheckList.DataSource = Nothing
End If
Else
If ObjAF.GetCheckListActividad(-1, -1, UsuarioActual.CveEmpresa) Then
GvCheckList.DataSource = ObjAF.DtResultados
Else
GvCheckList.DataSource = Nothing
End If
End If
ObjAF.Dispose()
GvCheckList.DataBind()
UpGvCheckList.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs)
Protected Sub GvCheckList_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Chk As CheckBox = e.Row.FCCheckBox("Chk")
If e.Row.DataKey("CveCheckListActividad").ToEntero = 0 Then
e.Row.FCLiteral("LtlNROW").Text = e.Row.DataKey("CheckListActividadGrupo").ToString
Chk.Visible = False
e.Row.Attributes.Add("style", "background-color:#DDD")
End If
If e.Row.DataKey("CveTipoServicio").ToEntero > 0 Then
Chk.Checked = True
End If
End If
@@ -572,7 +598,7 @@ Partial Class AF_TipoOrdenTrabajo
'validacion?
If CveTipoServicio = -1 Then
If ObjAF.AddTiposServicios(TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
@@ -591,16 +617,126 @@ Partial Class AF_TipoOrdenTrabajo
For Each GvRow As GridViewRow In GvActividades.Rows
Dim Chk As CheckBox = GvRow.FCCheckBox("Chk")
Dim Horas As Decimal = GvRow.FCTextBox("").Text.ToDecimal
Dim Horas As Decimal = GvRow.FCTextBox("TxtHoras").Text.ToDecimal
If Chk.Checked Then
If Not ObjAF.AddTiposServiciosActividades(GvRow.DataKey("CveActividad").ToEntero, CveTipoServicio, Horas, "") Then
ErrorProceso = True
Exit For
End If
End If
Next
If ObjAF.AddTiposServiciosActividades(GvRow.DataKey("").ToEntero) Then
For Each GvRow As GridViewRow In GvCheckList.Rows
Dim Chk As CheckBox = GvRow.FCCheckBox("Chk")
Dim CveCheckListActividad As Integer = GvRow.DataKey("CveCheckListActividad").ToEntero
If Chk.Checked Then
If Not ObjAF.AddCheckList(CveTipoServicio, CveCheckListActividad) Then
ErrorProceso = True
Exit For
End If
End If
Next
End If
Else
If Not ObjAF.UpdateTiposServicios(CveTipoServicio, TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorProceso = True
End If
If Not ErrorProceso Then
For Each GvRow As GridViewRow In GvActividades.Rows
Dim Chk As CheckBox = GvRow.FCCheckBox("Chk")
Dim CveTipoServicioActividad As Integer = GvRow.DataKey("CveTipoServicioActividad").ToEntero
Dim CveActividad As Integer = GvRow.DataKey("CveActividad").ToEntero
Dim Horas As Decimal = GvRow.FCTextBox("TxtHoras").Text.ToDecimal
If Chk.Checked Then
If CveTipoServicioActividad > 0 Then
If Not ObjAF.UpdateTiposServiciosActividades(CveTipoServicioActividad, CveActividad, Horas, "") Then
ErrorProceso = True
Exit For
End If
Else
If Not ObjAF.AddTiposServiciosActividades(CveActividad, CveTipoServicio, Horas, "") Then
ErrorProceso = True
Exit For
End If
End If
Else
If CveTipoServicioActividad > 0 Then
If Not ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad, UsuarioActual.CveEmpresa) Then
ErrorProceso = True
Exit For
End If
End If
End If
Next
If Not ErrorProceso Then
For Each GvRow As GridViewRow In GvCheckList.Rows
Dim Chk As CheckBox = GvRow.FCCheckBox("Chk")
If Chk.Visible Then
Dim CveTipoServicioTmp As Integer = GvRow.DataKey("CveTipoServicio").ToEntero
Dim CveCheckList As Integer = GvRow.DataKey("CveCheckList").ToEntero
Dim CveCheckListActividad As Integer = GvRow.DataKey("CveCheckListActividad").ToEntero
If CveTipoServicioTmp > 0 Then
If Not Chk.Checked Then
If Not ObjAF.DeleteCheckList(CveCheckList) Then
ErrorProceso = True
Exit For
End If
End If
Else
If Chk.Checked Then
If Not ObjAF.AddCheckList(CveTipoServicio, CveCheckListActividad) Then
ErrorProceso = True
Exit For
End If
End If
End If
End If
Next
End If
End If
End If
If ErrorProceso Then
ObjAF.RollBack()
@@ -612,6 +748,77 @@ Partial Class AF_TipoOrdenTrabajo
ObjAF.Dispose()
CargaDatos()
End Sub
Protected Sub Chk_CheckedChanged(sender As Object, e As EventArgs)
'Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, CheckBox).BindingContainer, GridViewRow)
'Dim Chk As CheckBox = GvRow.FCCheckBox("Chk")
'Dim CveTipoServicioActividad As Integer = GvRow.DataKey("CveTipoServicioActividad").ToEntero
'Dim CveActividad As Integer = GvRow.DataKey("CveActividad").ToEntero
'Dim Horas As Decimal = GvRow.FCTextBox("TxtHoras").Text.ToDecimal
'Dim ObjAF As New ClsAF
'If Chk.Checked Then
' If CveTipoServicioActividad > 0 Then
' If ObjAF.UpdateTiposServiciosActividades(CveTipoServicioActividad, CveActividad, Horas, "") Then
' End If
' Else
' If ObjAF.AddTiposServiciosActividades(CveActividad, CveTipoServicio, Horas, "") Then
' End If
' End If
'Else
' If CveTipoServicioActividad > 0 Then
' If ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad, UsuarioActual.CveEmpresa) Then
' End If
' End If
'End If
'ObjAF.Dispose()
End Sub
Protected Sub GvActividades_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim CveTipoServicioActividad As Integer = e.Row.DataKey("CveTipoServicioActividad").ToEntero
Dim TxtHoras As TextBox = e.Row.FCTextBox("TxtHoras")
Dim Chk As CheckBox = e.Row.FCCheckBox("Chk")
If CveTipoServicioActividad > 0 Then
Chk.Checked = True
TxtHoras.Text = e.Row.DataKey("Duracion")
End If
End If
End Sub
End Class

View File

@@ -91,6 +91,8 @@ Public Class ClsAF
Public Property CveDispositivo As Integer
Public Property MedidaVehicular As Integer
Public Property CveTipoServicio As Integer
Public Property CveOrdenTrabajo As Integer
Public Property FolioOT As Integer
#End Region
@@ -3480,6 +3482,7 @@ Public Class ClsAF
#End Region
#Region "TIPO SERVICIO"
Public Function GetTiposServicios(CveTipoServicio As Integer, CveTipoMantenimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -3572,7 +3575,7 @@ Public Class ClsAF
Return Retorno
End Function
Public Function GetTiposServiciosActividades(CveTipoServicioActividad As Integer, CveActividad As Integer) As Boolean
Public Function GetTiposServiciosActividades(CveTipoServicioActividad As Integer, CveTipoServicio As Integer, CveActividad As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosActividadesGet")
@@ -3580,6 +3583,7 @@ Public Class ClsAF
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioActividad", SqlDbType.Int).Value = CveTipoServicioActividad
.Add("@CveActividad", SqlDbType.Int).Value = CveActividad
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
End With
Try
@@ -3592,14 +3596,15 @@ Public Class ClsAF
Return Retorno
End Function
Public Function AddTiposServiciosActividades(CveActividad As Integer, Duracion As Integer, Observaciones As String) As Boolean
Public Function AddTiposServiciosActividades(CveActividad As Integer, CveTipoServicio As Integer, Duracion As Decimal, Observaciones As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosActividadesAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveActividad", SqlDbType.Int).Value = CveActividad
.Add("@Duracion", SqlDbType.Int).Value = Duracion
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
.Add("@Duracion", SqlDbType.SmallMoney).Value = Duracion
.Add("@Observaciones", SqlDbType.NVarChar).Value = Observaciones
End With
@@ -3613,7 +3618,7 @@ Public Class ClsAF
Return Retorno
End Function
Public Function UpdateTiposServiciosActividades(CveTipoServicioActividad As Integer, CveActividad As Integer, Duracion As Integer, Observaciones As String) As Boolean
Public Function UpdateTiposServiciosActividades(CveTipoServicioActividad As Integer, CveActividad As Integer, Duracion As Decimal, Observaciones As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosActividadesUpdate")
@@ -3621,7 +3626,7 @@ Public Class ClsAF
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioActividad", SqlDbType.Int).Value = CveTipoServicioActividad
.Add("@CveActividad", SqlDbType.Int).Value = CveActividad
.Add("@Duracion", SqlDbType.Int).Value = Duracion
.Add("@Duracion", SqlDbType.SmallMoney).Value = Duracion
.Add("@Observaciones", SqlDbType.NVarChar).Value = Observaciones
End With
@@ -3635,13 +3640,14 @@ Public Class ClsAF
Return Retorno
End Function
Public Function DeleteTiposServiciosActividades(CveTipoServicioActividad As Integer) As Boolean
Public Function DeleteTiposServiciosActividades(CveTipoServicioActividad As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosActividadesDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioActividad", SqlDbType.Int).Value = CveTipoServicioActividad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -3654,7 +3660,7 @@ Public Class ClsAF
Return Retorno
End Function
Public Function GetTiposServiciosMaterial(CveTipoServicioMaterial As Integer, CveTipoServicio As Integer) As Boolean
Public Function GetTiposServiciosMaterial(CveTipoServicioMaterial As Integer, CveTipoServicio As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosMaterialGet")
@@ -3662,6 +3668,7 @@ Public Class ClsAF
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioMaterial", SqlDbType.Int).Value = CveTipoServicioMaterial
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -4005,7 +4012,7 @@ Public Class ClsAF
Return Retorno
End Function
Public Function GetCheckListActividad(CveCheckListActividad As Integer, CveCheckListActividadGrupo As Integer) As Boolean
Public Function GetCheckListActividad(CveCheckListActividad As Integer, CveCheckListActividadGrupo As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_CheckListActividadGet")
@@ -4013,6 +4020,7 @@ Public Class ClsAF
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad
.Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -4085,7 +4093,7 @@ Public Class ClsAF
Return Retorno
End Function
Public Function GetCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean
Public Function GetCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_CheckListGet")
@@ -4094,6 +4102,7 @@ Public Class ClsAF
.Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
.Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -4166,6 +4175,110 @@ Public Class ClsAF
Return Retorno
End Function
#Region "O R D E N E S D E T R A B A J O"
Public Function GetOrdenesTrabajoEstatus(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_OrdenesTrabajoEstatusGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los estatus", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetOrdenesTrabajo(CveTipoServicio As Integer, CveAF As Integer, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_OrdenesTrabajoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Prioridad", SqlDbType.Int).Value = Prioridad
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@FechaFinReal", SqlDbType.Date).Value = FechaFinReal
.Add("@CveEstatusOT", SqlDbType.Int).Value = CveEstatusOT
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los estatus", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddOrdenesTrabajo(CveTipoServicio As Integer, CveAF As Integer, Servicio As String, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_OrdenesTrabajoAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@Servicio", SqlDbType.VarChar).Value = Servicio
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Prioridad", SqlDbType.Int).Value = Prioridad
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@FechaFinReal", SqlDbType.Date).Value = FechaFinReal
.Add("@CveEstatusOT", SqlDbType.Int).Value = CveEstatusOT
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveOrdenTrabajo", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@Folio", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
CveOrdenTrabajo = SqlAdapter.SelectCommand.Parameters("@CveOrdenTrabajo").Value.ToString.ToEntero
FolioOT = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString.ToEntero
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar la orden de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
#End Region

View File

@@ -2054,6 +2054,162 @@ Namespace Extensiones
End If
End Sub
<Runtime.CompilerServices.Extension()>
Public Sub ExportToExcelGembox(GridView As GridView, NombreArchivoXLSx As String, Usuario As Usuario, FechaIMes As String, FechaFMes As String, Titulo As String, SubProyecto As String, Divisor As Integer, Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100, Optional DatoTituloExtra As String ="")
Dim sw1 As New StringWriter()
Dim htw1 As New HtmlTextWriter(sw1)
GridView.RenderControl(htw1)
Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString()))
htmlStream1.Position = 0
Dim sr1 As New StreamReader(htmlStream1)
Dim myStr1 = sr1.ReadToEnd()
sr1.Dispose()
htmlStream1.Dispose()
sw1.Dispose()
Dim HtmlCompleto As String = myStr1
HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "")
Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto))
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet)
Dim excel As GemBox.Spreadsheet.ExcelFile
excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options)
If Usuario IsNot Nothing Then
Dim TotalRowHeader As Integer = 8
Dim TotalRowFooter As Integer = 2
Dim worksheet = excel.Worksheets(0)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
celdasConTexto.Style.Font.Name = "Calibri Light"
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
RangoNombreEmpresa.Style.Font.Size = 18 * 20
RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 20 * 20
RangoTitulo.Style.Font.Name = "Calibri Light"
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex)
RangoFechas.Merged = True
RangoFechas.Value = $"Fechas: {FechaIMes} a {FechaFMes}"
RangoFechas.Style.Font.Size = 15 * 20
RangoFechas.Style.Font.Name = "Calibri Light"
RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
If SubProyecto.Length > 0 Then
Dim RangoSubProyecto = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex)
RangoSubProyecto.Merged = True
RangoSubProyecto.Value = SubProyecto
RangoSubProyecto.Style.Font.Size = 20 * 20
RangoSubProyecto.Style.Font.Name = "Calibri Light"
RangoSubProyecto.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoSubProyecto.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
End If
If DatoTituloExtra.Length > 0 Then
Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
RangoDatoTituloExtra.Merged = True
RangoDatoTituloExtra.Value = DatoTituloExtra
RangoDatoTituloExtra.Style.Font.Size = 20 * 20
RangoDatoTituloExtra.Style.Font.Name = "Calibri Light"
RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
End If
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20
worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
If i > 0 Then
Try
worksheet.Columns(i).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
Dim IndexEndTable As Integer = GridView.Rows.Count + TotalRowHeader + TotalRowFooter
worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió"
worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión"
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
If Imagen.Exists Then
Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)
Using sr As New StreamReader(Ruta)
Dim ms As New MemoryStream()
sr.BaseStream.CopyTo(ms)
worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel)
End Using
End If
For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
If I > 0 Then
If Divisor = 1 Then
worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00"
Else
worksheet.Columns(I + 1).Style.NumberFormat = "#,##"
End If
Try
worksheet.Columns(I).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
End If
excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx")
End Sub
<Runtime.CompilerServices.Extension()>
Public Sub ExportToExcel(GridView As HtmlTable, NombreArchivoXLS As String)
Dim sb As StringBuilder = New StringBuilder()

View File

@@ -10,6 +10,23 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAcciones">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkExportar" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>

View File

@@ -134,6 +134,18 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
'RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
RegistraScript($"LimpiaCeros();")
Conta.Dispose()
If GvAnual.Rows.Count > 0 Then
LnkExportar.Visible = True
UpAcciones.Update()
End If
End Sub
#End Region
@@ -151,6 +163,22 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
End If
End Sub
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Dim SubProyecto As String = ""
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then
SubProyecto = DdlSubProyecto.SelectedItem.Text
End If
GvAnual.ExportToExcelGembox("AnexoCatálogoAnual", UsuarioActual, $"01/01/{DdlEjercicio.SelectedValue}", $"31/12/{DdlEjercicio2.SelectedValue}", "Anexo del Catálogo - Anual", SubProyecto, DdlDivisor.SelectedValue.ToEntero, DatoTituloExtra:=$"Periodo {DdlPeriodo.SelectedItem.Text}")
End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub
#End Region

View File

@@ -11,6 +11,18 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAcciones">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkExportar" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>

View File

@@ -114,6 +114,14 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
GvCC.DataSource = Nothing
End If
If GvCC.Rows.Count > 0 Then
LnkExportar.Visible = True
UpAcciones.Update()
End If
RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
Conta.Dispose()
End Sub
@@ -135,6 +143,19 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
End Sub
#End Region
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Dim SubProyecto As String = ""
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then
SubProyecto = DdlSubProyecto.SelectedItem.Text
End If
GvCC.ExportToExcelGembox("AnexoCatálogoMensual", UsuarioActual, $"01/01/{DdlEjercicio.SelectedValue}", $"31/12/{DdlEjercicio.SelectedValue}", "Anexo del Catálogo - Mensual", SubProyecto, DdlDivisor.SelectedValue.ToEntero, DatoTituloExtra:=$"Periodo {DdlPeriodo.SelectedItem.Text}")
End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub
End Class

View File

@@ -16,6 +16,21 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAcciones">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkExportar" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>

View File

@@ -81,6 +81,14 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual
GvMensual2.DataBind()
UpMensual.Update()
If GvMensual2.Rows.Count > 0 Then
LnkExportar.Visible = True
UpAcciones.Update()
End If
RegistraScript($"LimpiaCeros();")
Conta.Dispose()
End Sub
@@ -102,6 +110,19 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual
End Sub
#End Region
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Dim SubProyecto As String = ""
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then
SubProyecto = DdlSubProyecto.SelectedItem.Text
End If
GvMensual2.ExportToExcelGembox("AnexoCatálogoMensual", UsuarioActual, $"01/01/{DdlEjercicio.SelectedValue}", $"31/12/{DdlEjercicio.SelectedValue}", "Anexo del Catálogo - Mensual", SubProyecto, DdlDivisor.SelectedValue.ToEntero, DatoTituloExtra:=$"Periodo {DdlPeriodo.SelectedItem.Text}")
End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub
End Class

View File

@@ -174,6 +174,22 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
End Set
End Property
Private Property CountDinamicoAnual As Integer
Get
If ViewState("CountDinamicoAnual") Is Nothing Then
Return 0
Else
Return ViewState("CountDinamicoAnual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CountDinamicoAnual") = value
End Set
End Property
#End Region
#Region " S U B P R O Y E C T O H O R I Z O N T A L "
@@ -230,6 +246,23 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
End Property
Private Property CountDinamicoSubProyecto As Integer
Get
If ViewState("CountDinamicoSubProyecto") Is Nothing Then
Return 0
Else
Return ViewState("CountDinamicoSubProyecto").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CountDinamicoSubProyecto") = value
End Set
End Property
#End Region
@@ -1081,6 +1114,17 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
Dim IndexGv As Integer = 1
Dim IndexMax As Integer = 1
Dim IDX_LIMPIAR As Integer = 1
For IDX_LIMPIAR = 1 To 25
GvIngresosAnualH.Columns(IDX_LIMPIAR).Visible = False
GvGastosAnualH.Columns(IDX_LIMPIAR).Visible = False
GvTotalesAnualH.Columns(IDX_LIMPIAR).Visible = False
Next
If DtIngresosAnualH.Rows.Count > 0 Then
@@ -1142,6 +1186,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
Row.Item("PorcentajeAcumulado") = "100.00"
Row.Item("CtaMayor") = -1
Row.Item("CountDinamico") = DtGastosAnualH.MAX("CountDinamico")
CountDinamicoAnual = DtGastosAnualH.MAX("CountDinamico").ToEntero
DtIngresosAnualH.Rows.Add(Row)
Else
Row.Item("Nombre") = "TOTAL INGRESOS "
@@ -1441,9 +1486,10 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
'34
Dim IDX_LIMPIAR As Integer = 1
For IDX_LIMPIAR = 1 To 34
For IDX_LIMPIAR = 1 To 35
CType(GvIngresosSubProyectoH.Columns(IDX_LIMPIAR), BoundField).DataField = Nothing
CType(GvIngresosSubProyectoH.Columns(IDX_LIMPIAR), BoundField).HeaderText = ""
GvIngresosSubProyectoH.Columns(IDX_LIMPIAR).Visible = False
Next
@@ -1499,6 +1545,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
Row.Item("PorcentajeAcumulado") = "100.00"
Row.Item("CtaMayor") = -1
Row.Item("CountDinamico") = DtIngresosSubProyectoH.MAX("CountDinamico")
CountDinamicoSubProyecto = DtIngresosSubProyectoH.MAX("CountDinamico").ToEntero
DtIngresosSubProyectoH.Rows.Add(Row)
Else
Row.Item("Nombre") = "TOTAL INGRESOS "
@@ -1692,6 +1739,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
@@ -1751,7 +1799,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
ExportToExcelG(GvIngresosAnualH, GvGastosAnualH, TMesT1, "Reporte_Anual_Horizontal", UsuarioActual, "Anual Horizontal", Gv3:=GvTotalesAnualH)
ElseIf Tab.ActiveTabIndex = 3 AndAlso GvIngresosSubProyectoH.Rows.Count > 0 Then
ExportToExcelG(GvIngresosSubProyectoH, GvGastosSubProyectoH, TMesT1, "Reporte_Proyecto_Horizontal", UsuarioActual, "Proyecto Horizontal", Gv3:=GvTotalesSubProyectoH, EsPorSubProtyecto:=True)
ExportToExcelG(GvIngresosSubProyectoH, GvGastosSubProyectoH, TMesT1, "Reporte_Proyecto_Horizontal", UsuarioActual, $"{LblSubProyecto.Text} Horizontal", Gv3:=GvTotalesSubProyectoH, EsPorSubProtyecto:=True)
End If
End Sub
@@ -1829,28 +1877,21 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "")
Dim asd As String = ""
Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto))
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense("ESWN-4QFD-26JF-1SZ8")
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet)
Dim excel As GemBox.Spreadsheet.ExcelFile
'Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
'Using htmlStream = New MemoryStream(options.Encoding.GetBytes(sw.ToString()))
' excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream, options)
excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options)
If Usuario IsNot Nothing Then
Dim TotalRowHeader As Integer = 8
Dim TotalRowFooter As Integer = 2
Dim worksheet = excel.Worksheets(0)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
@@ -1865,15 +1906,6 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
'Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
'RangoFiltros.Merged = True
'RangoFiltros.Value = "Filtros"
'RangoFiltros.Style.Font.Size = 15 * 20
'RangoFiltros.Style.Font.Name = "Calibri Light"
'RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
'RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
@@ -1882,7 +1914,27 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex)
RangoFechas.Merged = True
RangoFechas.Value = $"Fechas: {FechaIMes} a {FechaFMes}"
RangoFechas.Style.Font.Size = 15 * 20
RangoFechas.Style.Font.Name = "Calibri Light"
RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
If EsPorSubProtyecto And DdlSubproyecto.SelectedValue.ToEntero > 0 Then
Dim RangoSubProyecto = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex)
RangoSubProyecto.Merged = True
RangoSubProyecto.Value = DdlSubproyecto.SelectedItem.Text
RangoSubProyecto.Style.Font.Size = 20 * 20
RangoSubProyecto.Style.Font.Name = "Calibri Light"
RangoSubProyecto.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoSubProyecto.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
End If
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20
worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
@@ -1929,10 +1981,30 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
End Using
End If
For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
If I > 0 Then
If DdlDivisor.SelectedValue.ToEntero = 1 Then
worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00"
Else
worksheet.Columns(I + 1).Style.NumberFormat = "#,##"
End If
'End Using
'htw.Dispose()
Try
worksheet.Columns(I).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
End If
excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx")

View File

@@ -290,6 +290,10 @@ Partial Class Inventarios_EntradasSalidas
TxtFecha.Text = Now.ToShortDateString
RVFecha.MaximumValue = Now.ToShortDateString
If Not UsuarioActual.CveEmpresa = 41 Then
TxtFecha.Enabled = False
End If
CantidadTotal = 0
IndexSeccionAlmacen = 0
@@ -482,6 +486,7 @@ Partial Class Inventarios_EntradasSalidas
DdlCConcepto.DataSource = GlobalDTInvConceptos.FiltraParametros("CveConcepto NOT IN (4,5)")
DdlCConcepto.DataBind()
'Llenar el dropdownlist de almacén
If Not IfNull(Request("CI"), -1).ToString.ToEntero > 0 Then
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
@@ -508,6 +513,8 @@ Partial Class Inventarios_EntradasSalidas
DdlConcepto.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
CargaPS()
' CargaDdlPaqueteria()
@@ -2025,11 +2032,16 @@ Partial Class Inventarios_EntradasSalidas
DdlConcepto.Items.Insert(0, New ListItem("Entrada Almacen ", "2"))
End If
If UsuarioActual.CveEmpresa = 72 AndAlso CveTipoAlmacen.Contiene(14, 19) AndAlso UsuarioActual.CveUsuario = 2185 Then
If UsuarioActual.CveEmpresa = 72 AndAlso (UsuarioActual.CveUsuario = 2185 OrElse UsuarioActual.CveRol = 1) Then
'DdlConcepto.Items.Add(New ListItem("Seleccione", "-1"))
DdlConcepto.Items.Add(New ListItem("Entrada por Ajuste", "32"))
If CveTipoAlmacen.Contiene(12, 14, 19) Then
DdlConcepto.Items.Add(New ListItem("Salida por Ajuste", "34"))
End If
End If