From 421cde5e98398452695f66700295ac3a3bd61481 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Thu, 21 Dec 2023 08:41:21 -0700 Subject: [PATCH] boletos --- Transportes/Boletos.aspx | 493 ++++++++++++++++++++++++++++++++++++ Transportes/Boletos.aspx.vb | 130 ++++++++++ 2 files changed, 623 insertions(+) create mode 100644 Transportes/Boletos.aspx create mode 100644 Transportes/Boletos.aspx.vb diff --git a/Transportes/Boletos.aspx b/Transportes/Boletos.aspx new file mode 100644 index 000000000..a15c547b1 --- /dev/null +++ b/Transportes/Boletos.aspx @@ -0,0 +1,493 @@ +<%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/Site.master" CodeFile="Boletos.aspx.vb" + Inherits="Boletos" EnableEventValidation="true" %> + + + Comprar Boleto + + + + + + + + +
  • + Contratos +
  • +
  • + Viajes +
  • +
    +
    + + + +
    +
    +
    + + Datos del Cliente +
    + +
    + +
    + + + + +
    +
    + +
    + +
    + + + + +
    +
    + +
    + +
    + + + + +
    +
    + +
    + + + + +
    + + +
    + +
    + +
    +
    +
    + +
    +
    + + Datos del Viaje +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + + + +
    +
    + + + + + + +
    +
    + +
    +
    + + + + + + +
    +
    + + + +
    + +
    + + +
    + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +      + + + +
    + + + +
    +
    +
    +
    + + + <%-- --%> + + + diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb new file mode 100644 index 000000000..f2d6fb379 --- /dev/null +++ b/Transportes/Boletos.aspx.vb @@ -0,0 +1,130 @@ + +Imports Extensiones + +Partial Class Boletos + Inherits ClsPaginas + Private Property asientoSeleccionado As String + Get + Return ViewState("asientoSeleccionado").ToString() + End Get + Set(value As String) + ViewState("asientoSeleccionado") = value + End Set + End Property + Private Property Importe As Decimal + Get + Return ViewState("Importe").ToString().ToDecimal + End Get + Set(value As Decimal) + ViewState("Importe") = value + End Set + End Property + + Private Property CveViaje As Decimal + Get + Return ViewState("CveViaje").ToString().ToDecimal + End Get + Set(value As Decimal) + ViewState("CveViaje") = value + End Set + End Property + + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not IsPostBack Then + If Request.QueryString("CveViaje") Is Nothing Then + Response.Redirect("/Transportes/ListadoViajes.aspx") + End If + CveViaje = Request.QueryString("CveViaje").ToEntero + + DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True + CargaDatos() + InicializaCombos() + + End If + End Sub + + Private Sub CargaDatos() + 'Datos Viaje + Dim ObjViaje As New ClsTransportes + Dim retorno = ObjViaje.GetViajes(CveViaje.ToEntero, UsuarioActual.CveEmpresa) + If retorno Then + TxtRuta.Text = ObjViaje.Ruta.ToString + TxtFecha.Text = ObjViaje.Fecha.ToString + End If + 'Lista Destinos''carga específicos + Dim ObjDestinos As New ClsDestinos() + If ObjDestinos.GetDestinos(-1, -1, -1, "", True, True, DateTime.Now) Then + + If ObjDestinos.DtResultados.Rows.Count > 0 Then + + DdlPartida.DataSource = ObjDestinos.DtResultados + DdlPartida.DataBind() + DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", "")) + + DdlDestino.DataSource = ObjDestinos.DtResultados + DdlDestino.DataBind() + DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "")) + End If + End If + End Sub + + Protected Sub InicializaCombos() + + End Sub + + Protected Sub CotizarTarifa(sender As Object, e As EventArgs) + If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then + + Dim ObjDestinos As New ClsTransportes() + If ObjDestinos.GetDestinosTarifas(DdlDestino.SelectedValue.ToEntero, DdlPartida.SelectedValue.ToEntero) Then + + If ObjDestinos.Importe > 0 Then + TxtCosto.Text = $"El precio de su boleto es ${ObjDestinos.Importe}" + BtnGuardar.Visible = True + upPanel.Visible = True + Importe = ObjDestinos.Importe.ToEntero + Else + TxtCosto.Text = "" + BtnGuardar.Visible = False + upPanel.Visible = False + Importe = 0 + End If + End If + End If + + End Sub + Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs) + Dim linkButton As LinkButton = DirectCast(sender, LinkButton) + Dim buttonID As String = linkButton.ID + linkButton.CssClass += " activo" + asientoSeleccionado = buttonID + End Sub + Protected Sub AddBoleto(sender As Object, e As EventArgs) + + If asientoSeleccionado = "" Then + Alert("Se requiere seleccionar su asiento") + Exit Sub + End If + + 'Page.Response.Write("") + 'Page.Response.Write("") + + Dim ObjTransporte As New ClsTransportes() + ObjTransporte.IniciaTransacSQL() + + Try + Dim retorno As Integer = ObjTransporte.AddViajePasajero(CveViaje.ToEntero, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero, 0.0, asientoSeleccionado, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario) + + If retorno > 1 Then + ObjTransporte.Commit() + End If + Catch ex As Exception + Alert($"No se pudo generar el boleto {ex}", TipoMensaje.MsgError) + Finally + ObjTransporte.Dispose() + + End Try + + End Sub +End Class