This commit is contained in:
2024-11-28 11:31:06 -07:00
20 changed files with 2961 additions and 375 deletions

View File

@@ -272,8 +272,28 @@
<div class="row">
<p class="col-md-6"></p>
<asp:Label runat="server" ID="LbCostos" CssClass="col-md-6 text-success bold my-1 text-right"
Visible="False"></asp:Label>
<div class="col-md-6" style="text-align:right">
<div class="row">
<div class="col-lg-10" style="text-align:right!important">
<asp:Label runat="server" Width="270px" ID="LbCostos" CssClass="text-success bold my-1 text-right" Visible="False"></asp:Label>
</div>
<div class="col-lg-2" style="text-align:left!important;margin-top:7px!important">
<asp:TextBox runat="server" ID="TxtImporte" Enabled="false" Visible="false" Width="50px" CssClass="text-success" ForeColor="#3b9c96" Font-Bold="true"></asp:TextBox>
<ajax:FilteredTextBoxExtender FilterType="Custom" ValidChars="1234567890." runat="server" TargetControlID="TxtImporte" />
</div>
</div>
<%--<table>
<tr>
<td style="width:270px;text-align:right"> </td>
<td style="width:50px;text-align:left">
</td>
</tr>
</table>--%>
</div>
</div>
</div>
</div>

View File

