usuarios(cerrar session, macaddres), se corrrigio doble click en login, actualizacion signalR
This commit is contained in:
137
LogIn.aspx.vb
137
LogIn.aspx.vb
@@ -170,64 +170,71 @@ Partial Class LogIn
|
||||
Application("GlobalDTUsuarios") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim BtnLogIn_Clickenter As Integer = 0
|
||||
Protected Sub BtnLogIn_Click(ByVal sender As Object, ByVal e As EventArgs) 'Handles CmdLogIn.Click
|
||||
Dim ObjUsuario As New ClsSisUsuarios
|
||||
Dim Usuario As Usuario = Nothing
|
||||
'Dim UsuarioAsignaciones As Usuario = Nothing
|
||||
If BtnLogIn_Clickenter = 0 Then 'esta variable se recicla con cada postaback
|
||||
BtnLogIn_Clickenter = 1
|
||||
Dim ObjUsuario As New ClsSisUsuarios
|
||||
Dim Usuario As Usuario = Nothing
|
||||
'Dim UsuarioAsignaciones As Usuario = Nothing
|
||||
|
||||
Usuario = ObjUsuario.ValidaUsuario(txtUsuario.Text, Encripta(TxtContraseña.Text.Trim), IMEI)
|
||||
'UsuarioAsignaciones = ObjUsuario.ValidaUsuarioAsignacion(Usuario.CveUsuario, Usuario.CveEmpresa)
|
||||
Usuario = ObjUsuario.ValidaUsuario(txtUsuario.Text, Encripta(TxtContraseña.Text.Trim), IMEI)
|
||||
'UsuarioAsignaciones = ObjUsuario.ValidaUsuarioAsignacion(Usuario.CveUsuario, Usuario.CveEmpresa)
|
||||
|
||||
ADSSessionConfig.sessionUser = Usuario
|
||||
ADSSessionConfig.sessionDpage = False
|
||||
ObjUsuario.Dispose()
|
||||
ADSSessionConfig.sessionUser = Usuario
|
||||
ADSSessionConfig.sessionDpage = False
|
||||
ObjUsuario.Dispose()
|
||||
|
||||
If Usuario IsNot Nothing Then
|
||||
CreaObjetoEmpresa(Usuario)
|
||||
ADSSessionConfig.sessionUser.MultipleEmpresa = True
|
||||
If Usuario IsNot Nothing Then
|
||||
If Not Usuario.AutorizadoxIP OrElse (HddAdsCodex.Text.Length > 0 AndAlso Usuario.CodigoAutorizado = HddAdsCodex.Text) Then
|
||||
|
||||
Dim x As New ADSSessionObj(Usuario.CveUsuario, Usuario.CveEmpresa)
|
||||
Dim _sessionid = Encripta(String.Format("{0}|{1}", Usuario.CveUsuario, x.SessionID))
|
||||
x = ADSSessionConfig.SessionManager(OpcionSession.agregarSession, x)
|
||||
CreaObjetoEmpresa(Usuario)
|
||||
ADSSessionConfig.sessionUser.MultipleEmpresa = True
|
||||
|
||||
If Usuario.CvePlataforma = 6 And Usuario.CveRol = 10 Then
|
||||
'PLATAFORMA PORTAL CLIENTE
|
||||
FormsAuthentication.RedirectFromLoginPage(_sessionid, False)
|
||||
Response.Redirect("/PortalCliente/PortalCliente.aspx", True)
|
||||
ElseIf Usuario.CvePlataforma = 7 And Usuario.CveRol = 11 Then
|
||||
'PLATAFORMA PORTAL PROVEEDOR
|
||||
FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
Response.Redirect("/PortalProveedor/PortalProveedor.aspx", True)
|
||||
Dim x As New ADSSessionObj(Usuario.CveUsuario, Usuario.CveEmpresa)
|
||||
Dim _sessionid = Encripta(String.Format("{0}|{1}", Usuario.CveUsuario, x.SessionID))
|
||||
x = ADSSessionConfig.SessionManager(OpcionSession.agregarSession, x)
|
||||
|
||||
ElseIf Usuario.CveRol = 1200 And Usuario.Acceso > 0 Then
|
||||
'PLATAFORMA GPS
|
||||
Usuario.CvePlataforma = 3
|
||||
FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
|
||||
Response.Redirect("/PortalGPS/InicioGPS.aspx", True)
|
||||
Else
|
||||
'PLATAFORMA SIG
|
||||
CType(Session("UsuarioSIG"), Usuario).CvePlataforma = 1
|
||||
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count >= 1 Then
|
||||
If dt.Rows.Count > 1 Then
|
||||
Usuario.MultipleEmpresa = True
|
||||
End If
|
||||
If Usuario.CvePlataforma = 6 And Usuario.CveRol = 10 Then
|
||||
'PLATAFORMA PORTAL CLIENTE
|
||||
FormsAuthentication.RedirectFromLoginPage(_sessionid, False)
|
||||
Response.Redirect("/PortalCliente/PortalCliente.aspx", True)
|
||||
ElseIf Usuario.CvePlataforma = 7 And Usuario.CveRol = 11 Then
|
||||
'PLATAFORMA PORTAL PROVEEDOR
|
||||
FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
Response.Redirect("/PortalProveedor/PortalProveedor.aspx", True)
|
||||
|
||||
ElseIf Usuario.CveRol = 1200 And Usuario.Acceso > 0 Then
|
||||
'PLATAFORMA GPS
|
||||
Usuario.CvePlataforma = 3
|
||||
FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
|
||||
Response.Redirect("/PortalGPS/InicioGPS.aspx", True)
|
||||
Else
|
||||
'PLATAFORMA SIG
|
||||
CType(Session("UsuarioSIG"), Usuario).CvePlataforma = 1
|
||||
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count >= 1 Then
|
||||
If dt.Rows.Count > 1 Then
|
||||
Usuario.MultipleEmpresa = True
|
||||
End If
|
||||
FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
|
||||
End If
|
||||
End If
|
||||
dt.Dispose()
|
||||
End If
|
||||
Else
|
||||
Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
dt.Dispose()
|
||||
'If Usuario.Acceso > 0 Then
|
||||
|
||||
'Else
|
||||
' Alert("Usuario con acceso limitado.", TipoMensaje.MsgAdvertencia)
|
||||
'End If
|
||||
Else
|
||||
Alert("Usuario y/o Contraseña incorrectos.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
'If Usuario.Acceso > 0 Then
|
||||
|
||||
'Else
|
||||
' Alert("Usuario con acceso limitado.", TipoMensaje.MsgAdvertencia)
|
||||
'End If
|
||||
Else
|
||||
Alert("Usuario y/o Contraseña incorrectos.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -250,34 +257,38 @@ Partial Class LogIn
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
End Sub
|
||||
|
||||
Dim BtnGuardar_Clickenter As Integer = 0
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
Dim TieneError As Boolean = False
|
||||
Dim ObjUsuario As New ClsSisUsuarios
|
||||
If BtnGuardar_Clickenter = 0 Then 'esta variable se recicla con cada postaback
|
||||
BtnGuardar_Clickenter = 1
|
||||
Dim TieneError As Boolean = False
|
||||
Dim ObjUsuario As New ClsSisUsuarios
|
||||
|
||||
If ObjUsuario.UpdateUsuarioContrasenia(Encripta(TxtContrasenia1.Text), CveUsuario, CveEmpresa) Then
|
||||
If ObjUsuario.GetUsuarios(CveUsuario) Then
|
||||
If ObjUsuario.DtResultados.Rows.Count = 1 Then
|
||||
Dim dr As DataRow = ObjUsuario.DtResultados.Rows(0)
|
||||
If ObjUsuario.UpdateUsuarioContrasenia(Encripta(TxtContrasenia1.Text), CveUsuario, CveEmpresa) Then
|
||||
If ObjUsuario.GetUsuarios(CveUsuario) Then
|
||||
If ObjUsuario.DtResultados.Rows.Count = 1 Then
|
||||
Dim dr As DataRow = ObjUsuario.DtResultados.Rows(0)
|
||||
|
||||
txtUsuario.Text = dr("Usuario").ToString
|
||||
Dim Contraseña As String = Decripta(dr("Contraseña").ToString)
|
||||
TxtContraseña.Text = Contraseña
|
||||
txtUsuario.Text = dr("Usuario").ToString
|
||||
Dim Contraseña As String = Decripta(dr("Contraseña").ToString)
|
||||
TxtContraseña.Text = Contraseña
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
ObjUsuario.Dispose()
|
||||
ObjUsuario.Dispose()
|
||||
|
||||
If Not TieneError Then
|
||||
BtnLogIn_Click(Nothing, Nothing)
|
||||
If Not TieneError Then
|
||||
BtnLogIn_Clickenter = 0
|
||||
BtnLogIn_Click(Nothing, Nothing)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user