--Se implementó el enrutamiento hacia RepContratoDetalle
This commit is contained in:
@@ -68,6 +68,13 @@ Partial Class ListadoViajes
|
||||
GvContratos.DataBind()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LBAgregarViaje_Click(sender As Object, e As EventArgs) Handles LBAgregarViaje.Click
|
||||
MostrarModal()
|
||||
End Sub
|
||||
|
||||
Public Sub MostrarModal()
|
||||
'Generar Folio
|
||||
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
|
||||
Dim ObjFolio As New ClsGralFolios
|
||||
@@ -77,13 +84,7 @@ Partial Class ListadoViajes
|
||||
LbFolio.Text = $"{drr("Serie").ToString}-{drr("FActual").ToString}"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LBAgregarViaje_Click(sender As Object, e As EventArgs) Handles LBAgregarViaje.Click
|
||||
MostrarModal()
|
||||
End Sub
|
||||
|
||||
Public Sub MostrarModal()
|
||||
IsMasivo.Visible = True
|
||||
DdlRutas.Text = ""
|
||||
TxtFechaViaje.Text = ""
|
||||
@@ -171,85 +172,31 @@ Partial Class ListadoViajes
|
||||
Alert("Ocurrió un error al generar viaje", TipoMensaje.MsgError)
|
||||
ObjContratos.RollBack()
|
||||
Finally
|
||||
'Reiniciamos modal
|
||||
DdlRutas.Text = ""
|
||||
TxtFechaViaje.Text = ""
|
||||
DdlPartida.Text = ""
|
||||
DdlDestino.SelectedValue = ""
|
||||
'Actualizamos Folio
|
||||
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
|
||||
Dim ObjFolios As New ClsGralFolios
|
||||
If ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then
|
||||
ObjFolios.Dispose()
|
||||
End If
|
||||
CargaDatos()
|
||||
|
||||
ObjContratos.Dispose()
|
||||
CargaDatos()
|
||||
End Try
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub UpdateViaje(sender As Object, e As EventArgs)
|
||||
IsMasivo.Visible = False
|
||||
DivFechaMasivo.Visible = False
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
DdlRutas.SelectedValue = GvRow.DataKey("CveRuta")
|
||||
DdlDestino.SelectedValue = GvRow.DataKey("CveDestino")
|
||||
DdlPartida.SelectedValue = GvRow.DataKey("CvePartida")
|
||||
ViewState("CveContrato") = GvRow.DataKey("CveContrato")
|
||||
ViewState("Ruta") = GvRow.DataKey("Ruta")
|
||||
Dim fecha As DateTime
|
||||
|
||||
If DateTime.TryParse(GvRow.DataKey("Fecha").ToString, fecha) Then
|
||||
TxtFechaViaje.Text = fecha.ToString("yyyy-MM-dd").Replace(" ", "T")
|
||||
End If
|
||||
|
||||
BtnGuardar.Text = "Actualizar"
|
||||
ModalLabel.InnerHtml = "Actualizar Viaje"
|
||||
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub RemoveViaje(sender As Object, e As EventArgs)
|
||||
'Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
'Dim CveMasivo As String = GvRow.DataKey("CveMasivo")
|
||||
|
||||
'Dim ObjTransportes As New ClsTransportes
|
||||
|
||||
'ObjTransportes.IniciaTransacSQL()
|
||||
'If CveMasivo = "" Then
|
||||
' Try
|
||||
' ObjTransportes.RemoveViaje(CveViaje:=GvRow.DataKey("CveViaje").ToEntero)
|
||||
' ObjTransportes.Commit()
|
||||
' Catch ex As Exception
|
||||
' Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError)
|
||||
' End Try
|
||||
'Else
|
||||
' Try
|
||||
' ObjTransportes.RemoveViaje(CveMasivo:=CveMasivo.ToEntero)
|
||||
' ObjTransportes.Commit()
|
||||
' Catch ex As Exception
|
||||
' Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError)
|
||||
|
||||
' End Try
|
||||
'End If
|
||||
'Alert("Viaje eliminado correctamente")
|
||||
'CargaDatos()
|
||||
'ObjTransportes.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ToggleMasivo(sender As Object, e As EventArgs)
|
||||
DivFechaMasivo.Visible = IsMasivo.Checked
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
||||
End Sub
|
||||
|
||||
Protected Sub GoViaje(sender As Object, e As EventArgs)
|
||||
Protected Sub GoContratoDetalle(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim CveViaje As String = GvRow.DataKey("CveViaje")
|
||||
Response.Redirect(String.Format("~/Transportes/Boletos.aspx?CveViaje={0}", CveViaje))
|
||||
Response.Redirect($"~/Transportes/RepContratoDetalle.aspx?CveContrato={GvRow.DataKey("CveContrato")}")
|
||||
End Sub
|
||||
Protected Sub GoBoletos(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Reference in New Issue
Block a user