--Se agregó el listado de boletos a los viajes que fuera de ruta.
This commit is contained in:
@@ -70,7 +70,22 @@ Partial Class Boletos
|
||||
TxtRuta.Text = Contrato.Rows(0)("Ruta").ToString
|
||||
TxtFecha.Text = Contrato.Rows(0)("FechaInicial").ToString
|
||||
|
||||
Dim ObjViaje As New ClsTransportes
|
||||
|
||||
'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 Sub
|
||||
|
||||
Protected Sub InicializaCombos()
|
||||
|
||||
@@ -184,9 +184,76 @@
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<%-- Boletos --%>
|
||||
<ajax:TabPanel runat="server" HeaderText="Boletos" CssClass="row" Visible="false" ID="TabBoletos">
|
||||
<ajax:TabPanel runat="server" HeaderText="Boletos" CssClass="row" Visible="false"
|
||||
ID="TabBoletos">
|
||||
<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,Asiento,Nombre, Visa,Celular,Sexo,Estatus,Partida,Destino, Importe,FechaIng, Agencia, TelefonoAgencia">
|
||||
<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="Importe" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "{0:n}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></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>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
|
||||
@@ -4,6 +4,8 @@ Imports System.Data
|
||||
Imports ADSNetLibrary.Helpers
|
||||
Imports ADSNetLibrary.SIGAPI.Helpers
|
||||
Imports Extensiones
|
||||
Imports Extensiones.ModExtensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
|
||||
Partial Class RepContratoDetalle
|
||||
@@ -42,6 +44,7 @@ Partial Class RepContratoDetalle
|
||||
DdlTipoAF.Items.Insert(0, New ListItem("-", ""))
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
'Información General
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
Contrato = ObjContratos.DtResultados
|
||||
@@ -49,9 +52,6 @@ Partial Class RepContratoDetalle
|
||||
Response.Redirect($"~/Transportes/RepContratos.aspx")
|
||||
End If
|
||||
|
||||
If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then
|
||||
TabBoletos.Visible = True
|
||||
End If
|
||||
|
||||
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
|
||||
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
|
||||
@@ -66,10 +66,71 @@ Partial Class RepContratoDetalle
|
||||
TxtDolares.Text = Contrato.Rows(0)("Importe").ToString
|
||||
TxtPesos.Text = Contrato.Rows(0)("ImporteMax").ToString
|
||||
TxtAnticipo.Text = Contrato.Rows(0)("ImporteMin").ToString
|
||||
'Boletos Vendidos
|
||||
If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then
|
||||
TabBoletos.Visible = True
|
||||
End If
|
||||
|
||||
Dim ObjTransportes As New ClsTransportes
|
||||
If ObjTransportes.GetViajesPasajeros(CveContrato) Then
|
||||
GvViajesPasajeros.DataSource = ObjTransportes.DtResultados
|
||||
GvViajesPasajeros.DataBind()
|
||||
ObjTransportes.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim CveViajePasajero As String = GvRow.DataKey("CveViajePasajero")
|
||||
Dim Estatus As String = GvRow.DataKey("Estatus")
|
||||
Dim cambiarEstatus As Boolean = Not Estatus.ToBool
|
||||
Dim ObjTransportes As New ClsTransportes
|
||||
ObjTransportes.IniciaTransacSQL()
|
||||
Try
|
||||
If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero.ToEntero, Activar:=cambiarEstatus, Estatus:=cambiarEstatus) Then
|
||||
If Not cambiarEstatus Then
|
||||
Alert($"El boleto ha sido cancelado correctamente.")
|
||||
Else
|
||||
Alert($"El boleto ha sido reactivado correctamente.")
|
||||
End If
|
||||
End If
|
||||
ObjTransportes.Commit()
|
||||
Catch ex As Exception
|
||||
ObjTransportes.RollBack()
|
||||
Alert($"No se pudo cambiar el estatus del boleto {ex}", TipoMensaje.MsgError)
|
||||
Finally
|
||||
ObjTransportes.Dispose()
|
||||
CargaDatos()
|
||||
End Try
|
||||
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", GvRow.DataKey("Ruta")),
|
||||
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, 1).ToString),
|
||||
New ReportParameter("TipoBoleto", "Tipo Boleto"),
|
||||
New ReportParameter("Agencia", GvRow.DataKey("Agencia")),
|
||||
New ReportParameter("TelefonoAgencia", GvRow.DataKey("TelefonoAgencia")),
|
||||
New ReportParameter("Asiento", GvRow.DataKey("Asiento"))
|
||||
}
|
||||
|
||||
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Boleto.mrt", dtResult, params, NombreArchivo:="Boleto")
|
||||
'Empresas/Grales/Formatos/EntradaSalida.mrt
|
||||
'Empresas/188/Formatos/Boleto.mrt
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user