This commit is contained in:
Raul Pimienta
2019-09-04 12:57:57 -07:00
20 changed files with 761 additions and 28 deletions

View File

@@ -89,7 +89,7 @@ Public Class ClsContPAQi
Catch ex As Exception Catch ex As Exception
Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
End Try End Try
ConexionAdd() 'ConexionAdd()
End Sub End Sub
Private Sub SetTimeOut(Optional Tiempo As Integer = 30) Private Sub SetTimeOut(Optional Tiempo As Integer = 30)
SqlCommand.CommandTimeout = Tiempo SqlCommand.CommandTimeout = Tiempo
@@ -11200,7 +11200,7 @@ Public Class ClsContPAQi
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose() 'ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -16,7 +16,8 @@ Public Class ClsOC
Private Data As DataTable Private Data As DataTable
'Atributos de la clase 'Atributos de la clase
Private disposedValue As Boolean = False Private disposedValue As Boolean = False
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
@@ -167,7 +168,7 @@ Public Class ClsOC
SqlCommand = New SqlCommand("", SqlConexion) SqlCommand = New SqlCommand("", SqlConexion)
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
StrSQL = New StringBuilder StrSQL = New StringBuilder
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlAdapter.SelectCommand With SqlAdapter.SelectCommand
@@ -178,6 +179,45 @@ Public Class ClsOC
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlCommand With SqlCommand
.Parameters.Clear() .Parameters.Clear()
@@ -2481,6 +2521,7 @@ Public Class ClsOC
disposedValue = True disposedValue = True
End Sub End Sub
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -16,6 +16,8 @@ Public Class ClsOIEventos
Private SqlCommand As SqlCommand Private SqlCommand As SqlCommand
Private Data As DataTable Private Data As DataTable
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -109,7 +111,7 @@ Public Class ClsOIEventos
SqlCommand = New SqlCommand("", SqlConexion) SqlCommand = New SqlCommand("", SqlConexion)
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlAdapter.SelectCommand With SqlAdapter.SelectCommand
@@ -120,6 +122,45 @@ Public Class ClsOIEventos
Data = New DataTable Data = New DataTable
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Public Sub IniciaTransacSQL() Public Sub IniciaTransacSQL()
SqlTransacc = SqlConexion.BeginTransaction() SqlTransacc = SqlConexion.BeginTransaction()
End Sub End Sub
@@ -1339,6 +1380,7 @@ Public Class ClsOIEventos
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -15,6 +15,8 @@ Public Class ClsOS
Private Data As DataTable Private Data As DataTable
'Atributos de la clase 'Atributos de la clase
Private disposedValue As Boolean = False Private disposedValue As Boolean = False
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
@@ -98,7 +100,7 @@ Public Class ClsOS
SqlCommand = New SqlCommand("", SqlConexion) SqlCommand = New SqlCommand("", SqlConexion)
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
StrSQL = New StringBuilder StrSQL = New StringBuilder
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlAdapter.SelectCommand With SqlAdapter.SelectCommand
@@ -109,6 +111,45 @@ Public Class ClsOS
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlCommand With SqlCommand
.Parameters.Clear() .Parameters.Clear()
@@ -1632,6 +1673,7 @@ Public Class ClsOS
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -21,6 +21,8 @@ Public Class ClsPV
'Atributos de la clase 'Atributos de la clase
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
@@ -64,7 +66,7 @@ Public Class ClsPV
End If End If
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure)
@@ -76,7 +78,44 @@ Public Class ClsPV
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
'Reporte de Ventas 'Reporte de Ventas
Public Function GetRepPVVentas(FechaI As String, FechaF As String, FechaIEjec As String, FechaFEjec As String, CveCliente As Integer, CveSubProyecto As Integer, CveSubProyectoEjecucion As Integer, Public Function GetRepPVVentas(FechaI As String, FechaF As String, FechaIEjec As String, FechaFEjec As String, CveCliente As Integer, CveSubProyecto As Integer, CveSubProyectoEjecucion As Integer,
@@ -193,6 +232,7 @@ Public Class ClsPV
' This code added by Visual Basic to correctly implement the disposable pattern. ' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -21,6 +21,8 @@ Public Class ClsPresupuestos
'Atributos de la clase 'Atributos de la clase
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
@@ -64,7 +66,7 @@ Public Class ClsPresupuestos
End If End If
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
@@ -78,7 +80,45 @@ Public Class ClsPresupuestos
End Sub End Sub
#End Region #End Region
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
#Region "P R E S U P U E S T O S - P R O D U C T O S - D E T A L L E S" #Region "P R E S U P U E S T O S - P R O D U C T O S - D E T A L L E S"
Public Function GetPresupuestosDetalleProductos(CvePresupuestoDetalle As Integer) As Boolean Public Function GetPresupuestosDetalleProductos(CvePresupuestoDetalle As Integer) As Boolean
@@ -732,6 +772,7 @@ Public Class ClsPresupuestos
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -18,6 +18,9 @@ Public Class ClsProductosServicios
Private SqlTransacc As SqlTransaction Private SqlTransacc As SqlTransaction
Private Data As DataTable Private Data As DataTable
Private disposedValue As Boolean = False Private disposedValue As Boolean = False
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -113,7 +116,7 @@ Public Class ClsProductosServicios
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
End Try End Try
ConexionAdd()
End Sub End Sub
@@ -145,7 +148,7 @@ Public Class ClsProductosServicios
End If End If
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlAdapter.SelectCommand With SqlAdapter.SelectCommand
@@ -156,6 +159,45 @@ Public Class ClsProductosServicios
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Public Function GetPS(CvePS As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Codigo2 As String = "-1", Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional EsPaquete As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional CveTipoPS As Integer = -1, Optional CveCompuesto As Integer = -1, Optional SATClavePS As String = "-1") As Boolean Public Function GetPS(CvePS As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Codigo2 As String = "-1", Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional EsPaquete As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional CveTipoPS As Integer = -1, Optional CveCompuesto As Integer = -1, Optional SATClavePS As String = "-1") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -17,6 +17,8 @@ Public Class ClsProsEncuestas
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
Private StrSQL As StringBuilder Private StrSQL As StringBuilder
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -48,7 +50,7 @@ Public Class ClsProsEncuestas
End If End If
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
@@ -60,7 +62,44 @@ Public Class ClsProsEncuestas
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Public Function IniciaTransacSQL() As SqlTransaction Public Function IniciaTransacSQL() As SqlTransaction
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction() If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
Return SqlTransacc Return SqlTransacc
@@ -752,6 +791,7 @@ Public Class ClsProsEncuestas
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -16,6 +16,8 @@ Public Class ClsProspectos
Private Data As DataTable Private Data As DataTable
Private StrSQL As StringBuilder Private StrSQL As StringBuilder
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -161,7 +163,7 @@ Public Class ClsProspectos
End If End If
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
@@ -173,6 +175,44 @@ Public Class ClsProspectos
Data = New DataTable Data = New DataTable
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
#Region "Prospectos" #Region "Prospectos"
Public Function GetNext() As Boolean Public Function GetNext() As Boolean
@@ -4591,6 +4631,7 @@ Public Class ClsProspectos
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -23,6 +23,8 @@ Public Class ClsProyectos
'Atributos de la clase 'Atributos de la clase
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
@@ -55,7 +57,7 @@ Public Class ClsProyectos
SqlCommand = New SqlCommand("", SqlConexion) SqlCommand = New SqlCommand("", SqlConexion)
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlAdapter.SelectCommand With SqlAdapter.SelectCommand
@@ -66,6 +68,44 @@ Public Class ClsProyectos
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlCommand With SqlCommand
.Parameters.Clear() .Parameters.Clear()
@@ -210,6 +250,7 @@ Public Class ClsProyectos
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -18,6 +18,8 @@ Public Class ClsPruebasJJMQ
Private StrSQL As StringBuilder Private StrSQL As StringBuilder
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
@@ -47,6 +49,7 @@ Public Class ClsPruebasJJMQ
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
StrSQL = New StringBuilder StrSQL = New StringBuilder
ConexionAdd()
End Sub End Sub
Private Sub SqlDataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub SqlDataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
@@ -58,7 +61,44 @@ Public Class ClsPruebasJJMQ
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
SqlDataAdapter("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
SqlDataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Private Sub SqlDataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub SqlDataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlCommand With SqlCommand
.Parameters.Clear() .Parameters.Clear()
@@ -134,6 +174,7 @@ Public Class ClsPruebasJJMQ
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -20,6 +20,8 @@ Public Class ClsPuntoVenta
'Atributos de la clase 'Atributos de la clase
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
@@ -84,7 +86,7 @@ Public Class ClsPuntoVenta
End If End If
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure)
@@ -96,7 +98,44 @@ Public Class ClsPuntoVenta
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Public Function GetVta_CortesDetalles(CveCorte As Integer) As Boolean Public Function GetVta_CortesDetalles(CveCorte As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -390,6 +429,7 @@ Public Class ClsPuntoVenta
' This code added by Visual Basic to correctly implement the disposable pattern. ' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -81,14 +81,14 @@ Public Class ClsRH
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo 'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
DataAdapter("PA_Sis_RegistrarConexion")
With SqlAdapter.SelectCommand.Parameters
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
.Add("@Modulo", SqlDbType.VarChar).Value = HttpContext.Current.Request.Url.AbsolutePath.ToString
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try 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) SqlAdapter.Fill(Data)
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
Catch ex As Exception Catch ex As Exception
@@ -102,7 +102,7 @@ Public Class ClsRH
If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then 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) DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
CveConexion = 0
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -17,6 +17,8 @@ Public Class ClsRMA
Private SqlTransacc As SqlTransaction Private SqlTransacc As SqlTransaction
Private Data As DataTable Private Data As DataTable
Private disposedValue As Boolean = False Private disposedValue As Boolean = False
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -56,7 +58,7 @@ Public Class ClsRMA
End If End If
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure)
With SqlAdapter.SelectCommand With SqlAdapter.SelectCommand
@@ -67,7 +69,44 @@ Public Class ClsRMA
Data = New DataTable Data = New DataTable
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Private Sub DataCommand(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataCommand(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure)
With SqlCommand With SqlCommand
.Parameters.Clear() .Parameters.Clear()
@@ -181,6 +220,7 @@ Public Class ClsRMA
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -30,6 +30,8 @@ Public Class ClsSAT
Private disposedValue As Boolean = False Private disposedValue As Boolean = False
Private ContListado69B As Integer = 0 Private ContListado69B As Integer = 0
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -78,7 +80,7 @@ Public Class ClsSAT
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
'ConexionAdd() ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure)
@@ -90,7 +92,44 @@ Public Class ClsSAT
Data = New DataTable Data = New DataTable
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Public Function ActualizarListado69B(Ruta As String) As Boolean Public Function ActualizarListado69B(Ruta As String) As Boolean
Dim respusta As Boolean = False Dim respusta As Boolean = False
@@ -337,6 +376,7 @@ Public Class ClsSAT
' This code added by Visual Basic to correctly implement the disposable pattern. ' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -15,6 +15,8 @@ Public Class ClsSCTLicencias
Private SqlCommand As SqlCommand Private SqlCommand As SqlCommand
Private Data As DataTable Private Data As DataTable
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -53,7 +55,7 @@ Public Class ClsSCTLicencias
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
End Try End Try
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
@@ -64,7 +66,44 @@ Public Class ClsSCTLicencias
End With End With
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
#Region "L I C E N C I A S " #Region "L I C E N C I A S "
@@ -226,6 +265,7 @@ Public Class ClsSCTLicencias
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -14,6 +14,8 @@ Public Class ClsSeguimiento
Private SqlAdapter As SqlDataAdapter Private SqlAdapter As SqlDataAdapter
Private Data As DataTable Private Data As DataTable
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -34,7 +36,7 @@ Public Class ClsSeguimiento
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
End Try End Try
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
@@ -45,7 +47,44 @@ Public Class ClsSeguimiento
End With End With
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
#Region " S E G U I M I E N T O " #Region " S E G U I M I E N T O "
@@ -144,6 +183,7 @@ Public Class ClsSeguimiento
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -54,6 +54,8 @@ Public Class ClsSisEmpresas
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
@@ -221,6 +223,7 @@ Public Class ClsSisEmpresas
SqlCommand = New SqlCommand("", SqlConexion) SqlCommand = New SqlCommand("", SqlConexion)
SqlAdapter = New SqlDataAdapter("", SqlConexion) SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
@@ -232,6 +235,44 @@ Public Class ClsSisEmpresas
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlCommand With SqlCommand
.Parameters.Clear() .Parameters.Clear()
@@ -1836,6 +1877,7 @@ Public Class ClsSisEmpresas
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose ( que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose ( que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -45,6 +45,8 @@ Public Class ClsSisNotificaciones
Private _ClavesNotificaciones As Dictionary(Of String, List(Of Integer)) Private _ClavesNotificaciones As Dictionary(Of String, List(Of Integer))
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "P R O P I E D A D E S" #Region "P R O P I E D A D E S"
@@ -92,7 +94,7 @@ Public Class ClsSisNotificaciones
'Inicializamos las propiedades necesarias 'Inicializamos las propiedades necesarias
_ClavesNotificaciones = New Dictionary(Of String, List(Of Integer)) _ClavesNotificaciones = New Dictionary(Of String, List(Of Integer))
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
@@ -103,7 +105,44 @@ Public Class ClsSisNotificaciones
End With End With
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
#Region "N O T I F I C A C I O N E S" #Region "N O T I F I C A C I O N E S"
Public Sub DispararNotificacion(CveNotificacion As Integer, CvesFiltro As List(Of Object), CveEmpresa As Integer) Public Sub DispararNotificacion(CveNotificacion As Integer, CvesFiltro As List(Of Object), CveEmpresa As Integer)
@@ -2046,6 +2085,7 @@ Public Class ClsSisNotificaciones
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub

View File

@@ -25,6 +25,8 @@ Public Class ClsSisParametros
Private _NombreUsuario As String Private _NombreUsuario As String
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0
#End Region #End Region
#Region "Propiedades" #Region "Propiedades"
@@ -82,7 +84,7 @@ Public Class ClsSisParametros
Catch ex As Exception Catch ex As Exception
Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
End Try End Try
ConexionAdd()
End Sub End Sub
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
@@ -93,7 +95,44 @@ Public Class ClsSisParametros
End With End With
Data = New DataTable Data = New DataTable
End Sub End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
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)
CveConexion = 0
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
#End Region
Public Function GetParametros() As Boolean Public Function GetParametros() As Boolean
Dim OnError As Boolean = False Dim OnError As Boolean = False
@@ -234,6 +273,7 @@ Public Class ClsSisParametros
' Visual Basic agregó este código para implementar correctamente el modelo descartable. ' Visual Basic agregó este código para implementar correctamente el modelo descartable.
Public Sub Dispose() Implements IDisposable.Dispose Public Sub Dispose() Implements IDisposable.Dispose
' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean).
ConexionClose()
Dispose(True) Dispose(True)
GC.SuppressFinalize(Me) GC.SuppressFinalize(Me)
End Sub End Sub