Se trabajo en los modelos y PA de Rutas y Destinos. Se trabajó en la lista de choferes. Se trabajó en la creación de viajes
This commit is contained in:
156
App_Code/ClsDestinos.vb
Normal file
156
App_Code/ClsDestinos.vb
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
Imports System.Data
|
||||||
|
Imports System.Data.SqlClient
|
||||||
|
Imports Extensiones
|
||||||
|
|
||||||
|
Public Class ClsDestinos
|
||||||
|
Implements IDisposable
|
||||||
|
|
||||||
|
#Region "Campos"
|
||||||
|
'SQL
|
||||||
|
Private SqlConexion As SqlConnection
|
||||||
|
Private SqlAdapter As SqlDataAdapter
|
||||||
|
Private SqlCommand As SqlCommand
|
||||||
|
Private SqlTransacc As SqlTransaction
|
||||||
|
Private Data As DataTable
|
||||||
|
Private DSet As New DataSet
|
||||||
|
|
||||||
|
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
||||||
|
'REGISTRAR CONEXIÓN
|
||||||
|
Private CveConexion As Integer = 0
|
||||||
|
Public ReadOnly Property DtResultados() As DataTable
|
||||||
|
Get
|
||||||
|
DtResultados = Data
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "Propiedades"
|
||||||
|
Public Property CveDestino As Integer
|
||||||
|
Public Property CveUsuario As Integer
|
||||||
|
Public Property CveEmpresa As Integer
|
||||||
|
Public Property Destino As String
|
||||||
|
Public Property Estatus As Boolean
|
||||||
|
Public Property EsNacional As Boolean
|
||||||
|
Public Property FechaIng As DateTime
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "Funciones básicas"
|
||||||
|
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
|
||||||
|
|
||||||
|
If TransaccionCompartida Is Nothing Then
|
||||||
|
SqlConexion = New SqlConnection
|
||||||
|
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
|
||||||
|
Try
|
||||||
|
SqlConexion.Open()
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
SqlConexion = TransaccionCompartida.Connection
|
||||||
|
SqlTransacc = TransaccionCompartida
|
||||||
|
End If
|
||||||
|
|
||||||
|
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
||||||
|
ConexionAdd()
|
||||||
|
End Sub
|
||||||
|
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand
|
||||||
|
.Parameters.Clear()
|
||||||
|
.CommandText = StrSQL
|
||||||
|
.CommandType = TipoComando
|
||||||
|
End With
|
||||||
|
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
|
||||||
|
Data = New DataTable
|
||||||
|
End Sub
|
||||||
|
#Region "Conexiones"
|
||||||
|
|
||||||
|
Private Sub ConexionAdd()
|
||||||
|
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||||
|
Try
|
||||||
|
DataAdapter("PA_Sis_RegistrarConexion")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
|
||||||
|
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
|
||||||
|
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
End With
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ConexionClose()
|
||||||
|
If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||||
|
|
||||||
|
DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
CveConexion = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
Public Function IniciaTransacSQL() As SqlTransaction
|
||||||
|
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
|
||||||
|
Return SqlTransacc
|
||||||
|
End Function
|
||||||
|
Public Sub RollBack()
|
||||||
|
SqlTransacc.Rollback()
|
||||||
|
End Sub
|
||||||
|
Public Sub Commit()
|
||||||
|
SqlTransacc.Commit()
|
||||||
|
End Sub
|
||||||
|
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||||
|
If Not disposedValue Then
|
||||||
|
If disposing Then
|
||||||
|
If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
|
||||||
|
If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing
|
||||||
|
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
|
||||||
|
If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
|
||||||
|
If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
|
||||||
|
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
|
||||||
|
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
disposedValue = True
|
||||||
|
End Sub
|
||||||
|
Public Sub Dispose() Implements IDisposable.Dispose
|
||||||
|
ConexionClose()
|
||||||
|
Dispose(True)
|
||||||
|
GC.SuppressFinalize(Me)
|
||||||
|
End Sub
|
||||||
|
#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
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Trans_DestinosGet")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveDestino", SqlDbType.Int).Value = CveDestino
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@Destino", SqlDbType.VarChar).Value = Destino
|
||||||
|
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||||
|
.Add("@EsNacional", SqlDbType.Bit).Value = EsNacional
|
||||||
|
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
||||||
|
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener los destino.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
End Class
|
||||||
154
App_Code/ClsRutas.vb
Normal file
154
App_Code/ClsRutas.vb
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
Imports System.Data
|
||||||
|
Imports System.Data.SqlClient
|
||||||
|
Imports Extensiones
|
||||||
|
|
||||||
|
Public Class ClsRutas
|
||||||
|
Implements IDisposable
|
||||||
|
|
||||||
|
#Region "Campos"
|
||||||
|
'SQL
|
||||||
|
Private SqlConexion As SqlConnection
|
||||||
|
Private SqlAdapter As SqlDataAdapter
|
||||||
|
Private SqlCommand As SqlCommand
|
||||||
|
Private SqlTransacc As SqlTransaction
|
||||||
|
Private Data As DataTable
|
||||||
|
Private DSet As New DataSet
|
||||||
|
|
||||||
|
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
||||||
|
'REGISTRAR CONEXIÓN
|
||||||
|
Private CveConexion As Integer = 0
|
||||||
|
Public ReadOnly Property DtResultados() As DataTable
|
||||||
|
Get
|
||||||
|
DtResultados = Data
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "Propiedades"
|
||||||
|
Public Property CveRuta As Integer
|
||||||
|
Public Property CveUsuario As Integer
|
||||||
|
Public Property CveEmpresa As Integer
|
||||||
|
Public Property Ruta As String
|
||||||
|
Public Property Estatus As Boolean
|
||||||
|
Public Property FechaIng As DateTime
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "Funciones básicas"
|
||||||
|
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
|
||||||
|
|
||||||
|
If TransaccionCompartida Is Nothing Then
|
||||||
|
SqlConexion = New SqlConnection
|
||||||
|
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
|
||||||
|
Try
|
||||||
|
SqlConexion.Open()
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
SqlConexion = TransaccionCompartida.Connection
|
||||||
|
SqlTransacc = TransaccionCompartida
|
||||||
|
End If
|
||||||
|
|
||||||
|
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
||||||
|
ConexionAdd()
|
||||||
|
End Sub
|
||||||
|
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand
|
||||||
|
.Parameters.Clear()
|
||||||
|
.CommandText = StrSQL
|
||||||
|
.CommandType = TipoComando
|
||||||
|
End With
|
||||||
|
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
|
||||||
|
Data = New DataTable
|
||||||
|
End Sub
|
||||||
|
#Region "Conexiones"
|
||||||
|
|
||||||
|
Private Sub ConexionAdd()
|
||||||
|
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||||
|
Try
|
||||||
|
DataAdapter("PA_Sis_RegistrarConexion")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
|
||||||
|
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
|
||||||
|
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
End With
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ConexionClose()
|
||||||
|
If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||||
|
|
||||||
|
DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
CveConexion = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
Public Function IniciaTransacSQL() As SqlTransaction
|
||||||
|
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
|
||||||
|
Return SqlTransacc
|
||||||
|
End Function
|
||||||
|
Public Sub RollBack()
|
||||||
|
SqlTransacc.Rollback()
|
||||||
|
End Sub
|
||||||
|
Public Sub Commit()
|
||||||
|
SqlTransacc.Commit()
|
||||||
|
End Sub
|
||||||
|
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||||
|
If Not disposedValue Then
|
||||||
|
If disposing Then
|
||||||
|
If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
|
||||||
|
If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing
|
||||||
|
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
|
||||||
|
If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
|
||||||
|
If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
|
||||||
|
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
|
||||||
|
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
disposedValue = True
|
||||||
|
End Sub
|
||||||
|
Public Sub Dispose() Implements IDisposable.Dispose
|
||||||
|
ConexionClose()
|
||||||
|
Dispose(True)
|
||||||
|
GC.SuppressFinalize(Me)
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
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
|
||||||
|
|
||||||
|
End Class
|
||||||
159
App_Code/ClsViajes.vb
Normal file
159
App_Code/ClsViajes.vb
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
|
||||||
|
Imports System.Data
|
||||||
|
Imports System.Data.SqlClient
|
||||||
|
Imports Extensiones
|
||||||
|
|
||||||
|
Public Class ClsViajes
|
||||||
|
Implements IDisposable
|
||||||
|
|
||||||
|
#Region "Campos"
|
||||||
|
'SQL
|
||||||
|
Private SqlConexion As SqlConnection
|
||||||
|
Private SqlAdapter As SqlDataAdapter
|
||||||
|
Private SqlCommand As SqlCommand
|
||||||
|
Private SqlTransacc As SqlTransaction
|
||||||
|
Private Data As DataTable
|
||||||
|
Private DSet As New DataSet
|
||||||
|
|
||||||
|
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
||||||
|
'REGISTRAR CONEXIÓN
|
||||||
|
Private CveConexion As Integer = 0
|
||||||
|
Public ReadOnly Property DtResultados() As DataTable
|
||||||
|
Get
|
||||||
|
DtResultados = Data
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "Propiedades"
|
||||||
|
Public Property CveViaje As Integer
|
||||||
|
Public Property CveRuta As String
|
||||||
|
Public Property CveAF As Integer
|
||||||
|
Public Property CvePersonal As String
|
||||||
|
Public Property CveEmpresa As Integer
|
||||||
|
Public Property Fecha As String
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "Funciones básicas"
|
||||||
|
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
|
||||||
|
|
||||||
|
If TransaccionCompartida Is Nothing Then
|
||||||
|
SqlConexion = New SqlConnection
|
||||||
|
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
|
||||||
|
Try
|
||||||
|
SqlConexion.Open()
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
SqlConexion = TransaccionCompartida.Connection
|
||||||
|
SqlTransacc = TransaccionCompartida
|
||||||
|
End If
|
||||||
|
|
||||||
|
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
||||||
|
ConexionAdd()
|
||||||
|
End Sub
|
||||||
|
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand
|
||||||
|
.Parameters.Clear()
|
||||||
|
.CommandText = StrSQL
|
||||||
|
.CommandType = TipoComando
|
||||||
|
End With
|
||||||
|
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
|
||||||
|
Data = New DataTable
|
||||||
|
End Sub
|
||||||
|
#Region "Conexiones"
|
||||||
|
|
||||||
|
Private Sub ConexionAdd()
|
||||||
|
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||||
|
Try
|
||||||
|
DataAdapter("PA_Sis_RegistrarConexion")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
|
||||||
|
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
|
||||||
|
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
End With
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ConexionClose()
|
||||||
|
If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||||
|
|
||||||
|
DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
CveConexion = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
Public Function IniciaTransacSQL() As SqlTransaction
|
||||||
|
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
|
||||||
|
Return SqlTransacc
|
||||||
|
End Function
|
||||||
|
Public Sub RollBack()
|
||||||
|
SqlTransacc.Rollback()
|
||||||
|
End Sub
|
||||||
|
Public Sub Commit()
|
||||||
|
SqlTransacc.Commit()
|
||||||
|
End Sub
|
||||||
|
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||||
|
If Not disposedValue Then
|
||||||
|
If disposing Then
|
||||||
|
If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
|
||||||
|
If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing
|
||||||
|
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
|
||||||
|
If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
|
||||||
|
If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
|
||||||
|
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
|
||||||
|
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
disposedValue = True
|
||||||
|
End Sub
|
||||||
|
Public Sub Dispose() Implements IDisposable.Dispose
|
||||||
|
ConexionClose()
|
||||||
|
Dispose(True)
|
||||||
|
GC.SuppressFinalize(Me)
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
Public Function AddViajes(CveRuta As Integer, CveAF As Integer, CvePersonal As Integer, CveEmpresa As Integer, Fecha As DateTime) 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
|
||||||
|
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = SqlAdapter.SelectCommand.Parameters("@CveViaje").Value.ToString.ToEntero
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al guardar el nuevo viaje.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
159
Transportes/ContratoTransporte.aspx
Normal file
159
Transportes/ContratoTransporte.aspx
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
<%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/Site.master" CodeFile="ContratoTransporte.aspx.vb"
|
||||||
|
Inherits="ContratoTransportes" %>
|
||||||
|
|
||||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||||
|
Registro de Contratos
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
|
<style>
|
||||||
|
.my-1 {
|
||||||
|
margin-block: 1rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
<contenttemplate>
|
||||||
|
<div class="col-md-12 ">
|
||||||
|
<div class="portlet smmallpadding light bordered">
|
||||||
|
<div class="portlet-title">
|
||||||
|
<div class="caption uppercase" style="position: relative;">
|
||||||
|
<i class="fa fa-info-circle"></i>Datos del Contrato
|
||||||
|
</div>
|
||||||
|
<a href="../SAT/">../SAT/</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="portlet-body">
|
||||||
|
<%-- cveCliente--%>
|
||||||
|
<div class="row my-1" id="TrCliente" runat="server">
|
||||||
|
<label class="col-md-4 bold">
|
||||||
|
<asp:Label ID="Label1" runat="server" Text="Cliente:"></asp:Label></label><div class="col-md-8">
|
||||||
|
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente"
|
||||||
|
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"
|
||||||
|
UsaWebService="true"></ADS:Dropdownlost>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4 bold">Servicio:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:TextBox ID="TxtDescripcion" runat="server" MaxLength="70" Width="400px"
|
||||||
|
TextMode="MultiLine"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripcion''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEDescripcion" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVDescripcion" Width="400px" BehaviorID="_content_VCEDescripcion">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-4 bold">Lugar de Salida:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:TextBox ID="TxtUbicacion" runat="server" MaxLength="70" Width="400px"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVUbicacion" runat="server" ControlToValidate="TxtUbicacion"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Ubicación''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEUbicacion" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVUbicacion" Width="400px" BehaviorID="_content_VCEUbicacion">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4 bold">Fecha Salida:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<div class="input-group input-sm input-small date date-picker">
|
||||||
|
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="True"
|
||||||
|
type="datetime-local"></asp:TextBox>
|
||||||
|
|
||||||
|
<asp:RequiredFieldValidator ID="RFVTxtFechaSalida" runat="server" ControlToValidate="TxtFechaSalida"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Salida''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCETxtFechaSalida" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVTxtFechaSalida" Width="400px" BehaviorID="_content_VCETxtFechaSalida">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4 bold">Fecha Regreso:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<div class="input-group input-sm input-small date date-picker">
|
||||||
|
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="True"
|
||||||
|
type="datetime-local"></asp:TextBox>
|
||||||
|
|
||||||
|
<asp:RequiredFieldValidator ID="RFVTxtFechaRegreso" runat="server" ControlToValidate="TxtFechaRegreso"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Regreso''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVTxtFechaRegreso" Width="400px" BehaviorID="_content_VCETxtFechaRegreso">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1" id="TrTipoUnidad" runat="server">
|
||||||
|
<label class="col-md-4 bold">
|
||||||
|
<asp:Label ID="Label2" runat="server" Text="Tipo de Unidad:"></asp:Label></label><div
|
||||||
|
class="col-md-8">
|
||||||
|
<asp:DropDownList ID="DdlUnidad"
|
||||||
|
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente"
|
||||||
|
Class="table-group-action-input form-control input-inline input-sm select2me"
|
||||||
|
Width="75%" ValidationGroup="GrpGuardar">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4 bold">Observaciones:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:TextBox ID="TxtObservaciones" runat="server" MaxLength="70" Width="400px"
|
||||||
|
TextMode="MultiLine"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVObservaciones" runat="server" ControlToValidate="TxtObservaciones"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripcion''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEObservaciones" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVObservaciones" Width="400px" BehaviorID="_content_VCEObservaciones">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4 bold">Costo dólares:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:TextBox ID="TxtDolares" runat="server" type="number"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4 bold">Costo pesos:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:TextBox ID="TxtPesos" runat="server" type="number"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4 bold">Anticipo:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:TextBox ID="TxtAnticipo" runat="server" type="number"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<contenttemplate>
|
||||||
|
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar"
|
||||||
|
CssClass="btn btn-success" OnClick="AddContrato" />
|
||||||
|
</contenttemplate>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</contenttemplate>
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
|
||||||
116
Transportes/ContratoTransporte.aspx.vb
Normal file
116
Transportes/ContratoTransporte.aspx.vb
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
Option Explicit On
|
||||||
|
Option Strict On
|
||||||
|
Imports ADSNetLibrary.SIGAPI.Helpers
|
||||||
|
Imports Extensiones
|
||||||
|
Imports Extensiones.ModExtensiones
|
||||||
|
|
||||||
|
Partial Class ContratoTransportes
|
||||||
|
Inherits ClsPaginas
|
||||||
|
|
||||||
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
|
|
||||||
|
If Not IsPostBack Then
|
||||||
|
DdlClientes.setEsWebService(True)
|
||||||
|
|
||||||
|
If Not String.IsNullOrEmpty(Request.QueryString("CveContrato")) Then
|
||||||
|
|
||||||
|
Dim id As Integer = Convert.ToInt32(Request.QueryString("CveContrato"))
|
||||||
|
Dim ObjContratos As New ClsContratos
|
||||||
|
ObjContratos.GetContratos(id, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
|
Dim fechaSalida As DateTime
|
||||||
|
Dim fechaRegreso As DateTime
|
||||||
|
|
||||||
|
If DateTime.TryParse(ObjContratos.FechaInicial.ToString, fechaSalida) And DateTime.TryParse(ObjContratos.FechaFinal.ToString, fechaRegreso) Then
|
||||||
|
TxtFechaSalida.Text = fechaSalida.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||||
|
TxtFechaRegreso.Text = fechaRegreso.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||||
|
End If
|
||||||
|
|
||||||
|
TxtDescripcion.Text = ObjContratos.DescripcionContrato
|
||||||
|
TxtObservaciones.Text = ObjContratos.DescripcionContrato
|
||||||
|
TxtUbicacion.Text = ObjContratos.Ubicacion
|
||||||
|
|
||||||
|
|
||||||
|
DdlClientes.DataValueField = ObjContratos.CveCliente.ToString
|
||||||
|
BtnGuardar.Text = "Editar"
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub AddContrato(sender As Object, e As EventArgs)
|
||||||
|
Dim ObjContratos As New ClsContratos
|
||||||
|
|
||||||
|
|
||||||
|
ObjContratos.IniciaTransacSQL()
|
||||||
|
Page.Response.Write("<script>console.log('El resultado de tu variable" + TxtFechaSalida.Text + "')</script>")
|
||||||
|
If DdlClientes.SelectedValue = "" Then
|
||||||
|
Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
Else
|
||||||
|
Try
|
||||||
|
|
||||||
|
If BtnGuardar.Text = "Guardar" Then
|
||||||
|
|
||||||
|
Page.Response.Write("<script>console.log('El resultado de tu variable" + "Guardando" + "')</script>")
|
||||||
|
|
||||||
|
Dim CveEstatusInicial As Integer = 10
|
||||||
|
Dim CveContratoHijo As Integer = -1
|
||||||
|
Dim CveContratoTipo As Integer = 2
|
||||||
|
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
||||||
|
CveEstatusInicial = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus=1").ToEntero
|
||||||
|
End If
|
||||||
|
CveContratoHijo = ObjContratos.AddContratos("", TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1)
|
||||||
|
|
||||||
|
|
||||||
|
If CveContratoHijo > 0 Then
|
||||||
|
ObjContratos.Commit()
|
||||||
|
Alert("El Contrato se registró Correctamente.", TipoMensaje.MsgInformacion)
|
||||||
|
TxtDescripcion.Text = ""
|
||||||
|
TxtFechaSalida.Text = ""
|
||||||
|
TxtFechaRegreso.Text = ""
|
||||||
|
TxtObservaciones.Text = ""
|
||||||
|
TxtUbicacion.Text = ""
|
||||||
|
DdlClientes.SelectedValue = ""
|
||||||
|
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Dim id As Integer = Convert.ToInt32(Request.QueryString("CveContrato"))
|
||||||
|
|
||||||
|
Dim ContratoEditado As New ClsContratos
|
||||||
|
ContratoEditado.GetContratos(id, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
|
Dim CveEstatusInicial As Integer = 10
|
||||||
|
Dim Editar As Boolean = False
|
||||||
|
Dim CveContratoTipo As Integer = 2
|
||||||
|
|
||||||
|
If ContratoEditado.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
||||||
|
CveEstatusInicial = ContratoEditado.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus=1").ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
Editar = ContratoEditado.UpdateContratos(ContratoEditado.CveContrato, id.ToString, TxtDescripcion.Text, ContratoEditado.NumeroLicitacion, ContratoEditado.CveProveedor, ContratoEditado.CveCliente, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", ContratoEditado.CveSubProyecto, ContratoEditado.PorIVA, ContratoEditado.PorAnticipo, ContratoEditado.PorAmortizacionAnticipo, ContratoEditado.PorGarantia, "", "", ContratoEditado.CveContratoPadre, ContratoEditado.CveUsuario, ContratoEditado.CveEmpresa, False, -1, -1, -1, ContratoEditado.CveMoneda, ContratoEditado.ModalidadDetalle, CveContratoTipo:=ContratoEditado.CveContratoTipo, CveContratosEstatus:=ContratoEditado.CveContratosEstatus)
|
||||||
|
|
||||||
|
Page.Response.Write("<script>console.log('El resultado de tu variable" + Editar.ToString + "')</script>")
|
||||||
|
|
||||||
|
If Editar = True Then
|
||||||
|
ContratoEditado.Commit()
|
||||||
|
Alert("El Contrato se modificó Correctamente.", TipoMensaje.MsgInformacion)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
ObjContratos.RollBack()
|
||||||
|
Finally
|
||||||
|
ObjContratos.Dispose()
|
||||||
|
Response.Redirect("ListadoContratos.aspx")
|
||||||
|
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
class="col-md-8">
|
class="col-md-8">
|
||||||
|
|
||||||
<asp:DropDownList ID="DdlRutas" AppendDataBoundItems="true" DataTextField="Ruta"
|
<asp:DropDownList ID="DdlRutas" AppendDataBoundItems="true" DataTextField="Ruta"
|
||||||
DataValueField="CveEmpresa" Class="table-group-action-input form-control input-inline text-center"
|
DataValueField="CveRuta" Class="table-group-action-input form-control input-inline text-center"
|
||||||
Width="200px" runat="server">
|
Width="200px" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVRutas" runat="server" ControlToValidate="DdlRutas"
|
<asp:RequiredFieldValidator ID="RFVRutas" runat="server" ControlToValidate="DdlRutas"
|
||||||
@@ -47,13 +47,14 @@
|
|||||||
</ajax:ValidatorCalloutExtender>
|
</ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row margin-bottom-5" id="TrDestino" runat="server">
|
<div class="row margin-bottom-5" id="TrDestino" 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
|
||||||
class="col-md-8">
|
class="col-md-8">
|
||||||
|
|
||||||
<asp:DropDownList ID="DdlDestino" AppendDataBoundItems="true" DataTextField="Ruta"
|
<asp:DropDownList ID="DdlDestino" AppendDataBoundItems="true" DataTextField="Destino"
|
||||||
DataValueField="CveEmpresa" Class="table-group-action-input form-control input-inline text-center"
|
DataValueField="CveDestino" Class="table-group-action-input form-control input-inline text-center"
|
||||||
Width="200px" runat="server">
|
Width="200px" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="DdlDestino"
|
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="DdlDestino"
|
||||||
@@ -64,13 +65,14 @@
|
|||||||
</ajax:ValidatorCalloutExtender>
|
</ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
</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="Destino:"></asp:Label></label><div
|
<asp:Label runat="server" Text="Destino:"></asp:Label></label><div
|
||||||
class="col-md-8">
|
class="col-md-8">
|
||||||
|
|
||||||
<asp:DropDownList ID="DdlPartida" AppendDataBoundItems="true" DataTextField="Ruta"
|
<asp:DropDownList ID="DdlPartida" AppendDataBoundItems="true" DataTextField="Destino"
|
||||||
DataValueField="CveEmpresa" Class="table-group-action-input form-control input-inline text-center"
|
DataValueField="CveDestino" Class="table-group-action-input form-control input-inline text-center"
|
||||||
Width="200px" runat="server">
|
Width="200px" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVPartida" runat="server" ControlToValidate="DdlPartida"
|
<asp:RequiredFieldValidator ID="RFVPartida" runat="server" ControlToValidate="DdlPartida"
|
||||||
@@ -81,13 +83,14 @@
|
|||||||
</ajax:ValidatorCalloutExtender>
|
</ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row margin-bottom-5" id="TrChofer" runat="server">
|
<div class="row margin-bottom-5" id="TrChofer" runat="server">
|
||||||
<label class="col-md-4 bold">
|
<label class="col-md-4 bold">
|
||||||
<asp:Label runat="server" Text="Chofer:"></asp:Label></label><div
|
<asp:Label runat="server" Text="Chofer:"></asp:Label></label><div
|
||||||
class="col-md-8">
|
class="col-md-8">
|
||||||
|
|
||||||
<asp:DropDownList ID="DdlChofer" AppendDataBoundItems="true" DataValueField="CveChofer"
|
<asp:DropDownList ID="DdlChofer" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
||||||
DataTextField="Chofer" Class="table-group-action-input form-control input-inline text-center"
|
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline text-center"
|
||||||
Width="200px" runat="server">
|
Width="200px" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVChofer" runat="server" ControlToValidate="DdlChofer"
|
<asp:RequiredFieldValidator ID="RFVChofer" runat="server" ControlToValidate="DdlChofer"
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
Partial Class CrearViaje
|
Imports ADSNetLibrary.Helpers
|
||||||
|
Imports ADSNetLibrary.SIGAPI.Helpers
|
||||||
|
Imports Extensiones.ModExtensiones
|
||||||
|
|
||||||
|
Partial Class CrearViaje
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
@@ -16,50 +20,53 @@
|
|||||||
DdlTransporte.DataSource = ObjAF.DtResultados
|
DdlTransporte.DataSource = ObjAF.DtResultados
|
||||||
DdlTransporte.DataBind()
|
DdlTransporte.DataBind()
|
||||||
|
|
||||||
DdlTransporte.Items.Insert(0, New ListItem("<--Seleccione Transporte-->", ""))
|
DdlTransporte.Items.Insert(0, New ListItem("Seleccione Transporte", ""))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
ObjAF.Dispose()
|
ObjAF.Dispose()
|
||||||
|
|
||||||
'Lista Rutas'
|
'Lista Rutas'
|
||||||
Dim ObjRutas As New ClsRH()
|
Dim ObjRutas As New ClsRutas()
|
||||||
If ObjRutas.GetRutas(7) Then
|
If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
|
||||||
Page.Response.Write("<script>console.log('El resultado de tu variable" + ObjRutas.DtResultados.Rows.ToString + "')</script>")
|
Page.Response.Write("<script>console.log('El resultado de tu variable" + ObjRutas.DtResultados.Rows.ToString + "')</script>")
|
||||||
|
|
||||||
If ObjRutas.DtResultados.Rows.Count > 0 Then
|
If ObjRutas.DtResultados.Rows.Count > 0 Then
|
||||||
DdlRutas.DataSource = ObjRutas.DtResultados
|
DdlRutas.DataSource = ObjRutas.DtResultados
|
||||||
DdlRutas.DataBind()
|
DdlRutas.DataBind()
|
||||||
DdlRutas.Items.Insert(0, New ListItem("<--Seleccione Ruta-->", ""))
|
DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", ""))
|
||||||
|
|
||||||
DdlPartida.DataSource = ObjRutas.DtResultados
|
|
||||||
DdlPartida.DataBind()
|
|
||||||
DdlPartida.Items.Insert(0, New ListItem("<--Seleccione Partida-->", ""))
|
|
||||||
|
|
||||||
DdlDestino.DataSource = ObjRutas.DtResultados
|
|
||||||
DdlDestino.DataBind()
|
|
||||||
DdlDestino.Items.Insert(0, New ListItem("<--Seleccione Destino-->", ""))
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
ObjRutas.Dispose()
|
ObjRutas.Dispose()
|
||||||
|
|
||||||
'Lista Chofer'
|
'Lista Destinos'
|
||||||
'GlobalDTRHPersonal()'
|
Dim ObjDestinos As New ClsDestinos()
|
||||||
'CvePersonal - Text Nombre COmpleto'
|
If ObjDestinos.GetDestinos(-1, -1, -1, "", True, True, DateTime.Now) Then
|
||||||
Dim ObjAcar As New ClsAcarreos()
|
Page.Response.Write("<script>console.log('El resultado de tu variable" + ObjDestinos.DtResultados.Rows.ToString + "')</script>")
|
||||||
If ObjAcar.GetChofer(-1, UsuarioActual.CveEmpresa, 1, -1) Then
|
|
||||||
DdlChofer.DataSource = ObjAcar.DtResultados
|
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||||
DdlChofer.DataBind()
|
|
||||||
DdlChofer.Items.Insert(0, New ListItem("<--Seleccione Chofer-->", ""))
|
DdlPartida.DataSource = ObjDestinos.DtResultados
|
||||||
|
DdlPartida.DataBind()
|
||||||
|
DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", ""))
|
||||||
|
|
||||||
|
DdlDestino.DataSource = ObjDestinos.DtResultados
|
||||||
|
DdlDestino.DataBind()
|
||||||
|
DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", ""))
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
ObjAcar.Dispose()
|
ObjRutas.Dispose()
|
||||||
|
'Lista Chofer'
|
||||||
|
DdlChofer.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||||
|
DdlChofer.DataBind()
|
||||||
|
DdlChofer.Items.Insert(0, New ListItem("Seleccione Chofer", ""))
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub AddViaje(sender As Object, e As EventArgs)
|
Protected Sub AddViaje(sender As Object, e As EventArgs)
|
||||||
'Dónde están los PA para agregar viajes?'
|
Dim ObjViajes As New ClsViajes()
|
||||||
'Dónde están los PA para consultar Destinos y rutas viajes?'
|
If ObjViajes.AddViajes(DdlRutas.Text.ToEntero, DdlTransporte.Text.ToEntero, DdlChofer.Text.ToEntero, UsuarioActual.CveEmpresa.ToEntero, TxtFechaViaje.Text.ToDate) = -1 Then
|
||||||
'Por qué siempre cambia el aside de Transportes V&A?'
|
Alert("El Contrato se agregó correctamente.", TipoMensaje.MsgAdvertencia)
|
||||||
Page.Response.Write("<script>console.log('clits')</script>")
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
108
Transportes/ListadoContratos.aspx
Normal file
108
Transportes/ListadoContratos.aspx
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/Site.master" CodeFile="ListadoContratos.aspx.vb"
|
||||||
|
Inherits="ListadoContratos" %>
|
||||||
|
|
||||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||||
|
Listado de Contratos
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
|
<style>
|
||||||
|
.my-1 {
|
||||||
|
margin-block: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_scrollHead {
|
||||||
|
background-color: #DDD;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-scrollable {
|
||||||
|
margin-top: 0px !important;
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Texto {
|
||||||
|
text-align: left !important
|
||||||
|
}
|
||||||
|
|
||||||
|
.boton {
|
||||||
|
background: red;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||||
|
<asp:UpdatePanel runat="server">
|
||||||
|
<ContentTemplate>
|
||||||
|
<li>
|
||||||
|
<asp:HyperLink ID="LBAgregarContrato" runat="server" NavigateUrl="ContratoTransporte.aspx"
|
||||||
|
Target="_blank"><i class='fa fa-plus'></i> Agregar Contrato</asp:HyperLink>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:HyperLink ID="LBCrearViaje" runat="server" NavigateUrl="CrearViaje.aspx"
|
||||||
|
Target="_blank"><i class='fa fa-car'></i> Crear Viaje</asp:HyperLink>
|
||||||
|
</li>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
<contenttemplate>
|
||||||
|
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
||||||
|
CssClass="table table-striped table-hover Widthall ScrollAD text-center" GridLines="None"
|
||||||
|
data-sort="true" OnRowCommand="GvContratos_Comandos">
|
||||||
|
<Columns>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="No. Contrato">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlCveContrato" runat="server" Text='<%# Eval("CveContrato") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Descripcion">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlDescripcionContrato" runat="server" Text='<%# Eval("DescripcionContrato") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Ubicación" ItemStyle-HorizontalAlign="Left">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtUbicacion" runat="server" Text='<%# Eval("Ubicacion") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
|
||||||
|
<HeaderTemplate>
|
||||||
|
Fecha<br />
|
||||||
|
Salida
|
||||||
|
</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaInicial", "{0:d}") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Fecha Final" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
|
||||||
|
<HeaderTemplate>
|
||||||
|
Fecha<br />
|
||||||
|
Regreso
|
||||||
|
</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:d}") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Acciones">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Button ID="btnEditar" runat="server" Text="Editar" CommandName="Editar" class="btn btn-primary"
|
||||||
|
CommandArgument='<%# Eval("CveContrato") %>' />
|
||||||
|
<asp:Button ID="btnEliminar" runat="server" Text="Eliminar" CommandName="Eliminar"
|
||||||
|
class="btn btn-danger" CommandArgument='<%# Eval("CveContrato") %>' />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
</contenttemplate>
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
|
||||||
57
Transportes/ListadoContratos.aspx.vb
Normal file
57
Transportes/ListadoContratos.aspx.vb
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
Option Explicit On
|
||||||
|
Option Strict On
|
||||||
|
|
||||||
|
Partial Class ListadoContratos
|
||||||
|
|
||||||
|
Inherits ClsPaginas
|
||||||
|
|
||||||
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
|
If Not IsPostBack Then
|
||||||
|
CargaDatos()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaDatos()
|
||||||
|
Dim ObjContratos As New ClsContratos
|
||||||
|
|
||||||
|
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
|
||||||
|
GvContratos.DataSource = ObjContratos.DtResultados
|
||||||
|
Else
|
||||||
|
Me.GvContratos.DataSource = Nothing
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjContratos.Dispose()
|
||||||
|
GvContratos.DataBind()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub GvContratos_Comandos(sender As Object, e As GridViewCommandEventArgs)
|
||||||
|
Dim id As Integer = Convert.ToInt32(e.CommandArgument)
|
||||||
|
Dim url As String = $"ContratoTransporte.aspx?CveContrato={id}"
|
||||||
|
|
||||||
|
If e.CommandName = "Editar" Then
|
||||||
|
Dim script As String = $"window.open('{url}', '_blank');"
|
||||||
|
Page.ClientScript.RegisterStartupScript(Me.GetType(), "OpenWindow", script, True)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.CommandName = "Eliminar" Then
|
||||||
|
Dim ObjContratos As New ClsContratos
|
||||||
|
ObjContratos.IniciaTransacSQL()
|
||||||
|
|
||||||
|
Try
|
||||||
|
ObjContratos.RemoveContrato(id, UsuarioActual.CveEmpresa)
|
||||||
|
ObjContratos.Commit()
|
||||||
|
Catch ex As Exception
|
||||||
|
ObjContratos.RollBack()
|
||||||
|
Finally
|
||||||
|
ObjContratos.Dispose()
|
||||||
|
Response.Redirect("ListadoContratos.aspx")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
Reference in New Issue
Block a user