-- cambios de Ruta a SubProyecto
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
Imports ADSNetLibrary.SIGAPI.Helpers
|
||||
Imports Extensiones
|
||||
Imports Extensiones.ModExtensiones
|
||||
|
||||
Partial Class CatRutas
|
||||
Inherits ClsPaginas
|
||||
@@ -25,14 +23,15 @@ Partial Class CatRutas
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
'Lista Rutas'
|
||||
Dim ObjRutas As New ClsTransportes()
|
||||
If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
|
||||
|
||||
If ObjRutas.DtResultados.Rows.Count > 0 Then
|
||||
GvRutas.DataSource = ObjRutas.DtResultados
|
||||
GvRutas.DataBind()
|
||||
End If
|
||||
End If
|
||||
Dim ObjRutas As New ClsTransportes()
|
||||
'If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
|
||||
|
||||
' If ObjRutas.DtResultados.Rows.Count > 0 Then
|
||||
' GvRutas.DataSource = ObjRutas.DtResultados
|
||||
' GvRutas.DataBind()
|
||||
' End If
|
||||
'End If
|
||||
'Lista Destinos'
|
||||
If ObjRutas.GetDestinos() Then
|
||||
|
||||
@@ -42,12 +41,13 @@ Partial Class CatRutas
|
||||
End If
|
||||
End If
|
||||
'Lista Importes'
|
||||
If ObjRutas.GetDestinosTarifas(-1, -1) Then
|
||||
If ObjRutas.GetDestinosTarifas(-1, -1, -1) Then
|
||||
If ObjRutas.DtResultados.Rows.Count > 0 Then
|
||||
GvImportes.DataSource = ObjRutas.DtResultados
|
||||
GvImportes.DataBind()
|
||||
End If
|
||||
End If
|
||||
ObjRutas.Dispose()
|
||||
|
||||
UpPanel.Update()
|
||||
|
||||
@@ -71,16 +71,18 @@ Partial Class CatRutas
|
||||
End If
|
||||
ObjDestinos.Dispose()
|
||||
|
||||
DdlRutas.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto in (12699,12700)")
|
||||
DdlRutas.DataBind()
|
||||
DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", ""))
|
||||
'Dim ObjRutas As New ClsTransportes()
|
||||
'If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
|
||||
|
||||
Dim ObjRutas As New ClsTransportes()
|
||||
If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
|
||||
|
||||
If ObjRutas.DtResultados.Rows.Count > 0 Then
|
||||
DdlRutas.DataSource = ObjRutas.DtResultados
|
||||
DdlRutas.DataBind()
|
||||
DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", ""))
|
||||
End If
|
||||
End If
|
||||
' If ObjRutas.DtResultados.Rows.Count > 0 Then
|
||||
' DdlRutas.DataSource = ObjRutas.DtResultados
|
||||
' DdlRutas.DataBind()
|
||||
' DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", ""))
|
||||
' End If
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Protected Sub MostrarModal(sender As Object, e As EventArgs)
|
||||
@@ -92,7 +94,6 @@ Partial Class CatRutas
|
||||
DdlOrigen.SelectedValue = ""
|
||||
DdlFinal.SelectedValue = ""
|
||||
TxtImporte.Text = ""
|
||||
BtnAddRuta.Visible = False
|
||||
BtnAddDestino.Visible = False
|
||||
BtnAddImporte.Visible = False
|
||||
PnRuta.Visible = False
|
||||
@@ -109,11 +110,8 @@ Partial Class CatRutas
|
||||
PnRuta.Visible = True
|
||||
TxtRuta.Text = GvRow.DataKey("Ruta")
|
||||
DdlRutaEstatus.SelectedValue = GvRow.DataKey("Estatus")
|
||||
BtnAddRuta.Visible = True
|
||||
BtnAddRuta.Text = "Editar"
|
||||
ViewState("Cve") = GvRow.DataKey("CveRuta").ToEntero
|
||||
|
||||
|
||||
Case "BtnEditarDestino"
|
||||
ModalLabel.Text = "Editar Destino"
|
||||
TxtDestino.Text = GvRow.DataKey("Destino")
|
||||
@@ -124,10 +122,9 @@ Partial Class CatRutas
|
||||
BtnAddDestino.Text = "Editar"
|
||||
ViewState("Cve") = GvRow.DataKey("CveDestino").ToEntero
|
||||
|
||||
|
||||
Case "BtnEditarImporte"
|
||||
ModalLabel.Text = "Editar Importe"
|
||||
DdlRutas.SelectedValue = GvRow.DataKey("CveRuta")
|
||||
DdlRutas.SelectedValue = GvRow.DataKey("CveSubProyecto")
|
||||
DdlOrigen.SelectedValue = GvRow.DataKey("CveDestinoOrigen")
|
||||
DdlFinal.SelectedValue = GvRow.DataKey("CveDestinoFinal")
|
||||
TxtImporte.Text = GvRow.DataKey("Importe")
|
||||
@@ -136,7 +133,6 @@ Partial Class CatRutas
|
||||
BtnAddImporte.Text = "Editar"
|
||||
ViewState("Cve") = GvRow.DataKey("CveDestinoTarifa").ToEntero
|
||||
|
||||
|
||||
End Select
|
||||
End If
|
||||
|
||||
@@ -145,8 +141,6 @@ Partial Class CatRutas
|
||||
Case "BtnAgregarRuta"
|
||||
ModalLabel.Text = "Agregar Ruta"
|
||||
PnRuta.Visible = True
|
||||
BtnAddRuta.Visible = True
|
||||
BtnAddRuta.Text = "Guardar"
|
||||
Case "BtnAgregarDestino"
|
||||
ModalLabel.Text = "Agregar Destino"
|
||||
PnDestino.Visible = True
|
||||
@@ -165,46 +159,46 @@ Partial Class CatRutas
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "Rutas"
|
||||
Protected Sub AddRuta(sender As Object, e As EventArgs)
|
||||
'#Region "Rutas"
|
||||
' Protected Sub AddRuta(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjRuta As New ClsTransportes
|
||||
ObjRuta.IniciaTransacSQL()
|
||||
Try
|
||||
If BtnAddRuta.Text = "Guardar" Then
|
||||
If ObjRuta.AddRuta(TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 1 Then
|
||||
ObjRuta.Commit()
|
||||
Alert("Ruta Agregada Correctamente.")
|
||||
End If
|
||||
End If
|
||||
' Dim ObjRuta As New ClsTransportes
|
||||
' ObjRuta.IniciaTransacSQL()
|
||||
' Try
|
||||
' If BtnAddRuta.Text = "Guardar" Then
|
||||
' If ObjRuta.AddRuta(TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 1 Then
|
||||
' ObjRuta.Commit()
|
||||
' Alert("Ruta Agregada Correctamente.")
|
||||
' End If
|
||||
' End If
|
||||
|
||||
If BtnAddRuta.Text = "Editar" Then
|
||||
If ObjRuta.UpdateRuta(Cve, TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ObjRuta.Commit()
|
||||
Alert("Ruta Actualizada Correctamente.")
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ObjRuta.RollBack()
|
||||
Finally
|
||||
CargaDatos()
|
||||
ObjRuta.Dispose()
|
||||
End Try
|
||||
' If BtnAddRuta.Text = "Editar" Then
|
||||
' If ObjRuta.UpdateRuta(Cve, TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
' ObjRuta.Commit()
|
||||
' Alert("Ruta Actualizada Correctamente.")
|
||||
' End If
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' ObjRuta.RollBack()
|
||||
' Finally
|
||||
' CargaDatos()
|
||||
' ObjRuta.Dispose()
|
||||
' End Try
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub RemoveRuta(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim ObjRuta As New ClsTransportes
|
||||
' End Sub
|
||||
' Protected Sub RemoveRuta(sender As Object, e As EventArgs)
|
||||
' Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
' Dim ObjRuta As New ClsTransportes
|
||||
|
||||
If ObjRuta.RemoveRuta(GvRow.DataKey("CveRuta").ToEntero) Then
|
||||
Alert("Ruta eliminada correctamente")
|
||||
CargaDatos()
|
||||
End If
|
||||
' If ObjRuta.RemoveRuta(GvRow.DataKey("CveRuta").ToEntero) Then
|
||||
' Alert("Ruta eliminada correctamente")
|
||||
' CargaDatos()
|
||||
' End If
|
||||
|
||||
ObjRuta.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
' ObjRuta.Dispose()
|
||||
' End Sub
|
||||
'#End Region
|
||||
|
||||
#Region "Destinos"
|
||||
Protected Sub AddDestino(sender As Object, e As EventArgs)
|
||||
@@ -252,27 +246,22 @@ Partial Class CatRutas
|
||||
|
||||
Dim ObjImporte As New ClsTransportes
|
||||
ObjImporte.IniciaTransacSQL()
|
||||
Try
|
||||
If BtnAddImporte.Text = "Guardar" Then
|
||||
If ObjImporte.AddDestinosTarifas(DdlRutas.SelectedValue, DdlOrigen.SelectedValue, DdlFinal.SelectedValue, TxtImporte.Text) > 1 Then
|
||||
ObjImporte.Commit()
|
||||
Alert("Importe agregado correctamente.")
|
||||
End If
|
||||
End If
|
||||
|
||||
If BtnAddImporte.Text = "Editar" Then
|
||||
If ObjImporte.UpdateDestinosTarifas(Cve, DdlRutas.SelectedValue, DdlOrigen.SelectedValue, DdlFinal.SelectedValue, TxtImporte.Text) Then
|
||||
ObjImporte.Commit()
|
||||
Alert("Importe actualizado correctamente.")
|
||||
End If
|
||||
If BtnAddImporte.Text = "Guardar" Then
|
||||
If ObjImporte.AddDestinosTarifas(DdlRutas.SelectedValue.ToEntero, DdlOrigen.SelectedValue.ToEntero, DdlFinal.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal) > 1 Then
|
||||
ObjImporte.Commit()
|
||||
Alert("Importe agregado correctamente.")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ObjImporte.RollBack()
|
||||
Finally
|
||||
CargaDatos()
|
||||
ObjImporte.Dispose()
|
||||
End Try
|
||||
End If
|
||||
|
||||
If BtnAddImporte.Text = "Editar" Then
|
||||
If ObjImporte.UpdateDestinosTarifas(Cve, DdlRutas.SelectedValue.ToEntero, DdlOrigen.SelectedValue.ToEntero, DdlFinal.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal) Then
|
||||
ObjImporte.Commit()
|
||||
Alert("Importe actualizado correctamente.")
|
||||
End If
|
||||
End If
|
||||
ObjImporte.Dispose()
|
||||
CargaDatos()
|
||||
|
||||
End Sub
|
||||
Protected Sub RemoveImporte(sender As Object, e As EventArgs)
|
||||
|
||||
Reference in New Issue
Block a user