--En ClsTransportes cambio nombre a variable para unificarlo con la base de datos @CveViaje. Se separó modal para editar datos de usuario o datos del viaje y se crearon sus métodos. También se agregar un OnChange para cuando el select tome otra ruta, indique los asientos que no están disponibles. En proceso...
This commit is contained in:
@@ -135,14 +135,14 @@ Public Class ClsTransportes
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Boletos"
|
#Region "Boletos"
|
||||||
Public Function AddViajesPasajeros(CveContrato 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, CveVendedor As Integer) As Integer
|
Public Function AddViajesPasajeros(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, CveVendedor As Integer) As Integer
|
||||||
Dim Retorno As Integer = -1
|
Dim Retorno As Integer = -1
|
||||||
|
|
||||||
DataAdapter("PA_Trans_ViajesPasajerosAdd")
|
DataAdapter("PA_Trans_ViajesPasajerosAdd")
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveViajePasajero", SqlDbType.Int).Direction = ParameterDirection.Output
|
.Add("@CveViajePasajero", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
|
.Add("@CveViaje", SqlDbType.Int).Value = CveViaje
|
||||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
||||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||||
.Add("@Importe", SqlDbType.Money).Value = Importe
|
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||||
@@ -310,89 +310,6 @@ Public Class ClsTransportes
|
|||||||
End Function
|
End Function
|
||||||
#End Region
|
#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
|
|
||||||
|
|
||||||
' 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
|
|
||||||
|
|
||||||
' 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
|
|
||||||
|
|
||||||
' 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
|
|
||||||
|
|
||||||
|
|
||||||
' 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
|
|
||||||
|
|
||||||
' Return Retorno
|
|
||||||
' End Function
|
|
||||||
|
|
||||||
'#End Region
|
|
||||||
|
|
||||||
#Region "Importes"
|
#Region "Importes"
|
||||||
Public Function GetDestinosTarifas(CveSubProyecto As Integer, 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
|
Dim Retorno As Boolean = False
|
||||||
@@ -469,5 +386,4 @@ Public Class ClsTransportes
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
<style>
|
<style>
|
||||||
.my-1 {
|
.my-1 {
|
||||||
margin-block: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx-1 {
|
.mx-1 {
|
||||||
@@ -95,10 +94,7 @@
|
|||||||
<ajax:TabPanel runat="server" HeaderText="Información General" CssClass="tabBodyOverride">
|
<ajax:TabPanel runat="server" HeaderText="Información General" CssClass="tabBodyOverride">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<%-- Datos del Contrato --%>
|
<%-- Datos del Contrato --%>
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-8">
|
|
||||||
<div class="portlet light bordered">
|
<div class="portlet light bordered">
|
||||||
|
|
||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
<div class="tools">
|
<div class="tools">
|
||||||
<a href="javascript;" data-idchekbox="C_chkexpand" class=" collapse" data-original-title=""
|
<a href="javascript;" data-idchekbox="C_chkexpand" class=" collapse" data-original-title=""
|
||||||
@@ -246,10 +242,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>
|
||||||
@@ -317,6 +309,8 @@
|
|||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar" OnClick="EditarBoleto"
|
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar" OnClick="EditarBoleto"
|
||||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" ToolTip="Editar" />
|
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" ToolTip="Editar" />
|
||||||
|
<asp:LinkButton ID="BtnReAgendar" runat="server" AlternateText="Editar" OnClick="CambiarBoleto"
|
||||||
|
CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-repeat'></i>" ToolTip="Editar" />
|
||||||
<asp:LinkButton ID="BtnCancelar" runat="server" AlternateText="Activar"
|
<asp:LinkButton ID="BtnCancelar" runat="server" AlternateText="Activar"
|
||||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-cancel'></i>"
|
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-cancel'></i>"
|
||||||
data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("Estatus").ToString = "True", "Cancelar Boleto", "Reactivar") %>'
|
data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("Estatus").ToString = "True", "Cancelar Boleto", "Reactivar") %>'
|
||||||
@@ -351,13 +345,15 @@
|
|||||||
<div class="row" style="display: flex; align-items: center;">
|
<div class="row" style="display: flex; align-items: center;">
|
||||||
<%-- Datos del Boleto --%>
|
<%-- Datos del Boleto --%>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
|
<asp:Panel runat="server" ID="PnEditarViaje" Visible="false">
|
||||||
<div class="row margin-bottom-5">
|
<div class="row margin-bottom-5">
|
||||||
<label class="col-md-4 bold">Ruta</label>
|
<label class="col-md-4 bold">Ruta</label>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<asp:DropDownList runat="server" ID="DdlRuta" CssClass="form-control select2me input-sm"
|
<asp:DropDownList runat="server" ID="DdlRuta" CssClass="form-control select2me input-sm"
|
||||||
DataTextField="SubProyecto"
|
DataTextField="SubProyecto"
|
||||||
DataValueField="CveSubProyecto"
|
DataValueField="CveSubProyecto" OnSelectedIndexChanged="OnChangeRuta" AutoPostBack="true"
|
||||||
Width="100%"></asp:DropDownList>
|
Width="100%">
|
||||||
|
</asp:DropDownList>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -385,6 +381,26 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row margin-bottom-5">
|
||||||
|
<label class="col-md-4 bold">Creado</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:Label CssClass="form-control" runat="server"
|
||||||
|
ID="LbCreado">Creado</asp:Label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row margin-bottom-5">
|
||||||
|
<label class="col-md-4 bold">Asiento</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
|
||||||
|
<asp:Label CssClass="form-control" runat="server"
|
||||||
|
ID="LbAsiento">Asiento</asp:Label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</asp:Panel>
|
||||||
|
|
||||||
|
<asp:Panel runat="server" ID="PnEditarUsuario" Visible="false">
|
||||||
<div class="row margin-bottom-5">
|
<div class="row margin-bottom-5">
|
||||||
<label class="col-md-4 bold">Nombre</label>
|
<label class="col-md-4 bold">Nombre</label>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
@@ -429,25 +445,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</asp:Panel>
|
||||||
<div class="row margin-bottom-5">
|
|
||||||
<label class="col-md-4 bold">Creado</label>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<asp:Label CssClass="form-control" runat="server"
|
|
||||||
ID="LbCreado">Creado</asp:Label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row margin-bottom-5">
|
|
||||||
<label class="col-md-4 bold">Asiento</label>
|
|
||||||
<div class="col-md-8">
|
|
||||||
|
|
||||||
<asp:Label CssClass="form-control" runat="server"
|
|
||||||
ID="LbAsiento">Asiento</asp:Label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<%-- Asientos --%>
|
<%-- Asientos --%>
|
||||||
<asp:UpdatePanel runat="server" ID="UpBoletos">
|
<asp:UpdatePanel runat="server" ID="UpBoletos">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ Imports Extensiones
|
|||||||
Imports Extensiones.ModExtensiones
|
Imports Extensiones.ModExtensiones
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
|
||||||
|
|
||||||
Partial Class RepContratoDetalle
|
Partial Class RepContratoDetalle
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
Private Property CveContrato As Integer
|
Private Property CveContrato As Integer
|
||||||
@@ -85,6 +84,8 @@ Partial Class RepContratoDetalle
|
|||||||
Dim ObjTransportes As New ClsTransportes
|
Dim ObjTransportes As New ClsTransportes
|
||||||
If ObjTransportes.GetViajesPasajeros(CveContrato) Then
|
If ObjTransportes.GetViajesPasajeros(CveContrato) Then
|
||||||
GvViajesPasajeros.DataSource = ObjTransportes.DtResultados
|
GvViajesPasajeros.DataSource = ObjTransportes.DtResultados
|
||||||
|
BusquedaSeleccionada(ObjTransportes.DtResultados)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
ObjTransportes.Dispose()
|
ObjTransportes.Dispose()
|
||||||
GvViajesPasajeros.DataBind()
|
GvViajesPasajeros.DataBind()
|
||||||
@@ -122,7 +123,9 @@ Partial Class RepContratoDetalle
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub EditarBoleto(sender As Object, e As EventArgs)
|
Protected Sub CambiarBoleto(sender As Object, e As EventArgs)
|
||||||
|
PnEditarViaje.Visible = True
|
||||||
|
PnEditarUsuario.Visible = False
|
||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
LbPartida.Text = GvRow.DataKey("Partida").ToString()
|
LbPartida.Text = GvRow.DataKey("Partida").ToString()
|
||||||
LbDestino.Text = GvRow.DataKey("Destino").ToString()
|
LbDestino.Text = GvRow.DataKey("Destino").ToString()
|
||||||
@@ -141,18 +144,22 @@ Partial Class RepContratoDetalle
|
|||||||
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, -1, CveEstatus:=-1, CveTipoContrato:=35) Then
|
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, -1, CveEstatus:=-1, CveTipoContrato:=35) Then
|
||||||
For Each row As DataRow In ObjContratos.DtResultados.Rows
|
For Each row As DataRow In ObjContratos.DtResultados.Rows
|
||||||
' Asigna los valores de la columna deseada al ListItem
|
' Asigna los valores de la columna deseada al ListItem
|
||||||
Dim listItem As New ListItem(row("CveContrato").ToString(), row("CveContrato").ToString())
|
Dim listItem As New ListItem(row("SubProyecto").ToString() + " - " + row("FechaInicial").ToString(), row("CveContrato").ToString())
|
||||||
|
|
||||||
' Agrega el ListItem al DropDownList
|
' Agrega el ListItem al DropDownList
|
||||||
DdlRuta.Items.Add(listItem)
|
DdlRuta.Items.Add(listItem)
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
DdlRuta.SelectedValue = GvRow.DataKey("CveViaje")
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
|
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub UpdateBoleto(sender As Object, e As EventArgs)
|
Protected Sub UpdateBoleto(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Protected Sub EditarBoleto(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs)
|
Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs)
|
||||||
@@ -171,6 +178,37 @@ Partial Class RepContratoDetalle
|
|||||||
UpBoletos.Update()
|
UpBoletos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub OnChangeRuta(sender As Object, e As EventArgs)
|
||||||
|
Dim ObjTransportes As New ClsTransportes
|
||||||
|
If ObjTransportes.GetViajesPasajeros(DdlRuta.SelectedValue.ToEntero) Then
|
||||||
|
BusquedaSeleccionada(ObjTransportes.DtResultados)
|
||||||
|
End If
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BusquedaSeleccionada(dt As DataTable)
|
||||||
|
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||||
|
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
|
||||||
|
|
||||||
|
For i As Integer = 1 To 50
|
||||||
|
Dim lnk As LinkButton = CType(cph.FindControl($"A{i}"), LinkButton)
|
||||||
|
If lnk IsNot Nothing Then
|
||||||
|
lnk.Enabled = True
|
||||||
|
lnk.CssClass = "disponible"
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
For Each dr As DataRow In dt.Rows
|
||||||
|
Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton)
|
||||||
|
If lnk IsNot Nothing Then
|
||||||
|
lnk.Enabled = False
|
||||||
|
lnk.CssClass = "nodisponible"
|
||||||
|
lnk.ToolTip = dr("Nombre").ToString
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
Protected Sub ImprimirBoleto(sender As Object, e As EventArgs)
|
Protected Sub ImprimirBoleto(sender As Object, e As EventArgs)
|
||||||
Dim dtResult As New DataTable()
|
Dim dtResult As New DataTable()
|
||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
|
|||||||
Reference in New Issue
Block a user