--Cambios en Boletos, parece que se duplicaron id's
This commit is contained in:
@@ -20,7 +20,6 @@ Partial Class Boletos
|
||||
ViewState("Importe") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveViaje As Integer
|
||||
Get
|
||||
Return ViewState("CveViaje").ToString().ToEntero
|
||||
@@ -59,13 +58,15 @@ Partial Class Boletos
|
||||
'Datos Viaje
|
||||
Dim ObjViaje As New ClsTransportes
|
||||
Dim retornoViaje As Boolean = ObjViaje.GetViajes(CveViaje, UsuarioActual.CveEmpresa)
|
||||
ViewState("CveRuta") = ObjViaje.CveRuta
|
||||
If retornoViaje Then
|
||||
|
||||
If retornoViaje AndAlso ObjViaje.CveViaje > 0 Then
|
||||
CveRuta = ObjViaje.CveRuta
|
||||
TxtRuta.Text = ObjViaje.Ruta
|
||||
TxtFecha.Text = ObjViaje.Fecha.ToShortDateString
|
||||
CargaDestinos()
|
||||
'Boletos Vendidos
|
||||
Dim dt As DataTable
|
||||
If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=True) Then 'Poner párametro para estatus y cancelado de viajes
|
||||
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
|
||||
@@ -75,7 +76,6 @@ Partial Class Boletos
|
||||
lnk.CssClass = "nodisponible"
|
||||
lnk.ToolTip = dr("Nombre").ToString
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
@@ -85,6 +85,10 @@ Partial Class Boletos
|
||||
|
||||
Protected Sub InicializaCombos()
|
||||
'Lista Destinos''carga específicos
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaDestinos()
|
||||
Dim ObjDestinos As New ClsTransportes()
|
||||
|
||||
If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
|
||||
@@ -102,20 +106,18 @@ Partial Class Boletos
|
||||
End If
|
||||
ObjDestinos.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub CotizarTarifa(sender As Object, e As EventArgs)
|
||||
If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then
|
||||
|
||||
Dim ObjDestinos As New ClsTransportes()
|
||||
Dim retorno As Boolean = ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero)
|
||||
Dim ImporteR As Decimal = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal
|
||||
Dim ImporteR As Decimal = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
|
||||
ObjDestinos.Dispose()
|
||||
|
||||
If retorno Then
|
||||
If ImporteR > 0 Then
|
||||
Dim redondeado As String = CStr(Math.Round(ImporteR, 2))
|
||||
ViewState("Importe") = redondeado
|
||||
TxtCosto.Text = $"El precio de su boleto es ${Importe}"
|
||||
ViewState("Importe") = ImporteR
|
||||
TxtCosto.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}"
|
||||
BtnGuardar.Visible = True
|
||||
upPanel.Visible = True
|
||||
Else
|
||||
@@ -177,4 +179,12 @@ Partial Class Boletos
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CotizarTarifa(sender, e)
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CotizarTarifa(sender, e)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
</style>
|
||||
</asp:Content>
|
||||
|
||||
<%--<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||
|
||||
</asp:Content>--%>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row my-1" style="margin-right: 10px; margin-top: 10px;" align="right">
|
||||
@@ -27,11 +27,13 @@
|
||||
</i></a>
|
||||
</div>
|
||||
<asp:Label ID="Prueba" runat="server" Text=""></asp:Label>
|
||||
<asp:UpdatePanel ID="UPPD" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="portlet light xspadding bordered margin-bottom-10">
|
||||
<div class="portlet light xspadding bordered margin-bottom-10">
|
||||
<asp:GridView ID="GvBoletos" 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="Asiento,Nombre, Visa,Celular,Sexo,Estatus,Partida,Destino, Importe,FechaIng, Agencia, TelefonoAgencia">
|
||||
data-sort="true" DataKeyNames="CveViajePasajero,Asiento,Nombre, Visa,Celular,Sexo,Estatus,Partida,Destino, Importe,FechaIng, Agencia, TelefonoAgencia">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="No. Asiento">
|
||||
@@ -93,10 +95,10 @@
|
||||
<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="BtnToggle" runat="server" AlternateText="Activar"
|
||||
<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="ToggleViajesPasajeros" />
|
||||
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" />
|
||||
@@ -107,6 +109,8 @@
|
||||
</asp:GridView>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ Partial Class ListadoBoletos
|
||||
Response.Redirect("/Transportes/RepViajes.aspx")
|
||||
End If
|
||||
CveViaje = Request.QueryString("CveViaje").ToEntero
|
||||
Ruta = Request.QueryString("Ruta")
|
||||
Ruta = IfNull(Request("Ruta"), "").ToString
|
||||
|
||||
Prueba.Text = Ruta
|
||||
|
||||
@@ -46,43 +46,11 @@ Partial Class ListadoBoletos
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjTransportes As New ClsTransportes
|
||||
|
||||
If ObjTransportes.GetViajesPasajeros(CveViaje) Then
|
||||
|
||||
GvBoletos.DataSource = ObjTransportes.DtResultados
|
||||
ObjTransportes.Dispose()
|
||||
GvBoletos.DataBind()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub ToggleViajesPasajeros(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
|
||||
|
||||
Try
|
||||
ObjTransportes.IniciaTransacSQL()
|
||||
If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero.ToEntero, Activar:=True, Estatus:=cambiarEstatus) Then
|
||||
|
||||
If 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
|
||||
|
||||
ObjTransportes.Dispose()
|
||||
GvBoletos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub ImprimirBoleto(sender As Object, e As EventArgs)
|
||||
@@ -113,4 +81,29 @@ Partial Class ListadoBoletos
|
||||
|
||||
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
|
||||
End Class
|
||||
Reference in New Issue
Block a user