@@ -4,6 +4,7 @@ Imports System.Data
Imports ADSNetLibrary.Helpers
Imports Extensiones
Imports Extensiones.ModExtensiones
Partial Class Boletos
Inherits ClsPaginas
#Region "Propiedades"
@@ -77,9 +78,7 @@ Partial Class Boletos
If Not IsPostBack Then
If UsuarioActual.CveRol = 1583 Then
EsAgencia = True
End If
If Request.QueryString("CveViaje") Is Nothing And UsuarioActual.CveVendedor <> Nothing And UsuarioActual.CveVendedor <> -1 Then
Response.Redirect("/Transportes/RepViajes.aspx")
@@ -92,8 +91,24 @@ Partial Class Boletos
Alert("Viaje no definido")
End If
Permisos()
End If
End Sub
Private Sub Permisos()
If UsuarioActual.CveRol = 1583 Then
EsAgencia = True
If UsuarioActual.CveVendedor <= 0 Then
Alert("El usuario no tiene Vendedor Asignado", TipoMensaje.MsgAdvertencia)
End If
End If
If UsuarioActual.TienePermisoProceso(400) Then
TxtImporte.Enabled = True
End If
End Sub
Private Sub CargaDatos()
Dim ObjContratos As New ClsContratos
Dim ObjViaje As New ClsTransportes
@@ -180,30 +195,33 @@ Partial Class Boletos
Dim CveSubProyecto As Integer = Contrato.Rows(0)("CveSubProyecto").ToString.ToEntero
If ObjDestinos.GetDestinosTarifas(CveSubProyecto, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) Then
Dim fechaHoy As Date = Date.Today
Dim fechaNacimiento As Date = TxtFechaNacimiento.Text.ToDate
Dim edad As Integer
' Calcular la diferencia en años entre la fecha actual y la fecha de nacimiento
edad = CInt(DateDiff(DateInterval.Year, fechaNacimiento, fechaHoy))
If edad <= 4 Or edad >= 60 Then
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL - 20
Dim edad As Integer = CInt(DateDiff(DateInterval.Year, TxtFechaNacimiento.Text.ToDate, Date.Today))
Dim Mes As Integer = TxtFecha.Text.ToDate.Month
If Mes.Contiene(11, 12) Then 'Tarifas de meses Noviembre y Diciembre
ImporteR = If(Mes = 11, ObjDestinos.DtResultados.FiltroPrimeroValor("ImporteNov").ToDecimal.RoundSQL, ObjDestinos.DtResultados.FiltroPrimeroValor("ImporteDic").ToDecimal.RoundSQL)
Else
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
End If
ImporteR = If(edad <= 4 Or edad >= 60, ImporteR - 20, ImporteR)
End If
If ImporteR > 0 Then
ViewState("Importe") = ImporteR
LbCostos.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}"
LbCostos.Text = $"El precio de su boleto es:"
LbCostos.Visible = True
TxtImporte.Text = ImporteR.FormatoNumero
TxtImporte.Visible = True
BtnAgregarPasajero.Visible = True
LbAviso.Visible = True
Else
ViewState("Importe") = 0
BtnAgregarPasajero.Visible = False
LbCostos.Visible = False
TxtImporte.Visible = False
Alert("No se encontro una tarifa para estos destinos", TipoMensaje.MsgAdvertencia)
End If
@@ -249,6 +267,7 @@ Partial Class Boletos
End If
dr("CveViajePasajero") = CveViajePasajero
'dr("Numero") = dr("Importe").ToString
Next
@@ -305,7 +324,9 @@ Partial Class Boletos
ObjTransporte.Commit()
ObjTransporte.Dispose()
SbAlert.Append("El boleto se genero correctamente.")
SbAlert.Append("El boleto se genero correctamente.</br>")
GeneraLinksDescargaBoleto(SbAlert)
DtPasajeros.Clear()
GvB.DataSource = DtPasajeros
@@ -321,7 +342,8 @@ Partial Class Boletos
CargaDatos()
End If
Alert(SbAlert.ToString(), If(TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), ShowCloseButton:=False)
Alert(SbAlert.ToString(), If(TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), ShowCloseButton:=False, JSBtnAceptar:="window.location.reload();")
End Try
LbAviso.Visible = False
@@ -331,6 +353,20 @@ Partial Class Boletos
UpPanel.Update()
End Sub
Private Sub GeneraLinksDescargaBoleto(ByRef SB As StringBuilder)
For Each dRow As DataRow In DtPasajeros.Rows
Dim CveViajePasajero As Integer = dRow("CveViajePasajero").ToString.ToEntero
If CveViajePasajero > 0 Then
Dim Liga As String = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=BOLETO&CVEVIAJEPASAJERO={0}", CveViajePasajero.ToString)))
SB.Append($"<a target= '_blank' href='{Liga}' class='Texto' ><i class='fa fa-print'></i> Boleto: {dRow("Nombre").ToString}</a></br>")
End If
Next
End Sub
Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs)
DdlDestino.DataSource = DtDestinos.FiltraParametros($"CveDestinoOrigen = {DdlPartida.SelectedValue}")
DdlDestino.DataBind()
@@ -358,6 +394,13 @@ Partial Class Boletos
End Sub
Protected Sub AgregarPasajero(sender As Object, e As EventArgs)
If EsAgencia Then
If UsuarioActual.CveVendedor <= 0 Then
Alert("El usuario no tiene Vendedor Asignado", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If AsientoSeleccionado = "" Then
Alert("No se ha seleccionado el asiento.")
Exit Sub
@@ -372,7 +415,7 @@ Partial Class Boletos
Dr1("Destino") = DdlDestino.SelectedItem
Dr1("CveDestinoOrigen") = DdlPartida.SelectedValue.ToEntero
Dr1("CveDestinoFinal") = DdlDestino.SelectedValue.ToEntero
Dr1("Importe") = Me.Importe
Dr1("Importe") = TxtImporte.Text.ToDecimal 'Me.Importe
Dr1("Asiento") = AsientoSeleccionado.Replace("A", "")
Dr1("Nombre") = TxtNombre.Text.Trim
'Dr1("INE") = TxtINE.Text.Trim
@@ -415,11 +458,11 @@ Partial Class Boletos
Private Function CrearRemision(ByRef objTrans As ClsTransportes) As Modelos.Factura.MMensajeFactura
Dim Retorno As New Modelos.Factura.MMensajeFactura
Dim CveCliente As Integer = 1154164
Dim CveCliente As Integer = 1172306 ' 1154164
Dim CveMoneda As Integer = 2
Dim CveSubProyecto As Integer = -1
Dim CvePSBoleto As Integer = 912720
Dim CvePSBoleto As Integer = 907706 '912720
If EsProduccion Then
CvePSBoleto = 986337
@@ -501,4 +544,7 @@ Partial Class Boletos
Return Retorno
End Function
End Class

View File

@@ -11,6 +11,17 @@
<li>
<asp:LinkButton runat="server" OnClick="ImprimirContrato"><i class="fa fa-print"></i> Imprimir Contrato</asp:LinkButton>
</li>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="ImgPDF" runat="server" OnClick="ImgPDF_Click"> <i class="fa fa-file-pdf-o" style="font-weight:bold; margin-right:5px;"></i> <span> Manifiesto</span></asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgPDF" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
@@ -111,7 +122,9 @@
<%-- Información General --%>
<ajax:TabPanel runat="server" HeaderText="Información General" CssClass="tabBodyOverride">
<ContentTemplate>
<div class="row">
<%-- Datos del Contrato --%>
<div class="col-md-7">
<div class="portlet light bordered xspadding">
@@ -216,18 +229,29 @@
<label class="col-md-4">Fecha Salida</label>
<div class="col-md-8">
<div class="input-group">
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="True"
<%-- <asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="True"
Width="100%"
type="datetime"></asp:TextBox>
type="datetime"></asp:TextBox>--%>
<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="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtFechaSalida" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEETxtFechaSalida" runat="server" TargetControlID="TxtFechaSalida" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalTxtFechaSalida" TargetControlID="TxtFechaSalida" PopupButtonID="LnkTxtFechaSalida" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVTxtFechaSalida" runat="server" ControlToValidate="TxtFechaSalida"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Salida''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFechaSalida" runat="server" HighlightCssClass="vco"
TargetControlID="RFVTxtFechaSalida" Width="100%">
TargetControlID="RFVTxtFechaSalida" Width="300px">
</ajax:ValidatorCalloutExtender>
<div class="input-group-addon">
<%--<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
</div>--%>
</div>
</div>
</div>
@@ -237,18 +261,29 @@
<div class="col-md-8">
<div class="input-group">
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="True"
<%--<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="True"
Width="100%"
type="datetime"></asp:TextBox>
type="datetime"></asp:TextBox>--%>
<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="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtFechaRegreso" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEETxtFechaRegreso" runat="server" TargetControlID="TxtFechaRegreso" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalTxtFechaRegreso" TargetControlID="TxtFechaRegreso" PopupButtonID="LnkTxtFechaRegreso" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVTxtFechaRegreso" runat="server" ControlToValidate="TxtFechaRegreso"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Regreso''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco"
TargetControlID="RFVTxtFechaRegreso" Width="100%">
TargetControlID="RFVTxtFechaRegreso" Width="300px">
</ajax:ValidatorCalloutExtender>
<div class="input-group-addon">
<%-- <div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
</div>--%>
</div>
</div>
</div>
@@ -494,220 +529,274 @@
</div>
<%-- Bitácora --%>
<div class="col-md-12">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<%-- Bitácora --%>
<%--<div class="caption uppercase" style="position: relative;">
<i class="fa fa-commenting"></i>Bitácora
</div>
</div>
<asp:UpdatePanel ID="UpBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group">
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-green" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold font-green" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green' ></i>Agendar" Visible="false" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Agendar"></asp:HyperLink><br />
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
</div>--%>
<div class="caption font-default">
<%--<i class="fa fa-users font-green"></i>--%>
<span class="caption-subject bold uppercase">Bitacora</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-light " data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-light ' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important; cursor: pointer" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold font-light " runat="server" Text="" Visible="false" Style="font-weight: 700 !important; cursor: pointer" ToolTip="Agendar"><i class='fa fa-calendar-plus-o font-light ' ></i>Agendar</asp:HyperLink><br />
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
<%--<script> function OnAddedTareaNueva() { $('.btnupEventoBitacora').click(); }</script>--%>
<div class="row">
<div class="col-md-12">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-default">
<span class="caption-subject bold uppercase">Bitacora</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-light " data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-light ' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important; cursor: pointer" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold font-light " runat="server" Text="" Visible="false" Style="font-weight: 700 !important; cursor: pointer" ToolTip="Agendar"><i class='fa fa-calendar-plus-o font-light ' ></i>Agendar</asp:HyperLink><br />
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<asp:UpdatePanel ID="UPEventoBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvEB" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEvento" EmptyDataText="No se han capturado comentarios o bitácora" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha Agenda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaAgenda" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Usuario</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Descripción</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEventoBitacora" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="10px" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>Archivo</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" CssClass="Texto" OnClick="DownloadFile">
<asp:Image ImageUrl="/Imagenes/Abajo.png" ID="ImgArchivo" runat="server" />
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption">
<i class="icon-pin"></i>
<span class="caption-subject bold uppercase">Historial de Modificación</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvBitacora" runat="server" GridLines="None" Width="100%" CssClass="table table-striped table-advance table-hover Widthall ADSCroll mysmallbtn" CellSpacing="0" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ConceptoHistorialBitacora" HeaderText="Campo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Anterior" HeaderText="Anterior" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Actual" HeaderText="Actual" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" HeaderText="Boletos" CssClass="row" Visible="false"
ID="TabBoletos">
<ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpPasajeros" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-lg-12">
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row" style="height: 32px;">
<div class="col-md-1 truncate">
Vendedor:
</div>
<div class="col-md-2" style="min-width: 115px">
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="100%"
AutoPostBack="true" OnSelectedIndexChanged="DdlVendedor_SelectedIndexChanged">
<asp:ListItem Selected="true" Text="Sin asignar" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<asp:UpdatePanel ID="UPEventoBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvEB" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEvento" EmptyDataText="No se han capturado comentarios o bitácora" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha Agenda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaAgenda" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Usuario</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Descripción</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEventoBitacora" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="10px" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>Archivo</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" CssClass="Texto" OnClick="DownloadFile">
<asp:Image ImageUrl="/Imagenes/Abajo.png" ID="ImgArchivo" runat="server" />
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px" align="left;">
<input type="text" id="TxtBusquedaBol" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaBol','{0}')", GvViajesPasajeros.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaBol','{0}')", GvViajesPasajeros.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvViajesPasajeros" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningún boleto registrado" Width="100%" ShowFooter="true"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn"
GridLines="None"
data-sort="true"
DataKeyNames="CveViajePasajero, CveViaje, CveDestinoFinal, CveVendedor, Importe, Asiento, Nombre, Visa, Celular, Observacion, Estatus, CveUsuario, FechaIng, Sexo, Partida, Destino, Vendedor, Agencia, TelefonoAgencia,FechaNacimiento"
OnRowDataBound="GvViajesPasajeros_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="No. Asiento">
<ItemTemplate>
<asp:Literal ID="LtlAsiento" runat="server" Text='<%# Eval("Asiento") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre">
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Visa">
<ItemTemplate>
<asp:Literal ID="LtlVisa" runat="server" Text='<%# Eval("Visa") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Celular">
<ItemTemplate>
<asp:Literal ID="LtlCelular" runat="server" Text='<%# Eval("Celular") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sexo">
<ItemTemplate>
<asp:Literal ID="LtlSexo" runat="server" Text='<%# If(Eval("Sexo").ToString = "True", "Masculino", "Femenino") %>'>
</asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Label ID="LtlEstatus" runat="server" Text='<%# If(Eval("Estatus").ToString = "True", "Activo", "Cancelado") %>'
CssClass='<%# If(Eval("Estatus").ToString = "True", "text-success", "text-danger") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Partida">
<ItemTemplate>
<asp:Literal ID="LtlPartida" runat="server" Text='<%# Eval("Partida") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Destino">
<ItemTemplate>
<asp:Literal ID="LtlDestino" runat="server" Text='<%# Eval("Destino") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Vendedor">
<ItemTemplate>
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'>
</asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
<FooterTemplate>
<asp:Literal ID="LtlImportePie" runat="server"></asp:Literal>
</FooterTemplate>
<ItemTemplate>
<asp:Literal ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "{0:C2}") %>'>
</asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
<ItemTemplate>
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar" OnClick="EditarBoleto"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" ToolTip="Editar" />
<asp:LinkButton ID="BtnReAgendar" runat="server" AlternateText="Editar" OnClick="CambiarBoleto"
CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-repeat'></i>" ToolTip="Editar" />
<asp:LinkButton ID="BtnCancelar" runat="server" AlternateText="Activar"
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-cancel'></i>"
data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("Estatus").ToString = "True", "Cancelar Boleto", "Reactivar") %>'
data-btn-ok-label="si" OnClick="BtnCancelar_Click" />
<asp:Literal runat="server" ID="LtlImprimir"></asp:Literal>
<%-- <asp:LinkButton ID="BtnImprimir" runat="server" AlternateText="Viaje"
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-print'></i>" ToolTip="Imprimir"
OnClick="ImprimirBoleto" />--%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
<asp:UpdatePanel ID="UpBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption">
<i class="icon-pin"></i>
<span class="caption-subject bold uppercase">Historial de Modificación</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvBitacora" runat="server" GridLines="None" Width="100%" CssClass="table table-striped table-advance table-hover Widthall ADSCroll mysmallbtn" CellSpacing="0" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ConceptoHistorialBitacora" HeaderText="Campo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Anterior" HeaderText="Anterior" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Actual" HeaderText="Actual" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<%-- Pre init --%>
<%-- <ajax:TabPanel runat="server" HeaderText="PreInit" CssClass="row">
<ContentTemplate>
</ContentTemplate>
</ajax:TabPanel>--%>
<%-- Boletos --%>
<ajax:TabPanel runat="server" HeaderText="Boletos" CssClass="row" Visible="false"
ID="TabBoletos">
<ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpPasajeros" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvViajesPasajeros" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningún boleto registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
data-sort="true" DataKeyNames="CveViajePasajero, CveViaje, CveDestinoFinal, CveVendedor, Importe, Asiento, Nombre, Visa, Celular, Observacion, Estatus, CveUsuario, FechaIng, Sexo, Partida, Destino, Vendedor, Agencia, TelefonoAgencia"
OnRowDataBound="GvViajesPasajeros_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="No. Asiento">
<ItemTemplate>
<asp:Literal ID="LtlAsiento" runat="server" Text='<%# Eval("Asiento") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre">
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Visa">
<ItemTemplate>
<asp:Literal ID="LtlVisa" runat="server" Text='<%# Eval("Visa") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Celular">
<ItemTemplate>
<asp:Literal ID="LtlCelular" runat="server" Text='<%# Eval("Celular") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sexo">
<ItemTemplate>
<asp:Literal ID="LtlSexo" runat="server" Text='<%# If(Eval("Sexo").ToString = "True", "Masculino", "Femenino") %>'>
</asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Label ID="LtlEstatus" runat="server" Text='<%# If(Eval("Estatus").ToString = "True", "Activo", "Cancelado") %>'
CssClass='<%# If(Eval("Estatus").ToString = "True", "text-success", "text-danger") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Partida">
<ItemTemplate>
<asp:Literal ID="LtlPartida" runat="server" Text='<%# Eval("Partida") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Destino">
<ItemTemplate>
<asp:Literal ID="LtlDestino" runat="server" Text='<%# Eval("Destino") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Vendedor">
<ItemTemplate>
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'>
</asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "{0:C2}") %>'>
</asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
<ItemTemplate>
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar" OnClick="EditarBoleto"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" ToolTip="Editar" />
<asp:LinkButton ID="BtnReAgendar" runat="server" AlternateText="Editar" OnClick="CambiarBoleto"
CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-repeat'></i>" ToolTip="Editar" />
<asp:LinkButton ID="BtnCancelar" runat="server" AlternateText="Activar"
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-cancel'></i>"
data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("Estatus").ToString = "True", "Cancelar Boleto", "Reactivar") %>'
data-btn-ok-label="si" OnClick="BtnCancelar_Click" />
<asp:LinkButton ID="BtnImprimir" runat="server" AlternateText="Viaje"
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-print'></i>" ToolTip="Imprimir"
OnClick="ImprimirBoleto" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<%-- Modal Editar Boleto --%>
<asp:UpdatePanel runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div id="ModalEditar" class="modal ADS fade" role="dialog">
@@ -811,7 +900,7 @@
</div>
<div class="row margin-bottom-5">
<label class="col-md-4 bold">Sexo</label>
<label class="col-md-4 bold">Sexo:</label>
<div class="col-md-8">
<asp:DropDownList ID="RblSexo" CssClass="form-control input-sm select2me" runat="server"
Width="100%">
@@ -821,6 +910,29 @@
</div>
</div>
<div class="row margin-bottom-5">
<label class="col-md-4 bold">Fecha de Nacimiento:</label>
<div class="col-md-8">
<%--<asp:TextBox ID="TxtFechaNacimiento" runat="server" type="date" Width="100%" CssClass="form-control x"></asp:TextBox>--%>
<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="TxtFechaNacimiento" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtFechaNacimiento" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaNacimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaNacimiento" PopupButtonID="LnkTxtFechaNacimiento" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None"
CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Nacimiento''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpActViaje"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFechaNacimiento" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaNacimiento" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row margin-bottom-5">
<label class="col-md-4 bold">Estatus</label>
<div class="col-md-8">
@@ -1145,8 +1257,7 @@
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:Button OnClick="UpdateBoleto" runat="server" CssClass="btn btn-primary" Text="Actualizar">
</asp:Button>
<asp:Button OnClick="UpdateBoleto" runat="server" CssClass="btn btn-primary" Text="Actualizar" ValidationGroup="GrpActViaje" ID="BtnActualizarViaje"></asp:Button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>

