Commit inicial Ventas Productivo
This commit is contained in:
258
Flotillas/CatCombustibles.aspx
Normal file
258
Flotillas/CatCombustibles.aspx
Normal file
@@ -0,0 +1,258 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCombustibles.aspx.vb" Inherits="Maq_CatCombustibles" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Combustibles
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<ajax:TabContainer runat="server" OnClientActiveTabChanged="ClientFunction" Height="500px" CssClass="tabBodyOverride">
|
||||
<ajax:TabPanel runat="server" HeaderText="Combustibles">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTitulosCombustibles" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="170px">
|
||||
<asp:LinkButton ID="LbCombustibleTipo2" runat="server" CausesValidation="false" Text="" CommandArgument="CombustibleTipo0;0" OnClick="LbOrden_Click">
|
||||
Tipo Combustible
|
||||
<asp:Literal ID="ImgCombustibleTipo0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LbCombustible" runat="server" CausesValidation="false" Text="" CommandArgument="Combustible0;0" OnClick="LbOrden_Click">
|
||||
Combustible
|
||||
<asp:Literal ID="ImgCombustible0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbEstatusCombustible" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus0;0" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbFechaCombustible" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng0;0" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaIng0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbUsuarioCombustible" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario0;0" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="121px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:DropDownList ID="DdlCombustibleTipo" runat="server" AppendDataBoundItems="true" DataValueField="CveCombustibleTipo" DataTextField="CombustibleTipo" ValidationGroup="GrpGuardar" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 160px !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVCombustibleTipo2" runat="server" ControlToValidate="DdlCombustibleTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Combustible''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCombustibleTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVCombustibleTipo2" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtCombustible" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="110px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCombustible" runat="server" ControlToValidate="TxtCombustible" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Combustible''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCCombustible" runat="server" HighlightCssClass="vco" TargetControlID="RFVCombustible" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center" align="center">
|
||||
<asp:LinkButton ID="LbAgregarCombustible" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatosCombustibles" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosCombustibles" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCombustible" EmptyDataText="No se encontraron Combustibles Registrados" ToolTip="Listado de Combustible" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCombustibleTipo2" runat="server" Text='<%# Eval("CombustibleTipo")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCombustibleTipo" runat="server" DataValueField="CveCombustibleTipo" DataTextField="CombustibleTipo" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 155px !important;"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCombustible" runat="server" Text='<%# Eval("Combustible")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCombustible" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Combustible") %>' ValidationGroup="GrpGV2" Width="110px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCombustible" runat="server" ControlToValidate="TxtCombustible" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Combustible''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV2"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCCombustible" runat="server" HighlightCssClass="vco" TargetControlID="RFVCombustible" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<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>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" HeaderText="Tipos de Combustible">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTitulosCombustiblesTipos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="150px">
|
||||
<asp:LinkButton ID="LbCombustibleTipo" runat="server" CausesValidation="false" Text="" CommandArgument="CombustibleTipo1;1" OnClick="LbOrden_Click">
|
||||
Combustible Tipo
|
||||
<asp:Literal ID="ImgCombustibleTipo1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbEstatusCombustibleTipo" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus1;1" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbFechaCombustibleTipo" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng1;1" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaIng1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbUsuarioCombustibleTipo" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario1;1" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="121px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtCombustibleTipo" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarTipo" Width="140px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCombustibleTipo" runat="server" ControlToValidate="TxtCombustibleTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''CombustibleTipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarTipo"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCCombustibleTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVCombustibleTipo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td align="center" style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregarCombustibleTipo" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarTipo"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosCombustiblesTipos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCombustibleTipo" EmptyDataText="No se encontraron Tipos de Combustibles Registrados" ToolTip="Listado de Tipos de Combustible" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCombustibleTipo" runat="server" Text='<%# Eval("CombustibleTipo")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCombustibleTipo" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("CombustibleTipo") %>' ValidationGroup="GrpGV" Width="140px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCombustibleTipo" runat="server" ControlToValidate="TxtCombustibleTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Combustible Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCCombustibleTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVCombustibleTipo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<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>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
335
Flotillas/CatCombustibles.aspx.vb
Normal file
335
Flotillas/CatCombustibles.aspx.vb
Normal file
@@ -0,0 +1,335 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Maq_CatCombustibles
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
|
||||
'Permiso de Agregar
|
||||
If UsuarioActual.TienePermisoProceso(96) Then LbAgregarCombustibleTipo.Enabled = True Else LbAgregarCombustibleTipo.Enabled = False
|
||||
If UsuarioActual.TienePermisoProceso(99) Then LbAgregarCombustible.Enabled = True Else LbAgregarCombustible.Enabled = False
|
||||
|
||||
'Permiso de Editar
|
||||
If UsuarioActual.TienePermisoProceso(97) Then GvDatosCombustiblesTipos.Columns(4).Visible = True Else GvDatosCombustiblesTipos.Columns(4).Visible = False
|
||||
If UsuarioActual.TienePermisoProceso(100) Then GvDatosCombustibles.Columns(5).Visible = True Else GvDatosCombustibles.Columns(5).Visible = False
|
||||
|
||||
'Permiso de Eliminar
|
||||
If UsuarioActual.TienePermisoProceso(98) Then GvDatosCombustiblesTipos.Columns(5).Visible = True Else GvDatosCombustiblesTipos.Columns(5).Visible = False
|
||||
If UsuarioActual.TienePermisoProceso(101) Then GvDatosCombustibles.Columns(6).Visible = True Else GvDatosCombustibles.Columns(6).Visible = False
|
||||
CargaDatos()
|
||||
CargaCombustiblesTipos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
|
||||
If ObjFlotilla.GetCombustiblesTipos(UsuarioActual.CveEmpresa) Then
|
||||
ViewState("DTCombustibleTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados
|
||||
Else
|
||||
Me.GvDatosCombustiblesTipos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
If ObjFlotilla.GetCombustibles() Then
|
||||
ViewState("DTCombustible") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados
|
||||
Else
|
||||
Me.GvDatosCombustibles.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombustiblesTipos()
|
||||
DdlCombustibleTipo.DataSource = ViewState("DTCombustibleTipo")
|
||||
DdlCombustibleTipo.DataBind()
|
||||
End Sub
|
||||
|
||||
#Region " C O M B U S T I B L E S "
|
||||
|
||||
Protected Sub LbAgregarCombustible_Click(sender As Object, e As EventArgs) Handles LbAgregarCombustible.Click
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.AddCombustibles(TxtCombustible.Text.Trim, DdlCombustibleTipo.Text.Trim.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
DdlCombustibleTipo.SelectedIndex = -1
|
||||
TxtCombustible.Text = ""
|
||||
Alert("El nuevo Combustible se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosCombustibles.Update()
|
||||
ViewState("DTCombustible") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCombustibles(-1) = ObjFlotilla.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
Else
|
||||
Alert("Error al agregar el nuevo Combustible.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
End Sub
|
||||
|
||||
'' **************------ GVDatosCombustibles -------**************
|
||||
|
||||
Protected Sub GvDatosCombustibles_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosCombustibles.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(176) 'COMBUSTIBLE TIPO
|
||||
e.Row.Cells(1).Width = Unit.Pixel(126) 'COMBUSTIBLE
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100) 'ESTATUS
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100) 'FECHA
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100) 'USUARIO
|
||||
e.Row.Cells(5).Width = Unit.Pixel(53) 'EDITAR
|
||||
e.Row.Cells(6).Width = Unit.Pixel(68) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlCombustibleTipo").DataSource = ViewState("DTCombustibleTipo")
|
||||
e.Row.FCDropDownList("DdlCombustibleTipo").DataBind()
|
||||
e.Row.FCDropDownList("DdlCombustibleTipo").SelectedValue = e.Row.DBCampo("CveCombustibleTipo")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosCombustibles_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosCombustibles.RowEditing
|
||||
GvDatosCombustibles.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosCombustibles_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosCombustibles.RowDeleting
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.RemoveCombustibles(GvDatosCombustibles.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatosCombustibles.EditIndex = -1
|
||||
ViewState("DTCombustible") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados
|
||||
Alert("El Combustible se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosCombustibles_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosCombustibles.RowCancelingEdit
|
||||
GvDatosCombustibles.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombustiblesTipos2(CveCombustibleTipo As Integer)
|
||||
DdlCombustibleTipo.DataSource = ViewState("DTCombustibleTipo")
|
||||
DdlCombustibleTipo.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosCombustibles_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosCombustibles.RowUpdating
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
|
||||
Dim Combustible As String = DirectCast(GvDatosCombustibles.Rows(e.RowIndex).FindControl("TxtCombustible"), TextBox).Text.Trim
|
||||
Dim CveCombustibleTipo As Integer = DirectCast(GvDatosCombustibles.Rows(e.RowIndex).FindControl("DdlCombustibleTipo"), DropDownList).Text.Trim.ToEntero
|
||||
Dim EstatusCombustible As Boolean = GvDatosCombustibles.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveCombustible As Integer = GvDatosCombustibles.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If ObjFlotilla.UpdateCombustibles(Combustible, CveCombustibleTipo, EstatusCombustible, CveCombustible) Then
|
||||
GvDatosCombustibles.EditIndex = -1
|
||||
ViewState("DTCombustible") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCombustibles(-1) = ObjFlotilla.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " C O M B U S T I B L E S - T I P O S"
|
||||
|
||||
Protected Sub LbAgregarCombustibleTipo_Click(sender As Object, e As EventArgs) Handles LbAgregarCombustibleTipo.Click
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.AddCombustiblesTipos(TxtCombustibleTipo.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtCombustibleTipo.Text = ""
|
||||
Alert("El nuevo Tipo de Combustible se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosCombustiblesTipos.Update()
|
||||
ViewState("DTCombustibleTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCombustibles(-1) = ObjFlotilla.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End If
|
||||
ObjFlotilla.Dispose()
|
||||
End Sub
|
||||
|
||||
'' **************------ GVDatosCombustiblesTipos -------**************
|
||||
|
||||
Protected Sub GvDatosCombustiblesTipos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosCombustiblesTipos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(156) 'COMBUSTIBLETIPO
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100) 'ESTATUS
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100) 'FECHA
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100) 'USUARIO
|
||||
e.Row.Cells(4).Width = Unit.Pixel(53) 'EDITAR
|
||||
e.Row.Cells(5).Width = Unit.Pixel(68) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosCombustiblesTipos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosCombustiblesTipos.RowDeleting
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.RemoveCombustiblesTipos(GvDatosCombustiblesTipos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatosCombustiblesTipos.EditIndex = -1
|
||||
ViewState("DTCombustibleTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados
|
||||
Alert("El Tipo de Combustible se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosCombustiblesTipos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosCombustiblesTipos.RowCancelingEdit
|
||||
GvDatosCombustiblesTipos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosCombustiblesTipos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosCombustiblesTipos.RowUpdating
|
||||
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
|
||||
Dim CombustibleTipo As String = DirectCast(GvDatosCombustiblesTipos.Rows(e.RowIndex).FindControl("TxtCombustibleTipo"), TextBox).Text.Trim
|
||||
Dim EstatusCombustibleTipo As Boolean = GvDatosCombustiblesTipos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveCombustibleTipo As Integer = GvDatosCombustiblesTipos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
|
||||
If ObjFlotilla.UpdateCombustiblesTipos(CombustibleTipo, EstatusCombustibleTipo, CveCombustibleTipo) Then
|
||||
GvDatosCombustiblesTipos.EditIndex = -1
|
||||
ViewState("DTCombustibleTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCombustiblesTipos = ObjFlotilla.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosCombustiblesTipos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosCombustiblesTipos.RowEditing
|
||||
GvDatosCombustiblesTipos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim gvi As Integer = 0
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
gvi = Arg(1).ToEntero
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
Campo = Campo.Substring(0, Campo.Length - 1)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo, gvi)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo, gvi)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo, gvi)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo, gvi)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden, gvi)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String, gvi As Integer)
|
||||
If gvi = 0 Then
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTCombustible"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatosCombustibles.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatosCombustibles.DataSource = CType(ViewState("DTCombustible"), DataTable)
|
||||
End If
|
||||
GvDatosCombustibles.DataBind()
|
||||
UpDatosCombustibles.Update()
|
||||
ElseIf gvi = 1 Then
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTCombustibleTipo"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatosCombustiblesTipos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatosCombustiblesTipos.DataSource = CType(ViewState("DTCombustibleTipo"), DataTable)
|
||||
End If
|
||||
GvDatosCombustiblesTipos.DataBind()
|
||||
UpDatos.Update()
|
||||
ElseIf gvi = 2 Then
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
127
Flotillas/CatDistribuidores.aspx
Normal file
127
Flotillas/CatDistribuidores.aspx
Normal file
@@ -0,0 +1,127 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDistribuidores.aspx.vb" Inherits="Flotillas_CatDistribuidores" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Distribuidores
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpTitulosDistribuidores" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="130px">
|
||||
<asp:LinkButton ID="LbDistribuidor" runat="server" CausesValidation="false" Text="" CommandArgument="Distribuidor" OnClick="LbOrden_Click">
|
||||
Distribuidor
|
||||
<asp:Literal ID="ImgDistribuidor" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="95px">
|
||||
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="95px">
|
||||
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="95px">
|
||||
<asp:LinkButton ID="LbUsuarior" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="165px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtDistribuidor" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarTipo" Width="120px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVDistribuidor" runat="server" ControlToValidate="TxtDistribuidor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Distribuidor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarTipo"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCDistribuidor" runat="server" HighlightCssClass="vco" TargetControlID="RFVDistribuidor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregarDistribuidor" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarTipo"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosDistribuidores" runat="server" AutoGenerateColumns="False" DataKeyNames="CveDistribuidor" EmptyDataText="No se encontraron Distribuidores Registrados" ToolTip="Listado de Distribuidores" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDistribuidor" runat="server" Text='<%# Eval("Distribuidor")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtDistribuidor" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Distribuidor")%>' ValidationGroup="GrpGV" Width="120px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVDistribuidor" runat="server" ControlToValidate="TxtDistribuidor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Distribuidor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCDistribuidor" runat="server" HighlightCssClass="vco" TargetControlID="RFVDistribuidor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>"/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<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" OnClientClick="javascript:return C();" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
function C() {
|
||||
return confirm('¿Está seguro que desea eliminar el Distribuidor?');
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
191
Flotillas/CatDistribuidores.aspx.vb
Normal file
191
Flotillas/CatDistribuidores.aspx.vb
Normal file
@@ -0,0 +1,191 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Flotillas_CatDistribuidores
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
|
||||
'Permiso de Agregar Distribuidor
|
||||
If UsuarioActual.TienePermisoProceso(108) Then LbAgregarDistribuidor.Enabled = True Else LbAgregarDistribuidor.Enabled = False
|
||||
|
||||
'Permiso de Editar Distribuidor
|
||||
If UsuarioActual.TienePermisoProceso(109) Then GvDatosDistribuidores.Columns(4).Visible = True Else GvDatosDistribuidores.Columns(4).Visible = False
|
||||
|
||||
'Permiso de Eliminar Distribuidor
|
||||
If UsuarioActual.TienePermisoProceso(110) Then GvDatosDistribuidores.Columns(5).Visible = True Else GvDatosDistribuidores.Columns(5).Visible = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
|
||||
If ObjFlotilla.GetDistribuidores() Then
|
||||
ViewState("DTDistribuidor") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTDistribuidores = ObjFlotilla.DtResultados
|
||||
Else
|
||||
Me.GvDatosDistribuidores.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " T A L L E R E S"
|
||||
|
||||
Protected Sub LbAgregarDistribuidor_Click(sender As Object, e As EventArgs) Handles LbAgregarDistribuidor.Click
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.AddDistribuidores(TxtDistribuidor.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtDistribuidor.Text = ""
|
||||
Alert("El nuevo Distribuidor se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosDistribuidores.Update()
|
||||
ViewState("DTDistribuidor") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientos = ObjFlotilla.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjFlotilla.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatosDistribuidores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosDistribuidores.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(136) 'DISTRIBUIDOR
|
||||
e.Row.Cells(1).Width = Unit.Pixel(95) 'ESTATUS
|
||||
e.Row.Cells(2).Width = Unit.Pixel(95) 'FECHA
|
||||
e.Row.Cells(3).Width = Unit.Pixel(95) 'USUARIO
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100) 'EDITAR
|
||||
e.Row.Cells(5).Width = Unit.Pixel(65) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosDistribuidores_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosDistribuidores.RowDeleting
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.RemoveDistribuidores(GvDatosDistribuidores.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatosDistribuidores.EditIndex = -1
|
||||
ViewState("DTDistribuidor") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTDistribuidores = ObjFlotilla.DtResultados
|
||||
Alert("El Distribuidor se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosDistribuidores_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosDistribuidores.RowCancelingEdit
|
||||
GvDatosDistribuidores.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosDistribuidores_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosDistribuidores.RowUpdating
|
||||
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
|
||||
Dim Distribuidor As String = DirectCast(GvDatosDistribuidores.Rows(e.RowIndex).FindControl("TxtDistribuidor"), TextBox).Text.Trim
|
||||
Dim EstatusDistribuidor As Boolean = GvDatosDistribuidores.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveDistribuidor As Integer = GvDatosDistribuidores.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
|
||||
If ObjFlotilla.UpdateDistribuidores(Distribuidor, EstatusDistribuidor, CveDistribuidor) Then
|
||||
GvDatosDistribuidores.EditIndex = -1
|
||||
ViewState("DTDistribuidor") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTDistribuidores = ObjFlotilla.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosDistribuidores_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosDistribuidores.RowEditing
|
||||
GvDatosDistribuidores.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTDistribuidor"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatosDistribuidores.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatosDistribuidores.DataSource = CType(ViewState("DTDistribuidor"), DataTable)
|
||||
End If
|
||||
GvDatosDistribuidores.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
265
Flotillas/CatMantenimientos.aspx
Normal file
265
Flotillas/CatMantenimientos.aspx
Normal file
@@ -0,0 +1,265 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMantenimientos.aspx.vb" Inherits="Flotillas_CatMantenimientos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Mantenimientos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<ajax:TabContainer runat="server" OnClientActiveTabChanged="ClientFunction" Height="500px" CssClass="tabBodyOverride">
|
||||
<ajax:TabPanel runat="server" HeaderText="Mantenimientos">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTitulosMantenimientos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="200px">
|
||||
<asp:LinkButton ID="LbMantenimientoTipo2" runat="server" CausesValidation="false" Text="" CommandArgument="MantenimientoTipo0;0" OnClick="LbOrden_Click">
|
||||
Tipo Mantenimiento
|
||||
<asp:Literal ID="ImgMantenimientoTipo0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="140px">
|
||||
<asp:LinkButton ID="LbMantenimiento" runat="server" CausesValidation="false" Text="" CommandArgument="Mantenimiento0;0" OnClick="LbOrden_Click">
|
||||
Mantenimiento
|
||||
<asp:Literal ID="ImgMantenimiento0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbEstatusMantenimiento" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus0;0" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbFechaMantenimiento" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng0;0" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaIng0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbUsuarioMantenimiento" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario0;0" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="Imgsuario0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="165px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:DropDownList ID="DdlMantenimientoTipo" runat="server" AppendDataBoundItems="true" DataValueField="CveMantenimientoTipo" DataTextField="MantenimientoTipo" ValidationGroup="GrpGuardar" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 190px !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVMantenimientoTipo2" runat="server" ControlToValidate="DdlMantenimientoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Mantenimiento''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOMantenimientoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVMantenimientoTipo2" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtMantenimiento" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="130px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMantenimiento" runat="server" ControlToValidate="TxtMantenimiento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mantenimiento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMantenimiento" runat="server" HighlightCssClass="vco" TargetControlID="RFVMantenimiento" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td align="center" style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregarMantenimiento" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatosMantenimientos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosMantenimientos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMantenimiento" EmptyDataText="No se encontraron Mantenimientos Registrados" ToolTip="Listado de Mantenimiento" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMantenimientoTipo2" runat="server" Text='<%# Eval("MantenimientoTipo")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlMantenimientoTipo" runat="server" DataValueField="CveMantenimientoTipo" DataTextField="MantenimientoTipo" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 185px !important;"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMantenimiento" runat="server" Text='<%# Eval("Mantenimiento")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMantenimiento" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Mantenimiento") %>' ValidationGroup="GrpGV2" Width="130px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMantenimiento" runat="server" ControlToValidate="TxtMantenimiento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mantenimiento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV2"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMantenimiento" runat="server" HighlightCssClass="vco" TargetControlID="RFVMantenimiento" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<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" OnClientClick="javascript:return C2();" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel runat="server" HeaderText="Tipos de Mantenimiento">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTitulosMantenimientosTipos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="200px">
|
||||
<asp:LinkButton ID="LbMantenimientoTipo" runat="server" CausesValidation="false" Text="" CommandArgument="MantenimientoTipo1;1" OnClick="LbOrden_Click">
|
||||
Mantenimiento Tipo
|
||||
<asp:Literal ID="ImgMantenimientoTipo1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbEstatusMantenimientoTipo" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus1;1" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbFechaMantenimientoTipo" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng1;1" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaIn1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbUsuarioMantenimientoTipo" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario1;1" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="165px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtMantenimientoTipo" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarTipo" Width="190px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMantenimientoTipo" runat="server" ControlToValidate="TxtMantenimientoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''MantenimientoTipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarTipo"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMantenimientoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVMantenimientoTipo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center" align="center">
|
||||
<asp:LinkButton ID="LbAgregarMantenimientoTipo" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarTipo"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosMantenimientosTipos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMantenimientoTipo" EmptyDataText="No se encontraron Tipos de Mantenimientos Registrados" ToolTip="Listado de Tipos de Mantenimiento" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMantenimientoTipo" runat="server" Text='<%# Eval("MantenimientoTipo")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMantenimientoTipo" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MantenimientoTipo")%>' ValidationGroup="GrpGV" Width="190px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMantenimientoTipo" runat="server" ControlToValidate="TxtMantenimientoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mantenimiento Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMantenimientoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVMantenimientoTipo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<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" OnClientClick="javascript:return C();" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
function C() {
|
||||
return confirm('¿Está seguro que desea eliminar el Tipo de Mantenimiento?');
|
||||
}
|
||||
function C2() {
|
||||
return confirm('¿Está seguro que desea eliminar el Mantenimiento?');
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
329
Flotillas/CatMantenimientos.aspx.vb
Normal file
329
Flotillas/CatMantenimientos.aspx.vb
Normal file
@@ -0,0 +1,329 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Flotillas_CatMantenimientos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
|
||||
'Permiso de Agregar
|
||||
If UsuarioActual.TienePermisoProceso(111) Then LbAgregarMantenimiento.Enabled = True Else LbAgregarMantenimiento.Enabled = False
|
||||
If UsuarioActual.TienePermisoProceso(102) Then LbAgregarMantenimientoTipo.Enabled = True Else LbAgregarMantenimientoTipo.Enabled = False
|
||||
|
||||
'Permiso de Editar
|
||||
If UsuarioActual.TienePermisoProceso(112) Then GvDatosMantenimientos.Columns(5).Visible = True Else GvDatosMantenimientos.Columns(5).Visible = False
|
||||
If UsuarioActual.TienePermisoProceso(103) Then GvDatosMantenimientosTipos.Columns(4).Visible = True Else GvDatosMantenimientosTipos.Columns(4).Visible = False
|
||||
|
||||
'Permiso de Eliminar
|
||||
If UsuarioActual.TienePermisoProceso(113) Then GvDatosMantenimientos.Columns(6).Visible = True Else GvDatosMantenimientos.Columns(6).Visible = False
|
||||
If UsuarioActual.TienePermisoProceso(104) Then GvDatosMantenimientosTipos.Columns(5).Visible = True Else GvDatosMantenimientosTipos.Columns(5).Visible = False
|
||||
|
||||
CargaDatos()
|
||||
CargaMantenimientosTipos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.GetMantenimientosTipos() Then
|
||||
ViewState("DTMantenimientoTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientosTipos = ObjFlotilla.DtResultados
|
||||
Else
|
||||
Me.GvDatosMantenimientosTipos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
If ObjFlotilla.GetMantenimientos() Then
|
||||
ViewState("DTMantenimiento") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientosTipos = ObjFlotilla.DtResultados
|
||||
Else
|
||||
Me.GvDatosMantenimientos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMantenimientosTipos()
|
||||
DdlMantenimientoTipo.DataSource = ViewState("DTMantenimientoTipo")
|
||||
DdlMantenimientoTipo.DataBind()
|
||||
End Sub
|
||||
|
||||
#Region " M A N T E N I M I E N T O S "
|
||||
|
||||
Protected Sub LbAgregarMantenimiento_Click(sender As Object, e As EventArgs) Handles LbAgregarMantenimiento.Click
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.AddMantenimientos(TxtMantenimiento.Text.Trim, DdlMantenimientoTipo.Text.Trim.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
DdlMantenimientoTipo.SelectedIndex = -1
|
||||
TxtMantenimiento.Text = ""
|
||||
Alert("El nuevo Mantenimiento se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosMantenimientos.Update()
|
||||
ViewState("DTMantenimiento") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientos = ObjFlotilla.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
Else
|
||||
Alert("Error al agregar el nuevo Mantenimiento. ", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
End Sub
|
||||
|
||||
'' **************------ GVDatosMantenimientos -------**************
|
||||
Protected Sub GvDatosMantenimientos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosMantenimientos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(206) 'Mantenimiento TIPO
|
||||
e.Row.Cells(1).Width = Unit.Pixel(146) 'Mantenimiento
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100) 'ESTATUS
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100) 'FECHA
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100) 'USUARIO
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100) 'EDITAR
|
||||
e.Row.Cells(6).Width = Unit.Pixel(65) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlMantenimientoTipo").DataSource = ViewState("DTMantenimientoTipo")
|
||||
e.Row.FCDropDownList("DdlMantenimientoTipo").DataBind()
|
||||
e.Row.FCDropDownList("DdlMantenimientoTipo").SelectedValue = e.Row.DBCampo("CveMantenimientoTipo")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosMantenimientos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosMantenimientos.RowEditing
|
||||
GvDatosMantenimientos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosMantenimientos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosMantenimientos.RowDeleting
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.RemoveMantenimientos(GvDatosMantenimientos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatosMantenimientos.EditIndex = -1
|
||||
ViewState("DTMantenimiento") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientosTipos = ObjFlotilla.DtResultados
|
||||
Alert("El Mantenimiento se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosMantenimientos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosMantenimientos.RowCancelingEdit
|
||||
GvDatosMantenimientos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMantenimientosTipos2(CveMantenimientoTipo As Integer)
|
||||
DdlMantenimientoTipo.DataSource = ViewState("DTMantenimientoTipo")
|
||||
DdlMantenimientoTipo.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosMantenimientos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosMantenimientos.RowUpdating
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
Dim Mantenimiento As String = DirectCast(GvDatosMantenimientos.Rows(e.RowIndex).FindControl("TxtMantenimiento"), TextBox).Text.Trim
|
||||
Dim CveMantenimientoTipo As Integer = DirectCast(GvDatosMantenimientos.Rows(e.RowIndex).FindControl("DdlMantenimientoTipo"), DropDownList).Text.Trim.ToEntero
|
||||
Dim EstatusMantenimiento As Boolean = GvDatosMantenimientos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveMantenimiento As Integer = GvDatosMantenimientos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If ObjFlotilla.UpdateMantenimientos(Mantenimiento, CveMantenimientoTipo, EstatusMantenimiento, CveMantenimiento) Then
|
||||
GvDatosMantenimientos.EditIndex = -1
|
||||
ViewState("DTMantenimiento") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientos = ObjFlotilla.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 0)
|
||||
Else
|
||||
CargaGrid("", 0)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " M A N T E N I M I E N T O S - T I P O S"
|
||||
|
||||
Protected Sub LbAgregarMantenimientoTipo_Click(sender As Object, e As EventArgs) Handles LbAgregarMantenimientoTipo.Click
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.AddMantenimientosTipos(TxtMantenimientoTipo.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtMantenimientoTipo.Text = ""
|
||||
Alert("El nuevo Tipo de Mantenimiento se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosMantenimientosTipos.Update()
|
||||
ViewState("DTMantenimientoTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientos = ObjFlotilla.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End If
|
||||
ObjFlotilla.Dispose()
|
||||
End Sub
|
||||
|
||||
'' **************------ GVDatosMantenimientosTipos -------**************
|
||||
|
||||
Protected Sub GvDatosMantenimientosTipos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosMantenimientosTipos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(206) 'MANTENIMIENTOTIPO
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100) 'ESTATUS
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100) 'FECHA
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100) 'USUARIO
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100) 'EDITAR
|
||||
e.Row.Cells(5).Width = Unit.Pixel(65) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosMantenimientosTipos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosMantenimientosTipos.RowDeleting
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.RemoveMantenimientosTipos(GvDatosMantenimientosTipos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatosMantenimientosTipos.EditIndex = -1
|
||||
ViewState("DTMantenimientoTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientosTipos = ObjFlotilla.DtResultados
|
||||
Alert("El Tipo de Mantenimiento se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosMantenimientosTipos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosMantenimientosTipos.RowCancelingEdit
|
||||
GvDatosMantenimientosTipos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosMantenimientosTipos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosMantenimientosTipos.RowUpdating
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
Dim MantenimientoTipo As String = DirectCast(GvDatosMantenimientosTipos.Rows(e.RowIndex).FindControl("TxtMantenimientoTipo"), TextBox).Text.Trim
|
||||
Dim EstatusMantenimientoTipo As Boolean = GvDatosMantenimientosTipos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveMantenimientoTipo As Integer = GvDatosMantenimientosTipos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If ObjFlotilla.UpdateMantenimientosTipos(MantenimientoTipo, EstatusMantenimientoTipo, CveMantenimientoTipo) Then
|
||||
GvDatosMantenimientosTipos.EditIndex = -1
|
||||
ViewState("DTMantenimientoTipo") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientosTipos = ObjFlotilla.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosMantenimientosTipos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosMantenimientosTipos.RowEditing
|
||||
GvDatosMantenimientosTipos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString(), 1)
|
||||
Else
|
||||
CargaGrid("", 1)
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim gvi As Integer = 0
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
gvi = Arg(1).ToEntero
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
Campo = Campo.Substring(0, Campo.Length - 1)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo, gvi)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo, gvi)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo, gvi)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo, gvi)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden, gvi)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String, gvi As Integer)
|
||||
If gvi = 0 Then
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTMantenimientoTipo"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatosMantenimientosTipos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatosMantenimientosTipos.DataSource = CType(ViewState("DTMantenimientoTipo"), DataTable)
|
||||
End If
|
||||
GvDatosMantenimientosTipos.DataBind()
|
||||
UpDatos.Update()
|
||||
ElseIf gvi = 1 Then
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTMantenimiento"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatosMantenimientos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatosMantenimientos.DataSource = CType(ViewState("DTMantenimiento"), DataTable)
|
||||
End If
|
||||
GvDatosMantenimientos.DataBind()
|
||||
UpDatosMantenimientos.Update()
|
||||
ElseIf gvi = 2 Then
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
127
Flotillas/CatTalleres.aspx
Normal file
127
Flotillas/CatTalleres.aspx
Normal file
@@ -0,0 +1,127 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTalleres.aspx.vb" Inherits="Flotillas_CatTalleres" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Talleres
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpTitulosTalleres" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="130px">
|
||||
<asp:LinkButton ID="LbTaller" runat="server" CausesValidation="false" Text="" CommandArgument="Taller" OnClick="LbOrden_Click">
|
||||
Taller
|
||||
<asp:Literal ID="ImgTaller" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="95px">
|
||||
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="95px">
|
||||
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="95px">
|
||||
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="165px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtTaller" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarTipo" Width="120px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTaller" runat="server" ControlToValidate="TxtTaller" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Taller''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarTipo"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCTaller" runat="server" HighlightCssClass="vco" TargetControlID="RFVTaller" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregarTaller" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarTipo"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosTalleres" runat="server" AutoGenerateColumns="False" DataKeyNames="CveTaller" EmptyDataText="No se encontraron Talleres Registrados" ToolTip="Listado de Talleres" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTaller" runat="server" Text='<%# Eval("Taller")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtTaller" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Taller")%>' ValidationGroup="GrpGV" Width="120px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTaller" runat="server" ControlToValidate="TxtTaller" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Taller''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCTaller" runat="server" HighlightCssClass="vco" TargetControlID="RFVTaller" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemStyle Width="95px" VerticalAlign="Middle" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<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" OnClientClick="javascript:return C();" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
function C() {
|
||||
return confirm('¿Está seguro que desea eliminar el Taller?');
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
185
Flotillas/CatTalleres.aspx.vb
Normal file
185
Flotillas/CatTalleres.aspx.vb
Normal file
@@ -0,0 +1,185 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Flotillas_CatTalleres
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
|
||||
'Permiso de Agregar Taller
|
||||
If UsuarioActual.TienePermisoProceso(105) Then LbAgregarTaller.Enabled = True Else LbAgregarTaller.Enabled = False
|
||||
|
||||
'Permiso de Editar Taller
|
||||
If UsuarioActual.TienePermisoProceso(106) Then GvDatosTalleres.Columns(4).Visible = True Else GvDatosTalleres.Columns(4).Visible = False
|
||||
|
||||
'Permiso de Eliminar Taller
|
||||
If UsuarioActual.TienePermisoProceso(107) Then GvDatosTalleres.Columns(5).Visible = True Else GvDatosTalleres.Columns(5).Visible = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
|
||||
If ObjFlotilla.GetTalleres() Then
|
||||
ViewState("DTTaller") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTTalleres = ObjFlotilla.DtResultados
|
||||
Else
|
||||
Me.GvDatosTalleres.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregarTaller_Click(sender As Object, e As EventArgs) Handles LbAgregarTaller.Click
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.AddTalleres(TxtTaller.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtTaller.Text = ""
|
||||
Alert("El nuevo Taller se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosTalleres.Update()
|
||||
ViewState("DTTaller") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMantenimientos = ObjFlotilla.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjFlotilla.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatosTalleres_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosTalleres.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(136) 'TALLER
|
||||
e.Row.Cells(1).Width = Unit.Pixel(95) 'ESTATUS
|
||||
e.Row.Cells(2).Width = Unit.Pixel(95) 'FECHA
|
||||
e.Row.Cells(3).Width = Unit.Pixel(95) 'USUARIO
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100) 'EDITAR
|
||||
e.Row.Cells(5).Width = Unit.Pixel(65) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosTalleres_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosTalleres.RowDeleting
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
If ObjFlotilla.RemoveTalleres(GvDatosTalleres.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatosTalleres.EditIndex = -1
|
||||
ViewState("DTTaller") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTTalleres = ObjFlotilla.DtResultados
|
||||
Alert("El Taller se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosTalleres_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosTalleres.RowCancelingEdit
|
||||
GvDatosTalleres.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosTalleres_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosTalleres.RowUpdating
|
||||
|
||||
Dim ObjFlotilla As New ClsFlotillas
|
||||
|
||||
Dim Taller As String = DirectCast(GvDatosTalleres.Rows(e.RowIndex).FindControl("TxtTaller"), TextBox).Text.Trim
|
||||
Dim EstatusTaller As Boolean = GvDatosTalleres.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveTaller As Integer = GvDatosTalleres.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
|
||||
If ObjFlotilla.UpdateTalleres(Taller, EstatusTaller, CveTaller) Then
|
||||
GvDatosTalleres.EditIndex = -1
|
||||
ViewState("DTTaller") = ObjFlotilla.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTTalleres = ObjFlotilla.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjFlotilla.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub GvDatosTalleres_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosTalleres.RowEditing
|
||||
GvDatosTalleres.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTTaller"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatosTalleres.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatosTalleres.DataSource = CType(ViewState("DTTaller"), DataTable)
|
||||
End If
|
||||
GvDatosTalleres.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
101
Flotillas/RepIncidentes.aspx
Normal file
101
Flotillas/RepIncidentes.aspx
Normal file
@@ -0,0 +1,101 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIncidentes.aspx.vb" Inherits="AF_RepIncidentes" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Incidentes
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Vehiculo:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="NombreVehiculo" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" 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="Valida"></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="Valida"></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>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" 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="Valida"></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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Contratos Suministros con los datos especificados." ToolTip="Listado de Contratos Suministros" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="FechaIncidente" HeaderText="Fecha Incidente" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField DataField="Asunto" HeaderText="Asunto" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="PrioridadTexto" HeaderText="Prioridad" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:F2}" HtmlEncode="false" />
|
||||
<asp:BoundField DataField="Horometro" HeaderText="Horometro" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
131
Flotillas/RepIncidentes.aspx.vb
Normal file
131
Flotillas/RepIncidentes.aspx.vb
Normal file
@@ -0,0 +1,131 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class AF_RepIncidentes
|
||||
Inherits ClsPaginas
|
||||
|
||||
Property DTDatos As DataTable
|
||||
Get
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
|
||||
CargaDispositivos()
|
||||
CargaDatos()
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjAF As New ClsAF
|
||||
Dim Finicial As String = ""
|
||||
Dim FFinal As String = ""
|
||||
|
||||
Try
|
||||
Finicial = txtFechaI.Text.ToDate.ToString("yyyy/MM/dd")
|
||||
FFinal = txtFechaF.Text.ToDate.ToString("yyyy/MM/dd")
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrio un error con las fechas")
|
||||
End Try
|
||||
|
||||
If ObjAF.GetIncidentesRep(-1, -1, -1, Finicial, FFinal, DdlDispositivo.SelectedValue.ToEntero, UsuarioActual.CveCliente) Then
|
||||
GvDatos.DataSource = ObjAF.DtResultados
|
||||
DTDatos = ObjAF.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
DTDatos = Nothing
|
||||
End If
|
||||
|
||||
ObjAF.Dispose()
|
||||
GvDatos.DataBind()
|
||||
|
||||
UPDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "C O M B O S"
|
||||
Private Sub CargaDispositivos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosGet(-1, -1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivo.DataSource = GPS.DtResultados
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "I M P R I M I R P D F/Excel"
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
Dim ObjTareas As New ClsOIEventos
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
|
||||
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim Filtros As String = $"<b>Filtros: </b> de { txtFechaI.Text} a {txtFechaF.Text}"
|
||||
|
||||
If DdlDispositivo.SelectedIndex > 0 Then
|
||||
Filtros = Filtros & $" <b> Vehiculo:</b> {DdlDispositivo.SelectedItem.Text}"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
params.Add(New ReportParameter("AgrupadoPor", Filtros))
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", txtFechaI.Text))
|
||||
params.Add(New ReportParameter("FechaFin", txtFechaF.Text))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas\Grales\Formatos\RepAFIncidentes.rdlc", DTDatos, params, "ReporIncidentes", Formato:=Formato)
|
||||
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
149
Flotillas/RepLicencias.aspx
Normal file
149
Flotillas/RepLicencias.aspx
Normal file
@@ -0,0 +1,149 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepLicencias.aspx.vb" Inherits="AF_RepLicencias" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Incidentes
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="height:70px">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Vehiculo:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="NombreVehiculo" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me" >
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
F.I. Expedición:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" 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="Valida"></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="Valida"></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>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
F.F. Expedición:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" 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="Valida"></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>
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
F.I. Vencimiento:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaVI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkCalendarioVI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEETxtFechaVI" runat="server" TargetControlID="TxtFechaVI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CCETxtFechaVI" TargetControlID="TxtFechaVI" PopupButtonID="LnkCalendarioVI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVTxtFechaVI" runat="server" ControlToValidate="TxtFechaVI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVTxtFechaVI" runat="server" ControlToValidate="TxtFechaVI" 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="Valida"></asp:CompareValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtFechaVI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaVI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
F.F Vencimiento:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaVF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkTxtFechaVF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="METxtFechaVF" runat="server" TargetControlID="TxtFechaVF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaVF" PopupButtonID="LnkTxtFechaVF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVTxtFechaVF" runat="server" ControlToValidate="TxtFechaVF" 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="CVTxtFechaVF" runat="server" ControlToValidate="TxtFechaVF" 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="Valida"></asp:CompareValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtFechaVF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaVF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Contratos Suministros con los datos especificados." ToolTip="Listado de Contratos Suministros" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Descripcion" HeaderText="Licencia" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaExpedicion" HeaderText="Fecha Expedicion" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField DataField="Anio" HeaderText="Año" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Licencia" HeaderText="Licencia" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaVencimiento" HeaderText="Fecha Vencimiento" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
136
Flotillas/RepLicencias.aspx.vb
Normal file
136
Flotillas/RepLicencias.aspx.vb
Normal file
@@ -0,0 +1,136 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class AF_RepLicencias
|
||||
Inherits ClsPaginas
|
||||
|
||||
Property DTDatos As DataTable
|
||||
Get
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
|
||||
|
||||
TxtFechaVI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
TxtFechaVF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
|
||||
CargaDispositivos()
|
||||
CargaDatos()
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjAF As New ClsAF
|
||||
Dim Finicial As String = ""
|
||||
Dim FFinal As String = ""
|
||||
|
||||
Dim FiniciaVl As String = ""
|
||||
Dim FFinalVl As String = ""
|
||||
|
||||
Try
|
||||
|
||||
Finicial = txtFechaI.Text.ToDateTime
|
||||
FFinal = txtFechaF.Text.ToDateTime
|
||||
FiniciaVl = TxtFechaVI.Text.ToDateTime
|
||||
FFinalVl = TxtFechaVF.Text.ToDateTime
|
||||
|
||||
Catch ex As Exception
|
||||
Finicial = "-1"
|
||||
FFinal = "-1"
|
||||
End Try
|
||||
|
||||
If ObjAF.GetLicenciasRep(-1, -1, -1, Finicial, FFinal, FiniciaVl, FFinalVl, DdlDispositivo.SelectedValue.ToEntero, UsuarioActual.CveCliente) Then
|
||||
GvDatos.DataSource = ObjAF.DtResultados
|
||||
DTDatos = ObjAF.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
DTDatos = Nothing
|
||||
End If
|
||||
|
||||
ObjAF.Dispose()
|
||||
GvDatos.DataBind()
|
||||
|
||||
UPDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "C O M B O S"
|
||||
Private Sub CargaDispositivos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosGet(-1, -1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivo.DataSource = GPS.DtResultados
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "I M P R I M I R P D F/Excel"
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim Filtros As String = $"<b>Filtros: </b> Expedición de { txtFechaI.Text} a {txtFechaF.Text} Vencimiento de { TxtFechaVI.Text} a {TxtFechaVF.Text } "
|
||||
|
||||
If DdlDispositivo.SelectedIndex > 0 Then
|
||||
Filtros = Filtros & $",Vehiculo: {DdlDispositivo.SelectedItem.Text}"
|
||||
End If
|
||||
|
||||
params.Add(New ReportParameter("AgrupadoPor", Filtros))
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", txtFechaI.Text))
|
||||
params.Add(New ReportParameter("FechaFin", txtFechaF.Text))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas\Grales\Formatos\RepAFLicencia.rdlc", DTDatos, params, "ReporLicencias", Formato:=Formato)
|
||||
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
156
Flotillas/RepPlacas.aspx
Normal file
156
Flotillas/RepPlacas.aspx
Normal file
@@ -0,0 +1,156 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPlacas.aspx.vb" Inherits="AF_RepPlacas" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Placas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="height:85px">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Dispositivo:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="NombreVehiculo" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Proveedor:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlProveedor" runat="server" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
F.I.Expedicion:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaEI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioEI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtFechaEI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="txtFechaEI" PopupButtonID="imgCalendarioEI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtFechaEI" 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="CompareValidator2" runat="server" ControlToValidate="txtFechaEI" 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="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
F.F. Expedicion:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaEF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioEF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtFechaEF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender3" TargetControlID="txtFechaEF" PopupButtonID="imgCalendarioEF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtFechaEF" 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="CompareValidator3" runat="server" ControlToValidate="txtFechaEF" 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="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator3" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator3" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
F.I.Vencimiento:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaVI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtFechaVI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtFechaVI" PopupButtonID="imgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFechaVI" 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="CompareValidator1" runat="server" ControlToValidate="txtFechaVI" 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="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
F.F. Vencimiento:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaVF" 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="txtFechaVF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaVF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaVF" 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="txtFechaVF" 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="Valida"></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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Placa:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlPlaca" runat="server" AppendDataBoundItems="true" DataTextField="Placa" DataValueField="CvePlaca" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" DataKeyNames="CvePlaca,CveAF" AutoGenerateColumns="False" EmptyDataText="No se encontraron placas con los datos especificados." ToolTip="Listado de Contratos Suministros" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" HeaderText="Activo Fijo" DataTextField="Descripcion" DataTextFormatString="{0}" DataNavigateUrlFields="CveAF" DataNavigateUrlFormatString="/AF/AF.aspx?CveActivoFijo={0}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Left" HeaderText="Placa" DataField="Placa" />
|
||||
<asp:BoundField runat="server" HeaderText="Fecha Expedicion" DataField="FechaExpedicion" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField runat="server" HeaderText="Fecha Vencimiento" DataField="FechaVencimiento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField runat="server" HeaderText="Fecha Ingreso" DataField="FechaIng" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField runat="server" HeaderText="Usuario" DataField="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
115
Flotillas/RepPlacas.aspx.vb
Normal file
115
Flotillas/RepPlacas.aspx.vb
Normal file
@@ -0,0 +1,115 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class AF_RepPlacas
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DTDatos As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
txtFechaEI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaEF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
txtFechaVI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaVF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
CargaDispositivos()
|
||||
CargaPlacas()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjAF As New ClsAF
|
||||
If ObjAF.GetRepPlacas(DdlPlaca.SelectedValue.ToEntero, -1, -1, txtFechaEI.Text.ToDateTime, txtFechaEF.Text.ToDateTime, txtFechaVI.Text.ToDateTime, txtFechaVF.Text.ToDateTime, DdlDispositivo.SelectedValue.ToEntero, UsuarioActual.CveCliente) Then
|
||||
GvDatos.DataSource = ObjAF.DtResultados
|
||||
GvDatos.DataBind()
|
||||
DTDatos = ObjAF.DtResultados
|
||||
End If
|
||||
ObjAF.Dispose()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosGet(-1, -1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivo.DataSource = GPS.DtResultados
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPlacas()
|
||||
Dim ObjAF As New ClsAF
|
||||
If ObjAF.GetPlacas(-1, -1, UsuarioActual.CveEmpresa) Then
|
||||
DdlPlaca.DataSource = ObjAF.DtResultados
|
||||
DdlPlaca.DataBind()
|
||||
DdlPlaca.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
End If
|
||||
ObjAF.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "I M P R I M I R P D F/Excel"
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
If DTDatos.Rows.Count > 0 Then
|
||||
Dim params As New List(Of ReportParameter)
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim StrFiltro As New StringBuilder
|
||||
If DdlDispositivo.SelectedValue <> "-1" Then StrFiltro.AppendFormat("<b>Vehiculo</b>: {0}", DdlDispositivo.SelectedItem.Text)
|
||||
If DdlPlaca.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Placa</b>: {0}", DdlPlaca.SelectedItem.Text)
|
||||
StrFiltro.AppendFormat($"<b>Filtros: </b> Fecha Expedicion: {txtFechaEI.Text} y {txtFechaEF.Text} Fecha Vencimiento: {txtFechaVI.Text} y {txtFechaVF.Text}")
|
||||
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas\Grales\Formatos\RepPlacas.rdlc", DTDatos, params, "ReportePlacas", Formato:=Formato)
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
144
Flotillas/RepPolizaSeguro.aspx
Normal file
144
Flotillas/RepPolizaSeguro.aspx
Normal file
@@ -0,0 +1,144 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPolizaSeguro.aspx.vb" Inherits="AF_RepPolizaSeguro" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Pólizas de Seguro
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="height:83px">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Dispositivo:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="NombreVehiculo" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<%--<div class="col-md-1 truncate">
|
||||
Proveedor:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlProveedor" runat="server" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>--%>
|
||||
</div>
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
F.I.Expedicion:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaEI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioEI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtFechaEI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="txtFechaEI" PopupButtonID="imgCalendarioEI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtFechaEI" 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="CompareValidator2" runat="server" ControlToValidate="txtFechaEI" 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="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
F.F. Expedicion:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaEF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioEF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtFechaEF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender3" TargetControlID="txtFechaEF" PopupButtonID="imgCalendarioEF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtFechaEF" 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="CompareValidator3" runat="server" ControlToValidate="txtFechaEF" 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="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator3" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator3" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
F.I.Vencimiento:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaVI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtFechaVI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtFechaVI" PopupButtonID="imgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFechaVI" 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="CompareValidator1" runat="server" ControlToValidate="txtFechaVI" 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="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
F.F. Vencimiento:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaVF" 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="txtFechaVF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaVF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaVF" 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="txtFechaVF" 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="Valida"></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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Contratos Suministros con los datos especificados." ToolTip="Listado de Contratos Suministros" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField runat="server" HeaderText="Póliza Seguro" DataField="PolizaSeguro" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField runat="server" HeaderText="Activo Fijo" DataField="Descripcion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField runat="server" HeaderText="Proveedor" DataField="ProveedorServicio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField runat="server" HeaderText="Fecha Expedición" DataField="FechaExpedicion" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField runat="server" HeaderText="Fecha Vencimiento" DataField="FechaVencimiento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
112
Flotillas/RepPolizaSeguro.aspx.vb
Normal file
112
Flotillas/RepPolizaSeguro.aspx.vb
Normal file
@@ -0,0 +1,112 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Partial Class AF_RepPolizaSeguro
|
||||
Inherits ClsPaginas
|
||||
|
||||
Property DTDatos As DataTable
|
||||
Get
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
txtFechaEI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaEF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
txtFechaVI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaVF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
CargaDatos()
|
||||
CargaDispositivos()
|
||||
CargaProveedores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjAF As New ClsAF
|
||||
If ObjAF.GetRepPolizaSeguro(-1, -1, txtFechaEI.Text.ToDateTime, txtFechaEF.Text.ToDateTime, txtFechaVI.Text.ToDateTime, txtFechaVF.Text.ToDateTime, -1, DdlDispositivo.SelectedValue.ToEntero, UsuarioActual.CveCliente) Then
|
||||
DTDatos = ObjAF.DtResultados
|
||||
GvDatos.DataSource = DTDatos
|
||||
GvDatos.DataBind()
|
||||
End If
|
||||
ObjAF.Dispose()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "C O M B O S"
|
||||
Private Sub CargaDispositivos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosGet(-1, -1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivo.DataSource = GPS.DtResultados
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Public Sub CargaProveedores()
|
||||
'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
'DdlProveedor.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "I M P R I M I R P D F/Excel"
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
Dim params As New List(Of ReportParameter)
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim Filtros As String = $"<b>Filtros: </b> Fecha Expedicion: {txtFechaEI.Text} y {txtFechaEF.Text} Fecha Vencimiento: {txtFechaVI.Text} y {txtFechaVF.Text}"
|
||||
If DdlDispositivo.SelectedValue > 0 Then
|
||||
Filtros = Filtros & $" <b> Vehiculo:</b> {DdlDispositivo.SelectedItem.Text}"
|
||||
End If
|
||||
|
||||
'If DdlProveedor.SelectedValue > 0 Then
|
||||
' Filtros = Filtros & $" <b> Proveedor:</b> {DdlProveedor.SelectedItem.Text}"
|
||||
'End If
|
||||
|
||||
params.Add(New ReportParameter("AgrupadoPor", Filtros))
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", txtFechaEI.Text))
|
||||
params.Add(New ReportParameter("FechaFin", txtFechaEF.Text))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas\Grales\Formatos\RepPolizaSeguroGPS.rdlc", DTDatos, params, "Reporte Poliza Seguro", Formato:=Formato)
|
||||
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
115
Flotillas/RepServicios.aspx
Normal file
115
Flotillas/RepServicios.aspx
Normal file
@@ -0,0 +1,115 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepServicios.aspx.vb" Inherits="AF_RepPlacas" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Servicios
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Dispositivo:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="NombreVehiculo" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me" ></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha I:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" 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="Valida"></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="Valida"></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>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha F:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" 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="Valida"></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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row">
|
||||
<%--<div class="col-md-1 truncate">
|
||||
Proveedor:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlProveedor" runat="server" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>--%>
|
||||
<div class="col-md-1 truncate">
|
||||
Tipo Servicio:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlTipoServicio" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" DataKeyNames="" AutoGenerateColumns="False" EmptyDataText="No se encontraron servicios con los datos especificados." ToolTip="Listado de servicios" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField runat="server" HeaderText="Tipo" DataField="TipoServicio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField runat="server" HeaderText="Fecha" DataField="FechaServicio" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField runat="server" HeaderText="Proveedor" DataField="ProveedorServicio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" HeaderText="Factura" DataTextField="SerieFolio" DataTextFormatString="{0}" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" />
|
||||
<asp:BoundField runat="server" HeaderText="Horometro" DataField="Horometro" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField runat="server" HeaderText="Observaciones" DataField="Observaciones" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
119
Flotillas/RepServicios.aspx.vb
Normal file
119
Flotillas/RepServicios.aspx.vb
Normal file
@@ -0,0 +1,119 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class AF_RepPlacas
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DTDatos As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
CargaDispositivos()
|
||||
CargaProveedores()
|
||||
CargaTipoServicios()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjAF As New ClsAF
|
||||
If ObjAF.GetRepServicios(-1, -1, DdlTipoServicio.SelectedValue.ToEntero, -1, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlDispositivo.SelectedValue.ToEntero, UsuarioActual.CveCliente) Then
|
||||
GvDatos.DataSource = ObjAF.DtResultados
|
||||
GvDatos.DataBind()
|
||||
DTDatos = ObjAF.DtResultados
|
||||
End If
|
||||
ObjAF.Dispose()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosGet(-1, -1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivo.DataSource = GPS.DtResultados
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaProveedores()
|
||||
'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
'DdlProveedor.DataBind()
|
||||
'DdlProveedor.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTipoServicios()
|
||||
DdlTipoServicio.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
DdlTipoServicio.Items.Insert(1, New System.Web.UI.WebControls.ListItem("Preventivo", "1"))
|
||||
DdlTipoServicio.Items.Insert(2, New System.Web.UI.WebControls.ListItem("Correctivo", "2"))
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "I M P R I M I R P D F/Excel"
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
If DTDatos.Rows.Count > 0 Then
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim StrFiltro As New StringBuilder
|
||||
If DdlDispositivo.SelectedValue <> "-1" Then StrFiltro.AppendFormat("<b>Vehiculo</b>: {0}", DdlDispositivo.SelectedItem.Text)
|
||||
'If DdlProveedor.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Proveedor</b>: {0}", DdlProveedor.SelectedItem.Text)
|
||||
If DdlTipoServicio.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Tipo Servicio</b>: {0}", DdlTipoServicio.SelectedItem.Text)
|
||||
If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" <b>Fecha Inicio</b>: {0}", txtFechaI.Text)
|
||||
If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" <b>Fecha Fin</b>: {0}", txtFechaF.Text)
|
||||
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas\Grales\Formatos\RepServiciosGPS.rdlc", DTDatos, params, "ReporteServicios", Formato:=Formato)
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user