--Se volvió a poner todo lo que eliminé. Se hizo el select para los destinos específicos por ruta, se agregaron boletos
This commit is contained in:
@@ -41,10 +41,9 @@ Partial Class ListadoViajes
|
||||
|
||||
'Lista Destinos'
|
||||
Dim ObjDestinos As New ClsDestinos()
|
||||
If ObjDestinos.GetDestinos(-1, -1, -1, "", True, True, DateTime.Now) Then
|
||||
If ObjDestinos.GetDestinos() Then
|
||||
|
||||
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
DdlPartida.DataSource = ObjDestinos.DtResultados
|
||||
DdlPartida.DataBind()
|
||||
DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", ""))
|
||||
@@ -72,7 +71,7 @@ Partial Class ListadoViajes
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjTransportes As New ClsTransportes
|
||||
|
||||
If ObjTransportes.GetViajes() Then
|
||||
If ObjTransportes.GetViajes(-1, UsuarioActual.CveEmpresa) Then
|
||||
GvViajes.DataSource = ObjTransportes.DtResultados
|
||||
ObjTransportes.Dispose()
|
||||
GvViajes.DataBind()
|
||||
@@ -97,10 +96,8 @@ Partial Class ListadoViajes
|
||||
End Sub
|
||||
|
||||
Protected Sub AddViaje(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjTransportes As New ClsTransportes
|
||||
|
||||
|
||||
ObjTransportes.IniciaTransacSQL()
|
||||
|
||||
If IsMasivo.Checked = True Then
|
||||
@@ -109,7 +106,7 @@ Partial Class ListadoViajes
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim CveMasivo = DateTimeOffset.Now.ToUnixTimeSeconds().ToEntero
|
||||
Dim CveMasivo As Integer = DateTimeOffset.Now.ToUnixTimeSeconds().ToEntero
|
||||
|
||||
Dim fechaInicial As DateTime = DateTime.Parse(TxtFechaInicial.Text)
|
||||
Dim frecuencia As Integer = Integer.Parse(TxtFrecuencia.Text)
|
||||
@@ -141,7 +138,6 @@ Partial Class ListadoViajes
|
||||
ObjTransportes.Dispose()
|
||||
CargaDatos()
|
||||
Alert("El viaje masivo se registró correctamente.", TipoMensaje.MsgInformacion)
|
||||
|
||||
Else
|
||||
Try
|
||||
If BtnGuardar.Text = "Guardar" Then
|
||||
@@ -157,18 +153,14 @@ Partial Class ListadoViajes
|
||||
TxtFechaViaje.Text = ""
|
||||
DdlPartida.Text = ""
|
||||
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
|
||||
Alert("El viaje se modificó correctamente.", TipoMensaje.MsgInformacion)
|
||||
ObjTransportes.Commit()
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ObjTransportes.RollBack()
|
||||
@@ -203,7 +195,7 @@ Partial Class ListadoViajes
|
||||
|
||||
Protected Sub RemoveViaje(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim CveMasivo = GvRow.DataKey("CveMasivo")
|
||||
Dim CveMasivo As String = GvRow.DataKey("CveMasivo")
|
||||
|
||||
Dim ObjTransportes As New ClsTransportes
|
||||
|
||||
@@ -233,6 +225,12 @@ Partial Class ListadoViajes
|
||||
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)
|
||||
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))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user