View File

@@ -1,11 +1,12 @@
Option Explicit On
Option Strict On
Imports System.Activities.Statements
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports Modelos
Partial Class RepContratoDetalle
@@ -231,6 +232,18 @@ Partial Class RepContratoDetalle
End Property
Private Property DTViajesPasajeros As DataTable
Get
If ViewState("DTViajesPasajeros") Is Nothing Then
ViewState("DTViajesPasajeros") = New DataTable
End If
Return CType(ViewState("DTViajesPasajeros"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTViajesPasajeros") = value
End Set
End Property
#End Region
@@ -297,9 +310,34 @@ Partial Class RepContratoDetalle
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
For i As Integer = DdlVendedor.Items.Count - 1 To 0 Step -1
If DdlVendedor.Items(i).Text = "Sin Asignar" Then
DdlVendedor.Items.RemoveAt(i)
End If
Next
If EsAgencia Then
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor)
DdlVendedor.Enabled = False
End If
End Sub
Private Sub CargaDatos()
CargaDatosContrato()
CargaDatosViajes()
'Información General
End Sub
Private Sub CargaDatosContrato()
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
Contrato = ObjContratos.DtResultados
@@ -359,17 +397,7 @@ Partial Class RepContratoDetalle
A1.Visible = True
End If
'Boletos Vendidos
If drc("CveContratoTipo").ToString() = "35" Then
TabBoletos.Visible = True
Dim ObjTransportes As New ClsTransportes
If ObjTransportes.GetViajesPasajeros(CveContrato) Then
GvViajesPasajeros.DataSource = ObjTransportes.DtResultados
BusquedaSeleccionada(ObjTransportes.DtResultados)
End If
ObjTransportes.Dispose()
GvViajesPasajeros.DataBind()
End If
''Bitácora
'Dim ObjEventoBitacora As New ClsOIEventos
'If ObjEventoBitacora.GetEventos(-1, -1, -1, "-1", "-1", -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
@@ -385,10 +413,38 @@ Partial Class RepContratoDetalle
End If
ObjContratos.Dispose()
UpTabContainer.Update()
End Sub
#End Region
Private Sub CargaDatosViajes()
'Boletos Vendidos
DTViajesPasajeros = New DataTable
If CveContratoTipo = 35 Then
TabBoletos.Visible = True
Dim ObjTransportes As New ClsTransportes
If ObjTransportes.GetViajesPasajeros(CveContrato) Then
If DdlVendedor.SelectedValue.ToEntero > 0 Then
DTViajesPasajeros = ObjTransportes.DtResultados.FiltraParametros($" CveVendedor = {DdlVendedor.SelectedValue.ToEntero} ")
Else
DTViajesPasajeros = ObjTransportes.DtResultados
End If
GvViajesPasajeros.DataSource = DTViajesPasajeros
BusquedaSeleccionada(DTViajesPasajeros)
End If
ObjTransportes.Dispose()
GvViajesPasajeros.DataBind()
End If
UpPasajeros.Update()
UpTabContainer.Update()
End Sub
#End Region
Protected Sub DdlUsuarioFiltroBoletos_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDatosViajes()
End Sub
#Region "Bitacora"
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
@@ -707,7 +763,7 @@ Partial Class RepContratoDetalle
For Each dRow As DataRow In DTPrePoliza.Rows
If Not ObjConta.UpdatePrePolizasDetalle(dRow("CvePrePolizaDetalle").ToString.ToEntero, dRow("Concepto").ToString, dRow("CveSubProyecto").ToString.ToEntero, -1, Boolean.Parse(dRow("TipoMovto").ToString), ImporteMN:=(TotalNew * TC), Importe:=TotalNew, TipoCambio:=TC) Then
If Not ObjConta.UpdatePrePolizasDetalle(dRow("CvePrePolizaDetalle").ToString.ToEntero, dRow("Concepto").ToString, dRow("CveSubProyecto").ToString.ToEntero, -1, Boolean.Parse(dRow("TipoMovto").ToString), ImporteMN:=TotalNew, Importe:=TotalNew, TipoCambio:=TC) Then
OcurrioError = True
Exit For
End If
@@ -840,7 +896,7 @@ Partial Class RepContratoDetalle
Try
ObjTransportes.IniciaTransacSQL()
If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero, DdlRuta.SelectedValue.ToEntero, UsuarioActual.CveVendedor, LbImporte.Text.ToDecimal, TxtAsiento.Text.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, TxtObservacion.Text, CBool(TxtEstatus.Text), UsuarioActual.CveUsuario, CBool(RblSexo.SelectedValue)) Then
If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero, DdlRuta.SelectedValue.ToEntero, UsuarioActual.CveVendedor, LbImporte.Text.ToDecimal, TxtAsiento.Text.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, TxtObservacion.Text, CBool(TxtEstatus.Text), UsuarioActual.CveUsuario, CBool(RblSexo.SelectedValue), FechaNacimiento:=TxtFechaNacimiento.Text.ToDate) Then
ObjTransportes.Commit()
End If
Catch ex As ArgumentException
@@ -855,6 +911,7 @@ Partial Class RepContratoDetalle
End Try
CargaDatos()
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalEditar"))
End Sub
Protected Sub OnChangeRuta(sender As Object, e As EventArgs)
@@ -893,53 +950,39 @@ Partial Class RepContratoDetalle
ViajeActual = dt
End Sub
Protected Sub ImprimirBoleto(sender As Object, e As EventArgs)
Dim dtResult As New DataTable()
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Fecha As Date = GvRow.DataKey("FechaIng").ToDate
Dim Importe As Decimal = GvRow.DataKey("Importe").ToDecimal
Dim params As New List(Of ReportParameter) From {
New ReportParameter("Ruta", SubProyecto),
New ReportParameter("Origen", GvRow.DataKey("Partida")),
New ReportParameter("Destino", GvRow.DataKey("Destino")),
New ReportParameter("FechaSalida", Fecha.ToShortDateString()),
New ReportParameter("HoraSalida", Fecha.ToString("HH:mm")),
New ReportParameter("Nombre", GvRow.DataKey("Nombre")),
New ReportParameter("Visa", GvRow.DataKey("Visa")),
New ReportParameter("Celular", GvRow.DataKey("Celular")),
New ReportParameter("Importe", Math.Round(Importe, 2).ToString),
New ReportParameter("TipoBoleto", "Tipo Boleto"),
New ReportParameter("Agencia", "Agencia"),
New ReportParameter("TelefonoAgencia", "TelefonoAgencia"),
New ReportParameter("Asiento", GvRow.DataKey("Asiento"))
}
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Boleto.mrt", dtResult, params, NombreArchivo:="Boleto")
End Sub
Protected Sub GvViajesPasajeros_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If EsAgencia Then
e.Row.FCLinkButton("BtnCancelar").Visible = False
e.Row.FCLinkButton("BtnReAgendar").Visible = False
End If
Dim Liga As String = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=BOLETO&CVEVIAJEPASAJERO={0}", e.Row.DataKey("CveViajePasajero"))))
e.Row.FCLiteral("LtlImprimir").Text = $"<a class='btn btn-circle btn-sm blue' target='_blank' href='{Liga}'><i class='fa fa-print'></i></a>"
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("BtnImprimir"))
'ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("BtnImprimir"))
End If
If e.Row.RowType = DataControlRowType.Footer Then
e.Row.FCLiteral("LtlImportePie").Text = DTViajesPasajeros.SUM("Importe").ToString("###,###,###.00")
End If
End Sub
Protected Sub EditarBoleto(sender As Object, e As EventArgs)
PnEditarUsuario.Visible = True
PnEditarViaje.Visible = False
PnAsientos.Visible = False
TxtFechaNacimiento.Enabled = True
TxtNombre.Enabled = True
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveViajePasajero = GvRow.DataKey("CveViajePasajero").ToEntero
DdlRuta.SelectedValue = GvRow.DataKey("CveViaje")
DdlRuta.SelectedValueExist(GvRow.DataKey("CveViaje"))
LbPartida.Text = GvRow.DataKey("Partida").ToString()
LbDestino.Text = GvRow.DataKey("Destino").ToString()
LbImporte.Text = Convert.ToDecimal(GvRow.DataKey("Importe")).ToString("C")
@@ -952,6 +995,12 @@ Partial Class RepContratoDetalle
TxtEstatus.Text = GvRow.DataKey("Estatus").ToString
LbEstatus.CssClass = If(CBool(GvRow.DataKey("Estatus").ToString), "text-success bold", "text-danger bold")
TxtAsiento.Text = GvRow.DataKey("Asiento").ToString()
TxtFechaNacimiento.Text = GvRow.DataKey("FechaNacimiento").ToString().ToDate.ToString("dd/MM/yyyy")
If EsAgencia Then
TxtFechaNacimiento.Enabled = False
TxtNombre.Enabled = False
End If
UpTabContainer.Update()
UpModal.Update()
@@ -977,6 +1026,7 @@ Partial Class RepContratoDetalle
LbEstatus.Text = GvRow.DataKey("Estatus").ToString()
LbCreado.Text = GvRow.DataKey("FechaIng").ToString()
TxtAsiento.Text = GvRow.DataKey("Asiento").ToString()
TxtFechaNacimiento.Text = GvRow.DataKey("FechaNacimiento").ToString().ToDate.ToString("dd/MM/yyyy")
'Seleccionamos la ruta que tiene el usuario actual
DdlRuta.ClearSelection()
@@ -990,7 +1040,7 @@ Partial Class RepContratoDetalle
DdlRuta.Items.Add(listItem)
Next
End If
DdlRuta.SelectedValue = GvRow.DataKey("CveViaje")
DdlRuta.SelectedValueExist(GvRow.DataKey("CveViaje"))
ObjContratos.Dispose()
UpTabContainer.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
@@ -1177,6 +1227,83 @@ Partial Class RepContratoDetalle
End Class
#End Region
Protected Sub DdlVendedor_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDatosViajes()
End Sub
#Region "IMPRESION MANIFIESTO"
'Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
' GeneraPDF("Excel")
' 'GvDatos.ExportToExcel("ReporteProductosServicios" & NowADS().ToShortDateString)
'End Sub
Private Sub PreparaManifiesto()
End Sub
Protected Sub GeneraPDF(Optional Formato As String = "PDF")
Dim DTManifiestoViajes As DataTable = DTViajesPasajeros.Copy
DTManifiestoViajes.Rows.Clear()
DTManifiestoViajes.Columns.Add("SexoStr")
For x = 1 To 50
Dim dRow As DataRow = DTManifiestoViajes.NewRow
Dim Encontrado As Boolean = False
For Each faRow As DataRow In DTViajesPasajeros.Rows
If faRow("Asiento").ToString.ToEntero = x Then
Encontrado = True
dRow("Asiento") = x
dRow("Nombre") = faRow("Nombre").ToString
dRow("Visa") = faRow("Visa").ToString
dRow("Celular") = faRow("Celular").ToString
dRow("SexoStr") = If(Boolean.Parse(faRow("Sexo").ToString), "Masculino", "Femenino")
dRow("Partida") = faRow("Partida").ToString
dRow("Destino") = faRow("Destino").ToString
dRow("Importe") = faRow("Importe").ToString.ToDecimal
Exit For
End If
Next
If Not Encontrado Then
dRow("Asiento") = x
End If
DTManifiestoViajes.Rows.Add(dRow)
Next
DTManifiestoViajes.TableName = "DTManifiestoViajes"
DTManifiestoViajes.AcceptChanges()
Dim DTManifiesto As DataTable = DTManifiestoViajes.FiltraParametros("", "Asiento")
DTManifiesto.TableName = "DTManifiestoViajes"
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
Dim params As New List(Of ReportParameter)()
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Contrato", TxtFolio.Text))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("FechaSalida", TxtFechaSalida.Text))
ImprimirPDF("Empresas/Grales/Formatos/ManifiestoViajes.rdlc", DTManifiesto, params, "Reporte de Productos Servicios", Formato)
End Sub
Protected Sub ImgPDF_Click(sender As Object, e As EventArgs)
GeneraPDF()
End Sub
#End Region
End Class

