checkpoint agregar registro de conexion
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user