--Se cambia el formato de las consultas en RepContratos y RepContratosCalendarios. Se modifica de LinkButton a HyperLink para mandar a RepContratoDetalle. Se agregan columnas ocultas y modal para personalizar el gridview.
This commit is contained in:
@@ -1,5 +1,10 @@
|
|||||||
Imports System.Data
|
Option Explicit On
|
||||||
|
Option Strict On
|
||||||
|
Imports System.Data
|
||||||
|
Imports ADSNetLibrary.Helpers
|
||||||
|
Imports ADSNetLibrary.SIGAPI.Helpers
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
|
Imports Extensiones.ModExtensiones
|
||||||
|
|
||||||
Partial Class Boletos
|
Partial Class Boletos
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -28,12 +33,13 @@ Partial Class Boletos
|
|||||||
ViewState("CveViaje") = value
|
ViewState("CveViaje") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Private Property CveRuta As Integer
|
|
||||||
|
Private Property Contrato As DataTable
|
||||||
Get
|
Get
|
||||||
Return ViewState("CveRuta").ToString().ToEntero
|
Return CType(ViewState("Contrato"), DataTable)
|
||||||
End Get
|
End Get
|
||||||
Set(value As Integer)
|
Set(value As DataTable)
|
||||||
ViewState("CveRuta") = value
|
ViewState("Contrato") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
@@ -44,7 +50,6 @@ Partial Class Boletos
|
|||||||
Response.Redirect("/Transportes/RepViajes.aspx")
|
Response.Redirect("/Transportes/RepViajes.aspx")
|
||||||
End If
|
End If
|
||||||
AsientoSeleccionado = ""
|
AsientoSeleccionado = ""
|
||||||
CveRuta = 0
|
|
||||||
CveViaje = Request.QueryString("CveViaje").ToEntero
|
CveViaje = Request.QueryString("CveViaje").ToEntero
|
||||||
If CveViaje > 0 Then
|
If CveViaje > 0 Then
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
@@ -55,43 +60,26 @@ Partial Class Boletos
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
'Datos Viaje
|
Dim ObjContratos As New ClsContratos
|
||||||
Dim ObjViaje As New ClsTransportes
|
If ObjContratos.GetContratos(CveViaje, UsuarioActual.CveEmpresa) Then
|
||||||
Dim retornoViaje As Boolean = ObjViaje.GetViajes(CveViaje, UsuarioActual.CveEmpresa)
|
Contrato = ObjContratos.DtResultados
|
||||||
|
Else
|
||||||
If retornoViaje AndAlso ObjViaje.CveViaje > 0 Then
|
Response.Redirect($"~/Transportes/RepContratos.aspx")
|
||||||
CveRuta = ObjViaje.CveRuta
|
|
||||||
TxtRuta.Text = ObjViaje.Ruta
|
|
||||||
TxtFecha.Text = ObjViaje.Fecha.ToShortDateString
|
|
||||||
CargaDestinos()
|
|
||||||
'Boletos Vendidos
|
|
||||||
Dim dt As DataTable
|
|
||||||
If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=1) Then 'Poner párametro para estatus y cancelado de viajes
|
|
||||||
dt = ObjViaje.DtResultados
|
|
||||||
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
|
|
||||||
For Each dr As DataRow In dt.Rows
|
|
||||||
Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton)
|
|
||||||
If lnk IsNot Nothing Then
|
|
||||||
lnk.Enabled = False
|
|
||||||
lnk.CssClass = "nodisponible"
|
|
||||||
lnk.ToolTip = dr("Nombre").ToString
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
ObjViaje.Dispose()
|
|
||||||
|
TxtRuta.Text = Contrato.Rows(0)("Ruta").ToString
|
||||||
|
TxtFecha.Text = Contrato.Rows(0)("FechaInicial").ToString
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub InicializaCombos()
|
Protected Sub InicializaCombos()
|
||||||
|
Dim CveRuta As Integer = Contrato.Rows(0)("CveRuta").ToString.ToEntero
|
||||||
|
|
||||||
'Lista Destinos''carga específicos
|
'Lista Destinos''carga específicos
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected Sub CargaDestinos()
|
|
||||||
Dim ObjDestinos As New ClsTransportes()
|
Dim ObjDestinos As New ClsTransportes()
|
||||||
|
If Not ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
|
||||||
If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
|
Else
|
||||||
|
|
||||||
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
@@ -106,6 +94,10 @@ Partial Class Boletos
|
|||||||
End If
|
End If
|
||||||
ObjDestinos.Dispose()
|
ObjDestinos.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub CargaDestinos()
|
||||||
|
|
||||||
|
End Sub
|
||||||
Protected Sub CotizarTarifa(sender As Object, e As EventArgs)
|
Protected Sub CotizarTarifa(sender As Object, e As EventArgs)
|
||||||
If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then
|
If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then
|
||||||
|
|
||||||
@@ -145,7 +137,6 @@ Partial Class Boletos
|
|||||||
AsientoSeleccionado = buttonID
|
AsientoSeleccionado = buttonID
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub AddBoleto(sender As Object, e As EventArgs)
|
Protected Sub AddBoleto(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
If AsientoSeleccionado = "" Then
|
If AsientoSeleccionado = "" Then
|
||||||
Alert("Se requiere seleccionar su asiento", TipoMensaje.MsgAdvertencia)
|
Alert("Se requiere seleccionar su asiento", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -175,7 +166,6 @@ Partial Class Boletos
|
|||||||
CargaDatos()
|
CargaDatos()
|
||||||
UpPanel.Update()
|
UpPanel.Update()
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
|
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
|
||||||
<%-- Información General --%>
|
<%-- Información General --%>
|
||||||
<ajax:TabPanel runat="server" HeaderText="Información General" CssClass="tabBodyOverride">
|
<ajax:TabPanel runat="server" HeaderText="Información General" CssClass="tabBodyOverride">
|
||||||
|
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<%-- Datos del Contrato --%>
|
<%-- Datos del Contrato --%>
|
||||||
<div class="portlet light bordered">
|
<div class="portlet light bordered">
|
||||||
@@ -184,6 +183,12 @@
|
|||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>
|
||||||
|
<%-- Boletos --%>
|
||||||
|
<ajax:TabPanel runat="server" HeaderText="Boletos" CssClass="row" Visible="false" ID="TabBoletos">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</ajax:TabPanel>
|
||||||
</ajax:TabContainer>
|
</ajax:TabContainer>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Imports ADSNetLibrary.Helpers
|
|||||||
Imports ADSNetLibrary.SIGAPI.Helpers
|
Imports ADSNetLibrary.SIGAPI.Helpers
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
|
|
||||||
|
|
||||||
Partial Class RepContratoDetalle
|
Partial Class RepContratoDetalle
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
Private Property CveContrato As Integer
|
Private Property CveContrato As Integer
|
||||||
@@ -48,6 +49,9 @@ Partial Class RepContratoDetalle
|
|||||||
Response.Redirect($"~/Transportes/RepContratos.aspx")
|
Response.Redirect($"~/Transportes/RepContratos.aspx")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then
|
||||||
|
TabBoletos.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
|
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
|
||||||
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
|
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
|
||||||
|
|||||||
@@ -12,134 +12,133 @@
|
|||||||
.my-1 {
|
.my-1 {
|
||||||
margin-block: 1rem;
|
margin-block: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.consulta {
|
|
||||||
background-color: #95A5A6;
|
|
||||||
padding: 1rem 1rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.consulta_linea {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-block: .5rem;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.consulta_campo {
|
|
||||||
display: flex;
|
|
||||||
gap: 1rem;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.consulta_campo label {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.expandir {
|
|
||||||
width: 2.5rem;
|
|
||||||
font-size: 2.5rem;
|
|
||||||
font-weight: 900;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
<asp:Content ID="Content3" ContentPlaceHolderID="H" runat="Server">
|
<asp:Content ID="Content3" ContentPlaceHolderID="H" runat="Server">
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LBAgregarContrato" runat="server"><i class='fa fa-plus'></i>Agregar Contrato</asp:LinkButton>
|
<asp:LinkButton ID="LBAgregarContrato" runat="server"><i class='fa fa-plus'></i>Agregar Contrato</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<asp:LinkButton ID="LnkPdf" runat="server"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
<li>
|
||||||
</li>
|
<asp:LinkButton OnClick="ModalPersonalizar" runat="server"><i class="fa fa-pencil"></i>Personalizar Columnas</asp:LinkButton>
|
||||||
<li>
|
</li>
|
||||||
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
<li>
|
||||||
</li>
|
<asp:LinkButton ID="LnkPdf" runat="server"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||||
|
</li>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
<asp:Content ID="Content4" ContentPlaceHolderID="C" runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="C" runat="Server">
|
||||||
<%-- Filtros --%>
|
<%-- Filtros --%>
|
||||||
<div class="consulta">
|
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||||
<div class="consulta_linea">
|
<ContentTemplate>
|
||||||
<div class="consulta_campo">
|
<div class="portlet solid grey-cascade portlet-filter">
|
||||||
<label>Fecha Inicial:</label>
|
<%-- Filtro Visible - Consulta --%>
|
||||||
<asp:TextBox Width="150px" ID="txtFechaI" runat="server" CssClass="form-control"
|
<div class="portlet-title portlet-filterT smalltitle">
|
||||||
type="datetime"
|
<div class="tools">
|
||||||
MaxLength="10"></asp:TextBox>
|
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn
|
||||||
</div>
|
btn-primary" />
|
||||||
|
<a href="javascript:;" class="expand"></a>
|
||||||
<div class="consulta_campo">
|
</div>
|
||||||
<label>Fecha Inicial:</label>
|
<div class="titlefiltros caption">
|
||||||
<asp:TextBox Width="150px" ID="txtFechaF" runat="server" CssClass="form-control"
|
<div class="row" style="height: 32px;">
|
||||||
type="datetime"
|
<%-- Fecha Inicial --%>
|
||||||
MaxLength="10"></asp:TextBox>
|
<label class="col-md-1 truncate">Fecha Inicial</label>
|
||||||
</div>
|
<div class="col-md-1" style="min-width: 115px">
|
||||||
|
<div class="input-group input-sm input-small date date-picker "
|
||||||
<div class="consulta_campo">
|
data-date-format="dd/mm/yyyy"
|
||||||
<label>Cliente</label>
|
style="width: 100px !important; padding: 0px;">
|
||||||
<ADS:Dropdownlost ID="DdlClientesConsulta" data-metodo="getcliente"
|
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control"
|
||||||
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 200px"
|
MaxLength="10"></asp:TextBox>
|
||||||
CssClassDdl="select2me"
|
<span class="input-group-btn ">
|
||||||
UsaWebService="true"></ADS:Dropdownlost>
|
<asp:LinkButton ID="imgCalendario" class="btn default "
|
||||||
</div>
|
Text="<i class='fa fa-calendar'></i>"
|
||||||
|
runat="server"></asp:LinkButton>
|
||||||
<div class="consulta_campo">
|
</span>
|
||||||
<label>Estatus:</label>
|
</div>
|
||||||
<div class="col-md-8">
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI"
|
||||||
<asp:DropDownList ID="DdlEstatusConsulta" runat="server" Class="table-group-action-input form-control input-inline select2me"
|
Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left">
|
||||||
DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus"
|
</ajax:MaskedEditExtender>
|
||||||
AppendDataBoundItems="true" Width="200px">
|
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI"
|
||||||
</asp:DropDownList>
|
PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
</div>
|
||||||
|
<%-- Fecha Final --%>
|
||||||
|
<label class="col-md-1 truncate">Fecha Fin</label>
|
||||||
|
<div class="col-md-1" style="min-width: 115px">
|
||||||
|
<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"
|
||||||
|
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>
|
||||||
|
</div>
|
||||||
|
<%-- Cliente --%>
|
||||||
|
<label class="col-md-1">Cliente</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlCliente" Width="86%"
|
||||||
|
data-metodo="getcliente"
|
||||||
|
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente"
|
||||||
|
CssStyle="width: 86%;"
|
||||||
|
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
|
||||||
|
</div>
|
||||||
|
<%-- Estatus --%>
|
||||||
|
<label class="col-md-1 ">Estatus:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlEstatus" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus" CssClass="form-control ddlFiltros input-sm select2me
|
||||||
|
Widthall"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%-- Filtro Oculto --%>
|
||||||
|
<div class="portlet-body row" style="display: none">
|
||||||
|
<%-- Centro de Costos --%>
|
||||||
|
<label class="col-md-1 truncate ">Centro de Costos</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlCentroCostos" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="" DataValueField="" CssClass="form-control ddlFiltros input-sm select2me
|
||||||
|
Widthall"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
<%-- Tipo de Unidad --%>
|
||||||
|
<label class="col-md-1 ">Tipo de Unidad</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlTipoUnidad" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="TipoActivoFijo" DataValueField="CveTipoActivoFijo" CssClass="form-control ddlFiltros input-sm select2me
|
||||||
|
Widthall"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
<%-- Chofer --%>
|
||||||
|
<label class="col-md-1 ">Chofer:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlChofer" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="NombreCompleto" DataValueField="CvePersonal" CssClass="form-control ddlFiltros input-sm select2me
|
||||||
|
Widthall"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="consulta_campo">
|
</ContentTemplate>
|
||||||
<asp:Button ID="BtnConsulta" runat="server" Text="Consultar" class="btn btn-primary"
|
</asp:UpdatePanel>
|
||||||
OnClick="Consultar" />
|
|
||||||
<asp:LinkButton ID="BtnExpandir" runat="server" Text="↓" CssClass="expandir"
|
|
||||||
OnClick="Expandir" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<asp:Panel runat="server" Visible="false" ID="PnExpandirConsulta" CssClass="consulta_linea">
|
|
||||||
<div class="consulta_campo">
|
|
||||||
<label>Centro Costos:</label>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<asp:DropDownList ID="DdlCentroCostos" runat="server"
|
|
||||||
DataTextField="" DataValueField=""
|
|
||||||
AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline select2me"
|
|
||||||
Width="200px">
|
|
||||||
</asp:DropDownList>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="consulta_campo">
|
|
||||||
<label>Tipo Unidad:</label>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<asp:DropDownList ID="DdlTIpoUnidad" runat="server"
|
|
||||||
DataTextField="TipoActivoFijo"
|
|
||||||
DataValueField="CveTipoActivoFijo"
|
|
||||||
AppendDataBoundItems="true"
|
|
||||||
Class="table-group-action-input form-control input-inline select2me"
|
|
||||||
Width="200px">
|
|
||||||
</asp:DropDownList>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="consulta_campo">
|
|
||||||
<label>Chofer:</label>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<asp:DropDownList ID="DdlChofer" runat="server"
|
|
||||||
DataValueField="CvePersonal"
|
|
||||||
DataTextField="NombreCompleto"
|
|
||||||
AppendDataBoundItems="true"
|
|
||||||
Class="table-group-action-input form-control input-inline select2me"
|
|
||||||
Width="200px">
|
|
||||||
</asp:DropDownList>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</asp:Panel>
|
|
||||||
</div>
|
|
||||||
<%-- Listado de Contratos --%>
|
<%-- Listado de Contratos --%>
|
||||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
@@ -149,7 +148,8 @@
|
|||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField HeaderText="Contrato">
|
<asp:TemplateField HeaderText="Contrato">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton runat="server" Text='<%# Eval("NumeroContrato") %>' OnClick="GoContratoDetalle"></asp:LinkButton>
|
<asp:HyperLink runat="server" NavigateUrl='<%# "~/Transportes/RepContratoDetalle.aspx?CveContrato=" + If(Eval("CveContrato") IsNot DBNull.Value, Eval("CveContrato").ToString(), String.Empty) %>'
|
||||||
|
Text='<%# Eval("NumeroContrato") %>'></asp:HyperLink>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
@@ -191,6 +191,25 @@
|
|||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<%-- Columnas Ocultas --%>
|
||||||
|
<asp:TemplateField HeaderText="Chofer 1" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="LbChofer" runat="server" Text='<%# Eval("NombreChofer") %>'></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Chofer 2" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtChofer2" runat="server" Text='<%# Eval("NombreChofer2") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Unidad" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtUnidad" runat="server" Text='<%# Eval("NombreAF") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-CssClass="bold">
|
<asp:TemplateField HeaderText="Estatus" ItemStyle-CssClass="bold">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label ID="LtlEstatus" runat="server"
|
<asp:Label ID="LtlEstatus" runat="server"
|
||||||
@@ -364,6 +383,38 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
<%-- Modal para personalizar columnas --%>
|
||||||
|
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div id="DivPersonalizar" class="modal fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">Personalizar Columnas</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<asp:CheckBox ID="ChkChofer" runat="server" Text="Chofer" /><br>
|
||||||
|
<asp:CheckBox ID="ChkChofer2" runat="server" Text="Chofer 2" /><br>
|
||||||
|
<asp:CheckBox ID="ChkUnidad" runat="server" Text="Unidad" /><br>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<asp:Button runat="server" CssClass="btn btn-success" OnClick="Personalizar" Text="Personalizar">
|
||||||
|
</asp:Button>
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
Option Explicit On
|
Option Explicit On
|
||||||
Option Strict On
|
Option Strict On
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.Data.SqlClient
|
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports Extensiones.ModExtensiones
|
Imports Extensiones.ModExtensiones
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
@@ -34,11 +33,11 @@ Partial Class ListadoContratos
|
|||||||
DdlTipoAF.DataBind()
|
DdlTipoAF.DataBind()
|
||||||
DdlTipoAF.Items.Insert(0, New ListItem("-", ""))
|
DdlTipoAF.Items.Insert(0, New ListItem("-", ""))
|
||||||
|
|
||||||
DdlTIpoUnidad.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
DdlTipoUnidad.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
||||||
DdlTIpoUnidad.DataBind()
|
DdlTipoUnidad.DataBind()
|
||||||
DdlTIpoUnidad.Items.Insert(0, New ListItem("-", ""))
|
DdlTipoUnidad.Items.Insert(0, New ListItem("-", ""))
|
||||||
'Lista Chofer'
|
'Lista Chofer'
|
||||||
DdlChofer.DataSource = GlobalDTRHPersonal(188)
|
DdlChofer.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||||
DdlChofer.DataBind()
|
DdlChofer.DataBind()
|
||||||
DdlChofer.Items.Insert(0, New ListItem("-", ""))
|
DdlChofer.Items.Insert(0, New ListItem("-", ""))
|
||||||
End Sub
|
End Sub
|
||||||
@@ -51,9 +50,9 @@ Partial Class ListadoContratos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
||||||
DdlEstatusConsulta.DataSource = ObjContratos.DtResultados
|
DdlEstatus.DataSource = ObjContratos.DtResultados
|
||||||
DdlEstatusConsulta.DataBind()
|
DdlEstatus.DataBind()
|
||||||
DdlEstatusConsulta.Items.Insert(0, New ListItem("-", ""))
|
DdlEstatus.Items.Insert(0, New ListItem("-", ""))
|
||||||
End If
|
End If
|
||||||
'Generamos Folio - NumeroContrato
|
'Generamos Folio - NumeroContrato
|
||||||
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
|
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
|
||||||
@@ -139,70 +138,15 @@ Partial Class ListadoContratos
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub Consultar(sender As Object, e As EventArgs)
|
Protected Sub Consultar(sender As Object, e As EventArgs)
|
||||||
Dim fechaInicial As String = txtFechaI.Text
|
|
||||||
Dim fechaFinal As String = txtFechaF.Text
|
|
||||||
|
|
||||||
Dim cliente As String = If(DdlClientesConsulta.SelectedValue = "", "", $"C.CveCliente = {DdlClientesConsulta.SelectedValue} AND")
|
|
||||||
Dim estatus As String = ""
|
|
||||||
Dim nombreEstatus As String = ""
|
|
||||||
Dim innerEstatus As String = ""
|
|
||||||
|
|
||||||
Dim tipoUnidad As String = ""
|
|
||||||
Dim nombreTipoUnidad As String = ""
|
|
||||||
Dim innerTipoUnidad As String = ""
|
|
||||||
|
|
||||||
Dim chofer As String = ""
|
|
||||||
Dim nombreChofer As String = ""
|
|
||||||
Dim innerChofer As String = ""
|
|
||||||
|
|
||||||
If (DdlEstatusConsulta.SelectedValue <> "") Then
|
|
||||||
estatus = $"C.CveContratosEstatus = {DdlEstatusConsulta.SelectedValue} AND"
|
|
||||||
nombreEstatus = ", CE.ContratoEstatus As ContratoEstatus1"
|
|
||||||
innerEstatus = " INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus "
|
|
||||||
End If
|
|
||||||
|
|
||||||
If (DdlTIpoUnidad.SelectedValue <> "") Then
|
|
||||||
'tipoUnidad = $"C.CveContratosEstatus = {DdlTIpoUnidad.SelectedValue} AND"
|
|
||||||
'nombreTipoUnidad = ", CE.ContratoTipoUnidad As ContratoTipoUnidad1"
|
|
||||||
'innerTipoUnidad = " INNER JOIN Con_ContratosTipoUnidad CE with(nolock) ON CE.CveContratoTipoUnidad = C.CveContratosEstatus "
|
|
||||||
End If
|
|
||||||
|
|
||||||
If (DdlChofer.SelectedValue <> "") Then
|
|
||||||
'tipoUnidad = $"C.CveContratosEstatus = {DdlTIpoUnidad.SelectedValue} AND"
|
|
||||||
'nombreTipoUnidad = ", CE.ContratoTipoUnidad As ContratoTipoUnidad1"
|
|
||||||
'innerTipoUnidad = " INNER JOIN Con_ContratosTipoUnidad CE with(nolock) ON CE.CveContratoTipoUnidad = C.CveContratosEstatus "
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Dim intervalo As String = If(DdlEstatusConsulta.SelectedValue = "" And DdlClientesConsulta.SelectedValue = "", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'")
|
|
||||||
|
|
||||||
|
|
||||||
Dim query As String = $"SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial {nombreEstatus} FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente {innerEstatus} WHERE {cliente} {estatus} {intervalo}"
|
|
||||||
|
|
||||||
Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
|
|
||||||
Using command As New SqlCommand(query, connection)
|
|
||||||
connection.Open()
|
|
||||||
Dim reader As SqlDataReader = command.ExecuteReader()
|
|
||||||
GvContratos.DataSource = reader
|
|
||||||
GvContratos.DataBind()
|
|
||||||
End Using
|
|
||||||
End Using
|
|
||||||
|
|
||||||
UpTitulos.Update()
|
UpTitulos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub Expandir(sender As Object, e As EventArgs)
|
Protected Sub ModalPersonalizar(sender As Object, e As EventArgs)
|
||||||
If PnExpandirConsulta.Visible Then
|
RegistraScript("$('#DivPersonalizar').modal('show')")
|
||||||
PnExpandirConsulta.Visible = False
|
|
||||||
BtnExpandir.Text = "↑"
|
|
||||||
Else
|
|
||||||
PnExpandirConsulta.Visible = True
|
|
||||||
BtnExpandir.Text = "↓"
|
|
||||||
|
|
||||||
End If
|
|
||||||
End Sub
|
End Sub
|
||||||
|
Protected Sub Personalizar(sender As Object, e As EventArgs)
|
||||||
Protected Sub GoContratoDetalle(sender As Object, e As EventArgs)
|
GvContratos.Columns(6).Visible = ChkChofer.Checked
|
||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
GvContratos.Columns(7).Visible = ChkChofer2.Checked
|
||||||
Response.Redirect($"~/Transportes/RepContratoDetalle.aspx?CveContrato={GvRow.DataKey("CveContrato")}")
|
GvContratos.Columns(8).Visible = ChkUnidad.Checked
|
||||||
|
UpTitulos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -19,37 +19,6 @@
|
|||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.consulta {
|
|
||||||
background-color: #95A5A6;
|
|
||||||
padding: 1rem 1rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.consulta_linea {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-block: .5rem;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.consulta_campo {
|
|
||||||
display: flex;
|
|
||||||
gap: 1rem;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.consulta_campo label {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.expandir {
|
|
||||||
width: 2.5rem;
|
|
||||||
font-size: 2.5rem;
|
|
||||||
font-weight: 900;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
@@ -118,87 +87,108 @@
|
|||||||
<ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="Contratos">
|
<ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="Contratos">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<%-- Filtros --%>
|
<%-- Filtros --%>
|
||||||
<div class="consulta">
|
<%-- Filtros --%>
|
||||||
<div class="consulta_linea">
|
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||||
<div class="consulta_campo">
|
<ContentTemplate>
|
||||||
<label>Fecha Inicial:</label>
|
<div class="portlet solid grey-cascade portlet-filter">
|
||||||
<asp:TextBox Width="150px" ID="txtFechaI" runat="server" CssClass="form-control"
|
<%-- Filtro Visible - Consulta --%>
|
||||||
type="datetime"
|
<div class="portlet-title portlet-filterT smalltitle">
|
||||||
MaxLength="10"></asp:TextBox>
|
<div class="tools">
|
||||||
</div>
|
<asp:Button ID="Button1" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||||
|
<a href="javascript:;" class="expand"></a>
|
||||||
<div class="consulta_campo">
|
</div>
|
||||||
<label>Fecha Inicial:</label>
|
<div class="titlefiltros caption">
|
||||||
<asp:TextBox Width="150px" ID="txtFechaF" runat="server" CssClass="form-control"
|
<div class="row" style="height: 32px;">
|
||||||
type="datetime"
|
<%-- Fecha Inicial --%>
|
||||||
MaxLength="10"></asp:TextBox>
|
<label class="col-md-1 truncate">Fecha Inicial</label>
|
||||||
</div>
|
<div class="col-md-1" style="min-width: 115px">
|
||||||
|
<div class="input-group input-sm input-small date date-picker "
|
||||||
<div class="consulta_campo">
|
data-date-format="dd/mm/yyyy"
|
||||||
<label>Cliente</label>
|
style="width: 100px !important; padding: 0px;">
|
||||||
<ADS:Dropdownlost ID="DdlClientesConsulta" data-metodo="getcliente"
|
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control"
|
||||||
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 200px"
|
MaxLength="10"></asp:TextBox>
|
||||||
CssClassDdl="select2me"
|
<span class="input-group-btn ">
|
||||||
UsaWebService="true"></ADS:Dropdownlost>
|
<asp:LinkButton ID="imgCalendario" class="btn default "
|
||||||
</div>
|
Text="<i class='fa fa-calendar'></i>"
|
||||||
|
runat="server"></asp:LinkButton>
|
||||||
<div class="consulta_campo">
|
</span>
|
||||||
<label>Estatus:</label>
|
</div>
|
||||||
<div class="col-md-8">
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI"
|
||||||
<asp:DropDownList ID="DdlEstatusConsulta" runat="server" Class="table-group-action-input form-control input-inline select2me"
|
Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left">
|
||||||
DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus"
|
</ajax:MaskedEditExtender>
|
||||||
AppendDataBoundItems="true" Width="200px">
|
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI"
|
||||||
</asp:DropDownList>
|
PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
</div>
|
||||||
|
<%-- Fecha Final --%>
|
||||||
|
<label class="col-md-1 truncate">Fecha Fin</label>
|
||||||
|
<div class="col-md-1" style="min-width: 115px">
|
||||||
|
<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"
|
||||||
|
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>
|
||||||
|
</div>
|
||||||
|
<%-- Cliente --%>
|
||||||
|
<label class="col-md-1">Cliente</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlCliente" Width="86%"
|
||||||
|
data-metodo="getcliente"
|
||||||
|
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente"
|
||||||
|
CssStyle="width: 86%;"
|
||||||
|
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
|
||||||
|
</div>
|
||||||
|
<%-- Estatus --%>
|
||||||
|
<label class="col-md-1 ">Estatus:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlEstatus" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%-- Filtro Oculto --%>
|
||||||
|
<div class="portlet-body row" style="display: none">
|
||||||
|
<%-- Centro de Costos --%>
|
||||||
|
<label class="col-md-1 truncate ">Centro de Costos</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlCentroCostos" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="" DataValueField="" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
<%-- Tipo de Unidad --%>
|
||||||
|
<label class="col-md-1 ">Tipo de Unidad</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlTipoUnidad" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="TipoActivoFijo" DataValueField="CveTipoActivoFijo" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
<%-- Chofer --%>
|
||||||
|
<label class="col-md-1 ">Chofer:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlChoferConsulta" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="NombreCompleto" DataValueField="CvePersonal" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
<div class="consulta_campo">
|
</asp:UpdatePanel>
|
||||||
<asp:Button ID="BtnConsulta" runat="server" Text="Consultar" class="btn btn-primary"
|
|
||||||
OnClick="Consultar" />
|
|
||||||
<asp:LinkButton ID="BtnExpandir" runat="server" Text="↓" CssClass="expandir"
|
|
||||||
OnClick="Expandir" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<asp:Panel runat="server" Visible="false" ID="PnExpandirConsulta" CssClass="consulta_linea">
|
|
||||||
<div class="consulta_campo">
|
|
||||||
<label>Centro Costos:</label>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<asp:DropDownList ID="DdlCentroCostos" runat="server"
|
|
||||||
DataTextField="" DataValueField=""
|
|
||||||
AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline select2me"
|
|
||||||
Width="200px">
|
|
||||||
</asp:DropDownList>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="consulta_campo">
|
|
||||||
<label>Tipo Unidad:</label>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<asp:DropDownList ID="DdlTIpoUnidad" runat="server"
|
|
||||||
DataTextField="TipoActivoFijo"
|
|
||||||
DataValueField="CveTipoActivoFijo"
|
|
||||||
AppendDataBoundItems="true"
|
|
||||||
Class="table-group-action-input form-control input-inline select2me"
|
|
||||||
Width="200px">
|
|
||||||
</asp:DropDownList>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="consulta_campo">
|
|
||||||
<label>Chofer:</label>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<asp:DropDownList ID="DropDownList1" runat="server"
|
|
||||||
DataValueField="CvePersonal"
|
|
||||||
DataTextField="NombreCompleto"
|
|
||||||
AppendDataBoundItems="true"
|
|
||||||
Class="table-group-action-input form-control input-inline select2me"
|
|
||||||
Width="200px">
|
|
||||||
</asp:DropDownList>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</asp:Panel>
|
|
||||||
</div>
|
|
||||||
<%-- Contratos --%>
|
<%-- Contratos --%>
|
||||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
@@ -209,7 +199,8 @@
|
|||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField HeaderText="Contrato">
|
<asp:TemplateField HeaderText="Contrato">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ForeColor="White" Font-Bold="true" runat="server" Text='<%# Eval("NumeroContrato") %>' OnClick="GoContratoDetalle"></asp:LinkButton>
|
<asp:HyperLink runat="server" NavigateUrl='<%# "~/Transportes/RepContratoDetalle.aspx?CveContrato=" + If(Eval("CveContrato") IsNot DBNull.Value, Eval("CveContrato").ToString(), String.Empty) %>'
|
||||||
|
Text='<%# Eval("NumeroContrato") %>'></asp:HyperLink>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
Option Explicit On
|
Option Explicit On
|
||||||
Option Strict On
|
Option Strict On
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.Data.SqlClient
|
|
||||||
Imports ADSNetLibrary.SIGAPI.Helpers
|
Imports ADSNetLibrary.SIGAPI.Helpers
|
||||||
Imports Extensiones.ModExtensiones
|
Imports Extensiones.ModExtensiones
|
||||||
Imports GemBox.Spreadsheet
|
Imports GemBox.Spreadsheet
|
||||||
@@ -29,12 +28,12 @@ Partial Class RepContratosCalendario
|
|||||||
End Property
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToString("MM/dd/yyyy").Replace(" ", "T")
|
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToString("MM/dd/yyyy").Replace(" ", "T")
|
||||||
txtFechaF.Text = DateTime.Now.AddDays(7).ToString("MM/dd/yyyy").Replace(" ", "T")
|
txtFechaF.Text = DateTime.Now.AddDays(7).ToString("MM/dd/yyyy").Replace(" ", "T")
|
||||||
|
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
CargaCombos()
|
InicializaCombos()
|
||||||
InicializaCalendar()
|
InicializaCalendar()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
|
|
||||||
@@ -54,9 +53,9 @@ Partial Class RepContratosCalendario
|
|||||||
DtAvance = ObjContratos.DtResultados
|
DtAvance = ObjContratos.DtResultados
|
||||||
|
|
||||||
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
||||||
DdlEstatusConsulta.DataSource = ObjContratos.DtResultados
|
DdlEstatus.DataSource = ObjContratos.DtResultados
|
||||||
DdlEstatusConsulta.DataBind()
|
DdlEstatus.DataBind()
|
||||||
DdlEstatusConsulta.Items.Insert(0, New ListItem("-", ""))
|
DdlEstatus.Items.Insert(0, New ListItem("-", ""))
|
||||||
|
|
||||||
DdlEstatusContrato.DataSource = ObjContratos.DtResultados
|
DdlEstatusContrato.DataSource = ObjContratos.DtResultados
|
||||||
DdlEstatusContrato.DataBind()
|
DdlEstatusContrato.DataBind()
|
||||||
@@ -72,24 +71,30 @@ Partial Class RepContratosCalendario
|
|||||||
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaCombos()
|
Private Sub InicializaCombos()
|
||||||
'Lista de Tipos de activo fijos
|
'Lista de Tipos de activo fijos
|
||||||
DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
||||||
DdlTipoAF.Items.Insert(0, New ListItem("-", ""))
|
DdlTipoAF.Items.Insert(0, New ListItem("-", ""))
|
||||||
DdlTipoAF.DataBind()
|
DdlTipoAF.DataBind()
|
||||||
|
|
||||||
|
DdlTipoUnidad.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
||||||
|
DdlTipoUnidad.DataBind()
|
||||||
|
DdlTipoUnidad.Items.Insert(0, New ListItem("-", ""))
|
||||||
'Lista de Activos fijos
|
'Lista de Activos fijos
|
||||||
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
|
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
|
||||||
DdlAF.DataBind()
|
DdlAF.DataBind()
|
||||||
DdlAF.Items.Insert(0, New ListItem("-", ""))
|
DdlAF.Items.Insert(0, New ListItem("-", ""))
|
||||||
|
|
||||||
'Lista Chofer'
|
'Lista Chofer'
|
||||||
DdlChofer.DataSource = GlobalDTRHPersonal(185)
|
DdlChofer.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||||
DdlChofer.DataBind()
|
DdlChofer.DataBind()
|
||||||
DdlChofer.Items.Insert(0, New ListItem("-", ""))
|
DdlChofer.Items.Insert(0, New ListItem("-", ""))
|
||||||
DdlChofer2.DataSource = GlobalDTRHPersonal(185)
|
DdlChofer2.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||||
DdlChofer2.DataBind()
|
DdlChofer2.DataBind()
|
||||||
DdlChofer2.Items.Insert(0, New ListItem("-", ""))
|
DdlChofer2.Items.Insert(0, New ListItem("-", ""))
|
||||||
|
DdlChoferConsulta.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||||
|
DdlChoferConsulta.DataBind()
|
||||||
|
DdlChoferConsulta.Items.Insert(0, New ListItem("-", ""))
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -141,66 +146,7 @@ Partial Class RepContratosCalendario
|
|||||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub Consultar(sender As Object, e As EventArgs)
|
Protected Sub Consultar(sender As Object, e As EventArgs)
|
||||||
Dim fechaInicial As String = txtFechaI.Text
|
|
||||||
Dim fechaFinal As String = txtFechaF.Text
|
|
||||||
|
|
||||||
Dim cliente As String = If(DdlClientesConsulta.SelectedValue = "", "", $"C.CveCliente = {DdlClientesConsulta.SelectedValue} AND")
|
|
||||||
Dim estatus As String = ""
|
|
||||||
Dim nombreEstatus As String = ""
|
|
||||||
Dim innerEstatus As String = ""
|
|
||||||
|
|
||||||
Dim tipoUnidad As String = ""
|
|
||||||
Dim nombreTipoUnidad As String = ""
|
|
||||||
Dim innerTipoUnidad As String = ""
|
|
||||||
|
|
||||||
Dim chofer As String = ""
|
|
||||||
Dim nombreChofer As String = ""
|
|
||||||
Dim innerChofer As String = ""
|
|
||||||
|
|
||||||
If (DdlEstatusConsulta.SelectedValue <> "") Then
|
|
||||||
estatus = $"C.CveContratosEstatus = {DdlEstatusConsulta.SelectedValue} AND"
|
|
||||||
nombreEstatus = ", CE.ContratoEstatus As ContratoEstatus1"
|
|
||||||
innerEstatus = " INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus "
|
|
||||||
End If
|
|
||||||
|
|
||||||
If (DdlTIpoUnidad.SelectedValue <> "") Then
|
|
||||||
'tipoUnidad = $"C.CveContratosEstatus = {DdlTIpoUnidad.SelectedValue} AND"
|
|
||||||
'nombreTipoUnidad = ", CE.ContratoTipoUnidad As ContratoTipoUnidad1"
|
|
||||||
'innerTipoUnidad = " INNER JOIN Con_ContratosTipoUnidad CE with(nolock) ON CE.CveContratoTipoUnidad = C.CveContratosEstatus "
|
|
||||||
End If
|
|
||||||
|
|
||||||
If (DdlChofer.SelectedValue <> "") Then
|
|
||||||
'tipoUnidad = $"C.CveContratosEstatus = {DdlTIpoUnidad.SelectedValue} AND"
|
|
||||||
'nombreTipoUnidad = ", CE.ContratoTipoUnidad As ContratoTipoUnidad1"
|
|
||||||
'innerTipoUnidad = " INNER JOIN Con_ContratosTipoUnidad CE with(nolock) ON CE.CveContratoTipoUnidad = C.CveContratosEstatus "
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Dim intervalo As String = If(DdlEstatusConsulta.SelectedValue = "" And DdlClientesConsulta.SelectedValue = "", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'")
|
|
||||||
|
|
||||||
|
|
||||||
Dim query As String = $"SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial {nombreEstatus} FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente {innerEstatus} WHERE {cliente} {estatus} {intervalo}"
|
|
||||||
|
|
||||||
Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
|
|
||||||
Using command As New SqlCommand(query, connection)
|
|
||||||
connection.Open()
|
|
||||||
Dim reader As SqlDataReader = command.ExecuteReader()
|
|
||||||
GvContratos.DataSource = reader
|
|
||||||
GvContratos.DataBind()
|
|
||||||
End Using
|
|
||||||
End Using
|
|
||||||
|
|
||||||
UpTitulos.Update()
|
|
||||||
End Sub
|
|
||||||
Protected Sub Expandir(sender As Object, e As EventArgs)
|
|
||||||
If PnExpandirConsulta.Visible Then
|
|
||||||
PnExpandirConsulta.Visible = False
|
|
||||||
BtnExpandir.Text = "↑"
|
|
||||||
Else
|
|
||||||
PnExpandirConsulta.Visible = True
|
|
||||||
BtnExpandir.Text = "↓"
|
|
||||||
|
|
||||||
End If
|
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||||
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
||||||
@@ -226,8 +172,4 @@ Partial Class RepContratosCalendario
|
|||||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub GoContratoDetalle(sender As Object, e As EventArgs)
|
|
||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
||||||
Response.Redirect($"~/Transportes/RepContratoDetalle.aspx?CveContrato={GvRow.DataKey("CveContrato")}")
|
|
||||||
End Sub
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -83,12 +83,11 @@
|
|||||||
CssClass='<%# If(Eval("Estatus").ToString = "", "", "text-success bold") %>'></asp:Label>
|
CssClass='<%# If(Eval("Estatus").ToString = "", "", "text-success bold") %>'></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:LinkButton ID="BtnViaje" runat="server" AlternateText="Viaje"
|
|
||||||
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-arrow-right'></i>"
|
|
||||||
OnClick="GoViaje" />
|
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:HyperLink runat="server" NavigateUrl='<%# "~/Transportes/Boletos.aspx?CveViaje=" + If(Eval("CveContrato") IsNot DBNull.Value, Eval("CveContrato").ToString(), String.Empty) %>'
|
||||||
|
Text="<i class='fa fa-ticket'></i>" ToolTip="Boletos"></asp:HyperLink>
|
||||||
|
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|||||||
Reference in New Issue
Block a user