--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:
@@ -130,19 +130,15 @@ Public Class ClsDestinos
|
|||||||
GC.SuppressFinalize(Me)
|
GC.SuppressFinalize(Me)
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
Public Function GetDestinos(CveDestino As Integer, CveUsuario As Integer, CveEmpresa As Integer, Destino As String, Estatus As Boolean, EsNacional As Boolean, FechaIng As DateTime) As Boolean
|
Public Function GetDestinos(Optional CveRuta As Integer = 0) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Trans_DestinosGet")
|
DataAdapter("PA_Trans_DestinosGet")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
If CveRuta <> 0 Then
|
||||||
.Add("@CveDestino", SqlDbType.Int).Value = CveDestino
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
End With
|
||||||
.Add("@Destino", SqlDbType.VarChar).Value = Destino
|
End If
|
||||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
|
||||||
.Add("@EsNacional", SqlDbType.Bit).Value = EsNacional
|
|
||||||
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
|
||||||
|
|
||||||
End With
|
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
|
|||||||
@@ -9468,10 +9468,9 @@ Public Class ClsPaginas
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Transportes"
|
#Region "Transportes"
|
||||||
PaginaDict.Add("/Transportes/ContratoTransporte.aspx".ToUpper(), 598)
|
|
||||||
PaginaDict.Add("/Transportes/ListadoContratos.aspx".ToUpper(), 598)
|
PaginaDict.Add("/Transportes/ListadoContratos.aspx".ToUpper(), 598)
|
||||||
PaginaDict.Add("/Transportes/CrearViaje.aspx".ToUpper(), 598)
|
|
||||||
PaginaDict.Add("/Transportes/ListadoViajes.aspx".ToUpper(), 598)
|
PaginaDict.Add("/Transportes/ListadoViajes.aspx".ToUpper(), 598)
|
||||||
|
PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 598)
|
||||||
#End Region
|
#End Region
|
||||||
'Antes de aquí.
|
'Antes de aquí.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
Imports System.Data
|
||||||
Imports System.Data
|
|
||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
|
|
||||||
@@ -136,7 +135,7 @@ Public Class ClsTransportes
|
|||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Métodos"
|
#Region "Viajes"
|
||||||
Public Function AddViajes(CveRuta As Integer, CveAF As Integer, CvePersonal As Integer, CveEmpresa As Integer, Fecha As DateTime, CvePartida As Integer, CveDestino As Integer, Optional IsMasivo As Boolean = False, Optional CveMasivo As Integer = -1) As Integer
|
Public Function AddViajes(CveRuta As Integer, CveAF As Integer, CvePersonal As Integer, CveEmpresa As Integer, Fecha As DateTime, CvePartida As Integer, CveDestino As Integer, Optional IsMasivo As Boolean = False, Optional CveMasivo As Integer = -1) As Integer
|
||||||
Dim Retorno As Integer = -1
|
Dim Retorno As Integer = -1
|
||||||
|
|
||||||
@@ -170,90 +169,59 @@ Public Class ClsTransportes
|
|||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
DataAdapter("PA_Trans_ViajesGet")
|
DataAdapter("PA_Trans_ViajesGet")
|
||||||
If CveViaje > 0 Then
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@CveViajeSeleccionado", SqlDbType.Int).Value = CveViaje
|
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
||||||
End With
|
|
||||||
End If
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
If CveViaje > 0 AndAlso Data IsNot Nothing AndAlso Data.Rows.Count > 0 Then
|
|
||||||
CveRuta = Data.Rows(0)("CveRuta").ToString.ToEntero
|
|
||||||
CveAF = Data.Rows(0)("CveAF").ToString.ToEntero
|
|
||||||
CvePersonal = Data.Rows(0)("CvePersonal").ToString.ToEntero
|
|
||||||
CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
|
|
||||||
CvePartida = Data.Rows(0)("CvePartida").ToString.ToEntero
|
|
||||||
CveDestino = Data.Rows(0)("CveDestino").ToString.ToEntero
|
|
||||||
CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero
|
|
||||||
Fecha = Data.Rows(0)("Fecha").ToString.ToDate
|
|
||||||
End If
|
|
||||||
Retorno = True
|
|
||||||
Catch ex As Exception
|
|
||||||
OnError("Ocurrió un error al obtener el catálogo de viajes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean
|
|
||||||
Dim Retorno As Boolean = False
|
|
||||||
|
|
||||||
DataAdapter("PA_Trans_ViajesGet")
|
|
||||||
If CveViaje > 0 Then
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
|
||||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
|
||||||
End With
|
|
||||||
End If
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
If CveViaje > 0 AndAlso Data IsNot Nothing AndAlso Data.Rows.Count > 0 Then
|
|
||||||
CveRuta = Data.Rows(0)("CveRuta").ToString.ToEntero
|
|
||||||
CveAF = Data.Rows(0)("CveAF").ToString.ToEntero
|
|
||||||
CvePersonal = Data.Rows(0)("CvePersonal").ToString.ToEntero
|
|
||||||
CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
|
|
||||||
CvePartida = Data.Rows(0)("CvePartida").ToString.ToEntero
|
|
||||||
CveDestino = Data.Rows(0)("CveDestino").ToString.ToEntero
|
|
||||||
CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero
|
|
||||||
Fecha = Data.Rows(0)("Fecha").ToString.ToDate
|
|
||||||
End If
|
|
||||||
Retorno = True
|
|
||||||
Catch ex As Exception
|
|
||||||
OnError("Ocurrió un error al obtener el catálogo de viajes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function AddViajePasajero(CveRuta As Integer, CveAF As Integer, CvePersonal As Integer, CveEmpresa As Integer, Fecha As DateTime, CvePartida As Integer, CveDestino As Integer, Optional IsMasivo As Boolean = False, Optional CveMasivo As Integer = -1) As Integer
|
|
||||||
Dim Retorno As Integer = -1
|
|
||||||
|
|
||||||
DataAdapter("PA_Trans_ViajesAdd")
|
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveViaje", SqlDbType.Int).Direction = ParameterDirection.Output
|
.Add("@CveViaje", SqlDbType.Int).Value = CveViaje
|
||||||
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
|
||||||
.Add("@CveAF", SqlDbType.Int).Value = CveAF
|
|
||||||
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
|
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
|
|
||||||
.Add("@CvePartida", SqlDbType.Int).Value = CvePartida
|
|
||||||
.Add("@CveDestino", SqlDbType.Int).Value = CveDestino
|
|
||||||
.Add("@IsMasivo", SqlDbType.Bit).Value = IsMasivo
|
|
||||||
.Add("@CveMasivo", SqlDbType.Int).Value = CveMasivo
|
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveViaje").Value.ToString)
|
If CveViaje > 0 AndAlso Data IsNot Nothing AndAlso Data.Rows.Count > 0 Then
|
||||||
|
CveRuta = Data.Rows(0)("CveRuta").ToString.ToEntero
|
||||||
|
CveAF = Data.Rows(0)("CveAF").ToString.ToEntero
|
||||||
|
CvePersonal = Data.Rows(0)("CvePersonal").ToString.ToEntero
|
||||||
|
CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
|
||||||
|
CvePartida = Data.Rows(0)("CvePartida").ToString.ToEntero
|
||||||
|
CveDestino = Data.Rows(0)("CveDestino").ToString.ToEntero
|
||||||
|
CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero
|
||||||
|
Fecha = Data.Rows(0)("Fecha").ToString.ToDate
|
||||||
|
Ruta = Data.Rows(0)("Ruta").ToString
|
||||||
|
End If
|
||||||
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al guardar el nuevo viaje.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al obtener el catálogo de viajes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
'Public Function AddViajePasajero(CveRuta As Integer, CveAF As Integer, CvePersonal As Integer, CveEmpresa As Integer, Fecha As DateTime, CvePartida As Integer, CveDestino As Integer, Optional IsMasivo As Boolean = False, Optional CveMasivo As Integer = -1) As Integer
|
||||||
|
' Dim Retorno As Integer = -1
|
||||||
|
|
||||||
|
' DataAdapter("PA_Trans_ViajesAdd")
|
||||||
|
|
||||||
|
' With SqlAdapter.SelectCommand.Parameters
|
||||||
|
' .Add("@CveViaje", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
' .Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||||
|
' .Add("@CveAF", SqlDbType.Int).Value = CveAF
|
||||||
|
' .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
|
||||||
|
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
' .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
|
||||||
|
' .Add("@CvePartida", SqlDbType.Int).Value = CvePartida
|
||||||
|
' .Add("@CveDestino", SqlDbType.Int).Value = CveDestino
|
||||||
|
' .Add("@IsMasivo", SqlDbType.Bit).Value = IsMasivo
|
||||||
|
' .Add("@CveMasivo", SqlDbType.Int).Value = CveMasivo
|
||||||
|
' End With
|
||||||
|
|
||||||
|
' Try
|
||||||
|
' SqlAdapter.Fill(Data)
|
||||||
|
' Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveViaje").Value.ToString)
|
||||||
|
|
||||||
|
' Catch ex As Exception
|
||||||
|
' OnError("Ocurrió un error al guardar el nuevo viaje.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
' End Try
|
||||||
|
|
||||||
|
' Return Retorno
|
||||||
|
'End Function
|
||||||
|
|
||||||
Public Function RemoveViaje(Optional CveViaje As Integer = -1, Optional CveMasivo As Integer = -1) As Boolean
|
Public Function RemoveViaje(Optional CveViaje As Integer = -1, Optional CveMasivo As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
@@ -301,4 +269,55 @@ Public Class ClsTransportes
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
#Region "Boletos"
|
||||||
|
Public Function AddViajePasajero(CveViaje As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal, Asiento As Integer, Nombre As String, Visa As String, Celular As String, Sexo As Boolean, Observacion As String, CveUsuario As Integer) As Integer
|
||||||
|
Dim Retorno As Integer = -1
|
||||||
|
|
||||||
|
DataAdapter("PA_Trans_ViajesPasajerosAdd")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveViajePasajero", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
.Add("@CveViaje", SqlDbType.Int).Value = CveViaje
|
||||||
|
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
||||||
|
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||||
|
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe
|
||||||
|
.Add("@Asiento", SqlDbType.TinyInt).Value = Asiento
|
||||||
|
.Add("@Nombre", SqlDbType.VarChar).Value = Nombre
|
||||||
|
.Add("@Visa", SqlDbType.VarChar).Value = Visa
|
||||||
|
.Add("@Celular", SqlDbType.VarChar).Value = Celular
|
||||||
|
.Add("@Sexo", SqlDbType.Bit).Value = Sexo
|
||||||
|
.Add("@Observacion", SqlDbType.VarChar).Value = Observacion
|
||||||
|
.Add("@Estatus", SqlDbType.Bit).Value = 1
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveViajePasajero").Value.ToString)
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al guardar el nuevo boleto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "Tarifas"
|
||||||
|
Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Trans_DestinosTarifasGet")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
||||||
|
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener la tarifa de los destinos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -42,8 +42,13 @@
|
|||||||
margin: 5px;
|
margin: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: white;
|
color: white;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nodisponible:hover {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.chofer {
|
.chofer {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -163,26 +168,6 @@
|
|||||||
|
|
||||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="upPanel">
|
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="upPanel">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="row margin-bottom-5" id="TrDestino" runat="server">
|
|
||||||
<label class="col-md-4 bold">
|
|
||||||
<asp:Label runat="server" Text="Destino:"></asp:Label></label><div
|
|
||||||
class="col-md-8">
|
|
||||||
|
|
||||||
<asp:DropDownList ID="DdlDestino" AppendDataBoundItems="true" DataTextField="Destino"
|
|
||||||
AutoPostBack="true"
|
|
||||||
DataValueField="CveDestino" Class="table-group-action-input form-control input-inline text-center"
|
|
||||||
OnTextChanged="CotizarTarifa"
|
|
||||||
Width="200px" runat="server">
|
|
||||||
</asp:DropDownList>
|
|
||||||
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="DdlDestino"
|
|
||||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Destino''</b> es necesario, por favor ingréselo."
|
|
||||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEDestino" runat="server" HighlightCssClass="vco"
|
|
||||||
TargetControlID="RFVDestino" Width="400px" BehaviorID="_content_VCEDestino">
|
|
||||||
</ajax:ValidatorCalloutExtender>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row margin-bottom-5" id="TrPartida" runat="server">
|
<div class="row margin-bottom-5" id="TrPartida" runat="server">
|
||||||
<label class="col-md-4 bold">
|
<label class="col-md-4 bold">
|
||||||
<asp:Label runat="server" Text="Partida:"></asp:Label></label><div
|
<asp:Label runat="server" Text="Partida:"></asp:Label></label><div
|
||||||
@@ -203,10 +188,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<asp:Label runat="server" ID="TxtCosto" CssClass="tarifa"></asp:Label>
|
<div class="row margin-bottom-5" id="TrDestino" runat="server">
|
||||||
<asp:Button ID="BtnGuardar" Visible="False" OnClick="AddBoleto" runat="server" CssClass="btn btn-success"
|
<label class="col-md-4 bold">
|
||||||
Text="Comprar Boleto"
|
<asp:Label runat="server" Text="Destino:"></asp:Label></label><div
|
||||||
ValidationGroup="GrpGuardar"></asp:Button>
|
class="col-md-8">
|
||||||
|
|
||||||
|
<asp:DropDownList ID="DdlDestino" AppendDataBoundItems="true" DataTextField="Destino"
|
||||||
|
AutoPostBack="true"
|
||||||
|
DataValueField="CveDestino" Class="table-group-action-input form-control input-inline text-center"
|
||||||
|
OnTextChanged="CotizarTarifa"
|
||||||
|
Width="200px" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="DdlDestino"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Destino''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEDestino" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVDestino" Width="400px" BehaviorID="_content_VCEDestino">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<asp:Label runat="server" ID="TxtCosto" CssClass="tarifa"></asp:Label>
|
||||||
|
<asp:Button ID="BtnGuardar" Visible="False" OnClick="AddBoleto" runat="server" CssClass="btn btn-success"
|
||||||
|
Text="Comprar Boleto"
|
||||||
|
ValidationGroup="GrpGuardar"></asp:Button>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
@@ -217,7 +222,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-2">
|
<div class="col-md-3">
|
||||||
<div class="portlet light xspadding bordered margin-bottom-10">
|
<div class="portlet light xspadding bordered margin-bottom-10">
|
||||||
|
|
||||||
<contenttemplate>
|
<contenttemplate>
|
||||||
@@ -241,7 +246,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td>
|
<td>
|
||||||
<asp:LinkButton OnClick="OnLinkButtonClick" CssClass="nodisponible" ID="A3" runat="server"
|
<asp:LinkButton OnClick="OnLinkButtonClick" CssClass="disponible" ID="A3" runat="server"
|
||||||
Text="<i class='fa fa-user my-1'><br/>3</i>" />
|
Text="<i class='fa fa-user my-1'><br/>3</i>" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
Partial Class Boletos
|
Partial Class Boletos
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
Private Property asientoSeleccionado As String
|
Private Property AsientoSeleccionado As String
|
||||||
Get
|
Get
|
||||||
Return ViewState("asientoSeleccionado").ToString()
|
Return ViewState("AsientoSeleccionado").ToString()
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
ViewState("asientoSeleccionado") = value
|
ViewState("AsientoSeleccionado") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Private Property Importe As Decimal
|
Private Property Importe As Decimal
|
||||||
@@ -21,12 +21,20 @@ Partial Class Boletos
|
|||||||
|
|
||||||
Private Property CveViaje As Integer
|
Private Property CveViaje As Integer
|
||||||
Get
|
Get
|
||||||
Return ViewState("CveViaje").ToString().toentero
|
Return ViewState("CveViaje").ToString().ToEntero
|
||||||
End Get
|
End Get
|
||||||
Set(value As Integer)
|
Set(value As Integer)
|
||||||
ViewState("CveViaje") = value
|
ViewState("CveViaje") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Private Property CveRuta As Integer
|
||||||
|
Get
|
||||||
|
Return ViewState("CveRuta").ToString().ToEntero
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveRuta") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
@@ -34,11 +42,13 @@ Partial Class Boletos
|
|||||||
If Request.QueryString("CveViaje") Is Nothing Then
|
If Request.QueryString("CveViaje") Is Nothing Then
|
||||||
Response.Redirect("/Transportes/ListadoViajes.aspx")
|
Response.Redirect("/Transportes/ListadoViajes.aspx")
|
||||||
End If
|
End If
|
||||||
|
AsientoSeleccionado = ""
|
||||||
|
CveRuta = 0
|
||||||
CveViaje = Request.QueryString("CveViaje").ToEntero
|
CveViaje = Request.QueryString("CveViaje").ToEntero
|
||||||
|
|
||||||
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
||||||
InicializaCombos()
|
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
|
InicializaCombos()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -47,8 +57,9 @@ Partial Class Boletos
|
|||||||
'Datos Viaje
|
'Datos Viaje
|
||||||
Dim ObjViaje As New ClsTransportes
|
Dim ObjViaje As New ClsTransportes
|
||||||
Dim retorno As Boolean = ObjViaje.GetViajes(CveViaje.ToEntero, UsuarioActual.CveEmpresa)
|
Dim retorno As Boolean = ObjViaje.GetViajes(CveViaje.ToEntero, UsuarioActual.CveEmpresa)
|
||||||
|
ViewState("CveRuta") = ObjViaje.CveRuta
|
||||||
If retorno Then
|
If retorno Then
|
||||||
'TxtRuta.Text = ObjViaje.Ruta.ToString
|
TxtRuta.Text = ObjViaje.Ruta
|
||||||
TxtFecha.Text = ObjViaje.Fecha.ToString
|
TxtFecha.Text = ObjViaje.Fecha.ToString
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -57,7 +68,7 @@ Partial Class Boletos
|
|||||||
Protected Sub InicializaCombos()
|
Protected Sub InicializaCombos()
|
||||||
'Lista Destinos''carga específicos
|
'Lista Destinos''carga específicos
|
||||||
Dim ObjDestinos As New ClsDestinos()
|
Dim ObjDestinos As New ClsDestinos()
|
||||||
If ObjDestinos.GetDestinos(-1, -1, -1, "", True, True, DateTime.Now) Then
|
If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
|
||||||
|
|
||||||
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
@@ -76,18 +87,20 @@ Partial Class Boletos
|
|||||||
If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then
|
If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then
|
||||||
|
|
||||||
Dim ObjDestinos As New ClsTransportes()
|
Dim ObjDestinos As New ClsTransportes()
|
||||||
If ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) Then
|
Dim retorno As Boolean = ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero)
|
||||||
Dim tImporte As Decimal = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal
|
Dim ImporteR As Decimal = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal
|
||||||
If tImporte > 0 Then
|
If retorno Then
|
||||||
TxtCosto.Text = $"El precio de su boleto es ${tImporte}"
|
If ImporteR > 0 Then
|
||||||
|
Dim redondeado As String = CStr(Math.Round(ImporteR, 2))
|
||||||
|
ViewState("Importe") = redondeado
|
||||||
|
TxtCosto.Text = $"El precio de su boleto es ${Importe}"
|
||||||
BtnGuardar.Visible = True
|
BtnGuardar.Visible = True
|
||||||
upPanel.Visible = True
|
upPanel.Visible = True
|
||||||
Importe = tImporte
|
|
||||||
Else
|
Else
|
||||||
TxtCosto.Text = ""
|
TxtCosto.Text = ""
|
||||||
BtnGuardar.Visible = False
|
BtnGuardar.Visible = False
|
||||||
upPanel.Visible = False
|
upPanel.Visible = False
|
||||||
Importe = 0
|
ViewState("Importe") = 0
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -97,25 +110,21 @@ Partial Class Boletos
|
|||||||
Dim linkButton As LinkButton = DirectCast(sender, LinkButton)
|
Dim linkButton As LinkButton = DirectCast(sender, LinkButton)
|
||||||
Dim buttonID As String = linkButton.ID
|
Dim buttonID As String = linkButton.ID
|
||||||
linkButton.CssClass += " activo"
|
linkButton.CssClass += " activo"
|
||||||
asientoSeleccionado = buttonID
|
ViewState("AsientoSeleccionado") = buttonID
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub AddBoleto(sender As Object, e As EventArgs)
|
Protected Sub AddBoleto(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
If asientoSeleccionado = "" Then
|
If AsientoSeleccionado = "" Then
|
||||||
Alert("Se requiere seleccionar su asiento")
|
Alert("Se requiere seleccionar su asiento", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Page.Response.Write("<script>console.log('El resultado de tu variable" + CveViaje.GetType.ToString + "')</script>")
|
|
||||||
'Page.Response.Write("<script>console.log('El resultado de tu variable" + CveViaje.ToEntero.ToString + "')</script>")
|
|
||||||
|
|
||||||
Dim ObjTransporte As New ClsTransportes()
|
Dim ObjTransporte As New ClsTransportes()
|
||||||
ObjTransporte.IniciaTransacSQL()
|
ObjTransporte.IniciaTransacSQL()
|
||||||
|
|
||||||
Try
|
Try
|
||||||
asientoSeleccionado = asientoSeleccionado.Replace("A", "")
|
AsientoSeleccionado = AsientoSeleccionado.Replace("A", "")
|
||||||
Dim retorno As Integer = ObjTransporte.AddViajePasajero(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, 0.0, asientoSeleccionado.ToEntero,
|
Dim retorno As Integer = ObjTransporte.AddViajePasajero(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario)
|
||||||
TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario)
|
|
||||||
|
|
||||||
If retorno > 1 Then
|
If retorno > 1 Then
|
||||||
ObjTransporte.Commit()
|
ObjTransporte.Commit()
|
||||||
|
|||||||
@@ -24,11 +24,10 @@
|
|||||||
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||||
<contenttemplate>
|
<contenttemplate>
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LBAgregarViaje" runat="server"
|
<asp:LinkButton ID="LBAgregarViaje" runat="server"><i class='fa fa-plus'></i>Agregar viaje</asp:LinkButton>
|
||||||
><i class='fa fa-plus'></i>Agregar viaje</asp:LinkButton>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:HyperLink ID="LBListadoContratos" runat="server" NavigateUrl="ListadoContratos.aspx"
|
<asp:HyperLink ID="LBListadoContratos" runat="server" NavigateUrl="ListadoContratos.aspx"
|
||||||
Target="_blank"><i class='fa fa-file'></i>Contratos</asp:HyperLink>
|
Target="_blank"><i class='fa fa-file'></i>Contratos</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -104,6 +103,9 @@
|
|||||||
CssClass="btn btn-circle btn-sm red" OnClick="RemoveViaje" Text="<i class='fa fa-trash'></i>"
|
CssClass="btn btn-circle btn-sm red" OnClick="RemoveViaje" Text="<i class='fa fa-trash'></i>"
|
||||||
data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("CveMasivo").ToString <> "", "Eliminación masiva", "Confirmar") %>'
|
data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("CveMasivo").ToString <> "", "Eliminación masiva", "Confirmar") %>'
|
||||||
data-btn-ok-label="si" />
|
data-btn-ok-label="si" />
|
||||||
|
<asp:LinkButton ID="BtnViaje" runat="server" AlternateText="Viaje"
|
||||||
|
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-arrow-right'></i>" OnClick="GoViaje"
|
||||||
|
/>
|
||||||
|
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|||||||
@@ -41,10 +41,9 @@ Partial Class ListadoViajes
|
|||||||
|
|
||||||
'Lista Destinos'
|
'Lista Destinos'
|
||||||
Dim ObjDestinos As New ClsDestinos()
|
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
|
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
DdlPartida.DataSource = ObjDestinos.DtResultados
|
DdlPartida.DataSource = ObjDestinos.DtResultados
|
||||||
DdlPartida.DataBind()
|
DdlPartida.DataBind()
|
||||||
DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", ""))
|
DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", ""))
|
||||||
@@ -72,7 +71,7 @@ Partial Class ListadoViajes
|
|||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
Dim ObjTransportes As New ClsTransportes
|
Dim ObjTransportes As New ClsTransportes
|
||||||
|
|
||||||
If ObjTransportes.GetViajes() Then
|
If ObjTransportes.GetViajes(-1, UsuarioActual.CveEmpresa) Then
|
||||||
GvViajes.DataSource = ObjTransportes.DtResultados
|
GvViajes.DataSource = ObjTransportes.DtResultados
|
||||||
ObjTransportes.Dispose()
|
ObjTransportes.Dispose()
|
||||||
GvViajes.DataBind()
|
GvViajes.DataBind()
|
||||||
@@ -97,10 +96,8 @@ Partial Class ListadoViajes
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub AddViaje(sender As Object, e As EventArgs)
|
Protected Sub AddViaje(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
Dim ObjTransportes As New ClsTransportes
|
Dim ObjTransportes As New ClsTransportes
|
||||||
|
|
||||||
|
|
||||||
ObjTransportes.IniciaTransacSQL()
|
ObjTransportes.IniciaTransacSQL()
|
||||||
|
|
||||||
If IsMasivo.Checked = True Then
|
If IsMasivo.Checked = True Then
|
||||||
@@ -109,7 +106,7 @@ Partial Class ListadoViajes
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
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 fechaInicial As DateTime = DateTime.Parse(TxtFechaInicial.Text)
|
||||||
Dim frecuencia As Integer = Integer.Parse(TxtFrecuencia.Text)
|
Dim frecuencia As Integer = Integer.Parse(TxtFrecuencia.Text)
|
||||||
@@ -141,7 +138,6 @@ Partial Class ListadoViajes
|
|||||||
ObjTransportes.Dispose()
|
ObjTransportes.Dispose()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
Alert("El viaje masivo se registró correctamente.", TipoMensaje.MsgInformacion)
|
Alert("El viaje masivo se registró correctamente.", TipoMensaje.MsgInformacion)
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Try
|
Try
|
||||||
If BtnGuardar.Text = "Guardar" Then
|
If BtnGuardar.Text = "Guardar" Then
|
||||||
@@ -157,18 +153,14 @@ Partial Class ListadoViajes
|
|||||||
TxtFechaViaje.Text = ""
|
TxtFechaViaje.Text = ""
|
||||||
DdlPartida.Text = ""
|
DdlPartida.Text = ""
|
||||||
DdlDestino.SelectedValue = ""
|
DdlDestino.SelectedValue = ""
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Dim id As Integer = Convert.ToInt32(Request.QueryString("CveViaje"))
|
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(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)
|
Alert("El viaje se modificó correctamente.", TipoMensaje.MsgInformacion)
|
||||||
ObjTransportes.Commit()
|
ObjTransportes.Commit()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ObjTransportes.RollBack()
|
ObjTransportes.RollBack()
|
||||||
@@ -203,7 +195,7 @@ Partial Class ListadoViajes
|
|||||||
|
|
||||||
Protected Sub RemoveViaje(sender As Object, e As EventArgs)
|
Protected Sub RemoveViaje(sender As Object, e As EventArgs)
|
||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
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
|
Dim ObjTransportes As New ClsTransportes
|
||||||
|
|
||||||
@@ -233,6 +225,12 @@ Partial Class ListadoViajes
|
|||||||
Protected Sub ToggleMasivo(sender As Object, e As EventArgs)
|
Protected Sub ToggleMasivo(sender As Object, e As EventArgs)
|
||||||
DivFechaMasivo.Visible = IsMasivo.Checked
|
DivFechaMasivo.Visible = IsMasivo.Checked
|
||||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
||||||
|
|
||||||
End Sub
|
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
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user