From 293f70625110795619100061c5172cf7325d7d60 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 5 Mar 2022 14:04:22 -0700 Subject: [PATCH] Usuario de norson para rastreo solo en inicio --- asmx/WSGPSApp.asmx | 68 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx index 1d97ac264..55d68a4c4 100644 --- a/asmx/WSGPSApp.asmx +++ b/asmx/WSGPSApp.asmx @@ -91,6 +91,25 @@ Public Class WSGPSApp End Set End Property #End Region + Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario) + + Dim ObjEmpresa As New ClsSisEmpresas() + If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then + If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) 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 + End If + ObjEmpresa.Dispose() + End Sub + Public Function Login(params As String) As String @@ -134,15 +153,22 @@ Public Class WSGPSApp 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 UsuarioRetorno.CveCliente > 0 Then - If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) Then - UsuarioRetorno.RastreoSoloInicio = True - End If + 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 + + 'MARCA PARA EL RASTREO SOLO INICIO + If UsuarioRetorno.CveUsuario = 3612 Then + UsuarioRetorno.RastreoSoloInicio = True End If + UsuarioRetorno.Clientes = Clientes DtClientes.Dispose() DtClientes = Nothing @@ -201,18 +227,25 @@ Public Class WSGPSApp 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 - If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) Then - UsuarioRetorno.RastreoSoloInicio = True - End If - End If + 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 + UsuarioRetorno.Clientes = Clientes DtClientes.Dispose() DtClientes = Nothing @@ -1005,13 +1038,6 @@ Public Class WSGPSApp End Function #Region "F U N C I O N E S" - Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario) - Dim ObjEmpresa As New ClsSisEmpresas() - If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then - UsuarioActual.Empresa = ObjEmpresa.Empresa - End If - ObjEmpresa.Dispose() - End Sub Private Function CargarEventos(CveCliente As Integer, FechaI As DateTime, FechaF As DateTime) As MWSDashboard2 Dim ObjGPS As New ClsGPS Dim dash As New MWSDashboard2 @@ -1139,7 +1165,7 @@ Namespace ADGPSModels Public Property Contrasenia As String Public Property TienePermisoOC As Boolean - Public Property TienePermisoPS As Boolean + Public Property TienePermisoPS As Boolean Public Property RastreoSoloInicio As Boolean = False End Class