checkpoint registro de conexion
This commit is contained in:
@@ -30,6 +30,8 @@ Public Class ClsSAT
|
||||
Private disposedValue As Boolean = False
|
||||
|
||||
Private ContListado69B As Integer = 0
|
||||
'PARA REGISTRAR CONEXION
|
||||
Private CveConexion As Integer = 0
|
||||
#End Region
|
||||
|
||||
#Region "Propiedades"
|
||||
@@ -78,7 +80,7 @@ Public Class ClsSAT
|
||||
|
||||
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
||||
|
||||
'ConexionAdd()
|
||||
ConexionAdd()
|
||||
|
||||
End Sub
|
||||
Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure)
|
||||
@@ -90,7 +92,44 @@ Public Class ClsSAT
|
||||
Data = New DataTable
|
||||
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
|
||||
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
|
||||
|
||||
Dim respusta As Boolean = False
|
||||
@@ -337,6 +376,7 @@ Public Class ClsSAT
|
||||
' This code added by Visual Basic to correctly implement the disposable pattern.
|
||||
Public Sub Dispose() Implements IDisposable.Dispose
|
||||
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
|
||||
ConexionClose()
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
@@ -15,6 +15,8 @@ Public Class ClsSCTLicencias
|
||||
Private SqlCommand As SqlCommand
|
||||
Private Data As DataTable
|
||||
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
||||
'PARA REGISTRAR CONEXION
|
||||
Private CveConexion As Integer = 0
|
||||
#End Region
|
||||
|
||||
#Region "Propiedades"
|
||||
@@ -53,7 +55,7 @@ Public Class ClsSCTLicencias
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
|
||||
End Try
|
||||
|
||||
ConexionAdd()
|
||||
End Sub
|
||||
|
||||
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
|
||||
@@ -64,10 +66,47 @@ Public Class ClsSCTLicencias
|
||||
End With
|
||||
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(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 "
|
||||
|
||||
|
||||
|
||||
Public Function GetLicencias(CveLicencia As Integer, TipoLicencia As String, NumeroLicencia As String, FechaExpedicionInicio As String, FechaExpedicionFin As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -226,6 +265,7 @@ Public Class ClsSCTLicencias
|
||||
' Visual Basic agregó este código para implementar correctamente el modelo descartable.
|
||||
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).
|
||||
ConexionClose()
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
@@ -14,6 +14,8 @@ Public Class ClsSeguimiento
|
||||
Private SqlAdapter As SqlDataAdapter
|
||||
Private Data As DataTable
|
||||
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
||||
'PARA REGISTRAR CONEXION
|
||||
Private CveConexion As Integer = 0
|
||||
#End Region
|
||||
|
||||
#Region "Propiedades"
|
||||
@@ -34,7 +36,7 @@ Public Class ClsSeguimiento
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
|
||||
End Try
|
||||
|
||||
ConexionAdd()
|
||||
End Sub
|
||||
|
||||
Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
|
||||
@@ -45,7 +47,44 @@ Public Class ClsSeguimiento
|
||||
End With
|
||||
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(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 "
|
||||
@@ -144,6 +183,7 @@ Public Class ClsSeguimiento
|
||||
' Visual Basic agregó este código para implementar correctamente el modelo descartable.
|
||||
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).
|
||||
ConexionClose()
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user