From 6b0047351abbce2a26345320dca9f414fd28d0f7 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Tue, 26 Dec 2023 19:06:58 -0700 Subject: [PATCH] --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