diff --git a/App_Code/ClsTransportes.vb b/App_Code/ClsTransportes.vb index 57e0f982c..46f930bfe 100644 --- a/App_Code/ClsTransportes.vb +++ b/App_Code/ClsTransportes.vb @@ -14,8 +14,7 @@ Public Class ClsTransportes Private Data As DataTable Private DSet As New DataSet - Private disposedValue As Boolean = False ' Para detectar llamadas redundantes - 'REGISTRAR CONEXIÓN + Private disposedValue As Boolean = False Private CveConexion As Integer = 0 Public ReadOnly Property DtResultados() As DataTable Get @@ -164,7 +163,6 @@ Public Class ClsTransportes Return Retorno End Function - Public Function GetViajes(CveViaje As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -194,34 +192,6 @@ Public Class ClsTransportes 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 - ' .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 Dim Retorno As Boolean = False @@ -271,42 +241,45 @@ Public Class ClsTransportes #End Region #Region "Boletos" - Public Function AddViajePasajeros(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 + 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) As Integer Dim Retorno As Integer = -1 - DataAdapter("PA_Trans_ViajesPasajerosAdd") + DataAdapter("PA_Trans_ViajesAdd") + 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("@Importe", SqlDbType.Money).Value = Importe + .Add("@Asiento", SqlDbType.Int).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) + OnError("Ocurrió un error al guardar el nuevo viaje.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno End Function - Public Function GetViajesPasajeros(CveViaje As Integer, Optional CveViajePasajero As Integer = 0) As Boolean + Public Function GetViajesPasajeros(CveViaje As Integer, Optional CveViajePasajero As Integer = 0, Optional Estatus As Boolean = False) As Boolean Dim Retorno As Boolean = False - DataAdapter("[PA_Trans_ViajesPasajerosGet]") - If CveViajePasajero <> 0 Then + DataAdapter("PA_Trans_ViajesPasajerosGet") + If Estatus = True Then With SqlAdapter.SelectCommand.Parameters .Add("@CveViaje", SqlDbType.Int).Value = CveViaje - .Add("@CveViajePasajero", SqlDbType.Int).Value = CveViajePasajero + .Add("@Estatus", SqlDbType.Bit).Value = Estatus End With Else With SqlAdapter.SelectCommand.Parameters @@ -318,11 +291,31 @@ Public Class ClsTransportes SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al obtener el catálogo de viajes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al obtener el catálogo de boletos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno End Function + Public Function UpdateViajesPasajeros(CveViajePasajero As Integer, Optional Estatus As Boolean = True, Optional Activar As Boolean = False) As Boolean + + If Activar Then + Dim Retorno As Boolean = False + DataAdapter("PA_Trans_ViajesPasajerosUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveViajePasajero", SqlDbType.Int).Value = CveViajePasajero + .Add("@Estatus", SqlDbType.Int).Value = Estatus + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el boleto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End If + End Function #End Region #Region "Tarifas" diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 45d5cbd21..e545a9329 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1976,7 +1976,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double) As Integer + Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double, Optional CvePrecioListaClonar As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Vta_PrecioListaAdd") @@ -1987,6 +1987,7 @@ Public Class ClsVentas .Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista .Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje .Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada + .Add("@CvePrecioListaClonar", SqlDbType.Int).Value = CvePrecioListaClonar .Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/Planeacion/CatSubProyectos.aspx b/Planeacion/CatSubProyectos.aspx index 677baa2bc..d308ceb0d 100644 --- a/Planeacion/CatSubProyectos.aspx +++ b/Planeacion/CatSubProyectos.aspx @@ -402,8 +402,11 @@ -
- +
+ +
@@ -449,7 +452,7 @@