View File

@@ -349,16 +349,28 @@
<label class="col-md-4">Fecha Salida</label>
<div class="col-md-8">
<div class="input-group">
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="True" type="datetime-local"
<%-- <asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="True" type="datetime-local"
Width="100%"
></asp:TextBox>
></asp:TextBox>--%>
<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="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtFechaSalida" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEETxtFechaSalida" runat="server" TargetControlID="TxtFechaSalida" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaSalida" PopupButtonID="LnkTxtFechaSalida" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVTxtFechaSalida" runat="server" ControlToValidate="TxtFechaSalida"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Salida''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFechaSalida" runat="server" HighlightCssClass="vco"
TargetControlID="RFVTxtFechaSalida" Width="100%">
TargetControlID="RFVTxtFechaSalida" Width="300px">
</ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
@@ -368,14 +380,26 @@
<div class="col-md-8">
<div class="input-group">
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="True" type="datetime-local"
<%-- <asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="True" type="datetime-local"
Width="100%"
></asp:TextBox>
></asp:TextBox>--%>
<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="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtFechaRegreso" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEETxtFechaRegreso" runat="server" TargetControlID="TxtFechaRegreso" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaRegreso" PopupButtonID="LnkTxtFechaRegreso" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVTxtFechaRegreso" runat="server" ControlToValidate="TxtFechaRegreso"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Regreso''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco"
TargetControlID="RFVTxtFechaRegreso" Width="100%">
TargetControlID="RFVTxtFechaRegreso" Width="300px">
</ajax:ValidatorCalloutExtender>
</div>

