- traspaso
This commit is contained in:
@@ -184,6 +184,7 @@ Public Class ClsTransportes
|
||||
CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero
|
||||
Fecha = Data.Rows(0)("Fecha").ToString.ToDate
|
||||
Ruta = Data.Rows(0)("Ruta").ToString
|
||||
Me.CveViaje = Data.Rows(0)("CveViaje").ToString.ToEntero
|
||||
End If
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
@@ -273,20 +274,15 @@ Public Class ClsTransportes
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GetViajesPasajeros(CveViaje As Integer, Optional CveViajePasajero As Integer = 0, Optional Estatus As Boolean = False) As Boolean
|
||||
Public Function GetViajesPasajeros(CveViaje As Integer, Optional CveViajePasajero As Integer = -1, Optional Estatus As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Trans_ViajesPasajerosGet")
|
||||
If Estatus = True Then
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveViaje", SqlDbType.Int).Value = CveViaje
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
End With
|
||||
Else
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveViaje", SqlDbType.Int).Value = CveViaje
|
||||
End With
|
||||
End If
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveViaje", SqlDbType.Int).Value = CveViaje
|
||||
.Add("@CveViajePasajero", SqlDbType.Int).Value = CveViajePasajero
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<%@ Page Language="VB" Title="Transportes V&A - Comprar Boleto" AutoEventWireup="false" MasterPageFile="~/Site.master" CodeFile="Boletos.aspx.vb"
|
||||
Inherits="Boletos" EnableEventValidation="true" %>
|
||||
Inherits="Boletos" %>
|
||||
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Comprar Boleto
|
||||
@@ -67,155 +67,146 @@
|
||||
</style>
|
||||
</asp:Content>
|
||||
|
||||
<%--<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||
<contenttemplate>
|
||||
<li>
|
||||
<asp:HyperLink ID="LBListadoViajes" runat="server" NavigateUrl="ListadoViajes.aspx"
|
||||
Target="_blank"><i class='fa fa-road'></i>Viajes</asp:HyperLink>
|
||||
</li>
|
||||
</contenttemplate>
|
||||
</asp:Content>--%>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="portlet light xspadding bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-users font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Datos del Cliente </span>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="upPanel">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="portlet light xspadding bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-users font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Datos del Cliente </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<div class="portlet-body form">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright ">
|
||||
<asp:TextBox ID="TxtNombre" CssClass="form-control" runat="server" MaxLength="200" ClientIDMode="Static"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtNombre" runat="server" ControlToValidate="TxtNombre" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtNombre.ClientID.ToString()%>">Nombre:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="row " >
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtVisa" runat="server" Width="100%" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtVisa.ClientID.ToString()%>">Visa:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="RblSexo" CssClass="form-control" runat="server" >
|
||||
<asp:ListItem Text="Masculino" Value="1" Selected="True" />
|
||||
<asp:ListItem Text="Femenino" Value="0" />
|
||||
</asp:DropDownList>
|
||||
<label for="<%= RblSexo.ClientID.ToString()%>">Sexo:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCelular" runat="server" Width="100%" CssClass="form-control" ></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCelular" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Celular''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCelular.ClientID.ToString()%>">Celular:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright ">
|
||||
<asp:TextBox ID="TxtObservaciones" CssClass="form-control" runat="server" MaxLength="200" ClientIDMode="Static"></asp:TextBox>
|
||||
<label for="<%= TxtObservaciones.ClientID.ToString()%>">Observaciones:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet light xspadding bordered ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-yellow">
|
||||
<i class=" fa fa-bus font-yellow"></i>
|
||||
<span class="caption-subject bold uppercase">Datos del Viaje</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtRuta" runat="server" Width="100%" Enabled="false" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtRuta.ClientID.ToString()%>">Ruta:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<asp:DropDownList ID="DdlPartida" DataTextField="Destino"
|
||||
AutoPostBack="true"
|
||||
DataValueField="CveDestino" Class="form-control input-sm select2me" OnSelectedIndexChanged="DdlPartida_SelectedIndexChanged"
|
||||
Width="200px" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVPartida" runat="server" ControlToValidate="DdlPartida"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Partida''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlPartida.ClientID.ToString()%>">Partida:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtFecha" runat="server" Width="100%" Enabled="false" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtFecha.ClientID.ToString()%>">Fecha:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlDestino" DataTextField="Destino"
|
||||
AutoPostBack="true"
|
||||
DataValueField="CveDestino" Class="form-control input-sm select2me"
|
||||
OnSelectedIndexChanged="DdlDestino_SelectedIndexChanged"
|
||||
Width="200px" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="DdlDestino"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Destino''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlDestino.ClientID.ToString()%>">Destino:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<asp:Label runat="server" ID="TxtCosto" CssClass="text-success bold text-center"></asp:Label>
|
||||
<br />
|
||||
<div class="text-center">
|
||||
<asp:Button ID="BtnGuardar" Visible="False" OnClick="AddBoleto" runat="server" CssClass="btn btn-success margin-top-15"
|
||||
Text="Comprar Boleto"
|
||||
ValidationGroup="GrpGuardar"></asp:Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright ">
|
||||
<asp:TextBox ID="TxtNombre" CssClass="form-control" runat="server" MaxLength="200" ClientIDMode="Static"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtNombre" runat="server" ControlToValidate="TxtNombre" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtNombre.ClientID.ToString()%>">Nombre:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="row " >
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtVisa" runat="server" Width="100%" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtVisa.ClientID.ToString()%>">Visa:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="RblSexo" CssClass="form-control" runat="server" >
|
||||
<asp:ListItem Text="Masculino" Value="1" Selected="True" />
|
||||
<asp:ListItem Text="Femenino" Value="0" />
|
||||
</asp:DropDownList>
|
||||
<label for="<%= RblSexo.ClientID.ToString()%>">Sexo:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCelular" runat="server" Width="100%" CssClass="form-control" ></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCelular" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Celular''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCelular.ClientID.ToString()%>">Celular:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright ">
|
||||
<asp:TextBox ID="TxtObservaciones" CssClass="form-control" runat="server" MaxLength="200" ClientIDMode="Static"></asp:TextBox>
|
||||
<label for="<%= TxtObservaciones.ClientID.ToString()%>">Observaciones:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet light xspadding bordered ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-yellow">
|
||||
<i class=" fa fa-bus font-yellow"></i>
|
||||
<span class="caption-subject bold uppercase">Datos del Viaje</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="upPanel">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtRuta" runat="server" Width="100%" Enabled="false" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtRuta.ClientID.ToString()%>">Ruta:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<asp:DropDownList ID="DdlPartida" AppendDataBoundItems="true" DataTextField="Destino"
|
||||
AutoPostBack="true"
|
||||
DataValueField="CveDestino" Class="form-control input-sm select2me"
|
||||
OnTextChanged="CotizarTarifa"
|
||||
Width="200px" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVPartida" runat="server" ControlToValidate="DdlPartida"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Partida''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlPartida.ClientID.ToString()%>">Partida:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtFecha" runat="server" Width="100%" Enabled="false" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtFecha.ClientID.ToString()%>">Fecha:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlDestino" AppendDataBoundItems="true" DataTextField="Destino"
|
||||
AutoPostBack="true"
|
||||
DataValueField="CveDestino" Class="form-control input-sm select2me"
|
||||
OnTextChanged="CotizarTarifa"
|
||||
Width="200px" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="DdlDestino"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Destino''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlDestino.ClientID.ToString()%>">Destino:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<asp:Label runat="server" ID="TxtCosto" CssClass="text-success bold text-center"></asp:Label>
|
||||
<br />
|
||||
<div class="text-center">
|
||||
<asp:Button ID="BtnGuardar" Visible="False" OnClick="AddBoleto" runat="server" CssClass="btn btn-success margin-top-15"
|
||||
Text="Comprar Boleto"
|
||||
ValidationGroup="GrpGuardar"></asp:Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light xspadding bordered margin-bottom-10">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPPAsientos">
|
||||
<ContentTemplate>
|
||||
@@ -226,6 +217,7 @@
|
||||
<asp:LinkButton ID="chofer" runat="server"
|
||||
Text="<i class='fa fa-user'><br/>Chofer</i>" />
|
||||
</td>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@@ -474,6 +466,9 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
@@ -59,13 +59,16 @@ 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
|
||||
dt = ObjViaje.DtResultados
|
||||
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
|
||||
For Each dr As DataRow In dt.Rows
|
||||
@@ -75,7 +78,6 @@ Partial Class Boletos
|
||||
lnk.CssClass = "nodisponible"
|
||||
lnk.ToolTip = dr("Nombre").ToString
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
@@ -85,6 +87,10 @@ Partial Class Boletos
|
||||
|
||||
Protected Sub InicializaCombos()
|
||||
'Lista Destinos''carga específicos
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDestinos()
|
||||
Dim ObjDestinos As New ClsTransportes()
|
||||
|
||||
If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
|
||||
@@ -102,20 +108,18 @@ Partial Class Boletos
|
||||
End If
|
||||
ObjDestinos.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub CotizarTarifa(sender As Object, e As EventArgs)
|
||||
Private Sub CotizarTarifa()
|
||||
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
|
||||
@@ -175,4 +179,12 @@ Partial Class Boletos
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CotizarTarifa()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CotizarTarifa()
|
||||
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