Agregado metodo para hacer registro de las conexiones en ClsRH
This commit is contained in:
@@ -59,6 +59,7 @@ Public Class ClsRH
|
|||||||
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
||||||
Try
|
Try
|
||||||
SqlConexion.Open()
|
SqlConexion.Open()
|
||||||
|
ConexionAdd()
|
||||||
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
|
||||||
@@ -72,8 +73,47 @@ Public Class ClsRH
|
|||||||
End With
|
End With
|
||||||
Data = New DataTable
|
Data = New DataTable
|
||||||
End Sub
|
End Sub
|
||||||
|
Private CveConexion As Integer = 0
|
||||||
|
|
||||||
|
#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
|
||||||
|
DataAdapter("PA_Sis_RegistrarConexion")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@Clase", SqlDbType.VarChar).Value = "ClsRH"
|
||||||
|
.Add("@Modulo", SqlDbType.VarChar).Value = HttpContext.Current.Request.Url.AbsolutePath.ToString
|
||||||
|
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
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 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
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
|
||||||
#Region "ClsRHAsistenciasInasistencias"
|
#Region "ClsRHAsistenciasInasistencias"
|
||||||
Public Function GetAsistenciasInasistencias() As Boolean
|
Public Function GetAsistenciasInasistencias() As Boolean
|
||||||
@@ -6673,6 +6713,7 @@ Public Class ClsRH
|
|||||||
' 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