--Se hicieron los cambios para poder modificar los viajes

This commit is contained in:
AbrahamCastilloV
2023-12-26 19:06:58 -07:00
parent 4413848b85
commit 6b0047351a

View File

@@ -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("<script>console.log('El resultado de tu variable" + CveViaje + "')</script>")
Dim fecha As DateTime
If DateTime.TryParse(GvRow.DataKey("Fecha").ToString, fecha) Then