View File

@@ -590,8 +590,15 @@ Partial Class RepContratosCalendario
TxtFechaSalida.Text = Convert.ToDateTime(DRow("FechaInicial")).ToString("dd/MM/yyyy HH:mm:ss")
TxtFechaRegreso.Text = Convert.ToDateTime(DRow("FechaFinal")).ToString("dd/MM/yyyy HH:mm:ss ")
TxtMoneda.Text = DRow("Moneda").ToString
TxtAnticipo.Text = DRow("ImporteMin").ToString
TxtDolares.Text = DRow("Importe").ToString
'Requeridos
DdlChofer.SelectedValueExist(-1)
DdlChofer2.SelectedValueExist(-1)
DdlChofer.SelectedValueExist(DRow("CveChofer").ToString)
DdlChofer2.SelectedValueExist(DRow("CveChofer2").ToString)
chkSegundoChofer.Checked = If(NumChoferes = 2, True, False)
@@ -719,6 +726,9 @@ Partial Class RepContratosCalendario
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy HH:mm:ss")
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy HH:mm:ss ")
TxtMoneda.Text = GvRow.DataKey("Moneda")
TxtAnticipo.Text = GvRow.DataKey("ImporteMin")
TxtDolares.Text = GvRow.DataKey("Importe")
'Requeridos
DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer"))

