From e5b0f0ff78f8c797ca427b136bf73a290c8e02df Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 26 Dec 2023 17:15:52 -0700 Subject: [PATCH 1/3] Clientes, Sunproyectos Precios de Lista Funcionalidad 404 --- App_Code/ClsVentas.vb | 3 +- Planeacion/CatSubProyectos.aspx | 9 +- Planeacion/CatSubProyectos.aspx.vb | 8 + Ventas/Clientes.aspx | 3 + Ventas/Clientes.aspx.vb | 435 +++++++++++++++++------------ 5 files changed, 275 insertions(+), 183 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 45d5cbd21..e545a9329 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1976,7 +1976,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double) As Integer + Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double, Optional CvePrecioListaClonar As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Vta_PrecioListaAdd") @@ -1987,6 +1987,7 @@ Public Class ClsVentas .Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista .Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje .Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada + .Add("@CvePrecioListaClonar", SqlDbType.Int).Value = CvePrecioListaClonar .Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/Planeacion/CatSubProyectos.aspx b/Planeacion/CatSubProyectos.aspx index 677baa2bc..d308ceb0d 100644 --- a/Planeacion/CatSubProyectos.aspx +++ b/Planeacion/CatSubProyectos.aspx @@ -402,8 +402,11 @@ -
- +
+ +
@@ -449,7 +452,7 @@ @@ -228,8 +232,8 @@ - diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index 3b878b195..05c479d40 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -65,7 +65,7 @@ Partial Class Boletos TxtFecha.Text = ObjViaje.Fecha.ToShortDateString 'Boletos Vendidos Dim dt As DataTable - If ObjViaje.GetViajesPasajeros(CveViaje) Then + If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=True) 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 @@ -129,9 +129,13 @@ Partial Class Boletos Dim linkButton As LinkButton = DirectCast(sender, LinkButton) Dim buttonID As String = linkButton.ID linkButton.CssClass += " activo" - ViewState("AsientoSeleccionado") = buttonID + 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 + AsientoSeleccionado = buttonID End Sub - Protected Sub AddBoleto(sender As Object, e As EventArgs) If AsientoSeleccionado = "" Then @@ -144,7 +148,7 @@ Partial Class Boletos Try AsientoSeleccionado = AsientoSeleccionado.Replace("A", "") - Dim retorno As Integer = ObjTransporte.AddViajePasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario) + Dim retorno As Integer = ObjTransporte.AddViajesPasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario) If retorno > 1 Then ObjTransporte.Commit() diff --git a/Transportes/ListadoBoletos.aspx b/Transportes/ListadoBoletos.aspx index 56f94003e..69136cf2c 100644 --- a/Transportes/ListadoBoletos.aspx +++ b/Transportes/ListadoBoletos.aspx @@ -10,7 +10,6 @@ .my-1 { margin-block: 1rem; } - @@ -42,14 +41,14 @@
+ data-sort="true" DataKeyNames="CveViajePasajero,CveViaje,CveDestinoOrigen,CveDestinoFinal,Importe,Asiento,Nombre,Visa,Celular,Sexo,Observacion,Estatus,CveUsuario,FechaIng"> - + @@ -87,10 +86,10 @@ - + data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("Estatus").ToString = "True", "Cancelar Boleto", "Reactivar") %>' + data-btn-ok-label="si" OnClick="ToggleViajesPasajeros" /> @@ -99,7 +98,7 @@
- + diff --git a/Transportes/ListadoBoletos.aspx.vb b/Transportes/ListadoBoletos.aspx.vb index 0addc5160..dad0c525d 100644 --- a/Transportes/ListadoBoletos.aspx.vb +++ b/Transportes/ListadoBoletos.aspx.vb @@ -1,5 +1,6 @@ Option Explicit On Option Strict On +Imports ADSNetLibrary.Helpers Imports ADSNetLibrary.SIGAPI.Helpers Imports Extensiones.ModExtensiones @@ -40,4 +41,28 @@ Partial Class ListadoBoletos End If End Sub + Protected Sub ToggleViajesPasajeros(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim CveViajePasajero As String = GvRow.DataKey("CveViajePasajero") + Dim Estatus As String = GvRow.DataKey("Estatus") + Dim cambiarEstatus As Boolean = Not Estatus.ToBool + Dim ObjTransportes As New ClsTransportes + + Try + ObjTransportes.IniciaTransacSQL() + If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero.ToEntero, Activar:=True, Estatus:=cambiarEstatus) Then + Alert("El boleto ha sido cancelado correctamente.") + End If + ObjTransportes.Commit() + + Catch ex As Exception + ObjTransportes.RollBack() + Alert($"No se pudo cambiar el estatus del boleto {ex}", TipoMensaje.MsgError) + Finally + ObjTransportes.Dispose() + CargaDatos() + End Try + + End Sub + End Class \ No newline at end of file From 6b0047351abbce2a26345320dca9f414fd28d0f7 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Tue, 26 Dec 2023 19:06:58 -0700 Subject: [PATCH 3/3] --Se hicieron los cambios para poder modificar los viajes --- Transportes/ListadoViajes.aspx.vb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Transportes/ListadoViajes.aspx.vb b/Transportes/ListadoViajes.aspx.vb index 83208732e..9aa5d7bfe 100644 --- a/Transportes/ListadoViajes.aspx.vb +++ b/Transportes/ListadoViajes.aspx.vb @@ -6,6 +6,16 @@ Imports Extensiones.ModExtensiones Partial Class ListadoViajes Inherits ClsPaginas +#Region "Propiedades" + Private Property CveViaje As String + Get + Return ViewState("CveViaje").ToString() + End Get + Set(value As String) + ViewState("CveViaje") = value + End Set + End Property +#End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -155,11 +165,11 @@ Partial Class ListadoViajes DdlDestino.SelectedValue = "" End If Else - Dim id As Integer = Convert.ToInt32(Request.QueryString("CveViaje")) - If ObjTransportes.UpdateViajes(id, DdlRutas.Text.ToEntero, DdlTransporte.Text.ToEntero, DdlChofer.Text.ToEntero, UsuarioActual.CveEmpresa, TxtFechaViaje.Text.ToDate, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero) = True Then + If ObjTransportes.UpdateViajes(CveViaje.ToEntero, DdlRutas.Text.ToEntero, DdlTransporte.Text.ToEntero, DdlChofer.Text.ToEntero, UsuarioActual.CveEmpresa, TxtFechaViaje.Text.ToDate, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero) = True Then Alert("El viaje se modificó correctamente.", TipoMensaje.MsgInformacion) ObjTransportes.Commit() + CargaDatos() End If End If Catch ex As Exception @@ -181,6 +191,8 @@ Partial Class ListadoViajes DdlDestino.SelectedValue = GvRow.DataKey("CveDestino") DdlPartida.SelectedValue = GvRow.DataKey("CvePartida") DdlChofer.SelectedValue = GvRow.DataKey("CvePersonal") + ViewState("CveViaje") = GvRow.DataKey("CveViaje") + Page.Response.Write("") Dim fecha As DateTime If DateTime.TryParse(GvRow.DataKey("Fecha").ToString, fecha) Then
- +