--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
|
||||
|
||||
#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
|
||||
|
||||
DataAdapter("PA_Trans_ViajesPasajerosAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.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("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||
@@ -310,89 +310,6 @@ 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
|
||||
|
||||
' 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"
|
||||
Public Function GetDestinosTarifas(CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
@@ -469,5 +386,4 @@ Public Class ClsTransportes
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,6 @@ Imports Extensiones
|
||||
Imports Extensiones.ModExtensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
|
||||
Partial Class RepContratoDetalle
|
||||
Inherits ClsPaginas
|
||||
Private Property CveContrato As Integer
|
||||
@@ -85,6 +84,8 @@ Partial Class RepContratoDetalle
|
||||
Dim ObjTransportes As New ClsTransportes
|
||||
If ObjTransportes.GetViajesPasajeros(CveContrato) Then
|
||||
GvViajesPasajeros.DataSource = ObjTransportes.DtResultados
|
||||
BusquedaSeleccionada(ObjTransportes.DtResultados)
|
||||
|
||||
End If
|
||||
ObjTransportes.Dispose()
|
||||
GvViajesPasajeros.DataBind()
|
||||
@@ -122,7 +123,9 @@ Partial Class RepContratoDetalle
|
||||
End Try
|
||||
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)
|
||||
LbPartida.Text = GvRow.DataKey("Partida").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
|
||||
For Each row As DataRow In ObjContratos.DtResultados.Rows
|
||||
' 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
|
||||
DdlRuta.Items.Add(listItem)
|
||||
Next
|
||||
End If
|
||||
DdlRuta.SelectedValue = GvRow.DataKey("CveViaje")
|
||||
ObjContratos.Dispose()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
|
||||
End Sub
|
||||
|
||||
Protected Sub UpdateBoleto(sender As Object, e As EventArgs)
|
||||
|
||||
End Sub
|
||||
Protected Sub EditarBoleto(sender As Object, e As EventArgs)
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs)
|
||||
@@ -171,6 +178,37 @@ Partial Class RepContratoDetalle
|
||||
UpBoletos.Update()
|
||||
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)
|
||||
Dim dtResult As New DataTable()
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Reference in New Issue
Block a user