--Se cambia el formato de las consultas en RepContratos y RepContratosCalendarios. Se modifica de LinkButton a HyperLink para mandar a RepContratoDetalle. Se agregan columnas ocultas y modal para personalizar el gridview.

This commit is contained in:
AbrahamCastilloV
2024-02-15 10:35:55 -07:00
parent 2ff89d048c
commit 7acb70d0f3
8 changed files with 342 additions and 416 deletions

View File

@@ -1,5 +1,10 @@
Imports System.Data
Option Explicit On
Option Strict On
Imports System.Data
Imports ADSNetLibrary.Helpers
Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones
Imports Extensiones.ModExtensiones
Partial Class Boletos
Inherits ClsPaginas
@@ -28,12 +33,13 @@ Partial Class Boletos
ViewState("CveViaje") = value
End Set
End Property
Private Property CveRuta As Integer
Private Property Contrato As DataTable
Get
Return ViewState("CveRuta").ToString().ToEntero
Return CType(ViewState("Contrato"), DataTable)
End Get
Set(value As Integer)
ViewState("CveRuta") = value
Set(value As DataTable)
ViewState("Contrato") = value
End Set
End Property
#End Region
@@ -44,7 +50,6 @@ Partial Class Boletos
Response.Redirect("/Transportes/RepViajes.aspx")
End If
AsientoSeleccionado = ""
CveRuta = 0
CveViaje = Request.QueryString("CveViaje").ToEntero
If CveViaje > 0 Then
CargaDatos()
@@ -55,43 +60,26 @@ Partial Class Boletos
End Sub
Private Sub CargaDatos()
'Datos Viaje
Dim ObjViaje As New ClsTransportes
Dim retornoViaje As Boolean = ObjViaje.GetViajes(CveViaje, UsuarioActual.CveEmpresa)
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:=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
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratos(CveViaje, UsuarioActual.CveEmpresa) Then
Contrato = ObjContratos.DtResultados
Else
Response.Redirect($"~/Transportes/RepContratos.aspx")
End If
ObjViaje.Dispose()
TxtRuta.Text = Contrato.Rows(0)("Ruta").ToString
TxtFecha.Text = Contrato.Rows(0)("FechaInicial").ToString
End Sub
Protected Sub InicializaCombos()
Dim CveRuta As Integer = Contrato.Rows(0)("CveRuta").ToString.ToEntero
'Lista Destinos''carga específicos
End Sub
Protected Sub CargaDestinos()
Dim ObjDestinos As New ClsTransportes()
If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
If Not ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
Else
If ObjDestinos.DtResultados.Rows.Count > 0 Then
@@ -106,6 +94,10 @@ Partial Class Boletos
End If
ObjDestinos.Dispose()
End Sub
Protected Sub CargaDestinos()
End Sub
Protected Sub CotizarTarifa(sender As Object, e As EventArgs)
If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then
@@ -145,7 +137,6 @@ Partial Class Boletos
AsientoSeleccionado = buttonID
End Sub
Protected Sub AddBoleto(sender As Object, e As EventArgs)
If AsientoSeleccionado = "" Then
Alert("Se requiere seleccionar su asiento", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -175,7 +166,6 @@ Partial Class Boletos
CargaDatos()
UpPanel.Update()
End Try
End Sub