--Se quitó imprimir boleto de repboleto por que se movió a repcontratodetalles. Se trabajo en la edición de los datos de usuario al editar el boleto. Se mejoró la estructura de repContratos y se quitaron llamados a modales en VB. Se implementó consulta en repContratos.

This commit is contained in:
AbrahamCastilloV
2024-03-06 17:18:05 -07:00
parent c263a34ab5
commit eb94bcabb4
7 changed files with 183 additions and 191 deletions

View File

@@ -1,88 +1,58 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports ADSNetLibrary.Helpers
Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones.ModExtensiones
Imports Microsoft.Reporting.WebForms
Partial Class ListadoBoletos
Inherits ClsPaginas
Private Property CveViaje As Integer
Get
Return ViewState("CveViaje").ToString().ToEntero
End Get
Set(value As Integer)
ViewState("CveViaje") = value
End Set
End Property
Private Property Ruta As String
Get
Return ViewState("Ruta").ToString()
End Get
Set(value As String)
ViewState("Ruta") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If Request.QueryString("CveViaje") Is Nothing Then
Response.Redirect("/Transportes/RepViajes.aspx")
End If
CveViaje = Request.QueryString("CveViaje").ToEntero
Ruta = IfNull(Request("Ruta"), "").ToString
LblViaje.Text = Ruta
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjTransportes As New ClsTransportes
If ObjTransportes.GetViajesPasajeros(CveViaje) Then
GvBoletos.DataSource = ObjTransportes.DtResultados
End If
ObjTransportes.Dispose()
GvBoletos.DataBind()
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)
Dim Fecha As Date = GvRow.DataKey("FechaIng").ToDate
Dim Importe As Decimal = GvRow.DataKey("Importe").ToDecimal
Dim params As New List(Of ReportParameter) From {
New ReportParameter("Ruta", Ruta),
New ReportParameter("Origen", GvRow.DataKey("Partida")),
New ReportParameter("Destino", GvRow.DataKey("Destino")),
New ReportParameter("FechaSalida", Fecha.ToShortDateString()),
New ReportParameter("HoraSalida", Fecha.ToString("HH:mm")),
New ReportParameter("Nombre", GvRow.DataKey("Nombre")),
New ReportParameter("Visa", GvRow.DataKey("Visa")),
New ReportParameter("Celular", GvRow.DataKey("Celular")),
New ReportParameter("Importe", Importe.FormatoNumero(2)),
New ReportParameter("TipoBoleto", "Tipo Boleto"),
New ReportParameter("Agencia", GvRow.DataKey("Agencia")),
New ReportParameter("TelefonoAgencia", GvRow.DataKey("TelefonoAgencia")),
New ReportParameter("Asiento", GvRow.DataKey("Asiento"))
}
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Boleto.mrt", dtResult, params, NombreArchivo:="Boleto")
'Empresas/Grales/Formatos/EntradaSalida.mrt
'Empresas/188/Formatos/Boleto.mrt
End Sub
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveViajePasajero As Integer = GvRow.DataKey("CveViajePasajero").ToEntero()
Dim Estatus As String = GvRow.DataKey("Estatus")
Option Explicit On
Option Strict On
Imports System.Data
Imports ADSNetLibrary.Helpers
Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones.ModExtensiones
Partial Class ListadoBoletos
Inherits ClsPaginas
Private Property CveViaje As Integer
Get
Return ViewState("CveViaje").ToString().ToEntero
End Get
Set(value As Integer)
ViewState("CveViaje") = value
End Set
End Property
Private Property Ruta As String
Get
Return ViewState("Ruta").ToString()
End Get
Set(value As String)
ViewState("Ruta") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If Request.QueryString("CveViaje") Is Nothing Then
Response.Redirect("/Transportes/RepViajes.aspx")
End If
CveViaje = Request.QueryString("CveViaje").ToEntero
Ruta = IfNull(Request("Ruta"), "").ToString
LblViaje.Text = Ruta
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjTransportes As New ClsTransportes
If ObjTransportes.GetViajesPasajeros(CveViaje) Then
GvBoletos.DataSource = ObjTransportes.DtResultados
End If
ObjTransportes.Dispose()
GvBoletos.DataBind()
End Sub
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveViajePasajero As Integer = GvRow.DataKey("CveViajePasajero").ToEntero()
Dim Estatus As String = GvRow.DataKey("Estatus")
Dim cambiarEstatus As Boolean = Not Estatus.ToBool
Dim TieneError As Boolean = False
Dim TieneError As Boolean = False
Try
Dim DtRem As DataTable = Nothing
@@ -129,21 +99,15 @@ Partial Class ListadoBoletos
End If
Catch ex As Exception
TieneError = True
GuardaLog(ex.ToString())
Finally
GuardaLog(ex.ToString())
Finally
If TieneError Then
Alert($"Ocurrió un error al cancelar el boleto.", TipoMensaje.MsgError)
Else
Alert($"El boleto ha sido cancelado correctamente.")
End If
CargaDatos()
End Try
End Sub
Protected Sub GvBoletos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("BtnImprimir"))
End If
CargaDatos()
End Try
End Sub
End Class