From e38bd1adbdb61e748953288fab091cda20f13f43 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Thu, 21 Dec 2023 19:11:03 -0700 Subject: [PATCH] =?UTF-8?q?--creaci=C3=B3n=20de=20listado=20de=20boletos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsTransportes.vb | 26 +++++++++- Transportes/Boletos.aspx | 94 ++++++++++++++++++++++++++----------- Transportes/Boletos.aspx.vb | 19 ++++++-- 3 files changed, 107 insertions(+), 32 deletions(-) diff --git a/App_Code/ClsTransportes.vb b/App_Code/ClsTransportes.vb index 2d3fb644d..57e0f982c 100644 --- a/App_Code/ClsTransportes.vb +++ b/App_Code/ClsTransportes.vb @@ -271,7 +271,7 @@ Public Class ClsTransportes #End Region #Region "Boletos" - Public Function AddViajePasajero(CveViaje As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal, Asiento As Integer, Nombre As String, Visa As String, Celular As String, Sexo As Boolean, Observacion As String, CveUsuario As Integer) As Integer + Public Function AddViajePasajeros(CveViaje As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal, Asiento As Integer, Nombre As String, Visa As String, Celular As String, Sexo As Boolean, Observacion As String, CveUsuario As Integer) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Trans_ViajesPasajerosAdd") @@ -297,6 +297,30 @@ Public Class ClsTransportes OnError("Ocurrió un error al guardar el nuevo boleto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + Return Retorno + End Function + Public Function GetViajesPasajeros(CveViaje As Integer, Optional CveViajePasajero As Integer = 0) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("[PA_Trans_ViajesPasajerosGet]") + If CveViajePasajero <> 0 Then + With SqlAdapter.SelectCommand.Parameters + .Add("@CveViaje", SqlDbType.Int).Value = CveViaje + .Add("@CveViajePasajero", SqlDbType.Int).Value = CveViajePasajero + End With + Else + With SqlAdapter.SelectCommand.Parameters + .Add("@CveViaje", SqlDbType.Int).Value = CveViaje + End With + End If + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el catálogo de viajes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno End Function #End Region diff --git a/Transportes/Boletos.aspx b/Transportes/Boletos.aspx index 26908782f..047276b85 100644 --- a/Transportes/Boletos.aspx +++ b/Transportes/Boletos.aspx @@ -15,21 +15,21 @@ display: inline-block; width: 45px; height: 45px; - border: 2px solid #26C281; + border: 2px solid #45b6af; border-radius: 10px !important; margin: .1px; cursor: pointer; - color: #26C281; + color: #45b6af; text-align: center; } .disponible:hover { - background-color: #26C281; + background-color: #45b6af; color: #fff; } .disponible.activo { - background-color: #26C281; + background-color: #45b6af; color: #fff; } @@ -60,12 +60,6 @@ cursor: pointer; color: black; } - - .tarifa { - font-weight: bold; - font-size: 1.6rem; - color: #26C281 - } @@ -84,7 +78,7 @@ -
+
@@ -208,10 +202,14 @@
- - + +
+
+ +
+ @@ -219,6 +217,60 @@
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -481,18 +533,6 @@
- <%-- --%> diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index 869255596..e178ace90 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -2,6 +2,7 @@ Partial Class Boletos Inherits ClsPaginas +#Region "Propiedades" Private Property AsientoSeleccionado As String Get Return ViewState("AsientoSeleccionado").ToString() @@ -35,7 +36,7 @@ Partial Class Boletos ViewState("CveRuta") = value End Set End Property - +#End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then @@ -56,12 +57,19 @@ Partial Class Boletos Private Sub CargaDatos() 'Datos Viaje Dim ObjViaje As New ClsTransportes - Dim retorno As Boolean = ObjViaje.GetViajes(CveViaje.ToEntero, UsuarioActual.CveEmpresa) + Dim retornoViaje As Boolean = ObjViaje.GetViajes(CveViaje.ToEntero, UsuarioActual.CveEmpresa) ViewState("CveRuta") = ObjViaje.CveRuta - If retorno Then + If retornoViaje Then TxtRuta.Text = ObjViaje.Ruta TxtFecha.Text = ObjViaje.Fecha.ToString End If + 'Boletos Vendidos + Dim retornoBoletos As Boolean = ObjViaje.GetViajesPasajeros(CveViaje) + If retornoBoletos Then + GvBoletos.DataSource = ObjViaje.DtResultados + ObjViaje.Dispose() + GvBoletos.DataBind() + End If End Sub @@ -106,12 +114,14 @@ Partial Class Boletos 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" ViewState("AsientoSeleccionado") = buttonID End Sub + Protected Sub AddBoleto(sender As Object, e As EventArgs) If AsientoSeleccionado = "" Then @@ -124,7 +134,7 @@ Partial Class Boletos Try AsientoSeleccionado = AsientoSeleccionado.Replace("A", "") - Dim retorno As Integer = ObjTransporte.AddViajePasajero(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario) + Dim retorno As Integer = ObjTransporte.AddViajePasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario) If retorno > 1 Then ObjTransporte.Commit() @@ -137,4 +147,5 @@ Partial Class Boletos End Try End Sub + End Class