- mejora cambio de conexión
This commit is contained in:
@@ -14,7 +14,7 @@ Partial Class PopUpSeleccionarEmpresa
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub GetEmpresas()
|
Private Sub GetEmpresas()
|
||||||
GlobalDTUsuarios(-1, -1) = Nothing
|
GlobalDTUsuarios(-1, -1) = Nothing
|
||||||
Dim Dt As Data.DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario)
|
Dim Dt As Data.DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario)
|
||||||
|
|
||||||
If Dt IsNot Nothing Then
|
If Dt IsNot Nothing Then
|
||||||
@@ -96,100 +96,97 @@ Partial Class PopUpSeleccionarEmpresa
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
'Protected Sub GvPortalCliente_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalCliente.RowCommand
|
Protected Sub GvPortalCliente_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalCliente.RowCommand
|
||||||
' If e.CommandName = "Cambia" Then
|
If e.CommandName = "Cambia" Then
|
||||||
' Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||||
|
|
||||||
' If gvr IsNot Nothing Then
|
If gvr IsNot Nothing Then
|
||||||
|
Dim Usuario As Usuario = Nothing
|
||||||
|
Dim tGrupoEmpresa As String = ClsPaginas.GlobalGrupoEmpresa(Request.Url.Host.ToUpper())
|
||||||
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexionDominio(Request.Url.Host.ToUpper())
|
||||||
|
|
||||||
' Dim ObjUsuario As New ClsSisUsuarios
|
Dim ObjUsuario As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
' Dim Usuario As Usuario = Nothing
|
Usuario = ObjUsuario.ValidaUsuario(gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"), CveEmpresa:=gvr.DataKey("CveEmpresa").ToEntero)
|
||||||
' Usuario = ObjUsuario.ValidaUsuarioPortalCliente(gvr.DataKey("CveCliente").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
|
ObjUsuario.Dispose()
|
||||||
|
'Dim ObjUsuario As New ClsSisUsuarios
|
||||||
|
'Dim Usuario As Usuario = Nothing
|
||||||
|
'Usuario = ObjUsuario.ValidaUsuarioPortalCliente(gvr.DataKey("CveCliente").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
|
||||||
|
|
||||||
' ObjUsuario.Dispose()
|
'ObjUsuario.Dispose()
|
||||||
|
|
||||||
' If Usuario IsNot Nothing Then
|
If Usuario IsNot Nothing Then
|
||||||
' Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||||
|
|
||||||
' Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
|
Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
|
||||||
' Usuario.ModoSimulacion = ModoSimulacion
|
Usuario.ModoSimulacion = ModoSimulacion
|
||||||
' ADSSession.ADSSessionConfig.sessionUser = Usuario
|
ADSSession.ADSSessionConfig.sessionUser = Usuario
|
||||||
' ADSSession.ADSSessionConfig.sessionDpage = False
|
ADSSession.ADSSessionConfig.sessionDpage = False
|
||||||
|
|
||||||
' If dt IsNot Nothing Then
|
If dt IsNot Nothing Then
|
||||||
' If dt.Rows.Count >= 1 Then
|
If dt.Rows.Count >= 1 Then
|
||||||
' If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
||||||
' Usuario.CvePlataforma = 6
|
Usuario.CvePlataforma = 6
|
||||||
' UsuarioActual.CveEmpresa = gvr.DataKey("CveEmpresa").ToEntero()
|
'UsuarioActual.CveEmpresa = gvr.DataKey("CveEmpresa").ToEntero()
|
||||||
' ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, UsuarioActual.CveEmpresa)
|
'ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, UsuarioActual.CveEmpresa)
|
||||||
' CreaObjetoEmpresa(Usuario)
|
'CreaObjetoEmpresa(Usuario)
|
||||||
' 'si la contraseña es la prederminada, pide la nueva contraseña
|
'si la contraseña es la prederminada, pide la nueva contraseña
|
||||||
' 'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False)
|
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False)
|
||||||
' RegistraScript("Ir4();")
|
RegistraScript("Ir4();")
|
||||||
' End If
|
End If
|
||||||
' End If
|
End If
|
||||||
' dt.Dispose()
|
dt.Dispose()
|
||||||
' End If
|
End If
|
||||||
|
|
||||||
' End If
|
End If
|
||||||
|
|
||||||
' End If
|
End If
|
||||||
'End Sub
|
End Sub
|
||||||
'Protected Sub GvPortalProveedor_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalProveedor.RowCommand
|
Protected Sub GvPortalProveedor_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalProveedor.RowCommand
|
||||||
' If e.CommandName = "Cambia" Then
|
If e.CommandName = "Cambia" Then
|
||||||
' Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||||
|
|
||||||
' If gvr IsNot Nothing Then
|
If gvr IsNot Nothing Then
|
||||||
' Dim tGrupoEmpresa As String = ""
|
Dim Usuario As Usuario = Nothing
|
||||||
' Dim NombreCadena As String = "Conexion"
|
Dim tGrupoEmpresa As String = ClsPaginas.GlobalGrupoEmpresa(Request.Url.Host.ToUpper())
|
||||||
' Dim Usuario As Usuario = Nothing
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexionDominio(Request.Url.Host.ToUpper())
|
||||||
' If Request.Url.Host.ToUpper().Contains("EMD".ToUpper()) Then tGrupoEmpresa = "EMD"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("BDH".ToUpper()) Then tGrupoEmpresa = "BDH"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("ECONOLLANTAS".ToUpper()) Then tGrupoEmpresa = "ECONOLLANTAS" : NombreCadena = "ConexionEcono"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("JAM".ToUpper()) Then tGrupoEmpresa = "JAM"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("CITRUS".ToUpper()) Then tGrupoEmpresa = "CITRUS"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("KINO".ToUpper()) Then tGrupoEmpresa = "KINO"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("VSH".ToUpper()) Then tGrupoEmpresa = "VSH"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("AJAM".ToUpper()) Then tGrupoEmpresa = "AJAM"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("ALATEL".ToUpper()) Then tGrupoEmpresa = "ALATEL"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("SERVEC".ToUpper()) Then tGrupoEmpresa = "SERVEC"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("SMS".ToUpper()) Then tGrupoEmpresa = "SMS"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("VYA".ToUpper()) Then tGrupoEmpresa = "VYA"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("GRUPODIAZ".ToUpper()) Then tGrupoEmpresa = "GRUPODIAZ"
|
|
||||||
' If Request.Url.Host.ToUpper().Contains("FERRETERA".ToUpper()) Then tGrupoEmpresa = "FERRETERA"
|
|
||||||
|
|
||||||
' Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
|
Dim ObjUsuario As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
' Usuario = ObjUsuario.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
|
Usuario = ObjUsuario.ValidaUsuario(gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"), CveEmpresa:=gvr.DataKey("CveEmpresa").ToEntero)
|
||||||
|
ObjUsuario.Dispose()
|
||||||
|
|
||||||
' ObjUsuario.Dispose()
|
'Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
|
||||||
|
'Usuario = ObjUsuario.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
|
||||||
|
|
||||||
' If Usuario IsNot Nothing Then
|
'ObjUsuario.Dispose()
|
||||||
' Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
|
||||||
|
|
||||||
' Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
|
If Usuario IsNot Nothing Then
|
||||||
' Usuario.ModoSimulacion = ModoSimulacion
|
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||||
' ADSSession.ADSSessionConfig.sessionUser = Usuario
|
|
||||||
' ADSSession.ADSSessionConfig.sessionDpage = False
|
|
||||||
|
|
||||||
' If dt IsNot Nothing Then
|
Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
|
||||||
' If dt.Rows.Count >= 1 Then
|
Usuario.ModoSimulacion = ModoSimulacion
|
||||||
' If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
ADSSession.ADSSessionConfig.sessionUser = Usuario
|
||||||
' Usuario.CvePlataforma = 7
|
ADSSession.ADSSessionConfig.sessionDpage = False
|
||||||
' UsuarioActual.CveEmpresa = gvr.DataKey("CveEmpresa").ToEntero()
|
|
||||||
' ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, UsuarioActual.CveEmpresa)
|
|
||||||
' CreaObjetoEmpresa(Usuario)
|
|
||||||
' 'si la contraseña es la prederminada, pide la nueva contraseña
|
|
||||||
' 'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False)
|
|
||||||
' RegistraScript("Ir5();")
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
' dt.Dispose()
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' End If
|
If dt IsNot Nothing Then
|
||||||
|
If dt.Rows.Count >= 1 Then
|
||||||
|
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
||||||
|
Usuario.CvePlataforma = 7
|
||||||
|
UsuarioActual.CveProveedor = gvr.DataKey("CveProveedor").ToEntero
|
||||||
|
'UsuarioActual.CveEmpresa = gvr.DataKey("CveEmpresa").ToEntero()
|
||||||
|
'ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, UsuarioActual.CveEmpresa)
|
||||||
|
'CreaObjetoEmpresa(Usuario)
|
||||||
|
'si la contraseña es la prederminada, pide la nueva contraseña
|
||||||
|
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False)
|
||||||
|
RegistraScript("Ir5();")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
dt.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
' End If
|
End If
|
||||||
'End Sub
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
#Region "F U N C I O N E S"
|
#Region "F U N C I O N E S"
|
||||||
Protected Sub BtnSetWindows_Click(sender As Object, e As System.EventArgs) Handles BtnSetWindows.Click
|
Protected Sub BtnSetWindows_Click(sender As Object, e As System.EventArgs) Handles BtnSetWindows.Click
|
||||||
|
|||||||
Reference in New Issue
Block a user