-- cambios de Ruta a SubProyecto
This commit is contained in:
@@ -190,7 +190,6 @@ Public Class ClsContratos
|
||||
Public Property CveChofer2 As Integer
|
||||
Public Property CveAF As Integer
|
||||
Public Property CantidadPasajeros As Integer
|
||||
Public Property CveRuta As Integer
|
||||
Public Property CvePartida As Integer
|
||||
Public Property CveDestino As Integer
|
||||
Public Property CveMasivo As Integer
|
||||
@@ -316,8 +315,7 @@ Public Class ClsContratos
|
||||
Me.CveChofer = Data.Rows(0)("CveChofer").ToString.ToEntero
|
||||
Me.CveChofer2 = Data.Rows(0)("CveChofer2").ToString.ToEntero
|
||||
Me.CveAF = Data.Rows(0)("CveAF").ToString.ToEntero
|
||||
Me.CantidadPasajeros = Data.Rows(0)("CantidadPasajeros").ToString.ToEntero
|
||||
Me.CveRuta = Data.Rows(0)("CveRuta").ToString.ToEntero
|
||||
Me.CantidadPasajeros = Data.Rows(0)("CantidadPasajeros").ToString.ToEntero
|
||||
Me.CvePartida = Data.Rows(0)("CvePartida").ToString.ToEntero
|
||||
Me.CveDestino = Data.Rows(0)("CveDestino").ToString.ToEntero
|
||||
Me.CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero
|
||||
|
||||
@@ -208,7 +208,7 @@ Public Class ClsTransportes
|
||||
#End Region
|
||||
|
||||
#Region "Destinos"
|
||||
Public Function GetDestinos(Optional CveRuta As Integer = 0) As Boolean
|
||||
Public Function GetDestinos(Optional CveSubProyecto As Integer = 0) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Trans_DestinosGet")
|
||||
If CveRuta <> 0 Then
|
||||
@@ -290,93 +290,95 @@ Public Class ClsTransportes
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Rutas"
|
||||
Public Function GetRutas(CveRuta As Integer, CveUsuario As Integer, CveEmpresa As Integer, Ruta As String, Estatus As Boolean, FechaIng As DateTime) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Trans_RutasGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@Ruta", SqlDbType.VarChar).Value = Ruta
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
||||
'#Region "Rutas"
|
||||
' Public Function GetRutas(CveRuta As Integer, CveUsuario As Integer, CveEmpresa As Integer, Ruta As String, Estatus As Boolean, FechaIng As DateTime) As Boolean
|
||||
' Dim Retorno As Boolean = False
|
||||
' DataAdapter("PA_Trans_RutasGet")
|
||||
' With SqlAdapter.SelectCommand.Parameters
|
||||
' .Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
' .Add("@Ruta", SqlDbType.VarChar).Value = Ruta
|
||||
' .Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
' .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
||||
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
' End With
|
||||
' Try
|
||||
' SqlAdapter.Fill(Data)
|
||||
' Retorno = True
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las rutas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
' Catch ex As Exception
|
||||
' OnError("Ocurrió un error al obtener las rutas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
' End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function AddRuta(Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer
|
||||
Dim Retorno As Integer = -1
|
||||
' Return Retorno
|
||||
' End Function
|
||||
' Public Function AddRuta(Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer
|
||||
' Dim Retorno As Integer = -1
|
||||
|
||||
DataAdapter("PA_Trans_RutasAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveRuta", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
.Add("@Ruta", SqlDbType.VarChar).Value = Ruta
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus)
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveRuta").Value.ToString)
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
' DataAdapter("PA_Trans_RutasAdd")
|
||||
' With SqlAdapter.SelectCommand.Parameters
|
||||
' .Add("@CveRuta", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
' .Add("@Ruta", SqlDbType.VarChar).Value = Ruta
|
||||
' .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus)
|
||||
' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
' End With
|
||||
' Try
|
||||
' SqlAdapter.Fill(Data)
|
||||
' Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveRuta").Value.ToString)
|
||||
' Catch ex As Exception
|
||||
' OnError("Ocurrió un error al agregar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
' End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function UpdateRuta(CveRuta As Integer, Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Trans_RutasUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||
.Add("@Ruta", SqlDbType.VarChar).Value = Ruta
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus)
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
' Return Retorno
|
||||
' End Function
|
||||
' Public Function UpdateRuta(CveRuta As Integer, Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
' Dim Retorno As Boolean = False
|
||||
' DataAdapter("PA_Trans_RutasUpdate")
|
||||
' With SqlAdapter.SelectCommand.Parameters
|
||||
' .Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||
' .Add("@Ruta", SqlDbType.VarChar).Value = Ruta
|
||||
' .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus)
|
||||
' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
' End With
|
||||
' Try
|
||||
' SqlAdapter.Fill(Data)
|
||||
' Retorno = True
|
||||
' Catch ex As Exception
|
||||
' OnError("Ocurrió un error al actualizar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
' End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function RemoveRuta(CveRuta As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
' Return Retorno
|
||||
' End Function
|
||||
' Public Function RemoveRuta(CveRuta As Integer) As Boolean
|
||||
' Dim Retorno As Boolean = False
|
||||
|
||||
|
||||
DataAdapter("PA_Trans_RutasRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||
End With
|
||||
' DataAdapter("PA_Trans_RutasRemove")
|
||||
' With SqlAdapter.SelectCommand.Parameters
|
||||
' .Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||
' End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
' Try
|
||||
' SqlAdapter.Fill(Data)
|
||||
' Retorno = True
|
||||
' Catch ex As Exception
|
||||
' OnError("Ocurrió un error al eliminar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
' End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
' Return Retorno
|
||||
' End Function
|
||||
|
||||
'#End Region
|
||||
|
||||
#Region "Importes"
|
||||
Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean
|
||||
Public Function GetDestinosTarifas(CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Trans_DestinosTarifasGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||
End With
|
||||
@@ -390,16 +392,16 @@ Public Class ClsTransportes
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddDestinosTarifas(CveRuta As String, CveDestinoOrigen As String, CveDestinoFinal As String, Importe As String) As Integer
|
||||
Public Function AddDestinosTarifas(CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal) As Integer
|
||||
Dim Retorno As Integer = -1
|
||||
|
||||
DataAdapter("PA_Trans_DestinosTarifasAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe
|
||||
.Add("@CveDestinoTarifa", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta.ToEntero
|
||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen.ToEntero
|
||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal.ToEntero
|
||||
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe.ToDecimal
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -410,15 +412,15 @@ Public Class ClsTransportes
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function UpdateDestinosTarifas(CveDestinoTarifa As Integer, CveRuta As String, CveDestinoOrigen As String, CveDestinoFinal As String, Importe As String) As Boolean
|
||||
Public Function UpdateDestinosTarifas(CveDestinoTarifa As Integer, CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Trans_DestinosTarifasUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveDestinoTarifa", SqlDbType.Int).Value = CveDestinoTarifa
|
||||
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta.ToEntero
|
||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen.ToEntero
|
||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal.ToEntero
|
||||
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe.ToDecimal
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -190,10 +190,10 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<asp:DropDownList ID="DdlPartida" DataTextField="Destino"
|
||||
<asp:DropDownList ID="DdlPartida" DataTextField="Partida"
|
||||
AutoPostBack="true"
|
||||
DataValueField="CveDestino" Class="form-control input-sm select2me" Width="200px"
|
||||
runat="server">
|
||||
DataValueField="CveDestinoOrigen" Class="form-control input-sm select2me" Width="200px"
|
||||
runat="server" OnSelectedIndexChanged="DdlPartida_SelectedIndexChanged" >
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVPartida" runat="server" ControlToValidate="DdlPartida"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Partida''</b> es necesario, por favor ingréselo."
|
||||
@@ -215,7 +215,7 @@
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlDestino" DataTextField="Destino"
|
||||
AutoPostBack="true"
|
||||
DataValueField="CveDestino" Class="form-control input-sm select2me"
|
||||
DataValueField="CveDestinoFinal" Class="form-control input-sm select2me"
|
||||
Width="200px" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="DdlDestino"
|
||||
|
||||
@@ -40,6 +40,14 @@ Partial Class Boletos
|
||||
ViewState("Contrato") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtDestinos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtDestinos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDestinos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtPasajeros As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtPasajeros"), DataTable)
|
||||
@@ -73,7 +81,7 @@ Partial Class Boletos
|
||||
If ObjContratos.GetContratos(CveViaje, UsuarioActual.CveEmpresa) Then
|
||||
Contrato = ObjContratos.DtResultados
|
||||
If ObjContratos.DtResultados IsNot Nothing AndAlso ObjContratos.DtResultados.Rows.Count > 0 Then
|
||||
TxtRuta.Text = Contrato.Rows(0)("Ruta").ToString
|
||||
TxtRuta.Text = Contrato.Rows(0)("SubProyecto").ToString
|
||||
TxtFecha.Text = Contrato.Rows(0)("FechaInicial").ToString.ToDate.ToShortDateString
|
||||
DtPasajeros = New DataTable
|
||||
DtPasajeros.Columns.Add("Numero", GetType(Integer))
|
||||
@@ -122,22 +130,35 @@ Partial Class Boletos
|
||||
End Sub
|
||||
|
||||
Protected Sub InicializaCombos()
|
||||
Dim CveRuta As Integer = Contrato.Rows(0)("CveRuta").ToString.ToEntero
|
||||
Dim CveSubProyecto As Integer = Contrato.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
'Lista Destinos''carga específicos
|
||||
Dim ObjDestinos As New ClsTransportes()
|
||||
If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
|
||||
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
DdlPartida.DataSource = ObjDestinos.DtResultados
|
||||
If ObjDestinos.GetDestinosTarifas(CveSubProyecto, -1, -1) Then
|
||||
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||
DtDestinos = ObjDestinos.DtResultados
|
||||
DdlPartida.DataSource = DtDestinos.FiltraParametros("", DistinctColumns:={"CveDestinoOrigen", "Partida"})
|
||||
DdlPartida.DataBind()
|
||||
DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", "-1"))
|
||||
|
||||
DdlDestino.DataSource = ObjDestinos.DtResultados
|
||||
DdlDestino.DataBind()
|
||||
DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1"))
|
||||
'DdlDestino.DataSource = DtDestinos
|
||||
'DdlDestino.DataBind()
|
||||
'DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1"))
|
||||
End If
|
||||
End If
|
||||
|
||||
'If ObjDestinos.GetDestinos(CveSubProyecto:=CveSubProyecto) Then
|
||||
' If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||
' DdlPartida.DataSource = ObjDestinos.DtResultados
|
||||
' DdlPartida.DataBind()
|
||||
' DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", "-1"))
|
||||
|
||||
' DdlDestino.DataSource = ObjDestinos.DtResultados
|
||||
' DdlDestino.DataBind()
|
||||
' DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1"))
|
||||
' End If
|
||||
'End If
|
||||
ObjDestinos.Dispose()
|
||||
End Sub
|
||||
|
||||
@@ -145,12 +166,12 @@ Partial Class Boletos
|
||||
If DdlDestino.SelectedValue <> "-1" And DdlPartida.SelectedValue <> "-1" Then
|
||||
Dim ImporteR As Decimal = 0
|
||||
Dim ObjDestinos As New ClsTransportes()
|
||||
Dim CveSubProyecto As Integer = Contrato.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
Try
|
||||
If ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) Then
|
||||
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
|
||||
End If
|
||||
If ImporteR > 0 Then
|
||||
If ObjDestinos.GetDestinosTarifas(CveSubProyecto, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) Then
|
||||
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
|
||||
End If
|
||||
If ImporteR > 0 Then
|
||||
ViewState("Importe") = ImporteR
|
||||
LbCostos.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}"
|
||||
LbCostos.Visible = True
|
||||
@@ -161,12 +182,9 @@ Partial Class Boletos
|
||||
LbCostos.Visible = False
|
||||
Alert("No se encontro una tarifa para estos destinos", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Alert("No se encontro una tarifa para estos destinos", TipoMensaje.MsgAdvertencia)
|
||||
ObjDestinos.RollBack()
|
||||
Finally
|
||||
ObjDestinos.Dispose()
|
||||
End Try
|
||||
|
||||
ObjDestinos.Dispose()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -276,8 +294,10 @@ Partial Class Boletos
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPartida.SelectedIndexChanged
|
||||
CotizarTarifa()
|
||||
Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
DdlDestino.DataSource = DtDestinos.FiltraParametros($"CveDestinoOrigen = {DdlPartida.SelectedValue}")
|
||||
DdlDestino.DataBind()
|
||||
DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1"))
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDestino.SelectedIndexChanged
|
||||
@@ -397,4 +417,6 @@ Partial Class Boletos
|
||||
' ScriptManager.RegisterStartupScript(Me, Me.GetType(), "ActualizarTiempo", "actualizarTiempo();", True)
|
||||
' UpTimer.Update()
|
||||
'End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -26,55 +26,6 @@
|
||||
<asp:Panel ID="PnlGeneral" runat="server">
|
||||
<%--Calendario Tab--%>
|
||||
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
|
||||
<%--Rutas Tab--%>
|
||||
<ajax:TabPanel ID="TabRutas" runat="server" HeaderText="Rutas">
|
||||
<ContentTemplate>
|
||||
<div class="spaced">
|
||||
<div>
|
||||
<asp:LinkButton ID="BtnAgregarRuta" runat="server" AlternateText="Agregar"
|
||||
CssClass="btn bsuccesscle btn-sm green" OnClick="MostrarModal" Text="<i class='fa fa-add'>Agregar</i>"
|
||||
ToolTip="Agregar" />
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRutas.ClientID) %>"
|
||||
style="display: inline-block; margin-right: -10px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRutas.ClientID) %>"
|
||||
style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier">
|
||||
</i></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<asp:GridView ID="GvRutas" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
|
||||
data-sort="true" DataKeyNames="CveRuta, Ruta, Estatus, CveUsuario, FechaIng, CveEmpresa">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Ruta">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRuta" runat="server" Text='<%# Eval("Ruta") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlEstatus" runat="server" Text='<%# If(Eval("Estatus").ToString = "True", "Activo", "Inactivo") %>'
|
||||
CssClass='<%# If(Eval("Estatus").ToString = "True", "text-success", "text-danger") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="BtnEditarRuta" runat="server" AlternateText="Editar"
|
||||
CssClass="btn btn-circle btn-sm green" OnClick="MostrarModal" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="BtnEliminarRuta" runat="server" AlternateText="Eliminar"
|
||||
CssClass="btn btn-circle btn-sm red" OnClick="RemoveRuta" Text="<i class='fa fa-trash'></i>"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar"
|
||||
data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<%--Destinos Tab--%>
|
||||
<ajax:TabPanel ID="TabDestinos" runat="server" HeaderText="Destinos">
|
||||
<ContentTemplate>
|
||||
@@ -133,7 +84,7 @@
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<%--Importes Tab--%>
|
||||
<ajax:TabPanel ID="TabImportes" runat="server" HeaderText="Importes">
|
||||
<ajax:TabPanel ID="TabImportes" runat="server" HeaderText="Tarifas">
|
||||
<ContentTemplate>
|
||||
<div class="spaced">
|
||||
<div>
|
||||
@@ -152,29 +103,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:GridView ID="GvImportes" runat="server" AutoGenerateColumns="false" EmptyDataText="No
|
||||
se Encontró Contrato Registrado"
|
||||
<asp:GridView ID="GvImportes" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
|
||||
data-sort="true" DataKeyNames="CveDestinoTarifa, CveRuta, CveDestinoOrigen, CveDestinoFinal, Importe, Destino, Salida">
|
||||
data-sort="true" DataKeyNames="CveDestinoTarifa, CveSubProyecto, CveDestinoOrigen, CveDestinoFinal, Importe, Destino, Partida">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Ruta">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCveRuta" runat="server" Text='<%# Eval("Ruta")%>'></asp:Literal>
|
||||
<asp:Literal ID="LtlCveRuta" runat="server" Text='<%# Eval("SubProyecto")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Destino">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDestino" runat="server" Text='<%# Eval("Destino")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Salida">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSalida" runat="server" Text='<%# Eval("Salida")%>'></asp:Literal>
|
||||
<asp:Literal ID="LtlSalida" runat="server" Text='<%# Eval("Partida")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Destino">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDestino" runat="server" Text='<%# Eval("Destino")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe" ItemStyle-CssClass="text-right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "{0:N2}")%>'></asp:Literal>
|
||||
@@ -305,8 +253,8 @@
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Ruta:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlRutas" AppendDataBoundItems="true" DataTextField="Ruta"
|
||||
DataValueField="CveRuta" Class="form-control input-sm select2me"
|
||||
<asp:DropDownList ID="DdlRutas" AppendDataBoundItems="true" DataTextField="SubProyecto"
|
||||
DataValueField="CveSubProyecto" Class="form-control input-sm select2me"
|
||||
Width="200px" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVRutas" runat="server" ControlToValidate="DdlRutas"
|
||||
@@ -368,8 +316,7 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAddRuta" OnClick="AddRuta" runat="server" CssClass="btn btn-primary"
|
||||
ValidationGroup="GrpGuardar" Visible="false"></asp:Button>
|
||||
|
||||
<asp:Button ID="BtnAddDestino" OnClick="AddDestino" runat="server" CssClass="btn btn-primary"
|
||||
ValidationGroup="GrpGuardar" Visible="false"></asp:Button>
|
||||
<asp:Button ID="BtnAddImporte" OnClick="AddImporte" runat="server" CssClass="btn btn-primary"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -48,35 +48,36 @@ Partial Class RepContratoDetalle
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
Contrato = ObjContratos.DtResultados
|
||||
If Contrato IsNot Nothing AndAlso Contrato.Rows.Count > 0 Then
|
||||
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
|
||||
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
|
||||
DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString
|
||||
TxtDescripcion.Text = Contrato.Rows(0)("DescripcionContrato").ToString
|
||||
TxtObservaciones.Text = Contrato.Rows(0)("Observaciones").ToString
|
||||
TxtUbicacion.Text = Contrato.Rows(0)("Ubicacion").ToString
|
||||
TxtFechaSalida.Text = Contrato.Rows(0)("FechaInicial").ToString
|
||||
TxtFechaRegreso.Text = Contrato.Rows(0)("FechaFinal").ToString
|
||||
TxtCantidadPasajeros.Text = Contrato.Rows(0)("CantidadPasajeros").ToString
|
||||
DdlTipoAF.SelectedValue = Contrato.Rows(0)("CveTipoAF").ToString
|
||||
TxtDolares.Text = Contrato.Rows(0)("Importe").ToString
|
||||
TxtPesos.Text = Contrato.Rows(0)("ImporteMax").ToString
|
||||
TxtAnticipo.Text = Contrato.Rows(0)("ImporteMin").ToString
|
||||
'Boletos Vendidos
|
||||
If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then
|
||||
TabBoletos.Visible = True
|
||||
Dim ObjTransportes As New ClsTransportes
|
||||
If ObjTransportes.GetViajesPasajeros(CveContrato) Then
|
||||
GvViajesPasajeros.DataSource = ObjTransportes.DtResultados
|
||||
End If
|
||||
ObjTransportes.Dispose()
|
||||
GvViajesPasajeros.DataBind()
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
ObjContratos.Dispose()
|
||||
Response.Redirect($"~/Transportes/RepContratos.aspx")
|
||||
End If
|
||||
|
||||
|
||||
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
|
||||
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
|
||||
DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString
|
||||
TxtDescripcion.Text = Contrato.Rows(0)("DescripcionContrato").ToString
|
||||
TxtObservaciones.Text = Contrato.Rows(0)("Observaciones").ToString
|
||||
TxtUbicacion.Text = Contrato.Rows(0)("Ubicacion").ToString
|
||||
TxtFechaSalida.Text = Contrato.Rows(0)("FechaInicial").ToString
|
||||
TxtFechaRegreso.Text = Contrato.Rows(0)("FechaFinal").ToString
|
||||
TxtCantidadPasajeros.Text = Contrato.Rows(0)("CantidadPasajeros").ToString
|
||||
DdlTipoAF.SelectedValue = Contrato.Rows(0)("CveTipoAF").ToString
|
||||
TxtDolares.Text = Contrato.Rows(0)("Importe").ToString
|
||||
TxtPesos.Text = Contrato.Rows(0)("ImporteMax").ToString
|
||||
TxtAnticipo.Text = Contrato.Rows(0)("ImporteMin").ToString
|
||||
'Boletos Vendidos
|
||||
If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then
|
||||
TabBoletos.Visible = True
|
||||
End If
|
||||
|
||||
Dim ObjTransportes As New ClsTransportes
|
||||
If ObjTransportes.GetViajesPasajeros(CveContrato) Then
|
||||
GvViajesPasajeros.DataSource = ObjTransportes.DtResultados
|
||||
GvViajesPasajeros.DataBind()
|
||||
ObjTransportes.Dispose()
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Contrato">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink runat="server" NavigateUrl='<%# "~/Transportes/RepContratoDetalle.aspx?CveContrato=" + If(Eval("CveContrato") IsNot DBNull.Value, Eval("CveContrato").ToString(), String.Empty) %>'
|
||||
<asp:HyperLink runat="server" NavigateUrl='<%# Eval("CveContrato", "/Transportes/RepContratoDetalle.aspx?CveContrato={0}") %>'
|
||||
Text='<%# Eval("NumeroContrato") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -43,6 +43,11 @@ Partial Class ListadoContratos
|
||||
'Lista de Monedas
|
||||
DdlMoneda.DataSource = GlobalDTMonedas
|
||||
DdlMoneda.DataBind()
|
||||
|
||||
DdlEstatus.DataSource = GlobalDTContratosEstatus(UsuarioActual.CveEmpresa)
|
||||
DdlEstatus.DataBind()
|
||||
DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
@@ -52,11 +57,6 @@ Partial Class ListadoContratos
|
||||
GvContratos.DataBind()
|
||||
End If
|
||||
|
||||
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
||||
DdlEstatus.DataSource = ObjContratos.DtResultados
|
||||
DdlEstatus.DataBind()
|
||||
DdlEstatus.Items.Insert(0, New ListItem("-", ""))
|
||||
End If
|
||||
'Generamos Folio - NumeroContrato
|
||||
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
|
||||
Dim ObjFolio As New ClsGralFolios
|
||||
|
||||
@@ -49,12 +49,11 @@ Partial Class RepContratosCalendario
|
||||
|
||||
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero, CveEstatus:=DdlEstatusConsulta.SelectedValue.ToEntero, CveTipoContrato:=34) Then
|
||||
GvContratos.DataSource = ObjContratos.DtResultados
|
||||
GvContratos.DataBind()
|
||||
End If
|
||||
|
||||
DtAvance = ObjContratos.DtResultados
|
||||
|
||||
ObjContratos.Dispose()
|
||||
GvContratos.DataBind()
|
||||
End Sub
|
||||
Private Sub InicializaCalendar()
|
||||
|
||||
|
||||
@@ -49,13 +49,13 @@
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Contrato">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" Text='<%# Eval("NumeroContrato") %>' OnClick="GoContratoDetalle"></asp:LinkButton>
|
||||
<asp:HyperLink runat="server" Text='<%# Eval("NumeroContrato") %>' NavigateUrl='<%# Eval("CveContrato", "/Transportes/RepContratoDetalle.aspx?CveContrato={0}") %>' ></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Ruta">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRuta" runat="server" Text='<%# Eval("Ruta") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlRuta" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -115,8 +115,8 @@
|
||||
<div class="row">
|
||||
<label class="col-md-4">Ruta</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlRutas" AppendDataBoundItems="true" DataTextField="Ruta"
|
||||
DataValueField="CveRuta" Class="form-control input-sm select2me"
|
||||
<asp:DropDownList ID="DdlRutas" AppendDataBoundItems="true" DataTextField="SubProyecto"
|
||||
DataValueField="CveSubProyecto" Class="form-control input-sm select2me"
|
||||
Width="100%" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVRutas" runat="server" ControlToValidate="DdlRutas"
|
||||
|
||||
@@ -34,15 +34,21 @@ Partial Class ListadoViajes
|
||||
End Sub
|
||||
Private Sub InicializaCombos()
|
||||
'Lista Rutas'
|
||||
Dim ObjRutas As New ClsTransportes()
|
||||
If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
|
||||
DdlRutas.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto in (12699,12700)")
|
||||
DdlRutas.DataBind()
|
||||
|
||||
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
|
||||
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
|
||||
'DdlRutas.DataSource = ObjRutas.DtResultados
|
||||
' DdlRutas.DataBind()
|
||||
' DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", ""))
|
||||
'Lista Destinos'
|
||||
If ObjRutas.GetDestinos() Then
|
||||
|
||||
@@ -62,11 +68,15 @@ Partial Class ListadoViajes
|
||||
Private Sub CargaDatos()
|
||||
'Carga Viajes
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=35) Then
|
||||
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, -1, CveEstatus:=-1, CveTipoContrato:=35) Then
|
||||
GvContratos.DataSource = ObjContratos.DtResultados
|
||||
GvContratos.DataBind()
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
GvContratos.DataBind()
|
||||
'If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=35) Then
|
||||
' GvContratos.DataSource = ObjContratos.DtResultados
|
||||
' GvContratos.DataBind()
|
||||
'End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -86,7 +96,6 @@ Partial Class ListadoViajes
|
||||
End If
|
||||
|
||||
IsMasivo.Visible = True
|
||||
DdlRutas.Text = ""
|
||||
TxtFechaViaje.Text = ""
|
||||
DdlPartida.Text = ""
|
||||
DdlDestino.SelectedValue = ""
|
||||
@@ -141,13 +150,11 @@ Partial Class ListadoViajes
|
||||
ObjContratos.RollBack()
|
||||
Alert("Ocurrió un error al generar viajes masivo", TipoMensaje.MsgError)
|
||||
Finally
|
||||
DdlRutas.Text = ""
|
||||
|
||||
TxtFechaViaje.Text = ""
|
||||
DdlPartida.Text = ""
|
||||
DdlDestino.SelectedValue = ""
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.Dispose()
|
||||
CargaDatos()
|
||||
End Try
|
||||
Else
|
||||
@@ -157,13 +164,13 @@ Partial Class ListadoViajes
|
||||
Try
|
||||
'Agregamos Viaje
|
||||
If BtnGuardar.Text = "Agregar" Then
|
||||
If ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaViaje.Text.ToDate, TxtFechaViaje.Text.ToDate, "", "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, -1, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CveRuta:=DdlRutas.Text.ToEntero, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero) > 0 Then
|
||||
If ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaViaje.Text.ToDate, TxtFechaViaje.Text.ToDate, "", "", -1, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, 0, 0, 0, 2, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero) > 0 Then
|
||||
ObjContratos.Commit()
|
||||
Alert("Viaje agregado correctamente.")
|
||||
End If
|
||||
Else
|
||||
'Actualizamos Viaje
|
||||
If ObjContratos.UpdateContratos(CveContrato.ToEntero, LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaInicial.Text.ToDate, TxtFechaInicial.Text.ToDate, "", "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, -1, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CveRuta:=DdlRutas.Text.ToEntero, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero) = True Then
|
||||
If ObjContratos.UpdateContratos(CveContrato.ToEntero, LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaInicial.Text.ToDate, TxtFechaInicial.Text.ToDate, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, 2, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero) = True Then
|
||||
ObjContratos.Commit()
|
||||
Alert("El viaje se actualizó correctamente.")
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user