Usuario de norson para rastreo solo en inicio

This commit is contained in:
2022-03-05 14:04:22 -07:00
parent 908c644b42
commit 293f706251

View File

@@ -91,6 +91,25 @@ Public Class WSGPSApp
End Set End Set
End Property End Property
#End Region #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
<SoapHeader("Credentials")> <SoapHeader("Credentials")>
<WebMethod> <WebMethod>
Public Function Login(params As String) As String 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}) Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
Next Next
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
If UsuarioRetorno.CveCliente > 0 Then If UsuarioRetorno.CveCliente > 0 Then
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) Then CreaObjetoEmpresa(UsuarioActual)
UsuarioRetorno.RastreoSoloInicio = True If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) OrElse UsuarioActual.CveUsuario = 3612 Then
End If UsuarioRetorno.RastreoSoloInicio = True
End If
End If 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 End If
UsuarioRetorno.Clientes = Clientes UsuarioRetorno.Clientes = Clientes
DtClientes.Dispose() DtClientes.Dispose()
DtClientes = Nothing DtClientes = Nothing
@@ -201,18 +227,25 @@ Public Class WSGPSApp
Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString}) Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
Next Next
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
If UsuarioRetorno.CveCliente > 0 Then If UsuarioRetorno.CveCliente > 0 Then
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) Then CreaObjetoEmpresa(UsuarioActual)
UsuarioRetorno.RastreoSoloInicio = True If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) OrElse UsuarioActual.CveUsuario = 3612 Then
End If UsuarioRetorno.RastreoSoloInicio = True
End If End If
End If
End If 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 End If
UsuarioRetorno.Clientes = Clientes UsuarioRetorno.Clientes = Clientes
DtClientes.Dispose() DtClientes.Dispose()
DtClientes = Nothing DtClientes = Nothing
@@ -1005,13 +1038,6 @@ Public Class WSGPSApp
End Function End Function
#Region "F U N C I O N E S" #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 Private Function CargarEventos(CveCliente As Integer, FechaI As DateTime, FechaF As DateTime) As MWSDashboard2
Dim ObjGPS As New ClsGPS Dim ObjGPS As New ClsGPS
Dim dash As New MWSDashboard2 Dim dash As New MWSDashboard2
@@ -1139,7 +1165,7 @@ Namespace ADGPSModels
Public Property Contrasenia As String Public Property Contrasenia As String
Public Property TienePermisoOC As Boolean Public Property TienePermisoOC As Boolean
Public Property TienePermisoPS As Boolean Public Property TienePermisoPS As Boolean
Public Property RastreoSoloInicio As Boolean = False Public Property RastreoSoloInicio As Boolean = False
End Class End Class