--En ClsTransportes cambio nombre a variable para unificarlo con la base de datos @CveViaje. Se separó modal para editar datos de usuario o datos del viaje y se crearon sus métodos. También se agregar un OnChange para cuando el select tome otra ruta, indique los asientos que no están disponibles. En proceso...

This commit is contained in:
AbrahamCastilloV
2024-02-23 17:33:09 -07:00
parent a2a3a764c8
commit bf60f3e2a5
3 changed files with 594 additions and 639 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,6 @@ Imports Extensiones
Imports Extensiones.ModExtensiones
Imports Microsoft.Reporting.WebForms
Partial Class RepContratoDetalle
Inherits ClsPaginas
Private Property CveContrato As Integer
@@ -85,6 +84,8 @@ Partial Class RepContratoDetalle
Dim ObjTransportes As New ClsTransportes
If ObjTransportes.GetViajesPasajeros(CveContrato) Then
GvViajesPasajeros.DataSource = ObjTransportes.DtResultados
BusquedaSeleccionada(ObjTransportes.DtResultados)
End If
ObjTransportes.Dispose()
GvViajesPasajeros.DataBind()
@@ -122,7 +123,9 @@ Partial Class RepContratoDetalle
End Try
End Sub
Protected Sub EditarBoleto(sender As Object, e As EventArgs)
Protected Sub CambiarBoleto(sender As Object, e As EventArgs)
PnEditarViaje.Visible = True
PnEditarUsuario.Visible = False
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
LbPartida.Text = GvRow.DataKey("Partida").ToString()
LbDestino.Text = GvRow.DataKey("Destino").ToString()
@@ -141,18 +144,22 @@ Partial Class RepContratoDetalle
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, -1, CveEstatus:=-1, CveTipoContrato:=35) Then
For Each row As DataRow In ObjContratos.DtResultados.Rows
' Asigna los valores de la columna deseada al ListItem
Dim listItem As New ListItem(row("CveContrato").ToString(), row("CveContrato").ToString())
Dim listItem As New ListItem(row("SubProyecto").ToString() + " - " + row("FechaInicial").ToString(), row("CveContrato").ToString())
' Agrega el ListItem al DropDownList
DdlRuta.Items.Add(listItem)
Next
End If
DdlRuta.SelectedValue = GvRow.DataKey("CveViaje")
ObjContratos.Dispose()
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
End Sub
Protected Sub UpdateBoleto(sender As Object, e As EventArgs)
End Sub
Protected Sub EditarBoleto(sender As Object, e As EventArgs)
End Sub
Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs)
@@ -171,6 +178,37 @@ Partial Class RepContratoDetalle
UpBoletos.Update()
End Sub
Protected Sub OnChangeRuta(sender As Object, e As EventArgs)
Dim ObjTransportes As New ClsTransportes
If ObjTransportes.GetViajesPasajeros(DdlRuta.SelectedValue.ToEntero) Then
BusquedaSeleccionada(ObjTransportes.DtResultados)
End If
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
End Sub
Protected Sub BusquedaSeleccionada(dt As DataTable)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
For i As Integer = 1 To 50
Dim lnk As LinkButton = CType(cph.FindControl($"A{i}"), LinkButton)
If lnk IsNot Nothing Then
lnk.Enabled = True
lnk.CssClass = "disponible"
End If
Next
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
End Sub
Protected Sub ImprimirBoleto(sender As Object, e As EventArgs)
Dim dtResult As New DataTable()
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)