--Se agrega modal para actualizar el asiento y el viaje del pasajero.

This commit is contained in:
AbrahamCastilloV
2024-02-21 18:03:43 -07:00
parent 3092ed3b6b
commit 2b1b4eb30b
3 changed files with 999 additions and 415 deletions

View File

@@ -26,6 +26,22 @@ Partial Class RepContratoDetalle
ViewState("Contrato") = value
End Set
End Property
Private Property SubProyecto As String
Get
Return CType(ViewState("SubProyecto"), String)
End Get
Set(value As String)
ViewState("SubProyecto") = value
End Set
End Property
Private Property AsientoSeleccionado As String
Get
Return ViewState("AsientoSeleccionado").ToString()
End Get
Set(value As String)
ViewState("AsientoSeleccionado") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Request("CveContrato") Is Nothing Then
Response.Redirect($"~/Transportes/RepContratos.aspx")
@@ -49,6 +65,7 @@ Partial Class RepContratoDetalle
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
Contrato = ObjContratos.DtResultados
If Contrato IsNot Nothing AndAlso Contrato.Rows.Count > 0 Then
SubProyecto = Contrato.Rows(0)("SubProyecto").ToString
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString
@@ -105,6 +122,55 @@ Partial Class RepContratoDetalle
End Try
End Sub
Protected Sub EditarBoleto(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
LbPartida.Text = GvRow.DataKey("Partida").ToString()
LbDestino.Text = GvRow.DataKey("Destino").ToString()
LbImporte.Text = GvRow.DataKey("Importe").ToString()
LbNombre.Text = GvRow.DataKey("Nombre").ToString()
LbVisa.Text = GvRow.DataKey("Visa").ToString()
LbCelular.Text = GvRow.DataKey("Celular").ToString()
LbObservacion.Text = GvRow.DataKey("Observacion").ToString()
LbEstatus.Text = GvRow.DataKey("Estatus").ToString()
LbCreado.Text = GvRow.DataKey("FechaIng").ToString()
LbAsiento.Text = GvRow.DataKey("Asiento").ToString()
'Seleccionamos la ruta que tiene el usuario actual
DdlRuta.ClearSelection()
Dim ObjContratos As New ClsContratos
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())
' Agrega el ListItem al DropDownList
DdlRuta.Items.Add(listItem)
Next
End If
ObjContratos.Dispose()
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
End Sub
Protected Sub UpdateBoleto(sender As Object, e As EventArgs)
End Sub
Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs)
'quitamos la selección anterior, en caso de existir.
If AsientoSeleccionado <> "" Then
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
Dim lnk As LinkButton = CType(cph.FindControl(AsientoSeleccionado), LinkButton)
lnk.CssClass = "disponible"
End If
Dim linkButton As LinkButton = DirectCast(sender, LinkButton)
Dim buttonID As String = linkButton.ID
linkButton.CssClass += " activo"
AsientoSeleccionado = buttonID
UpBoletos.Update()
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)
@@ -112,7 +178,7 @@ Partial Class RepContratoDetalle
Dim Importe As Decimal = GvRow.DataKey("Importe").ToDecimal
Dim params As New List(Of ReportParameter) From {
New ReportParameter("Ruta", GvRow.DataKey("Ruta")),
New ReportParameter("Ruta", SubProyecto),
New ReportParameter("Origen", GvRow.DataKey("Partida")),
New ReportParameter("Destino", GvRow.DataKey("Destino")),
New ReportParameter("FechaSalida", Fecha.ToShortDateString()),
@@ -132,6 +198,8 @@ Partial Class RepContratoDetalle
'Empresas/188/Formatos/Boleto.mrt
End Sub
End Class