-- mejora en direccionamiento de conexion string

This commit is contained in:
2024-04-18 20:11:30 -07:00
parent 0f13301c16
commit 4628c35a7a
6 changed files with 7 additions and 11 deletions

View File

@@ -92,7 +92,7 @@ Public Class ClsPaginas
If HttpContext.Current.Session("UsuarioSIG") Is Nothing Then If HttpContext.Current.Session("UsuarioSIG") Is Nothing Then
Return "" Return ""
Else Else
Return DirectCast(HttpContext.Current.Session("UsuarioSIG"), Usuario).Empresa.RutaDB Return DirectCast(HttpContext.Current.Session("UsuarioSIG"), Usuario).RutaDB
End If End If
Catch ex As Exception Catch ex As Exception
Return "" Return ""

View File

@@ -22,6 +22,7 @@ Public Class ClsSisUsuarios
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'PARA REGISTRAR CONEXION 'PARA REGISTRAR CONEXION
Private CveConexion As Integer = 0 Private CveConexion As Integer = 0
Private ConnStr As String = ""
#End Region #End Region
@@ -68,6 +69,7 @@ Public Class ClsSisUsuarios
If TransaccionCompartida Is Nothing Then If TransaccionCompartida Is Nothing Then
SqlConexion = New SqlConnection SqlConexion = New SqlConnection
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
ConnStr = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
Try Try
SqlConexion.Open() SqlConexion.Open()
Catch ex As Exception Catch ex As Exception
@@ -235,6 +237,7 @@ Public Class ClsSisUsuarios
Retorno.CodigoAutorizado = Data.Rows(0)("CodigoAutorizado").ToString() Retorno.CodigoAutorizado = Data.Rows(0)("CodigoAutorizado").ToString()
Dim autoip As String = Data.Rows(0)("AutorizadoxIP").ToString().ToUpper() Dim autoip As String = Data.Rows(0)("AutorizadoxIP").ToString().ToUpper()
Retorno.AutorizadoxIP = (autoip = "1" OrElse autoip = "TRUE") Retorno.AutorizadoxIP = (autoip = "1" OrElse autoip = "TRUE")
Retorno.RutaDB = ConnStr
' Esto es parta el punto de venta ' Esto es parta el punto de venta
Retorno.CveSucursal = Data.Rows(0)("CveSubProyecto").ToString().ToEntero Retorno.CveSucursal = Data.Rows(0)("CveSubProyecto").ToString().ToEntero

View File

@@ -97,8 +97,6 @@ Public Class Empresa
Public Property Timbres As Integer Public Property Timbres As Integer
Public Property _RutaArchivos As String Public Property _RutaArchivos As String
Public Property ContaFormatoCuenta As String Public Property ContaFormatoCuenta As String
Public Property RutaDB As String
Public ReadOnly Property Ruta As String Public ReadOnly Property Ruta As String
Get Get
If Not String.IsNullOrEmpty(_RutaArchivos) AndAlso ClsPaginas.EsProduccion Then If Not String.IsNullOrEmpty(_RutaArchivos) AndAlso ClsPaginas.EsProduccion Then

View File

@@ -50,23 +50,18 @@ Public Class Usuario
Public Property ListaPersonalizacion As Hashtable Public Property ListaPersonalizacion As Hashtable
Public Property Acceso As Integer Public Property Acceso As Integer
Public Property TipoControl As Integer Public Property TipoControl As Integer
Public Property CvePlataforma As Integer Public Property CvePlataforma As Integer
Public Property DescuentoAutorizado As Double Public Property DescuentoAutorizado As Double
Public Property AutorizadoxIP As Boolean Public Property AutorizadoxIP As Boolean
Public Property CodigoAutorizado As String Public Property CodigoAutorizado As String
Public Property UTCOffset As Integer Public Property UTCOffset As Integer
Public Property PorcentajeMaximoAutorizacion As Decimal Public Property PorcentajeMaximoAutorizacion As Decimal
Public Property DiasMaximoAutorizacion As Integer Public Property DiasMaximoAutorizacion As Integer
Public Property isLoginseted As Boolean = False Public Property isLoginseted As Boolean = False
Public Property SesionBloqueada As Boolean = False Public Property SesionBloqueada As Boolean = False
Public Property ErrorDesbloqueo As Boolean = False Public Property ErrorDesbloqueo As Boolean = False
Public Property MsgErrorDesbloqueo As String = "" Public Property MsgErrorDesbloqueo As String = ""
Public Property RutaDB As String
Public ReadOnly Property FechaActualCliente As DateTime Public ReadOnly Property FechaActualCliente As DateTime
Get Get

View File

@@ -79,6 +79,7 @@ Public Class E119 : Implements IHttpHandler
End If End If
UsuarioActual.Empresa = ObjEmpresa.Empresa UsuarioActual.Empresa = ObjEmpresa.Empresa
If UsuarioActual.Empresa.RutaDB = "" Then UsuarioActual.Empresa.RutaDB = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
End If End If
ObjEmpresa.Dispose() ObjEmpresa.Dispose()
End Sub End Sub

View File

@@ -358,7 +358,6 @@ Partial Class LogIn
End If End If
UsuarioActual.Empresa = ObjEmpresa.Empresa UsuarioActual.Empresa = ObjEmpresa.Empresa
If UsuarioActual.Empresa.RutaDB = "" Then UsuarioActual.Empresa.RutaDB = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
Else Else
End If End If
ObjEmpresa.Dispose() ObjEmpresa.Dispose()