From 2fa5ccacd226f928deebc83973121715abf99146 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 29 May 2020 00:01:40 -0700 Subject: [PATCH] -- conexion, si es compartida para registrar la bitacora de conexion --- App_Code/ClsAF.vb | 4 +++- App_Code/ClsAcumuladores.vb | 4 +++- App_Code/ClsCompProveedores.vb | 4 +++- App_Code/ClsGPS.vb | 6 ++++-- App_Code/ClsGralFolios.vb | 4 +++- App_Code/ClsOC.vb | 4 +++- App_Code/ClsOIEventos.vb | 5 ++++- App_Code/ClsProductosServicios.vb | 5 +++-- App_Code/ClsSAT.vb | 4 +++- App_Code/ClsVtaVendedores.vb | 4 +++- 10 files changed, 32 insertions(+), 12 deletions(-) diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index f08a705e2..ee7e27b43 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -21,6 +21,7 @@ Public Class ClsAF Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIÓN Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region #Region "Propiedades" @@ -95,6 +96,7 @@ Public Class ClsAF Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -112,7 +114,7 @@ Public Class ClsAF #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index e451e5b44..46ca6341d 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -19,6 +19,7 @@ Public Class ClsAcumuladores Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIÓN Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False Private Sub SqlDataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) With SqlAdapter.SelectCommand @@ -62,6 +63,7 @@ Public Class ClsAcumuladores Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -70,7 +72,7 @@ Public Class ClsAcumuladores #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try SqlDataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb index bbbc1b8f1..813a15016 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -21,6 +21,7 @@ Public Class ClsCompProveedores Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIÓN Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region #Region "Propiedades" @@ -170,6 +171,7 @@ Public Class ClsCompProveedores Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -187,7 +189,7 @@ Public Class ClsCompProveedores #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/ClsGPS.vb b/App_Code/ClsGPS.vb index 622a9de14..1488d68ff 100644 --- a/App_Code/ClsGPS.vb +++ b/App_Code/ClsGPS.vb @@ -22,7 +22,8 @@ Public Class ClsGPS Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIONES ABIERTAS - Private CveConexion As Integer = 0 + Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False Public ReadOnly Property DtResultados() As DataTable Get @@ -61,6 +62,7 @@ Public Class ClsGPS Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -78,7 +80,7 @@ Public Class ClsGPS #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/ClsGralFolios.vb b/App_Code/ClsGralFolios.vb index d65f873ba..2705071c7 100644 --- a/App_Code/ClsGralFolios.vb +++ b/App_Code/ClsGralFolios.vb @@ -34,6 +34,7 @@ Public Class ClsGralFolios Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIONES ABIERTAS Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region @@ -72,6 +73,7 @@ Public Class ClsGralFolios Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -90,7 +92,7 @@ Public Class ClsGralFolios #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index ba3ba2c77..cf460fdab 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -18,6 +18,7 @@ Public Class ClsOC Private disposedValue As Boolean = False 'PARA REGISTRAR CONEXION Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region @@ -163,6 +164,7 @@ Public Class ClsOC Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlCommand = New SqlCommand("", SqlConexion) @@ -182,7 +184,7 @@ Public Class ClsOC #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso 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 diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index d8084033f..551593b30 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -75,6 +75,8 @@ Public Class ClsOIEventos Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'PARA REGISTRAR CONEXION Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False + #End Region #Region "Propiedades" @@ -164,6 +166,7 @@ Public Class ClsOIEventos Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlCommand = New SqlCommand("", SqlConexion) @@ -183,7 +186,7 @@ Public Class ClsOIEventos #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso 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 diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 16d4ca047..02e26a446 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -20,7 +20,7 @@ Public Class ClsProductosServicios Private disposedValue As Boolean = False 'PARA REGISTRAR CONEXION Private CveConexion As Integer = 0 - + Private EsTransaccionCompartida As Boolean = False #End Region #Region "Propiedades" @@ -152,6 +152,7 @@ Public Class ClsProductosServicios Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -169,7 +170,7 @@ Public Class ClsProductosServicios #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try diff --git a/App_Code/ClsSAT.vb b/App_Code/ClsSAT.vb index abc93de5a..b5592d9d8 100644 --- a/App_Code/ClsSAT.vb +++ b/App_Code/ClsSAT.vb @@ -32,6 +32,7 @@ Public Class ClsSAT Private ContListado69B As Integer = 0 'PARA REGISTRAR CONEXION Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region #Region "Propiedades" @@ -76,6 +77,7 @@ Public Class ClsSAT Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -95,7 +97,7 @@ Public Class ClsSAT #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso 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 diff --git a/App_Code/ClsVtaVendedores.vb b/App_Code/ClsVtaVendedores.vb index e76734c7f..6949554e1 100644 --- a/App_Code/ClsVtaVendedores.vb +++ b/App_Code/ClsVtaVendedores.vb @@ -15,6 +15,7 @@ Public Class ClsVtaVendedores Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'PARA REGISTRAR CONEXION Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region #Region "Propiedades" @@ -51,6 +52,7 @@ Public Class ClsVtaVendedores Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlCommand = New SqlCommand("", SqlConexion) @@ -70,7 +72,7 @@ Public Class ClsVtaVendedores #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters