-- cambio de clase de validación de usuario
This commit is contained in:
@@ -95,24 +95,10 @@ Partial Class Sistemas_PopUpCambiaUsuario
|
||||
tContraseña = gvr.DataKey("Contraseña").ToString
|
||||
tCveEmpresa = gvr.DataKey("CveEmpresa").ToString.ToEntero
|
||||
|
||||
Dim tGrupoEmpresa As String = ""
|
||||
Dim NombreCadena As String = "Conexion"
|
||||
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 tGrupoEmpresa As String = ClsPaginas.GlobalGrupoEmpresa(Request.Url.Host.ToUpper())
|
||||
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexionDominio(Request.Url.Host.ToUpper())
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
|
||||
Dim ObjUsuario As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||
Dim Usuario As Usuario
|
||||
'Dim UsuarioAsignaciones As Usuario
|
||||
|
||||
@@ -127,8 +113,6 @@ Partial Class Sistemas_PopUpCambiaUsuario
|
||||
ADSSessionConfig.sessionUser.CvePlataforma = 3
|
||||
End If
|
||||
ADSSessionConfig.sessionDpage = False
|
||||
|
||||
|
||||
ADSSessionConfig.sessionUser.ModoSimulacion = True
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
@@ -137,36 +121,15 @@ Partial Class Sistemas_PopUpCambiaUsuario
|
||||
End If
|
||||
End If
|
||||
dt.Dispose()
|
||||
ADSSessionConfig.sessionUser.CveEmpresa = Usuario.Empresa.CveEmpresa
|
||||
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, Usuario.Empresa.CveEmpresa)
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
If ObjEmpresa.GetEmpresas(tCveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
If ObjEmpresa.GetEmpresasFuncionalidades(tCveEmpresa) Then
|
||||
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||
|
||||
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||
For Each Row As Data.DataRow In dttmp.Rows
|
||||
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||
Next
|
||||
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||
|
||||
End If
|
||||
|
||||
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||
ADSSessionConfig.sessionUser.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
|
||||
|
||||
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, ObjEmpresa.Empresa.CveEmpresa)
|
||||
Else
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
If UsuarioActual.CveCliente > 0 Then
|
||||
CargaZonasHorarias(UsuarioActual)
|
||||
End If
|
||||
End If
|
||||
|
||||
RegistraScript("gotourl();")
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaZonasHorarias(ByRef UsuarioActual As Usuario)
|
||||
|
||||
@@ -92,25 +92,11 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
|
||||
tUsuario = gvr.DataKey("Usuario").ToString
|
||||
tContraseña = gvr.DataKey("Contraseña").ToString
|
||||
tCveEmpresa = gvr.DataKey("CveEmpresa").ToString.ToEntero
|
||||
Dim tGrupoEmpresa As String = ""
|
||||
Dim NombreCadena As String = "Conexion"
|
||||
|
||||
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 tGrupoEmpresa As String = ClsPaginas.GlobalGrupoEmpresa(Request.Url.Host.ToUpper())
|
||||
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexionDominio(Request.Url.Host.ToUpper())
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
|
||||
Dim ObjUsuario As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||
Dim Usuario As Usuario
|
||||
'Dim UsuarioAsignaciones As Usuario
|
||||
|
||||
@@ -130,7 +116,7 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
|
||||
ADSSessionConfig.sessionUser.ModoSimulacion = False
|
||||
ADSSessionConfig.sessionUser.ModoSimulacionXEmpresa = True
|
||||
|
||||
UsuarioActual.Empresa = objempresa
|
||||
UsuarioActual.Empresa = Usuario.Empresa
|
||||
dt.Dispose()
|
||||
|
||||
If UsuarioActual.CveCliente > 0 Then
|
||||
|
||||
@@ -60,150 +60,136 @@ Partial Class PopUpSeleccionarEmpresa
|
||||
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||
|
||||
If gvr IsNot Nothing Then
|
||||
Dim tGrupoEmpresa As String = ""
|
||||
Dim NombreCadena As String = "Conexion"
|
||||
Dim Usuario As Usuario = Nothing
|
||||
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 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 ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||
Usuario = ObjUsuario.ValidaUsuario(gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"), CveEmpresa:=gvr.DataKey("CveEmpresa").ToEntero)
|
||||
ObjUsuario.Dispose()
|
||||
|
||||
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
|
||||
Usuario.ModoSimulacion = ModoSimulacion
|
||||
ADSSession.ADSSessionConfig.sessionUser = Usuario
|
||||
ADSSession.ADSSessionConfig.sessionDpage = False
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count >= 1 Then
|
||||
Dim CveEmpresa = e.CommandArgument.ToString().ToEntero()
|
||||
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
||||
Usuario.CvePlataforma = 1
|
||||
Usuario.CveEmpresa = CveEmpresa
|
||||
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, CveEmpresa)
|
||||
CreaObjetoEmpresa(Usuario)
|
||||
RegistraScript("Ir3();")
|
||||
End If
|
||||
End If
|
||||
dt.Dispose()
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub GvPortalCliente_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalCliente.RowCommand
|
||||
If e.CommandName = "Cambia" Then
|
||||
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||
|
||||
If gvr IsNot Nothing Then
|
||||
|
||||
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()
|
||||
|
||||
If Usuario IsNot Nothing Then
|
||||
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
|
||||
Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
|
||||
Usuario.ModoSimulacion = ModoSimulacion
|
||||
ADSSession.ADSSessionConfig.sessionUser = Usuario
|
||||
ADSSession.ADSSessionConfig.sessionDpage = False
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count >= 1 Then
|
||||
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
||||
Usuario.CvePlataforma = 6
|
||||
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("Ir4();")
|
||||
End If
|
||||
End If
|
||||
dt.Dispose()
|
||||
Usuario.MultipleEmpresa = True
|
||||
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, e.CommandArgument.ToString().ToEntero())
|
||||
RegistraScript("Ir3();")
|
||||
'If dt IsNot Nothing Then
|
||||
' If dt.Rows.Count >= 1 Then
|
||||
' Dim CveEmpresa = e.CommandArgument.ToString().ToEntero()
|
||||
' If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
||||
' Usuario.CvePlataforma = 1
|
||||
' Usuario.CveEmpresa = CveEmpresa
|
||||
' ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, CveEmpresa)
|
||||
' CreaObjetoEmpresa(Usuario)
|
||||
' RegistraScript("Ir3();")
|
||||
' End If
|
||||
'End If
|
||||
'dt.Dispose()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub GvPortalProveedor_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalProveedor.RowCommand
|
||||
If e.CommandName = "Cambia" Then
|
||||
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||
'Protected Sub GvPortalCliente_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalCliente.RowCommand
|
||||
' If e.CommandName = "Cambia" Then
|
||||
' Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||
|
||||
If gvr IsNot Nothing Then
|
||||
Dim tGrupoEmpresa As String = ""
|
||||
Dim NombreCadena As String = "Conexion"
|
||||
Dim Usuario As Usuario = Nothing
|
||||
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"
|
||||
' If gvr IsNot Nothing Then
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
|
||||
Usuario = ObjUsuario.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
|
||||
' 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
|
||||
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
' If Usuario IsNot Nothing Then
|
||||
' Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
|
||||
Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
|
||||
Usuario.ModoSimulacion = ModoSimulacion
|
||||
ADSSession.ADSSessionConfig.sessionUser = Usuario
|
||||
ADSSession.ADSSessionConfig.sessionDpage = False
|
||||
' Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
|
||||
' Usuario.ModoSimulacion = ModoSimulacion
|
||||
' ADSSession.ADSSessionConfig.sessionUser = Usuario
|
||||
' ADSSession.ADSSessionConfig.sessionDpage = False
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count >= 1 Then
|
||||
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
||||
Usuario.CvePlataforma = 7
|
||||
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
|
||||
' If dt IsNot Nothing Then
|
||||
' If dt.Rows.Count >= 1 Then
|
||||
' If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
||||
' Usuario.CvePlataforma = 6
|
||||
' 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("Ir4();")
|
||||
' End If
|
||||
' End If
|
||||
' dt.Dispose()
|
||||
' End If
|
||||
|
||||
End If
|
||||
' End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
' End If
|
||||
'End Sub
|
||||
'Protected Sub GvPortalProveedor_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalProveedor.RowCommand
|
||||
' If e.CommandName = "Cambia" Then
|
||||
' Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||
|
||||
' If gvr IsNot Nothing Then
|
||||
' Dim tGrupoEmpresa As String = ""
|
||||
' Dim NombreCadena As String = "Conexion"
|
||||
' Dim Usuario As Usuario = Nothing
|
||||
' 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)
|
||||
' Usuario = ObjUsuario.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
|
||||
|
||||
' ObjUsuario.Dispose()
|
||||
|
||||
' If Usuario IsNot Nothing Then
|
||||
' Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
|
||||
' Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
|
||||
' Usuario.ModoSimulacion = ModoSimulacion
|
||||
' ADSSession.ADSSessionConfig.sessionUser = Usuario
|
||||
' ADSSession.ADSSessionConfig.sessionDpage = False
|
||||
|
||||
' If dt IsNot Nothing Then
|
||||
' If dt.Rows.Count >= 1 Then
|
||||
' If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
|
||||
' Usuario.CvePlataforma = 7
|
||||
' 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
|
||||
|
||||
#Region "F U N C I O N E S"
|
||||
Protected Sub BtnSetWindows_Click(sender As Object, e As System.EventArgs) Handles BtnSetWindows.Click
|
||||
|
||||
@@ -21,45 +21,45 @@ Partial Class Sistemas_Usuarios
|
||||
End Property
|
||||
|
||||
#Region "Permisos"
|
||||
Private Property PermisoEditar As Boolean
|
||||
Get
|
||||
Return CType(ViewState("PermisoEditar"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PermisoEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property PermisoEditar As Boolean
|
||||
Get
|
||||
Return CType(ViewState("PermisoEditar"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PermisoEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property PermisoModulos As Boolean
|
||||
Get
|
||||
Return CType(ViewState("PermisoModulos"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PermisoModulos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property PermisoModulos As Boolean
|
||||
Get
|
||||
Return CType(ViewState("PermisoModulos"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PermisoModulos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property PermisoProcesos As Boolean
|
||||
Get
|
||||
Return CType(ViewState("PermisoProcesos"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PermisoProcesos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property PermisoProcesos As Boolean
|
||||
Get
|
||||
Return CType(ViewState("PermisoProcesos"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PermisoProcesos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property PermisoRestablecerContraseña As Boolean
|
||||
Get
|
||||
Return CType(ViewState("PermisoProcesos"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PermisoProcesos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property PermisoRestablecerContraseña As Boolean
|
||||
Get
|
||||
Return CType(ViewState("PermisoProcesos"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PermisoProcesos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
|
||||
|
||||
@@ -67,12 +67,12 @@ Partial Class Sistemas_Usuarios
|
||||
ViewState("CveRol") = -1
|
||||
CargarEmpresa()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Public Sub CargaDatos()
|
||||
|
||||
Dim Usuario As New ClsSisUsuarios
|
||||
Dim Usuario As New ClsSisUsuarios
|
||||
If Usuario.GetUsuarios(-1, -1, Estatus:=DdlEsatus.SelectedValue.ToEntero) Then
|
||||
If UsuarioActual.CveRol <> 1 Then
|
||||
DtUsuarios = Usuario.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0} AND CveRol <> 1", DdlEmpresa.SelectedValue))
|
||||
@@ -84,13 +84,13 @@ Partial Class Sistemas_Usuarios
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
Usuario.Dispose()
|
||||
Usuario.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub consultar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -70,15 +70,14 @@ Public Class WSApp
|
||||
#Region "M E T O D O S - S E R V I C I O"
|
||||
Public Function ValidaUsuario(CveUsuario As Integer) As Usuario
|
||||
Dim UsuarioActual As Usuario = Nothing
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
If ObjUsuarios.GetUsuarios(CveUsuario) Then
|
||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
||||
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
||||
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia)
|
||||
CreaObjetoEmpresa(UsuarioActual)
|
||||
End If
|
||||
End If
|
||||
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion
|
||||
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(CveUsuario)
|
||||
'If UsuarioActual IsNot Nothing Then
|
||||
' Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
||||
' Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
||||
' UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia)
|
||||
|
||||
'End If
|
||||
ObjUsuarios.Dispose()
|
||||
Return UsuarioActual
|
||||
End Function
|
||||
@@ -87,7 +86,7 @@ Public Class WSApp
|
||||
Dim retorno As String = ""
|
||||
|
||||
Dim Salida As WSUSER = Nothing
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion
|
||||
Dim ObjClientes As New ClsClientes
|
||||
Try
|
||||
Dim UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Encripta(Contrasenia))
|
||||
|
||||
@@ -42,7 +42,7 @@ Public Class WSCGame
|
||||
Dim Entrada = JsonConvert.DeserializeAnonymousType(decripParams, Estructura)
|
||||
|
||||
If Not IsNothing(Entrada) Then
|
||||
Dim tUsuario As New ClsSisUsuarios
|
||||
Dim tUsuario As New ClsSisUsuarioAutenticacion
|
||||
Dim UsuarioActual = tUsuario.ValidaUsuario(Entrada.Usuario, Encripta(Entrada.Contrasenia))
|
||||
tUsuario.Dispose()
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ Public Class WSGPSApp
|
||||
<WebMethod>
|
||||
Public Function Login(params As String) As String
|
||||
Dim Retorno As String = ""
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion
|
||||
Try
|
||||
Dim json = Decripta(params, "AES")
|
||||
Dim Datos As MWSLogin2 = JsonConvert.DeserializeObject(Of MWSLogin2)(json)
|
||||
@@ -137,8 +137,8 @@ Public Class WSGPSApp
|
||||
Dim UsuariosModulos As New List(Of WsModulos)
|
||||
Dim Empresas As New List(Of WsEmpresa)
|
||||
Dim Clientes As New List(Of WsClientePortalGPS)
|
||||
|
||||
If ObjUsuarios.GetUsuariosModulos(UsuarioRetorno.CveUsuario, -1) Then
|
||||
Dim objUsr As New ClsSisUsuarios(UsuarioActual:=UsuarioActual)
|
||||
If objUsr.GetUsuariosModulos(UsuarioRetorno.CveUsuario, -1) Then
|
||||
Dim DtModulos As DataTable = ObjUsuarios.DtResultados.FiltraParametros("CvePlataforma = 5 AND Permitir = 1")
|
||||
For Each Row As DataRow In DtModulos.Rows
|
||||
UsuariosModulos.Add(New WsModulos With {.CveModulo = Row("CveModulo").ToString.ToEntero, .CvePadre = Row("CvePadre").ToString.ToEntero, .CvePlataforma = 5, .Estilo = Row("Estilo").ToString, .Liga = Row("Liga").ToString, .Modulo = Row("Modulo").ToString, .Parametros = Row("Parametros").ToString})
|
||||
@@ -146,6 +146,7 @@ Public Class WSGPSApp
|
||||
DtModulos.Dispose()
|
||||
DtModulos = Nothing
|
||||
End If
|
||||
objUsr.Dispose()
|
||||
UsuarioRetorno.Modulos = UsuariosModulos
|
||||
Dim DtClientes As DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario).FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")
|
||||
If DtClientes IsNot Nothing Then
|
||||
@@ -185,96 +186,97 @@ Public Class WSGPSApp
|
||||
|
||||
End Function
|
||||
'<SoapHeader("Credentials")>
|
||||
<WebMethod>
|
||||
Public Function Login2(params As String) As String
|
||||
Dim Retorno As String = ""
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
Try
|
||||
Dim json = Decripta(params, "AES")
|
||||
Dim Datos As MWSLogin2 = JsonConvert.DeserializeObject(Of MWSLogin2)(json)
|
||||
Dim UsuarioActual = ObjUsuarios.ValidaUsuario(Decripta(Datos.Usuario, "AES"), Encripta(Decripta(Datos.Contraseña, "AES")))
|
||||
'<WebMethod>
|
||||
'Public Function Login2(params As String) As String
|
||||
' Dim Retorno As String = ""
|
||||
' Dim ObjUsuarios As New ClsSisUsuarioAutenticacion
|
||||
' Try
|
||||
' Dim json = Decripta(params, "AES")
|
||||
' Dim Datos As MWSLogin2 = JsonConvert.DeserializeObject(Of MWSLogin2)(json)
|
||||
' Dim UsuarioActual = ObjUsuarios.ValidaUsuario(Decripta(Datos.Usuario, "AES"), Encripta(Decripta(Datos.Contraseña, "AES")))
|
||||
|
||||
If UsuarioActual IsNot Nothing Then
|
||||
Dim UsuarioRetorno As New WSUSER2
|
||||
UsuarioRetorno.CveUsuario = UsuarioActual.CveUsuario
|
||||
UsuarioRetorno.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
UsuarioRetorno.CveCliente = UsuarioActual.CveCliente
|
||||
UsuarioRetorno.Usuario = UsuarioActual.Usuario
|
||||
UsuarioRetorno.Nombre = UsuarioActual.Nombre
|
||||
UsuarioRetorno.CveRol = UsuarioActual.CveRol
|
||||
UsuarioRetorno.Rol = UsuarioActual.Rol
|
||||
UsuarioRetorno.Contrasenia = UsuarioActual.Contraseña
|
||||
UsuarioRetorno.CveSubProyecto = UsuarioActual.CveSubProyecto
|
||||
UsuarioRetorno.Procesos = UsuarioActual.Procesos.Values.Cast(Of String).ToList()
|
||||
' If UsuarioActual IsNot Nothing Then
|
||||
' Dim UsuarioRetorno As New WSUSER2
|
||||
' UsuarioRetorno.CveUsuario = UsuarioActual.CveUsuario
|
||||
' UsuarioRetorno.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
' UsuarioRetorno.CveCliente = UsuarioActual.CveCliente
|
||||
' UsuarioRetorno.Usuario = UsuarioActual.Usuario
|
||||
' UsuarioRetorno.Nombre = UsuarioActual.Nombre
|
||||
' UsuarioRetorno.CveRol = UsuarioActual.CveRol
|
||||
' UsuarioRetorno.Rol = UsuarioActual.Rol
|
||||
' UsuarioRetorno.Contrasenia = UsuarioActual.Contraseña
|
||||
' UsuarioRetorno.CveSubProyecto = UsuarioActual.CveSubProyecto
|
||||
' UsuarioRetorno.Procesos = UsuarioActual.Procesos.Values.Cast(Of String).ToList()
|
||||
|
||||
Dim UsuariosModulos As New List(Of WsModulos)
|
||||
Dim Empresas As New List(Of WsEmpresa)
|
||||
Dim Clientes As New List(Of WsClientePortalGPS)
|
||||
' Dim UsuariosModulos As New List(Of WsModulos)
|
||||
' Dim Empresas As New List(Of WsEmpresa)
|
||||
' Dim Clientes As New List(Of WsClientePortalGPS)
|
||||
|
||||
If ObjUsuarios.GetUsuariosModulos(UsuarioRetorno.CveUsuario, -1) Then
|
||||
Dim DtModulos As DataTable = ObjUsuarios.DtResultados.FiltraParametros("CvePlataforma = 5 AND Permitir = 1")
|
||||
For Each Row As DataRow In DtModulos.Rows
|
||||
UsuariosModulos.Add(New WsModulos With {.CveModulo = Row("CveModulo").ToString.ToEntero, .CvePadre = Row("CvePadre").ToString.ToEntero, .CvePlataforma = 5, .Estilo = Row("Estilo").ToString, .Liga = Row("Liga").ToString, .Modulo = Row("Modulo").ToString, .Parametros = Row("Parametros").ToString})
|
||||
Next
|
||||
DtModulos.Dispose()
|
||||
DtModulos = Nothing
|
||||
End If
|
||||
' Dim objUsr As New ClsSisUsuarios(UsuarioActual:=UsuarioActual)
|
||||
' If objUsr.GetUsuariosModulos(UsuarioRetorno.CveUsuario, -1) Then
|
||||
' Dim DtModulos As DataTable = ObjUsuarios.DtResultados.FiltraParametros("CvePlataforma = 5 AND Permitir = 1")
|
||||
' For Each Row As DataRow In DtModulos.Rows
|
||||
' UsuariosModulos.Add(New WsModulos With {.CveModulo = Row("CveModulo").ToString.ToEntero, .CvePadre = Row("CvePadre").ToString.ToEntero, .CvePlataforma = 5, .Estilo = Row("Estilo").ToString, .Liga = Row("Liga").ToString, .Modulo = Row("Modulo").ToString, .Parametros = Row("Parametros").ToString})
|
||||
' Next
|
||||
' DtModulos.Dispose()
|
||||
' DtModulos = Nothing
|
||||
' End If
|
||||
' objUsr.Dispose()
|
||||
' UsuarioRetorno.Modulos = UsuariosModulos
|
||||
' Dim DtClientes As DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario).FiltraParametros("CvePlataforma = 3 AND CveCliente > 0", "Empresa")
|
||||
' If DtClientes IsNot Nothing Then
|
||||
' If DtClientes.Rows.Count > 0 Then
|
||||
' For Each Row As DataRow In DtClientes.Rows
|
||||
' Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
|
||||
' Next
|
||||
' If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
' UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
' If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
' UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
' If UsuarioRetorno.CveCliente > 0 Then
|
||||
' CreaObjetoEmpresa(UsuarioActual)
|
||||
' If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) OrElse UsuarioActual.CveUsuario = 3612 Then
|
||||
' UsuarioRetorno.RastreoSoloInicio = True
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
UsuarioRetorno.Modulos = UsuariosModulos
|
||||
Dim DtClientes As DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario).FiltraParametros("CvePlataforma = 3 AND CveCliente > 0", "Empresa")
|
||||
If DtClientes IsNot Nothing Then
|
||||
If DtClientes.Rows.Count > 0 Then
|
||||
For Each Row As DataRow In DtClientes.Rows
|
||||
Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
|
||||
Next
|
||||
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioRetorno.CveCliente > 0 Then
|
||||
CreaObjetoEmpresa(UsuarioActual)
|
||||
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) OrElse UsuarioActual.CveUsuario = 3612 Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' 'MARCA PARA EL RASTREO SOLO INICIO
|
||||
' If UsuarioRetorno.CveUsuario = 3612 Then
|
||||
' UsuarioRetorno.RastreoSoloInicio = True
|
||||
' End If
|
||||
|
||||
'MARCA PARA EL RASTREO SOLO INICIO
|
||||
If UsuarioRetorno.CveUsuario = 3612 Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
' UsuarioRetorno.Clientes = Clientes
|
||||
' DtClientes.Dispose()
|
||||
' DtClientes = Nothing
|
||||
' Retorno = Encripta(JsonConvert.SerializeObject(UsuarioRetorno), "AES")
|
||||
' Else
|
||||
' Dim UsuarioError As New WSUSER2
|
||||
' UsuarioError.CveUsuario = -2
|
||||
' UsuarioError.CveEmpresa = -1
|
||||
' UsuarioError.CveCliente = -1
|
||||
' UsuarioError.Usuario = ""
|
||||
' UsuarioError.Nombre = ""
|
||||
' UsuarioError.CveRol = -1
|
||||
' UsuarioError.Rol = ""
|
||||
' UsuarioError.Contrasenia = ""
|
||||
' UsuarioError.CveSubProyecto = -1
|
||||
|
||||
UsuarioRetorno.Clientes = Clientes
|
||||
DtClientes.Dispose()
|
||||
DtClientes = Nothing
|
||||
Retorno = Encripta(JsonConvert.SerializeObject(UsuarioRetorno), "AES")
|
||||
Else
|
||||
Dim UsuarioError As New WSUSER2
|
||||
UsuarioError.CveUsuario = -2
|
||||
UsuarioError.CveEmpresa = -1
|
||||
UsuarioError.CveCliente = -1
|
||||
UsuarioError.Usuario = ""
|
||||
UsuarioError.Nombre = ""
|
||||
UsuarioError.CveRol = -1
|
||||
UsuarioError.Rol = ""
|
||||
UsuarioError.Contrasenia = ""
|
||||
UsuarioError.CveSubProyecto = -1
|
||||
' Retorno = Encripta(JsonConvert.SerializeObject(UsuarioError), "AES")
|
||||
' End If
|
||||
|
||||
Retorno = Encripta(JsonConvert.SerializeObject(UsuarioError), "AES")
|
||||
End If
|
||||
' Catch ex As Exception
|
||||
' Retorno = ""
|
||||
' OnError("Ocurrio un error al iniciar sesion.", ex)
|
||||
' Finally
|
||||
' ObjUsuarios.Dispose()
|
||||
' End Try
|
||||
' Return Retorno
|
||||
|
||||
Catch ex As Exception
|
||||
Retorno = ""
|
||||
OnError("Ocurrio un error al iniciar sesion.", ex)
|
||||
Finally
|
||||
ObjUsuarios.Dispose()
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
'End Function
|
||||
<WebMethod>
|
||||
Public Function GetPosicionesEquipos(strParams As String) As String
|
||||
Dim json = "[]"
|
||||
|
||||
@@ -474,7 +474,7 @@ Public Class WSSIGApp
|
||||
If Not IsNothing(Entrada) Then
|
||||
If IsCurrentDate(Entrada.Ticks) Then
|
||||
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion
|
||||
Dim UsuarioActual = ObjUsuarios.ValidaUsuario(Entrada.Usuario, Encripta(Entrada.Contrasenia), IMEI)
|
||||
|
||||
If UsuarioActual IsNot Nothing Then
|
||||
@@ -491,8 +491,8 @@ Public Class WSSIGApp
|
||||
|
||||
Dim UsuariosModulos As New List(Of WsModulos)
|
||||
Dim Empresas As New List(Of WsEmpresa)
|
||||
|
||||
If ObjUsuarios.GetUsuariosModulos(Salida.CveUsuario, Salida.CveEmpresa) Then
|
||||
Dim objUsr As New ClsSisUsuarios(UsuarioActual:=UsuarioActual)
|
||||
If objUsr.GetUsuariosModulos(Salida.CveUsuario, Salida.CveEmpresa) Then
|
||||
Dim dttmp As DataTable = ObjUsuarios.DtResultados.FiltraParametros("CvePlataforma = 4")
|
||||
For Each Row As DataRow In dttmp.Rows
|
||||
UsuariosModulos.Add(New WsModulos With {.CveModulo = Row("CveModulo").ToString.ToEntero, .CvePadre = Row("CvePadre").ToString.ToEntero, .CvePlataforma = 4, .Estilo = Row("Estilo").ToString, .Liga = Row("Liga").ToString, .Modulo = Row("Modulo").ToString})
|
||||
@@ -511,7 +511,7 @@ Public Class WSSIGApp
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If ObjUsuarios.GetUsuariosEmpresas(Salida.CveUsuario, Salida.CveEmpresa) Then
|
||||
If objUsr.GetUsuariosEmpresas(Salida.CveUsuario, Salida.CveEmpresa) Then
|
||||
For Each Row As DataRow In ObjUsuarios.DtResultados.FiltraParametros("", "", {"CveEmpresa", "CveEncuestaCRM", "Empresa", "Tipo_CentroCosto"}).Rows
|
||||
Empresas.Add(New WsEmpresa With {
|
||||
.CveEmpresa = Row("CveEmpresa").ToString.ToEntero(),
|
||||
@@ -523,7 +523,7 @@ Public Class WSSIGApp
|
||||
|
||||
Salida.Empresas = Empresas
|
||||
ObjUsuarios.Dispose()
|
||||
|
||||
objUsr.Dispose()
|
||||
retorno = Encripta(JsonConvert.SerializeObject(Salida), "AES")
|
||||
End If
|
||||
End If
|
||||
@@ -548,7 +548,7 @@ Public Class WSSIGApp
|
||||
Dim Salida As WSUSER = Nothing
|
||||
Try
|
||||
|
||||
Dim tUsuario As New ClsSisUsuarios
|
||||
Dim tUsuario As New ClsSisUsuarioAutenticacion
|
||||
Dim UsuarioActual = tUsuario.ValidaUsuario(Usuario, Encripta(Contrasenia), IMEI)
|
||||
|
||||
If UsuarioActual IsNot Nothing Then
|
||||
@@ -565,18 +565,20 @@ Public Class WSSIGApp
|
||||
|
||||
Dim UsuariosModulos As New List(Of WsModulos)
|
||||
Dim Empresas As New List(Of WsEmpresa)
|
||||
If tUsuario.GetUsuariosModulos(Salida.CveUsuario, Salida.CveEmpresa) Then
|
||||
Dim objUsr As New ClsSisUsuarios(UsuarioActual:=UsuarioActual)
|
||||
If objUsr.GetUsuariosModulos(Salida.CveUsuario, Salida.CveEmpresa) Then
|
||||
Dim dttmp As DataTable = tUsuario.DtResultados.FiltraParametros("CvePlataforma = 4")
|
||||
For Each Row As DataRow In dttmp.Rows
|
||||
UsuariosModulos.Add(New WsModulos With {.CveModulo = Row("CveModulo").ToString.ToEntero, .CvePadre = Row("CvePadre").ToString.ToEntero, .CvePlataforma = 4, .Estilo = Row("Estilo").ToString, .Liga = Row("Liga").ToString, .Modulo = Row("Modulo").ToString})
|
||||
Next
|
||||
End If
|
||||
Salida.Modulos = UsuariosModulos
|
||||
If tUsuario.GetUsuariosEmpresas(Salida.CveUsuario, Salida.CveEmpresa) Then
|
||||
If objUsr.GetUsuariosEmpresas(Salida.CveUsuario, Salida.CveEmpresa) Then
|
||||
For Each Row As DataRow In tUsuario.DtResultados.Rows
|
||||
Empresas.Add(New WsEmpresa With {.CveEmpresa = Row("CveEmpresa").ToString.ToEntero, .Empresa = Row("Empresa").ToString})
|
||||
Next
|
||||
End If
|
||||
objUsr.Dispose()
|
||||
Salida.Empresas = Empresas
|
||||
retorno = JsonConvert.SerializeObject(Salida)
|
||||
End If
|
||||
@@ -603,7 +605,7 @@ Public Class WSSIGApp
|
||||
Dim Ent = JsonConvert.DeserializeAnonymousType(decripParams, Estructura)
|
||||
|
||||
If IsCurrentDate(Ent.Ticks) Then
|
||||
Dim tUsuario As New ClsSisUsuarios
|
||||
Dim tUsuario As New ClsSisUsuarioAutenticacion
|
||||
Dim UsuarioActual = tUsuario.ValidaUsuario(Ent.Usuario, Ent.Contrasenia, IMEI)
|
||||
tUsuario.Dispose()
|
||||
|
||||
@@ -1784,15 +1786,15 @@ Public Class WSSIGApp
|
||||
Public Function AddVentas(TipoDocto As String, CveCliente As Integer, CveSubProyecto As Integer, CveUsuario As Integer, SubTotal As Decimal, IVA As Decimal, CveMoneda As Integer, Observaciones As String, Productos As String) As String
|
||||
Dim Retorno = New Modelos.Factura.MMensajeFactura()
|
||||
Try
|
||||
Dim ObjUsuarios As New ClsSisUsuarios()
|
||||
Dim UsuarioActual As Usuario = Nothing
|
||||
If ObjUsuarios.GetUsuarios(CveUsuario) Then
|
||||
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion
|
||||
Dim UsuarioActual As Usuario = ObjUsuarios.GetUsuarioDetalle(CveUsuario)
|
||||
If UsuarioActual IsNot Nothing Then
|
||||
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
||||
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
||||
|
||||
If ObjUsuarios.DtResultados.Rows.Count = 1 Then
|
||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI)
|
||||
CreaObjetoEmpresa(UsuarioActual)
|
||||
' CreaObjetoEmpresa(UsuarioActual)
|
||||
End If
|
||||
End If
|
||||
ObjUsuarios.Dispose()
|
||||
|
||||
@@ -739,7 +739,7 @@ Public Class WS_PuntoVenta
|
||||
<WebMethod()>
|
||||
Public Function GetUsuariosRolesProcesos(Usuario As String, Contraseña As String, CveProceso As Integer) As Integer
|
||||
Dim CveUsuario As Integer = -1
|
||||
Dim objUsuarios As New ClsSisUsuarios
|
||||
Dim objUsuarios As New ClsSisUsuarioAutenticacion
|
||||
Dim objUsuario As New Usuario
|
||||
|
||||
objUsuario = objUsuarios.ValidaUsuario(Usuario, Encripta(Contraseña))
|
||||
|
||||
Reference in New Issue
Block a user