From eb94bcabb406053a7656ac0b685688f2e9d20ea5 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Wed, 6 Mar 2024 17:18:05 -0700 Subject: [PATCH] =?UTF-8?q?--Se=20quit=C3=B3=20imprimir=20boleto=20de=20re?= =?UTF-8?q?pboleto=20por=20que=20se=20movi=C3=B3=20a=20repcontratodetalles?= =?UTF-8?q?.=20=20Se=20trabajo=20en=20la=20edici=C3=B3n=20de=20los=20datos?= =?UTF-8?q?=20de=20usuario=20al=20editar=20el=20boleto.=20Se=20mejor=C3=B3?= =?UTF-8?q?=20la=20estructura=20de=20repContratos=20y=20se=20quitaron=20ll?= =?UTF-8?q?amados=20a=20modales=20en=20VB.=20Se=20implement=C3=B3=20consul?= =?UTF-8?q?ta=20en=20repContratos.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Transportes/RepBoletos.aspx | 4 - Transportes/RepBoletos.aspx.vb | 148 ++++++++++--------------- Transportes/RepContratoDetalle.aspx | 26 ++--- Transportes/RepContratoDetalle.aspx.vb | 75 ++++++++----- Transportes/RepContratos.aspx | 87 ++++++++------- Transportes/RepContratos.aspx.vb | 30 ++--- Transportes/RepViajes.aspx.vb | 4 +- 7 files changed, 183 insertions(+), 191 deletions(-) diff --git a/Transportes/RepBoletos.aspx b/Transportes/RepBoletos.aspx index 90d69dcdc..18c239ad1 100644 --- a/Transportes/RepBoletos.aspx +++ b/Transportes/RepBoletos.aspx @@ -40,7 +40,6 @@
@@ -98,9 +97,6 @@ CssClass="btn btn-circle btn-sm red" Text="" data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("Estatus").ToString = "True", "Cancelar Boleto", "Reactivar") %>' data-btn-ok-label="si" OnClick="BtnCancelar_Click" /> - diff --git a/Transportes/RepBoletos.aspx.vb b/Transportes/RepBoletos.aspx.vb index 1033db0ff..7645b2807 100644 --- a/Transportes/RepBoletos.aspx.vb +++ b/Transportes/RepBoletos.aspx.vb @@ -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 \ No newline at end of file diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx index 8dd15d431..1b34d1045 100644 --- a/Transportes/RepContratoDetalle.aspx +++ b/Transportes/RepContratoDetalle.aspx @@ -1,5 +1,5 @@ <%@ Page Language="VB" AutoEventWireup="true" Title="Transportes V&A - Detalles del Contrato" - MasterPageFile="~/Site.master" + MasterPageFile="~/Site.master" EnableEventValidation="true" CodeFile="RepContratoDetalle.aspx.vb" Inherits="RepContratoDetalle" %> @@ -283,7 +283,8 @@ Width="200px"> @@ -411,7 +412,7 @@
<%-- Datos del Boleto --%>
- +
@@ -469,7 +470,7 @@
- Nombre + Nombre
@@ -478,7 +479,7 @@
- Visa + Visa
@@ -486,23 +487,23 @@
- Celular + Celular
- Observacion + Observacion
- Sexo + Sexo
@@ -510,15 +511,14 @@
- Estatus + Estatus
- <%-- Asientos --%> diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb index 09b1c2067..8ffd44810 100644 --- a/Transportes/RepContratoDetalle.aspx.vb +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -110,7 +110,7 @@ Partial Class RepContratoDetalle 'Lista Tipo AF DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa) DdlTipoAF.DataBind() - DdlTipoAF.Items.Insert(0, New ListItem("-", "0")) + DdlTipoAF.Items.Insert(0, New ListItem("-", "")) End Sub Private Sub CargaDatos() 'Información General @@ -131,7 +131,7 @@ Partial Class RepContratoDetalle TxtFechaSalida.Text = Contrato.Rows(0)("FechaInicial").ToString TxtFechaRegreso.Text = Contrato.Rows(0)("FechaFinal").ToString TxtCantidadPasajeros.Text = Contrato.Rows(0)("CantidadPasajeros").ToString - DdlTipoAF.SelectedValue = Contrato.Rows(0)("CveTipoAF").ToString + DdlTipoAF.SelectedValue = If(Contrato.Rows(0)("CveTipoAF") Is Nothing, "", Contrato.Rows(0)("CveTipoAF").ToString) TxtDolares.Text = Contrato.Rows(0)("Importe").ToString TxtPesos.Text = Contrato.Rows(0)("ImporteMax").ToString TxtAnticipo.Text = Contrato.Rows(0)("ImporteMin").ToString @@ -151,7 +151,6 @@ Partial Class RepContratoDetalle If ObjTransportes.GetViajesPasajeros(CveContrato) Then GvViajesPasajeros.DataSource = ObjTransportes.DtResultados BusquedaSeleccionada(ObjTransportes.DtResultados) - End If ObjTransportes.Dispose() GvViajesPasajeros.DataBind() @@ -315,7 +314,7 @@ Partial Class RepContratoDetalle Try ObjTransportes.IniciaTransacSQL() - If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero, DdlRuta.SelectedValue.ToEntero, UsuarioActual.CveVendedor, LbImporte.Text.ToDecimal, TxtAsiento.Text.ToEntero, LbNombre.Text, LbVisa.Text, LbCelular.Text, LbObservacion.Text, LbEstatus.Text.ToBool, UsuarioActual.CveUsuario, LbSexo.Text.ToBool) Then + If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero, DdlRuta.SelectedValue.ToEntero, UsuarioActual.CveVendedor, LbImporte.Text.ToDecimal, TxtAsiento.Text.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, TxtObservacion.Text, TxtEstatus.Text.ToBool, UsuarioActual.CveUsuario, TxtSexo.Text.ToBool) Then ObjTransportes.Commit() End If Catch ex As ArgumentException @@ -326,10 +325,9 @@ Partial Class RepContratoDetalle ObjTransportes.Dispose() End Try - RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalEditar")) - UpTabContainer.Update() - UpPasajeros.Update() + CargaDatos() + RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalEditar")) End Sub Protected Sub OnChangeRuta(sender As Object, e As EventArgs) Dim ObjTransportes As New ClsTransportes @@ -363,6 +361,8 @@ Partial Class RepContratoDetalle End If Next End If + UpTabContainer.Update() + ViajeActual = dt End Sub Protected Sub ImprimirBoleto(sender As Object, e As EventArgs) @@ -396,23 +396,45 @@ Partial Class RepContratoDetalle End If End Sub Protected Sub EditarBoleto(sender As Object, e As EventArgs) + PnEditarUsuario.Visible = True + PnEditarViaje.Visible = False + PnAsientos.Visible = False - End Sub - 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) CveViajePasajero = GvRow.DataKey("CveViajePasajero").ToEntero LbPartida.Text = GvRow.DataKey("Partida").ToString() LbDestino.Text = GvRow.DataKey("Destino").ToString() LbImporte.Text = Convert.ToDecimal(GvRow.DataKey("Importe")).ToString("C") - LbNombre.Text = GvRow.DataKey("Nombre").ToString() - LbVisa.Text = GvRow.DataKey("Visa").ToString() - LbCelular.Text = GvRow.DataKey("Celular").ToString() - LbSexo.Text = GvRow.DataKey("Sexo").ToString() - LbObservacion.Text = GvRow.DataKey("Observacion").ToString() - LbEstatus.Text = GvRow.DataKey("Estatus").ToString() + TxtNombre.Text = GvRow.DataKey("Nombre").ToString() + TxtVisa.Text = GvRow.DataKey("Visa").ToString() + TxtCelular.Text = GvRow.DataKey("Celular").ToString() + TxtSexo.Text = GvRow.DataKey("Sexo").ToString() + TxtObservacion.Text = GvRow.DataKey("Observacion").ToString() + TxtEstatus.Text = GvRow.DataKey("Estatus").ToString() + + UpTabContainer.Update() + UpModal.Update() + RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar")) + + End Sub + Protected Sub CambiarBoleto(sender As Object, e As EventArgs) + PnEditarViaje.Visible = True + PnEditarUsuario.Visible = False + PnAsientos.Visible = True + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + CveViajePasajero = GvRow.DataKey("CveViajePasajero").ToEntero + LbPartida.Text = GvRow.DataKey("Partida").ToString() + LbDestino.Text = GvRow.DataKey("Destino").ToString() + LbImporte.Text = Convert.ToDecimal(GvRow.DataKey("Importe")).ToString("C") + TxtNombre.Text = GvRow.DataKey("Nombre").ToString() + TxtVisa.Text = GvRow.DataKey("Visa").ToString() + TxtCelular.Text = GvRow.DataKey("Celular").ToString() + TxtSexo.Text = GvRow.DataKey("Sexo").ToString() + TxtObservacion.Text = GvRow.DataKey("Observacion").ToString() + TxtEstatus.Text = GvRow.DataKey("Estatus").ToString() LbCreado.Text = GvRow.DataKey("FechaIng").ToString() TxtAsiento.Text = GvRow.DataKey("Asiento").ToString() @@ -439,21 +461,21 @@ Partial Class RepContratoDetalle LbPartida.Text = GvRow.DataKey("Partida").ToString() LbDestino.Text = GvRow.DataKey("Destino").ToString() LbImporte.Text = Convert.ToDecimal(GvRow.DataKey("Importe")).ToString("C") - LbNombre.Text = GvRow.DataKey("Nombre").ToString() - LbVisa.Text = GvRow.DataKey("Visa").ToString() - LbCelular.Text = GvRow.DataKey("Celular").ToString() - LbSexo.Text = GvRow.DataKey("Sexo").ToString() - LbObservacion.Text = GvRow.DataKey("Observacion").ToString() - LbEstatus.Text = GvRow.DataKey("Estatus").ToString() + TxtNombre.Text = GvRow.DataKey("Nombre").ToString() + TxtVisa.Text = GvRow.DataKey("Visa").ToString() + TxtCelular.Text = GvRow.DataKey("Celular").ToString() + TxtSexo.Text = GvRow.DataKey("Sexo").ToString() + TxtObservacion.Text = GvRow.DataKey("Observacion").ToString() + TxtEstatus.Text = GvRow.DataKey("Estatus").ToString() LbCreado.Text = GvRow.DataKey("FechaIng").ToString() TxtAsiento.Text = GvRow.DataKey("Asiento").ToString() - Dim Estatus As Boolean = Not LbEstatus.Text.ToBool + Dim Estatus As Boolean = Not TxtEstatus.Text.ToBool Dim ObjTransportes As New ClsTransportes Try ObjTransportes.IniciaTransacSQL() - If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero, CveContrato, UsuarioActual.CveVendedor, LbImporte.Text.ToDecimal, TxtAsiento.Text.ToEntero, LbNombre.Text, LbVisa.Text, LbCelular.Text, LbObservacion.Text, Estatus, UsuarioActual.CveUsuario, LbSexo.Text.ToBool) Then - Alert($"El boleto ha modificado el estatus de su boleto correctamente.") + If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero, CveContrato, UsuarioActual.CveVendedor, LbImporte.Text.ToDecimal, TxtAsiento.Text.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, TxtObservacion.Text, Estatus, UsuarioActual.CveUsuario, TxtSexo.Text.ToBool) Then + Alert("Se ha modificado el estatus de su boleto correctamente.") ObjTransportes.Commit() End If @@ -465,6 +487,7 @@ Partial Class RepContratoDetalle ObjTransportes.Dispose() CargaDatos() End Try + UpPasajeros.Update() End Sub #End Region diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx index 0c4a53718..1e626144c 100644 --- a/Transportes/RepContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -17,11 +17,13 @@
  • - Agregar Contrato + Agregar Contrato
  • - Personalizar Columnas + Personalizar Columnas
  • Generar PDF @@ -39,7 +41,7 @@ <%-- Filtro Visible - Consulta --%>
    -
    @@ -225,13 +227,13 @@ - <%--MODAL UPLOAD--%> -