View File

@@ -186,19 +186,7 @@
TargetControlID="RFVTxtFechaViaje" Width="400px" BehaviorID="_content_VCETxtFechaViaje">
</ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row my-1">
<label class="col-md-4">Tipo Unidad</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoAF" DataValueField="CveTipoActivoFijo"
DataTextField="TipoActivoFijo" Class="form-control input-inline"
Width="100%" runat="server" Enabled="true"
AutoPostBack="true"
OnSelectedIndexChanged="DdlTipoAF_SelectedIndexChanged">
</asp:DropDownList>
</div>
</div>
</div>
<div class="row my-1" id="DivAF" runat="server">
<label class="col-md-4">Unidad</label>

View File

@@ -24,12 +24,27 @@ Partial Class ListadoViajes
ViewState("Ruta") = value
End Set
End Property
Private Property CveTipoActivoFijo As Integer
Get
If ViewState("CveTipoActivoFijo") Is Nothing Then
ViewState("CveTipoActivoFijo") = -1
End If
Return ViewState("CveTipoActivoFijo").ToString().ToEntero
End Get
Set(value As Integer)
ViewState("CveTipoActivoFijo") = value
End Set
End Property
#End Region
#Region "Carga Página"
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CveTipoActivoFijo = 181 'Autobuses
CargaDatos()
InicializaCombos()
End If
@@ -69,6 +84,7 @@ Partial Class ListadoViajes
End If
ObjContratos.Dispose()
GvContratos.DataBind()
UpDatos.Update()
End Sub
#End Region
@@ -94,7 +110,7 @@ Partial Class ListadoViajes
BtnGuardar.Text = "Agregar"
ModalLabel.InnerHtml = "Agregar Nuevo Viaje"
DdlTipoAF.SelectedValueExist(-1)
'DdlTipoAF.SelectedValueExist(-1)
DdlAF.SelectedValueExist(-1)
DdlChofer.SelectedValueExist(-1)
DdlChofer2.SelectedValueExist(-1)
@@ -144,7 +160,7 @@ Partial Class ListadoViajes
ObjContratos.IniciaTransacSQL()
If Not ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, fecha, fecha, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1,
-1, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero, CveMasivo:=CveMasivo, CveVendedor:=UsuarioActual.CveVendedor,
CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero) > 0 Then
CveTipoAF:=CveTipoActivoFijo, CveAF:=DdlAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero) > 0 Then
'ObjContratos.Commit()
ErrorProceso = True
Exit For
@@ -192,14 +208,14 @@ Partial Class ListadoViajes
If BtnGuardar.Text = "Agregar" Then
If Not ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaViaje.Text.ToDate, TxtFechaViaje.Text.ToDate, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, 0, 0, 0, 2, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero,
CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero) > 0 Then
CveTipoAF:=CveTipoActivoFijo, CveAF:=DdlAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero) > 0 Then
ErrorProceso = True
End If
Else
'Actualizamos Viaje
If Not ObjContratos.UpdateContratos(CveContrato.ToEntero, LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaInicial.Text.ToDate, TxtFechaInicial.Text.ToDate, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, 2, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero,
CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero) = True Then
CveTipoAF:=CveTipoActivoFijo, CveAF:=DdlAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero) = True Then
ErrorProceso = True
End If
End If
@@ -262,15 +278,15 @@ Partial Class ListadoViajes
Private Sub CargaUnidades()
Dim dttipoaf As DataTable = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("MedidaVehicularClave IN (2,3)")
DdlTipoAF.DataSource = dttipoaf
DdlTipoAF.DataBind()
DdlTipoAF.Items.Insert(0, New ListItem("-", "-1"))
'Dim dttipoaf As DataTable = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("MedidaVehicularClave IN (2,3)")
'DdlTipoAF.DataSource = dttipoaf
'DdlTipoAF.DataBind()
'DdlTipoAF.Items.Insert(0, New ListItem("-", "-1"))
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros($" EstadoActivoFijo= 'Activo' AND CveTipoActivoFijo = {CveTipoActivoFijo}")
DdlAF.DataBind()
DdlAF.Items.Insert(0, New ListItem("-", "-1"))
'DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros(" EstadoActivoFijo= 'Activo' ")
'DdlAF.DataBind()
'DdlAF.Items.Insert(0, New ListItem("-", "-1"))
'UpDatos.Update()
UpModal.Update()
End Sub
Private Sub CargaChoferes()
@@ -299,50 +315,5 @@ Partial Class ListadoViajes
End Sub
Protected Sub DdlTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs)
'Dim FechaInicio As Date = TxtFechaViaje.Text.ToDate
'If FechaInicio <= MinFecha Then
' Alert("Debe seleccionar Fecha de viaje.", TipoMensaje.MsgAdvertencia)
' DdlTipoAF.SelectedValueExist(-1)
' UpModal.Update()
' Exit Sub
'End If
CargaAFDdl(DdlTipoAF.SelectedValue.ToEntero)
End Sub
'FIXME OIC REVISAR SI SE VA USAR
Private Sub CargaAFDdl(CveTipoAF As Integer)
'Lista de Activos fijos
'DdlAF.ClearSelection()
'DdlAF.SelectedValue = Nothing
'DdlAF.Items.Clear()
'Dim FechaInicio As Date = TxtFechaViaje.Text.ToDate
'Dim FinDeAnio As Date = New Date(FechaInicio.Year, 12, 31)
'Dim ObjContratos As New ClsContratos
'If ObjContratos.GetContratosValUnidadesAgendadas(DdlAF.SelectedValue.ToEntero, TxtFechaViaje.Text.ToDate, FinDeAnio, UsuarioActual.CveEmpresa, -1, 2) Then
' If CveTipoAF > 0 Then
' DdlAF.DataSource = ObjContratos.DtResultados.FiltraParametros($" CveTipoActivoFijo = {CveTipoAF} ")
' Else
' DdlAF.DataSource = ObjContratos.DtResultados
' End If
'End If
'ObjContratos.Dispose()
'Lista de Activos fijos
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros($" EstadoActivoFijo= 'Activo' AND CveTipoActivoFijo = {CveTipoAF} ")
DdlAF.DataBind()
DdlAF.Items.Insert(0, New ListItem("-", "-1"))
UpModal.Update()
End Sub
End Class