-- validar acceso al usuario.
This commit is contained in:
@@ -204,11 +204,11 @@ Public Class ClsSisEmpresas
|
|||||||
'Public Property PwdContPAQi As String
|
'Public Property PwdContPAQi As String
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional NombreCadena As String = "Conexion")
|
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional UsuarioActual As Usuario = Nothing)
|
||||||
|
|
||||||
If TransaccionCompartida Is Nothing Then
|
If TransaccionCompartida Is Nothing Then
|
||||||
SqlConexion = New SqlConnection
|
SqlConexion = New SqlConnection
|
||||||
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
|
SqlConexion.ConnectionString = If(UsuarioActual IsNot Nothing, UsuarioActual.RutaDB, ClsPaginas.UsuarioActualRutaDB)
|
||||||
Try
|
Try
|
||||||
SqlConexion.Open()
|
SqlConexion.Open()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
|||||||
@@ -248,18 +248,16 @@ Public Class ClsSisNotificaciones
|
|||||||
|
|
||||||
#Region "V A L I D A - U S U A R I O"
|
#Region "V A L I D A - U S U A R I O"
|
||||||
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
||||||
Dim UsuarioActual As Usuario = Nothing
|
Dim UsuarioActual As Usuario = Nothing
|
||||||
Dim ObjUsuarios As New ClsSisUsuarios
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa)
|
||||||
If ObjUsuarios.GetUsuarios(100) Then
|
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100)
|
||||||
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
If UsuarioActual IsNot Nothing Then
|
||||||
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa)
|
CreaObjetoEmpresa(UsuarioActual)
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa
|
End If
|
||||||
CreaObjetoEmpresa(UsuarioActual)
|
ObjUsuarios.Dispose()
|
||||||
End If
|
|
||||||
End If
|
|
||||||
ObjUsuarios.Dispose()
|
|
||||||
Return UsuarioActual
|
Return UsuarioActual
|
||||||
End Function
|
End Function
|
||||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||||
|
|||||||
564
App_Code/ClsSisUsuarioAutenticacion.vb
Normal file
564
App_Code/ClsSisUsuarioAutenticacion.vb
Normal file
@@ -0,0 +1,564 @@
|
|||||||
|
Option Explicit On
|
||||||
|
Option Strict On
|
||||||
|
|
||||||
|
Imports System.Data
|
||||||
|
Imports System.Data.SqlClient
|
||||||
|
Imports Extensiones
|
||||||
|
Public Class ClsSisUsuarioAutenticacion
|
||||||
|
Implements IDisposable
|
||||||
|
|
||||||
|
|
||||||
|
#Region "Campos"
|
||||||
|
|
||||||
|
'SQL
|
||||||
|
Private SqlConexion As SqlConnection
|
||||||
|
Private SqlAdapter As SqlDataAdapter
|
||||||
|
Private SqlTransacc As SqlTransaction
|
||||||
|
Private SqlCommand As SqlCommand
|
||||||
|
Private Data As DataTable
|
||||||
|
|
||||||
|
'Atributos de la clase
|
||||||
|
|
||||||
|
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
|
||||||
|
'PARA REGISTRAR CONEXION
|
||||||
|
Private CveConexion As Integer = 0
|
||||||
|
Private ConnStr As String = ""
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "Propiedades"
|
||||||
|
|
||||||
|
Public ReadOnly Property DtResultados() As DataTable
|
||||||
|
Get
|
||||||
|
DtResultados = Data
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
Public Property CveUsuario As Integer
|
||||||
|
Public Property Usuario As String
|
||||||
|
Public Property Nombre As String
|
||||||
|
Public Property CveRol As Integer
|
||||||
|
Public Property Correo As String
|
||||||
|
Public Property CveSupervisa As Integer
|
||||||
|
Public Property CveAutoriza As Integer
|
||||||
|
Public Property CveEmpresa As Integer
|
||||||
|
Public Property CveAlmacen As Integer
|
||||||
|
Public Property CveEmpresaPredeterminada As Integer
|
||||||
|
Public Property CvePersonal As Integer
|
||||||
|
Public Property CveVendedor As Integer
|
||||||
|
Public Property CveTipoDocumento As String
|
||||||
|
Public Property Estado As Boolean
|
||||||
|
Public Property Fecha As DateTime
|
||||||
|
Public Property Registro As Integer
|
||||||
|
Public Property UsuarioCreo As String
|
||||||
|
Public Property Contraseña As String
|
||||||
|
Public Property EsLogIn As Integer
|
||||||
|
Public Property FechaUltimoAcceso As Date
|
||||||
|
Public Property FechaUltimoCambioContraseña As Date
|
||||||
|
Public Property PolCambiarContraseña As Boolean
|
||||||
|
Public Property TipoControl As Integer
|
||||||
|
Public Property CveSubProyecto As Integer
|
||||||
|
Public Property AsignarAutomaticamenteSubProyecto As Boolean
|
||||||
|
Public Property AsignarAutomaticamenteOC As Boolean
|
||||||
|
Public Property DescuentoAutorizado As Double
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional NombreCadena As String = "Conexion")
|
||||||
|
|
||||||
|
If TransaccionCompartida Is Nothing Then
|
||||||
|
SqlConexion = New SqlConnection
|
||||||
|
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
|
||||||
|
ConnStr = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
|
||||||
|
Try
|
||||||
|
SqlConexion.Open()
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
SqlConexion = TransaccionCompartida.Connection
|
||||||
|
SqlTransacc = TransaccionCompartida
|
||||||
|
End If
|
||||||
|
|
||||||
|
SqlCommand = New SqlCommand("", SqlConexion)
|
||||||
|
SqlAdapter = New SqlDataAdapter("", SqlConexion)
|
||||||
|
ConexionAdd()
|
||||||
|
End Sub
|
||||||
|
Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand
|
||||||
|
.Parameters.Clear()
|
||||||
|
.CommandText = StrSQL
|
||||||
|
.CommandType = TipoComando
|
||||||
|
End With
|
||||||
|
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
|
||||||
|
Data = New DataTable
|
||||||
|
End Sub
|
||||||
|
#Region "Conexiones"
|
||||||
|
|
||||||
|
Private Sub ConexionAdd()
|
||||||
|
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||||
|
|
||||||
|
Try
|
||||||
|
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
|
||||||
|
DataAdapter("PA_Sis_RegistrarConexion")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
|
||||||
|
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
|
||||||
|
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
End With
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ConexionClose()
|
||||||
|
If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||||
|
|
||||||
|
DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
CveConexion = 0
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
|
||||||
|
With SqlCommand
|
||||||
|
.Parameters.Clear()
|
||||||
|
.CommandText = pStrSQL
|
||||||
|
.CommandType = TipoComando
|
||||||
|
End With
|
||||||
|
|
||||||
|
If Not SqlTransacc Is Nothing Then SqlCommand.Transaction = SqlTransacc
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Public Function IniciaTransacSQL() As SqlTransaction
|
||||||
|
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
|
||||||
|
Return SqlTransacc
|
||||||
|
End Function
|
||||||
|
Public Sub RollBack()
|
||||||
|
If SqlTransacc IsNot Nothing Then SqlTransacc.Rollback()
|
||||||
|
SqlTransacc = Nothing
|
||||||
|
End Sub
|
||||||
|
Public Sub Commit()
|
||||||
|
If SqlTransacc IsNot Nothing Then SqlTransacc.Commit()
|
||||||
|
SqlTransacc = Nothing
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Function UsuariosGetTokenXEquipo(CveUsuario As Integer, CveUsuarioAutoriza As Integer, AdsCodex As String) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Sis_UsuariosGetTokenXEquipo")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
|
||||||
|
.Add("@AdsCodex", SqlDbType.VarChar).Value = AdsCodex
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
'If Data.Rows.Count > 0 Then
|
||||||
|
' = Data.Rows(0)("Token").ToString()
|
||||||
|
'End If
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As SqlException
|
||||||
|
OnError("Ocurrio un error al guardar token por equipo.", ex)
|
||||||
|
Retorno = False
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function GetModulosUsuariosPlataforma(CveUsuario As Integer, CvePlataforma As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("SELECT M.* FROM [dbo].[UsuariosModulos] UM INNER JOIN Modulos M ON M.CveModulo=UM.CveModulo WHERE M.CvePlataforma =@CvePlataforma AND @CveUsuario = UM .CveUsuario AND UM.Permitir =1", CommandType.Text)
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As SqlException
|
||||||
|
OnError("Ocurrio un error al obtener el menu.", ex)
|
||||||
|
Retorno = False
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function ValidaUsuario(Usuario As String, Password As String, Optional CveEmpresa As Integer = -1, Optional GrupoEmpresa As String = "", Optional GenerarMenu As Boolean = True) As Usuario
|
||||||
|
Dim Retorno As Usuario = Nothing
|
||||||
|
DataAdapter("PA_Sis_UsuarioValidacionGet")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@Usuario", SqlDbType.VarChar).Value = Usuario
|
||||||
|
.Add("@Contraseña", SqlDbType.VarChar).Value = Password
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@GrupoEmpresa", SqlDbType.VarChar).Value = GrupoEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
|
||||||
|
If Data.Rows.Count > 0 Then
|
||||||
|
Retorno = New Usuario
|
||||||
|
|
||||||
|
Retorno.Acceso = Data.Rows(0)("Acceso").ToString().ToEntero()
|
||||||
|
Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString().ToEntero()
|
||||||
|
Retorno.Usuario = Usuario
|
||||||
|
Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString()
|
||||||
|
Retorno.Nombre = Data.Rows(0)("Nombre").ToString()
|
||||||
|
Retorno.CveRol = Data.Rows(0)("CveRol").ToString().ToEntero()
|
||||||
|
Retorno.Rol = Data.Rows(0)("Rol").ToString()
|
||||||
|
|
||||||
|
If CveEmpresa > 0 Then Retorno.CveEmpresa = CveEmpresa Else Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString().ToEntero()
|
||||||
|
Retorno.CvePlataforma = Data.Rows(0)("CvePlataforma").ToString().ToEntero()
|
||||||
|
|
||||||
|
Retorno.FechaUltimoAcceso = Data.Rows(0)("FechaUltimoAcceso").ToString().ToDate()
|
||||||
|
Retorno.FechaUltimoCambioContraseña = Data.Rows(0)("FechaUltimoCambioContraseña").ToString().ToDate()
|
||||||
|
Retorno.ActCambiarContraseña = If(Data.Rows(0)("ActCambiarContraseña").ToString() = "SI", True, False)
|
||||||
|
Retorno.TipoControl = Data.Rows(0)("TipoControl").ToString().ToEntero()
|
||||||
|
'*
|
||||||
|
Retorno.CveProveedor = Data.Rows(0)("CveProveedor").ToString().ToEntero()
|
||||||
|
Retorno.EsSupervisorRH = CBool(Data.Rows(0)("EsSupervisorRH").ToString())
|
||||||
|
|
||||||
|
Retorno.CveCliente = Data.Rows(0)("CveCliente").ToString().ToEntero()
|
||||||
|
Retorno.CveProveedor = Data.Rows(0)("CveProveedor").ToString().ToEntero()
|
||||||
|
|
||||||
|
Retorno.NombreAbreviatura = Data.Rows(0)("NombreAbreviatura").ToString()
|
||||||
|
Retorno.DescuentoAutorizado = Data.Rows(0)("DescuentoAutorizado").ToString().ToDouble()
|
||||||
|
|
||||||
|
Retorno.PorcentajeMaximoAutorizacion = Data.Rows(0)("PorcentajeMaximoAutorizacion").ToString().ToDecimal()
|
||||||
|
Retorno.DiasMaximoAutorizacion = Data.Rows(0)("DiasMaximoAutorizacion").ToString().ToEntero()
|
||||||
|
|
||||||
|
Retorno.CodigoAutorizado = Data.Rows(0)("CodigoAutorizado").ToString()
|
||||||
|
Dim autoip As String = Data.Rows(0)("AutorizadoxIP").ToString().ToUpper()
|
||||||
|
Retorno.AutorizadoxIP = (autoip = "1" OrElse autoip = "TRUE")
|
||||||
|
Retorno.RutaDB = ConnStr
|
||||||
|
|
||||||
|
' Esto es parta el punto de venta
|
||||||
|
Retorno.CveSucursal = Data.Rows(0)("CveSubProyecto").ToString().ToEntero
|
||||||
|
|
||||||
|
Dim ObjUsr As New ClsSisUsuarios(UsuarioActual:=Retorno)
|
||||||
|
|
||||||
|
'cargo los modulos del usuario y genero el menú
|
||||||
|
Dim dttmp As DataTable = ObjUsr.GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveEmpresa)
|
||||||
|
If GenerarMenu Then GeneraMenu(Retorno.CveUsuario, dttmp, Retorno.CvePlataforma)
|
||||||
|
|
||||||
|
Dim UsuariosModulos As New HybridDictionary
|
||||||
|
For Each Row As DataRow In dttmp.Rows
|
||||||
|
UsuariosModulos.Add(Convert.ToInt32(Row("CveModulo")), Row("CveModulo").ToString)
|
||||||
|
Next
|
||||||
|
Retorno.Modulos = UsuariosModulos
|
||||||
|
'cargo los procesos del usuario
|
||||||
|
dttmp = ObjUsr.GetUsuariosRolesProcesos(Retorno.CveUsuario)
|
||||||
|
Dim UsuariosProcesos As New HybridDictionary
|
||||||
|
For Each Row As DataRow In dttmp.Rows
|
||||||
|
UsuariosProcesos.Add(Convert.ToInt32(Row("CveProceso")), Row("CveProceso").ToString)
|
||||||
|
Next
|
||||||
|
Retorno.Procesos = UsuariosProcesos
|
||||||
|
|
||||||
|
Dim UsuariosIndicadores As New HybridDictionary
|
||||||
|
Dim dTableIndicadores As DataTable = ObjUsr.getUsuarioIndicadores(Retorno.CveUsuario, Retorno.CveEmpresa, Retorno.CveRol)
|
||||||
|
|
||||||
|
|
||||||
|
For Each Row As DataRow In dTableIndicadores.Rows
|
||||||
|
UsuariosIndicadores.Add(Convert.ToInt32(Row("CveIndicador")), Row("Indicador").ToString)
|
||||||
|
Next
|
||||||
|
Retorno.Indicadores = UsuariosIndicadores
|
||||||
|
|
||||||
|
If ObjUsr.GetUsuariosDetalleAsignaciones(Retorno.CveUsuario, If(CveEmpresa = -1, Retorno.CveEmpresa, CveEmpresa)) Then
|
||||||
|
Dim drt As DataRow = ObjUsr.DtResultados.FiltroPrimero("")
|
||||||
|
Retorno.CveSubProyecto = drt("CveSucursal").ToString.ToEntero
|
||||||
|
Retorno.CveVendedor = drt("CveVendedor").ToString.ToEntero
|
||||||
|
Retorno.CvePersonal = drt("CvePersonal").ToString.ToEntero
|
||||||
|
Retorno.CveAlmacen = drt("CveAlmacen").ToString.ToEntero
|
||||||
|
Retorno.CveTipoDocumento = drt("CveTipoDocumento").ToString
|
||||||
|
Else
|
||||||
|
Retorno.CveSubProyecto = -1
|
||||||
|
Retorno.CveVendedor = -1
|
||||||
|
Retorno.CvePersonal = -1
|
||||||
|
Retorno.CveAlmacen = -1
|
||||||
|
Retorno.CveTipoDocumento = "-1"
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim ObjEmpresa As New ClsSisEmpresas(UsuarioActual:=Retorno)
|
||||||
|
If ObjEmpresa.GetEmpresas(Retorno.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
|
If ObjEmpresa.GetEmpresasFuncionalidades(Retorno.CveEmpresa) Then
|
||||||
|
Dim dttmp2 As Data.DataTable = ObjEmpresa.DtResultados
|
||||||
|
|
||||||
|
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||||
|
For Each Row As Data.DataRow In dttmp2.Rows
|
||||||
|
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||||
|
Next
|
||||||
|
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||||
|
End If
|
||||||
|
Retorno.Empresa = ObjEmpresa.Empresa
|
||||||
|
End If
|
||||||
|
ObjEmpresa.Dispose()
|
||||||
|
|
||||||
|
If ObjUsr.GetUsuariosEmpresas(Retorno.CveUsuario, -1) Then
|
||||||
|
Dim dt As Data.DataTable = ObjUsr.DtResultados
|
||||||
|
If dt IsNot Nothing Then
|
||||||
|
If dt.Rows.Count >= 1 Then
|
||||||
|
If dt.Rows.Count > 1 Then
|
||||||
|
Retorno.MultipleEmpresa = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
dt.Dispose()
|
||||||
|
End If
|
||||||
|
Retorno.ListaPersonalizacion = ObjUsr.CargaPersonalizacionUsuario(Retorno.CveUsuario)
|
||||||
|
ObjUsr.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As SqlException
|
||||||
|
OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
||||||
|
Retorno = Nothing
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function GetUsuarioDetalle(CveUsuario As Integer, Optional CveEmpresa As Integer = -1) As Usuario
|
||||||
|
|
||||||
|
Dim Retorno As Usuario = Nothing
|
||||||
|
DataAdapter("PA_Sis_UsuariosGet")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@CveRol", SqlDbType.Int).Value = -1
|
||||||
|
.Add("@Usuario", SqlDbType.VarChar).Value = "-1"
|
||||||
|
.Add("@Contraseña", SqlDbType.VarChar).Value = "-1"
|
||||||
|
.Add("@EsLogIn", SqlDbType.Bit).Value = 0
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
If Data IsNot Nothing AndAlso Data.Rows.Count > 0 Then
|
||||||
|
Retorno = New Usuario
|
||||||
|
|
||||||
|
Retorno.Acceso = Data.Rows(0)("Acceso").ToString().ToEntero()
|
||||||
|
Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString().ToEntero()
|
||||||
|
Retorno.Usuario = Usuario
|
||||||
|
Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString()
|
||||||
|
Retorno.Nombre = Data.Rows(0)("Nombre").ToString()
|
||||||
|
Retorno.CveRol = Data.Rows(0)("CveRol").ToString().ToEntero()
|
||||||
|
Retorno.Rol = Data.Rows(0)("Rol").ToString()
|
||||||
|
|
||||||
|
If CveEmpresa > 0 Then Retorno.CveEmpresa = CveEmpresa Else Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString().ToEntero()
|
||||||
|
Retorno.CvePlataforma = Data.Rows(0)("CvePlataforma").ToString().ToEntero()
|
||||||
|
|
||||||
|
Retorno.FechaUltimoAcceso = Data.Rows(0)("FechaUltimoAcceso").ToString().ToDate()
|
||||||
|
Retorno.FechaUltimoCambioContraseña = Data.Rows(0)("FechaUltimoCambioContraseña").ToString().ToDate()
|
||||||
|
Retorno.ActCambiarContraseña = If(Data.Rows(0)("ActCambiarContraseña").ToString() = "SI", True, False)
|
||||||
|
Retorno.TipoControl = Data.Rows(0)("TipoControl").ToString().ToEntero()
|
||||||
|
'*
|
||||||
|
Retorno.CveProveedor = Data.Rows(0)("CveProveedor").ToString().ToEntero()
|
||||||
|
Retorno.EsSupervisorRH = CBool(Data.Rows(0)("EsSupervisorRH").ToString())
|
||||||
|
|
||||||
|
Retorno.CveCliente = Data.Rows(0)("CveCliente").ToString().ToEntero()
|
||||||
|
Retorno.CveProveedor = Data.Rows(0)("CveProveedor").ToString().ToEntero()
|
||||||
|
|
||||||
|
Retorno.NombreAbreviatura = Data.Rows(0)("NombreAbreviatura").ToString()
|
||||||
|
Retorno.DescuentoAutorizado = Data.Rows(0)("DescuentoAutorizado").ToString().ToDouble()
|
||||||
|
|
||||||
|
Retorno.PorcentajeMaximoAutorizacion = Data.Rows(0)("PorcentajeMaximoAutorizacion").ToString().ToDecimal()
|
||||||
|
Retorno.DiasMaximoAutorizacion = Data.Rows(0)("DiasMaximoAutorizacion").ToString().ToEntero()
|
||||||
|
|
||||||
|
Retorno.CodigoAutorizado = Data.Rows(0)("CodigoAutorizado").ToString()
|
||||||
|
Dim autoip As String = Data.Rows(0)("AutorizadoxIP").ToString().ToUpper()
|
||||||
|
Retorno.AutorizadoxIP = (autoip = "1" OrElse autoip = "TRUE")
|
||||||
|
Retorno.RutaDB = ConnStr
|
||||||
|
|
||||||
|
' Esto es parta el punto de venta
|
||||||
|
Retorno.CveSucursal = Data.Rows(0)("CveSubProyecto").ToString().ToEntero
|
||||||
|
Dim ObjEmpresa As New ClsSisEmpresas(UsuarioActual:=Retorno)
|
||||||
|
If ObjEmpresa.GetEmpresas(Retorno.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
|
If ObjEmpresa.GetEmpresasFuncionalidades(Retorno.CveEmpresa) Then
|
||||||
|
Dim dttmp2 As Data.DataTable = ObjEmpresa.DtResultados
|
||||||
|
|
||||||
|
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||||
|
For Each Row As Data.DataRow In dttmp2.Rows
|
||||||
|
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||||
|
Next
|
||||||
|
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||||
|
End If
|
||||||
|
Retorno.Empresa = ObjEmpresa.Empresa
|
||||||
|
End If
|
||||||
|
ObjEmpresa.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
|
||||||
|
Catch ex As SqlException
|
||||||
|
OnError("Ocurrio un error al Consultar Usuarios.", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
'Public Function ValidaUsuarioAsignacion(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
|
||||||
|
' Dim Retorno As Usuario = Nothing
|
||||||
|
|
||||||
|
' DataAdapter("PA_Sis_UsuariosAsignacionesGet")
|
||||||
|
|
||||||
|
' With SqlAdapter.SelectCommand.Parameters
|
||||||
|
' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
|
||||||
|
' End With
|
||||||
|
|
||||||
|
' Try
|
||||||
|
' SqlAdapter.Fill(Data)
|
||||||
|
' If Data.Rows.Count > 0 Then
|
||||||
|
' Retorno = New Usuario
|
||||||
|
|
||||||
|
' Try
|
||||||
|
' Retorno.CveSubProyecto = Data.Rows(0)("CveSucursal").ToString.ToEntero
|
||||||
|
' Catch ex As Exception
|
||||||
|
' Retorno.CveSubProyecto = -1
|
||||||
|
' End Try
|
||||||
|
|
||||||
|
' Retorno.CveVendedor = Data.Rows(0)("CveVendedor").ToString.ToEntero
|
||||||
|
' Retorno.CvePersonal = Data.Rows(0)("CvePersonal").ToString.ToEntero
|
||||||
|
' Retorno.CveAlmacen = Data.Rows(0)("CveAlmacen").ToString.ToEntero
|
||||||
|
' End If
|
||||||
|
' Catch ex As SqlException
|
||||||
|
' OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
||||||
|
' Retorno = Nothing
|
||||||
|
' End Try
|
||||||
|
|
||||||
|
' Return Retorno
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
'Public Function ValidaUsuarioWs(Usuario As String, Password As String, tIMEI As String) As Usuario
|
||||||
|
' Dim Retorno As Usuario = Nothing
|
||||||
|
|
||||||
|
' DataAdapter("PA_Sis_UsuariosGet")
|
||||||
|
|
||||||
|
' With SqlAdapter.SelectCommand.Parameters
|
||||||
|
' .Add("@CveUsuario", SqlDbType.Int).Value = -1
|
||||||
|
' .Add("@CveRol", SqlDbType.Int).Value = -1
|
||||||
|
' .Add("@Usuario", SqlDbType.VarChar).Value = Usuario
|
||||||
|
' .Add("@Contraseña", SqlDbType.VarChar).Value = Password
|
||||||
|
' .Add("@EsLogIn", SqlDbType.Bit).Value = 1
|
||||||
|
' End With
|
||||||
|
|
||||||
|
' Try
|
||||||
|
' SqlAdapter.Fill(Data)
|
||||||
|
|
||||||
|
' Catch ex As SqlException
|
||||||
|
' OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
||||||
|
' Retorno = Nothing
|
||||||
|
' End Try
|
||||||
|
|
||||||
|
' Return Retorno
|
||||||
|
'End Function
|
||||||
|
'Public Function ValidaUsuarioAppGPS(Usuario As String, Password As String, tIMEI As String) As Usuario
|
||||||
|
' Dim Retorno As Usuario = Nothing
|
||||||
|
|
||||||
|
' DataAdapter("PA_Sis_UsuariosAppGet")
|
||||||
|
|
||||||
|
' With SqlAdapter.SelectCommand.Parameters
|
||||||
|
' .Add("@CveUsuario", SqlDbType.Int).Value = -1
|
||||||
|
' .Add("@CveRol", SqlDbType.Int).Value = -1
|
||||||
|
' .Add("@Usuario", SqlDbType.VarChar).Value = Usuario
|
||||||
|
' .Add("@Contraseña", SqlDbType.VarChar).Value = Password
|
||||||
|
' .Add("@EsLogIn", SqlDbType.Bit).Value = 1
|
||||||
|
' End With
|
||||||
|
|
||||||
|
' Try
|
||||||
|
' SqlAdapter.Fill(Data)
|
||||||
|
' If Data.Rows.Count > 0 Then
|
||||||
|
' Retorno = New Usuario
|
||||||
|
|
||||||
|
' Retorno.Acceso = Data.Rows(0)("Acceso").ToString.ToEntero
|
||||||
|
' Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero
|
||||||
|
' Retorno.Usuario = Usuario
|
||||||
|
' Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString
|
||||||
|
' Retorno.Nombre = Data.Rows(0)("Nombre").ToString
|
||||||
|
' Retorno.CveRol = Data.Rows(0)("CveRol").ToString.ToEntero
|
||||||
|
' Retorno.Rol = Data.Rows(0)("Rol").ToString
|
||||||
|
' Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
|
||||||
|
' Try
|
||||||
|
' Retorno.CveSubProyecto = Data.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||||
|
' Catch ex As Exception
|
||||||
|
' Retorno.CveSubProyecto = -1
|
||||||
|
' End Try
|
||||||
|
' Retorno.FechaUltimoAcceso = Data.Rows(0)("FechaUltimoAcceso").ToString.ToDate
|
||||||
|
' Retorno.FechaUltimoCambioContraseña = Data.Rows(0)("FechaUltimoCambioContraseña").ToString.ToDate
|
||||||
|
' Retorno.CveProveedor = Data.Rows(0)("CveProveedor").ToString.ToEntero
|
||||||
|
' Retorno.CveVendedor = Data.Rows(0)("CveVendedor").ToString.ToEntero
|
||||||
|
' Retorno.CveCliente = Data.Rows(0)("CveCliente").ToString.ToEntero
|
||||||
|
' Retorno.NombreAbreviatura = Data.Rows(0)("NombreAbreviatura").ToString
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' Catch ex As SqlException
|
||||||
|
' OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
||||||
|
' Retorno = Nothing
|
||||||
|
' End Try
|
||||||
|
|
||||||
|
' Return Retorno
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Function GeneraMenu(CveUsuario As Integer, dtMenu As DataTable, Optional CvePlataforma As Integer = 1) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
dtMenu.TableName = "UsuariosModulos"
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim Carpeta As String = ""
|
||||||
|
|
||||||
|
'GPS
|
||||||
|
Carpeta = $"{AppDomain.CurrentDomain.BaseDirectory}/Menu/GPS"
|
||||||
|
Carpeta.DirectoryExistsCreate
|
||||||
|
dtMenu.FiltraParametros("CvePlataforma = 3").WriteXml($"{Carpeta}/{CveUsuario}.xml", XmlWriteMode.WriteSchema)
|
||||||
|
|
||||||
|
Carpeta = $"{AppDomain.CurrentDomain.BaseDirectory}/Menu/ERP"
|
||||||
|
Carpeta.DirectoryExistsCreate
|
||||||
|
Select Case CvePlataforma
|
||||||
|
Case 6, 7
|
||||||
|
dtMenu.FiltraParametros($"CvePlataforma = {CvePlataforma}").WriteXml($"{Carpeta}/{CveUsuario}.xml", XmlWriteMode.WriteSchema)
|
||||||
|
Case Else
|
||||||
|
dtMenu.FiltraParametros("CvePlataforma = 1").WriteXml($"{Carpeta}/{CveUsuario}.xml", XmlWriteMode.WriteSchema)
|
||||||
|
End Select
|
||||||
|
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al generar el menú del usuario.", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
#Region "IDisposable Support"
|
||||||
|
Protected Overridable Sub Dispose(disposing As Boolean)
|
||||||
|
If Not Me.disposedValue Then
|
||||||
|
If disposing Then
|
||||||
|
|
||||||
|
|
||||||
|
If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
|
||||||
|
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
|
||||||
|
If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
|
||||||
|
If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
|
||||||
|
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
|
||||||
|
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Me.disposedValue = True
|
||||||
|
End Sub
|
||||||
|
Public Sub Dispose() Implements IDisposable.Dispose
|
||||||
|
ConexionClose()
|
||||||
|
Dispose(True)
|
||||||
|
GC.SuppressFinalize(Me)
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
@@ -64,12 +64,14 @@ Public Class ClsSisUsuarios
|
|||||||
Public Property DescuentoAutorizado As Double
|
Public Property DescuentoAutorizado As Double
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional NombreCadena As String = "Conexion")
|
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional UsuarioActual As Usuario = Nothing)
|
||||||
|
|
||||||
If TransaccionCompartida Is Nothing Then
|
If TransaccionCompartida Is Nothing Then
|
||||||
SqlConexion = New SqlConnection
|
SqlConexion = New SqlConnection
|
||||||
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
|
SqlConexion.ConnectionString = If(UsuarioActual IsNot Nothing, UsuarioActual.RutaDB, ClsPaginas.UsuarioActualRutaDB)
|
||||||
ConnStr = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
|
|
||||||
|
'SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
|
||||||
|
'ConnStr = ConfigurationManager.ConnectionStrings(NombreCadena).ConnectionString
|
||||||
Try
|
Try
|
||||||
SqlConexion.Open()
|
SqlConexion.Open()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -153,7 +155,29 @@ Public Class ClsSisUsuarios
|
|||||||
If SqlTransacc IsNot Nothing Then SqlTransacc.Commit()
|
If SqlTransacc IsNot Nothing Then SqlTransacc.Commit()
|
||||||
SqlTransacc = Nothing
|
SqlTransacc = Nothing
|
||||||
End Sub
|
End Sub
|
||||||
|
Public Function ValidaUsuarioCodigoAcceso(CodigoAcceso As String, CveEmpresa As Integer) As Integer
|
||||||
|
Dim Retorno As Integer = Nothing
|
||||||
|
|
||||||
|
DataAdapter("PA_Sis_UsuariosCodigoAccesoGet")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
If Data.Rows.Count > 0 Then
|
||||||
|
Retorno = Data.Rows(0)("CveUsuario").ToString.ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As SqlException
|
||||||
|
OnError("Ocurrió un error al obtener el usuario.", ex)
|
||||||
|
Retorno = Nothing
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
Public Function UsuariosGetTokenXEquipo(CveUsuario As Integer, CveUsuarioAutoriza As Integer, AdsCodex As String) As Boolean
|
Public Function UsuariosGetTokenXEquipo(CveUsuario As Integer, CveUsuarioAutoriza As Integer, AdsCodex As String) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Sis_UsuariosGetTokenXEquipo")
|
DataAdapter("PA_Sis_UsuariosGetTokenXEquipo")
|
||||||
@@ -191,136 +215,15 @@ Public Class ClsSisUsuarios
|
|||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function ValidaUsuario(Usuario As String, Password As String, Optional CveEmpresa As Integer = -1, Optional GrupoEmpresa As String = "", Optional GenerarMenu As Boolean = True) As Usuario
|
|
||||||
Dim Retorno As Usuario = Nothing
|
|
||||||
DataAdapter("PA_Sis_UsuarioValidacionGet")
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@Usuario", SqlDbType.VarChar).Value = Usuario
|
|
||||||
.Add("@Contraseña", SqlDbType.VarChar).Value = Password
|
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
||||||
.Add("@GrupoEmpresa", SqlDbType.VarChar).Value = GrupoEmpresa
|
|
||||||
End With
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
|
|
||||||
If Data.Rows.Count > 0 Then
|
|
||||||
Retorno = New Usuario
|
|
||||||
|
|
||||||
Retorno.Acceso = Data.Rows(0)("Acceso").ToString().ToEntero()
|
|
||||||
Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString().ToEntero()
|
|
||||||
Retorno.Usuario = Usuario
|
|
||||||
Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString()
|
|
||||||
Retorno.Nombre = Data.Rows(0)("Nombre").ToString()
|
|
||||||
Retorno.CveRol = Data.Rows(0)("CveRol").ToString().ToEntero()
|
|
||||||
Retorno.Rol = Data.Rows(0)("Rol").ToString()
|
|
||||||
|
|
||||||
Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString().ToEntero()
|
|
||||||
Retorno.CvePlataforma = Data.Rows(0)("CvePlataforma").ToString().ToEntero()
|
|
||||||
|
|
||||||
Retorno.FechaUltimoAcceso = Data.Rows(0)("FechaUltimoAcceso").ToString().ToDate()
|
|
||||||
Retorno.FechaUltimoCambioContraseña = Data.Rows(0)("FechaUltimoCambioContraseña").ToString().ToDate()
|
|
||||||
Retorno.ActCambiarContraseña = If(Data.Rows(0)("ActCambiarContraseña").ToString() = "SI", True, False)
|
|
||||||
Retorno.TipoControl = Data.Rows(0)("TipoControl").ToString().ToEntero()
|
|
||||||
'*
|
|
||||||
Retorno.CveProveedor = Data.Rows(0)("CveProveedor").ToString().ToEntero()
|
|
||||||
Retorno.EsSupervisorRH = CBool(Data.Rows(0)("EsSupervisorRH").ToString())
|
|
||||||
|
|
||||||
Retorno.CveCliente = Data.Rows(0)("CveCliente").ToString().ToEntero()
|
|
||||||
Retorno.CveProveedor = Data.Rows(0)("CveProveedor").ToString().ToEntero()
|
|
||||||
|
|
||||||
Retorno.NombreAbreviatura = Data.Rows(0)("NombreAbreviatura").ToString()
|
|
||||||
Retorno.DescuentoAutorizado = Data.Rows(0)("DescuentoAutorizado").ToString().ToDouble()
|
|
||||||
|
|
||||||
Retorno.PorcentajeMaximoAutorizacion = Data.Rows(0)("PorcentajeMaximoAutorizacion").ToString().ToDecimal()
|
|
||||||
Retorno.DiasMaximoAutorizacion = Data.Rows(0)("DiasMaximoAutorizacion").ToString().ToEntero()
|
|
||||||
|
|
||||||
Retorno.CodigoAutorizado = Data.Rows(0)("CodigoAutorizado").ToString()
|
|
||||||
Dim autoip As String = Data.Rows(0)("AutorizadoxIP").ToString().ToUpper()
|
|
||||||
Retorno.AutorizadoxIP = (autoip = "1" OrElse autoip = "TRUE")
|
|
||||||
Retorno.RutaDB = ConnStr
|
|
||||||
|
|
||||||
' Esto es parta el punto de venta
|
|
||||||
Retorno.CveSucursal = Data.Rows(0)("CveSubProyecto").ToString().ToEntero
|
|
||||||
|
|
||||||
''Toma la primer letra de cada nombre
|
|
||||||
'Dim sbr As New StringBuilder
|
|
||||||
'For Each St As String In Retorno.Nombre.Split(" "c)
|
|
||||||
' sbr.AppendFormat("{0}.", St.Substring(0, 1))
|
|
||||||
'Next
|
|
||||||
'Retorno.NombreIniciales = sbr.ToString
|
|
||||||
'sbr.Clear()
|
|
||||||
'Retorno.Liga = Data.Rows(0)("Liga" ).ToString
|
|
||||||
|
|
||||||
'cargo los modulos del usuario y genero el menú
|
|
||||||
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveEmpresa)
|
|
||||||
If GenerarMenu Then GeneraMenu(Retorno.CveUsuario, dttmp, Retorno.CvePlataforma)
|
|
||||||
|
|
||||||
Dim UsuariosModulos As New HybridDictionary
|
|
||||||
For Each Row As DataRow In dttmp.Rows
|
|
||||||
UsuariosModulos.Add(Convert.ToInt32(Row("CveModulo")), Row("CveModulo").ToString)
|
|
||||||
Next
|
|
||||||
Retorno.Modulos = UsuariosModulos
|
|
||||||
'cargo los procesos del usuario
|
|
||||||
dttmp = GetUsuariosRolesProcesos(Retorno.CveUsuario)
|
|
||||||
Dim UsuariosProcesos As New HybridDictionary
|
|
||||||
For Each Row As DataRow In dttmp.Rows
|
|
||||||
UsuariosProcesos.Add(Convert.ToInt32(Row("CveProceso")), Row("CveProceso").ToString)
|
|
||||||
Next
|
|
||||||
Retorno.Procesos = UsuariosProcesos
|
|
||||||
|
|
||||||
Dim UsuariosIndicadores As New HybridDictionary
|
|
||||||
Dim dTableIndicadores As DataTable = getUsuarioIndicadores(Retorno.CveUsuario, Retorno.CveEmpresa, Retorno.CveRol)
|
|
||||||
|
|
||||||
|
|
||||||
For Each Row As DataRow In dTableIndicadores.Rows
|
|
||||||
UsuariosIndicadores.Add(Convert.ToInt32(Row("CveIndicador")), Row("Indicador").ToString)
|
|
||||||
Next
|
|
||||||
Retorno.Indicadores = UsuariosIndicadores
|
|
||||||
|
|
||||||
If GetUsuariosDetalleAsignaciones(Retorno.CveUsuario, If(CveEmpresa = -1, Retorno.CveEmpresa, CveEmpresa)) Then
|
|
||||||
Try
|
|
||||||
Retorno.CveSubProyecto = Data.Rows(0)("CveSucursal").ToString.ToEntero
|
|
||||||
Catch ex As Exception
|
|
||||||
Retorno.CveSubProyecto = -1
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Retorno.CveVendedor = Data.Rows(0)("CveVendedor").ToString.ToEntero
|
|
||||||
Retorno.CvePersonal = Data.Rows(0)("CvePersonal").ToString.ToEntero
|
|
||||||
Retorno.CveAlmacen = Data.Rows(0)("CveAlmacen").ToString.ToEntero
|
|
||||||
Retorno.CveTipoDocumento = Data.Rows(0)("CveTipoDocumento").ToString
|
|
||||||
Else
|
|
||||||
Retorno.CveSubProyecto = -1
|
|
||||||
Retorno.CveVendedor = -1
|
|
||||||
Retorno.CvePersonal = -1
|
|
||||||
Retorno.CveAlmacen = -1
|
|
||||||
Retorno.CveTipoDocumento = "-1"
|
|
||||||
End If
|
|
||||||
|
|
||||||
Retorno.ListaPersonalizacion = CargaPersonalizacionUsuario(Retorno.CveUsuario)
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As SqlException
|
|
||||||
OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
|
||||||
Retorno = Nothing
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function CargaPersonalizacionUsuario(CveUsuarioParamerto As Integer) As Hashtable
|
Public Function CargaPersonalizacionUsuario(CveUsuarioParamerto As Integer) As Hashtable
|
||||||
|
|
||||||
Dim Retorno As New Hashtable
|
Dim Retorno As New Hashtable
|
||||||
If GetUsuariosPersonalizaciones(CveUsuarioParamerto) Then
|
If GetUsuariosPersonalizaciones(CveUsuarioParamerto) Then
|
||||||
|
|
||||||
For Each drow As DataRow In Data.Rows
|
For Each drow As DataRow In Data.Rows
|
||||||
Retorno.Add(drow("PersonalizacionNombre").ToString, drow("PersonalizacionValor").ToString)
|
Retorno.Add(drow("PersonalizacionNombre").ToString, drow("PersonalizacionValor").ToString)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ValidaUsuarioAsignacion(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
|
Public Function ValidaUsuarioAsignacion(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
|
||||||
@@ -357,214 +260,6 @@ Public Class ClsSisUsuarios
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ValidaUsuarioWs(Usuario As String, Password As String, tIMEI As String) As Usuario
|
|
||||||
Dim Retorno As Usuario = Nothing
|
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuariosGet")
|
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@CveRol", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@Usuario", SqlDbType.VarChar).Value = Usuario
|
|
||||||
.Add("@Contraseña", SqlDbType.VarChar).Value = Password
|
|
||||||
.Add("@EsLogIn", SqlDbType.Bit).Value = 1
|
|
||||||
End With
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
|
|
||||||
Catch ex As SqlException
|
|
||||||
OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
|
||||||
Retorno = Nothing
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
Public Function ValidaUsuarioAppGPS(Usuario As String, Password As String, tIMEI As String) As Usuario
|
|
||||||
Dim Retorno As Usuario = Nothing
|
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuariosAppGet")
|
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@CveRol", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@Usuario", SqlDbType.VarChar).Value = Usuario
|
|
||||||
.Add("@Contraseña", SqlDbType.VarChar).Value = Password
|
|
||||||
.Add("@EsLogIn", SqlDbType.Bit).Value = 1
|
|
||||||
End With
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
If Data.Rows.Count > 0 Then
|
|
||||||
Retorno = New Usuario
|
|
||||||
|
|
||||||
Retorno.Acceso = Data.Rows(0)("Acceso").ToString.ToEntero
|
|
||||||
Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero
|
|
||||||
Retorno.Usuario = Usuario
|
|
||||||
Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString
|
|
||||||
Retorno.Nombre = Data.Rows(0)("Nombre").ToString
|
|
||||||
Retorno.CveRol = Data.Rows(0)("CveRol").ToString.ToEntero
|
|
||||||
Retorno.Rol = Data.Rows(0)("Rol").ToString
|
|
||||||
Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
|
|
||||||
Try
|
|
||||||
Retorno.CveSubProyecto = Data.Rows(0)("CveSubProyecto").ToString.ToEntero
|
|
||||||
Catch ex As Exception
|
|
||||||
Retorno.CveSubProyecto = -1
|
|
||||||
End Try
|
|
||||||
Retorno.FechaUltimoAcceso = Data.Rows(0)("FechaUltimoAcceso").ToString.ToDate
|
|
||||||
Retorno.FechaUltimoCambioContraseña = Data.Rows(0)("FechaUltimoCambioContraseña").ToString.ToDate
|
|
||||||
Retorno.CveProveedor = Data.Rows(0)("CveProveedor").ToString.ToEntero
|
|
||||||
Retorno.CveVendedor = Data.Rows(0)("CveVendedor").ToString.ToEntero
|
|
||||||
Retorno.CveCliente = Data.Rows(0)("CveCliente").ToString.ToEntero
|
|
||||||
Retorno.NombreAbreviatura = Data.Rows(0)("NombreAbreviatura").ToString
|
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As SqlException
|
|
||||||
OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
|
||||||
Retorno = Nothing
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function ValidaUsuarioCodigoAcceso(CodigoAcceso As String, CveEmpresa As Integer) As Integer
|
|
||||||
Dim Retorno As Integer = Nothing
|
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuariosCodigoAccesoGet")
|
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
|
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
||||||
End With
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
If Data.Rows.Count > 0 Then
|
|
||||||
Retorno = Data.Rows(0)("CveUsuario").ToString.ToEntero
|
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As SqlException
|
|
||||||
OnError("Ocurrió un error al obtener el usuario.", ex)
|
|
||||||
Retorno = Nothing
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
Public Function ValidaUsuarioPortalCliente(CveCliente As Integer, Usuario As String, Password As String) As Usuario
|
|
||||||
Dim Retorno As Usuario = Nothing
|
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuariosGet")
|
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@CveRol", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@Usuario", SqlDbType.VarChar).Value = Usuario
|
|
||||||
.Add("@Contraseña", SqlDbType.VarChar).Value = Password
|
|
||||||
.Add("@EsLogIn", SqlDbType.Bit).Value = 1
|
|
||||||
End With
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
If Data.Rows.Count > 0 Then
|
|
||||||
Retorno = New Usuario
|
|
||||||
|
|
||||||
Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero
|
|
||||||
Retorno.Usuario = Usuario
|
|
||||||
Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString
|
|
||||||
Retorno.Nombre = Data.Rows(0)("Nombre").ToString
|
|
||||||
Retorno.CveRol = Data.Rows(0)("CveRol").ToString.ToEntero
|
|
||||||
Retorno.Rol = Data.Rows(0)("Rol").ToString
|
|
||||||
'Retorno.NombreEmpresa = Data.Rows(0)("Empresa").ToString
|
|
||||||
Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
|
|
||||||
Retorno.CveCliente = CveCliente
|
|
||||||
Retorno.ClienteGPS = False
|
|
||||||
Retorno.Portal = True
|
|
||||||
Retorno.Referencia = Data.Rows(0)("Referencia").ToString
|
|
||||||
Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False)
|
|
||||||
Retorno.RutaDB = ConnStr
|
|
||||||
'cargo los modulos del usuario y genero el menú
|
|
||||||
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveCliente)
|
|
||||||
|
|
||||||
Dim UsuariosModulos As New HybridDictionary
|
|
||||||
For Each Row As DataRow In dttmp.Rows
|
|
||||||
UsuariosModulos.Add(Convert.ToInt32(Row("CveModulo")), Row("CveModulo").ToString)
|
|
||||||
Next
|
|
||||||
Retorno.Modulos = UsuariosModulos
|
|
||||||
''cargo los procesos del usuario
|
|
||||||
dttmp = GetUsuariosRolesProcesos(Retorno.CveUsuario)
|
|
||||||
Dim UsuariosProcesos As New HybridDictionary
|
|
||||||
For Each Row As DataRow In dttmp.Rows
|
|
||||||
UsuariosProcesos.Add(Convert.ToInt32(Row("CveProceso")), Row("CveProceso").ToString)
|
|
||||||
Next
|
|
||||||
Retorno.Procesos = UsuariosProcesos
|
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As SqlException
|
|
||||||
OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
|
||||||
Retorno = Nothing
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function ValidaUsuarioPortalProveedor(CveProveedor As Integer, Usuario As String, Password As String) As Usuario
|
|
||||||
Dim Retorno As Usuario = Nothing
|
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuariosGet")
|
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@CveRol", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@Usuario", SqlDbType.VarChar).Value = Usuario
|
|
||||||
.Add("@Contraseña", SqlDbType.VarChar).Value = Password
|
|
||||||
.Add("@EsLogIn", SqlDbType.Bit).Value = 1
|
|
||||||
End With
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
If Data.Rows.Count > 0 Then
|
|
||||||
Retorno = New Usuario
|
|
||||||
|
|
||||||
Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero
|
|
||||||
Retorno.Usuario = Usuario
|
|
||||||
Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString
|
|
||||||
Retorno.Nombre = Data.Rows(0)("Nombre").ToString
|
|
||||||
Retorno.CveRol = Data.Rows(0)("CveRol").ToString.ToEntero
|
|
||||||
Retorno.Rol = Data.Rows(0)("Rol").ToString
|
|
||||||
'Retorno.NombreEmpresa = Data.Rows(0)("Empresa").ToString
|
|
||||||
Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
|
|
||||||
Retorno.CveProveedor = CveProveedor
|
|
||||||
Retorno.ClienteGPS = False
|
|
||||||
Retorno.Portal = True
|
|
||||||
Retorno.Referencia = Data.Rows(0)("Referencia").ToString
|
|
||||||
Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False)
|
|
||||||
Retorno.RutaDB = ConnStr
|
|
||||||
'cargo los modulos del usuario y genero el menú
|
|
||||||
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveProveedor)
|
|
||||||
|
|
||||||
Dim UsuariosModulos As New HybridDictionary
|
|
||||||
For Each Row As DataRow In dttmp.Rows
|
|
||||||
UsuariosModulos.Add(Convert.ToInt32(Row("CveModulo")), Row("CveModulo").ToString)
|
|
||||||
Next
|
|
||||||
|
|
||||||
Retorno.Modulos = UsuariosModulos
|
|
||||||
''cargo los procesos del usuario
|
|
||||||
dttmp = GetUsuariosRolesProcesos(Retorno.CveUsuario)
|
|
||||||
Dim UsuariosProcesos As New HybridDictionary
|
|
||||||
For Each Row As DataRow In dttmp.Rows
|
|
||||||
UsuariosProcesos.Add(Convert.ToInt32(Row("CveProceso")), Row("CveProceso").ToString)
|
|
||||||
Next
|
|
||||||
Retorno.Procesos = UsuariosProcesos
|
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As SqlException
|
|
||||||
OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
|
||||||
Retorno = Nothing
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
|
||||||
#Region "U S U A R I O - I N D I C A D O R E S"
|
#Region "U S U A R I O - I N D I C A D O R E S"
|
||||||
Public Function getUsuarioIndicadores(_CveUsuario As Integer, _CveEmpresa As Integer, _CveRol As Integer) As DataTable
|
Public Function getUsuarioIndicadores(_CveUsuario As Integer, _CveEmpresa As Integer, _CveRol As Integer) As DataTable
|
||||||
@@ -2620,170 +2315,6 @@ Public Class ClsSisUsuarios
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ValidaUsuarioGPS2(Clave As String, Usuario As String, Password As String) As Usuario
|
|
||||||
Dim Retorno As Usuario = Nothing
|
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuariosGet")
|
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@CveRol", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@Usuario", SqlDbType.VarChar).Value = Usuario
|
|
||||||
.Add("@Contraseña", SqlDbType.VarChar).Value = Password
|
|
||||||
.Add("@EsLogIn", SqlDbType.Bit).Value = 1
|
|
||||||
End With
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
If Data.Rows.Count > 0 Then
|
|
||||||
Retorno = New Usuario
|
|
||||||
|
|
||||||
Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero
|
|
||||||
Retorno.Usuario = Usuario
|
|
||||||
Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString
|
|
||||||
Retorno.Nombre = Data.Rows(0)("Nombre").ToString
|
|
||||||
Retorno.CveRol = Data.Rows(0)("CveRol").ToString.ToEntero
|
|
||||||
Retorno.Rol = Data.Rows(0)("Rol").ToString
|
|
||||||
'Retorno.NombreEmpresa = Data.Rows(0)("Empresa").ToString
|
|
||||||
Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
|
|
||||||
Retorno.CveCliente = Clave.ToEntero
|
|
||||||
Retorno.ClienteGPS = True
|
|
||||||
Retorno.Referencia = Data.Rows(0)("Referencia").ToString
|
|
||||||
Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False)
|
|
||||||
'Retorno.Liga = Data.Rows(0)("Liga").ToString
|
|
||||||
'cargo los modulos del usuario y genero el menú
|
|
||||||
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveCliente)
|
|
||||||
GeneraMenuGPS(Retorno.CveUsuario, dttmp)
|
|
||||||
Dim UsuariosModulos As New HybridDictionary
|
|
||||||
For Each Row As DataRow In dttmp.Rows
|
|
||||||
UsuariosModulos.Add(Convert.ToInt32(Row("CveModulo")), Row("CveModulo").ToString)
|
|
||||||
Next
|
|
||||||
Retorno.Modulos = UsuariosModulos
|
|
||||||
''cargo los procesos del usuario
|
|
||||||
dttmp = GetUsuariosRolesProcesos(Retorno.CveUsuario)
|
|
||||||
Dim UsuariosProcesos As New HybridDictionary
|
|
||||||
For Each Row As DataRow In dttmp.Rows
|
|
||||||
UsuariosProcesos.Add(Convert.ToInt32(Row("CveProceso")), Row("CveProceso").ToString)
|
|
||||||
Next
|
|
||||||
Retorno.Procesos = UsuariosProcesos
|
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As SqlException
|
|
||||||
OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
|
||||||
Retorno = Nothing
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function GetUsuarioGPS(Clave As String, Usuario As String, Password As String) As Boolean
|
|
||||||
Dim Retorno As Boolean = False
|
|
||||||
DataAdapter("PA_Sis_UsuariosPortalGet")
|
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@pCveUsuario", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@pCveRol", SqlDbType.Int).Value = 1200
|
|
||||||
.Add("@pCveClave", SqlDbType.VarChar).Value = Clave
|
|
||||||
.Add("@pUsuario", SqlDbType.VarChar).Value = Usuario
|
|
||||||
.Add("@pContraseña", SqlDbType.VarChar).Value = Password
|
|
||||||
.Add("@pEsLogIn", SqlDbType.Bit).Value = 1
|
|
||||||
.Add("@pCveCliente", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@pCveProveedor", SqlDbType.Int).Value = -1
|
|
||||||
End With
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
Retorno = True
|
|
||||||
Catch ex As SqlException
|
|
||||||
OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex)
|
|
||||||
Retorno = Nothing
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function GetUsuariosPortalGPS(pCveUsuarioPortal As Integer, pCveCliente As Integer, pCveProveedor As Integer) As Boolean
|
|
||||||
Dim Retorno As Boolean = False
|
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuariosPortalGet")
|
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@pCveUsuario", SqlDbType.Int).Value = pCveUsuarioPortal
|
|
||||||
.Add("@pCveRol", SqlDbType.Int).Value = -1
|
|
||||||
.Add("@pCveClave", SqlDbType.VarChar).Value = -1
|
|
||||||
.Add("@pUsuario", SqlDbType.VarChar).Value = "-1"
|
|
||||||
.Add("@pContraseña", SqlDbType.VarChar).Value = "-1"
|
|
||||||
.Add("@pEsLogIn", SqlDbType.Bit).Value = 0
|
|
||||||
.Add("@pCveCliente", SqlDbType.Int).Value = pCveCliente
|
|
||||||
.Add("@pCveProveedor", SqlDbType.Int).Value = pCveProveedor
|
|
||||||
End With
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
Retorno = True
|
|
||||||
Catch ex As SqlException
|
|
||||||
OnError("Ocurrio un error al Consultar los usuarios.", ex)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Public Function UpdateUsuarioPortalGPS(Usuario As String, Nombre As String, Correo As String,
|
|
||||||
pPermiso1 As Boolean, pPermiso2 As Boolean, pPermiso3 As Boolean, pPermiso4 As Boolean, pPermiso5 As Boolean,
|
|
||||||
pPermiso6 As Boolean, pPermiso7 As Boolean, pPermiso8 As Boolean, pPermiso9 As Boolean, pPermiso10 As Boolean,
|
|
||||||
Activo As Boolean, pContrasenia As String, pCveCliente As Integer, pCveProveedor As Integer, CveUsuarioPortal As Integer) As Boolean
|
|
||||||
Dim Retorno As Boolean = False
|
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuariosPortalUpdate")
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@pUsuario", SqlDbType.VarChar).Value = Usuario
|
|
||||||
.Add("@pNombre", SqlDbType.VarChar).Value = Nombre
|
|
||||||
.Add("@pCorreo", SqlDbType.VarChar).Value = Correo
|
|
||||||
.Add("@pPermiso1", SqlDbType.Bit).Value = If(pPermiso1, 1, 0)
|
|
||||||
.Add("@pPermiso2", SqlDbType.Bit).Value = If(pPermiso2, 1, 0)
|
|
||||||
.Add("@pPermiso3", SqlDbType.Bit).Value = If(pPermiso3, 1, 0)
|
|
||||||
.Add("@pPermiso4", SqlDbType.Bit).Value = If(pPermiso4, 1, 0)
|
|
||||||
.Add("@pPermiso5", SqlDbType.Bit).Value = If(pPermiso5, 1, 0)
|
|
||||||
.Add("@pPermiso6", SqlDbType.Bit).Value = If(pPermiso6, 1, 0)
|
|
||||||
.Add("@pPermiso7", SqlDbType.Bit).Value = If(pPermiso7, 1, 0)
|
|
||||||
.Add("@pPermiso8", SqlDbType.Bit).Value = If(pPermiso8, 1, 0)
|
|
||||||
.Add("@pPermiso9", SqlDbType.Bit).Value = If(pPermiso9, 1, 0)
|
|
||||||
.Add("@pPermiso10", SqlDbType.Bit).Value = If(pPermiso10, 1, 0)
|
|
||||||
.Add("@pEstatus", SqlDbType.Bit).Value = If(Activo, 1, 0)
|
|
||||||
.Add("@pContrasenia", SqlDbType.VarChar).Value = pContrasenia
|
|
||||||
.Add("@pCveCliente", SqlDbType.Int).Value = pCveCliente
|
|
||||||
.Add("@pCveProveedor", SqlDbType.Int).Value = pCveProveedor
|
|
||||||
.Add("@pCveUsuarioPortal", SqlDbType.Int).Value = CveUsuarioPortal
|
|
||||||
End With
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
Retorno = True
|
|
||||||
Catch ex As Exception
|
|
||||||
OnError("Ocurrió un error al modificar el usuario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function RemoveUsuarioPortalGPS(CveUsuario As Integer) As Boolean
|
|
||||||
Dim Retorno As Boolean = False
|
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuariosPortalRemove")
|
|
||||||
SqlAdapter.SelectCommand.Parameters.Add("@pCveUsuario", SqlDbType.Int).Value = CveUsuario
|
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
Retorno = True
|
|
||||||
Catch ex As Exception
|
|
||||||
OnError("Ocurrió un error al eliminar el usuario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Function GeneraMenuGPS(CveUsuario As Integer, dtMenu As DataTable) As Boolean
|
Private Function GeneraMenuGPS(CveUsuario As Integer, dtMenu As DataTable) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
dtMenu = dtMenu.FiltraParametros("CvePlataforma = 3")
|
dtMenu = dtMenu.FiltraParametros("CvePlataforma = 3")
|
||||||
|
|||||||
@@ -3723,7 +3723,6 @@ Public Class ClsVentas
|
|||||||
If CveVentas IsNot Nothing Then
|
If CveVentas IsNot Nothing Then
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
Dim ObjCancelacion As New Timbrado
|
Dim ObjCancelacion As New Timbrado
|
||||||
Dim ObjUsuario As New ClsSisUsuarios
|
|
||||||
Dim Usuario As Usuario = Nothing
|
Dim Usuario As Usuario = Nothing
|
||||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||||
|
|
||||||
@@ -3733,7 +3732,6 @@ Public Class ClsVentas
|
|||||||
Dim RFCReceptor As String = "-1"
|
Dim RFCReceptor As String = "-1"
|
||||||
Dim Nombre As String = "-1"
|
Dim Nombre As String = "-1"
|
||||||
Dim DbRowVenta As DataRow
|
Dim DbRowVenta As DataRow
|
||||||
Dim CveUsuario As Integer = -1
|
|
||||||
Dim pCveEmpresa As Integer = -1
|
Dim pCveEmpresa As Integer = -1
|
||||||
Dim Contraseña As String = "-1"
|
Dim Contraseña As String = "-1"
|
||||||
|
|
||||||
@@ -3745,32 +3743,30 @@ Public Class ClsVentas
|
|||||||
CveEstatus = DbRowVenta("CveEstatusFactura").ToString.ToEntero
|
CveEstatus = DbRowVenta("CveEstatusFactura").ToString.ToEntero
|
||||||
Total = DbRowVenta("Total").ToString.ToDecimal
|
Total = DbRowVenta("Total").ToString.ToDecimal
|
||||||
RFCReceptor = DbRowVenta("ClienteRFC").ToString
|
RFCReceptor = DbRowVenta("ClienteRFC").ToString
|
||||||
CveUsuario = DbRowVenta("CveUsuario").ToString.ToEntero
|
'CveUsuario = DbRowVenta("CveUsuario").ToString.ToEntero
|
||||||
pCveEmpresa = DbRowVenta("CveEmpresa").ToString.ToEntero
|
pCveEmpresa = DbRowVenta("CveEmpresa").ToString.ToEntero
|
||||||
Nombre = DbRowVenta("Nombre").ToString
|
Nombre = DbRowVenta("Nombre").ToString
|
||||||
|
|
||||||
If ObjUsuario.GetUsuarios(CveUsuario, -1, -1) Then
|
'If ObjUsuario.GetUsuarios(CveUsuario, -1, -1) Then
|
||||||
Contraseña = ObjUsuario.DtResultados.Rows(0)("Contraseña").ToString
|
' Contraseña = ObjUsuario.DtResultados.Rows(0)("Contraseña").ToString
|
||||||
Else
|
'Else
|
||||||
CveVentasError.Add(PCveVenta.ToEntero)
|
' CveVentasError.Add(PCveVenta.ToEntero)
|
||||||
Continue For
|
' Continue For
|
||||||
End If
|
'End If
|
||||||
Usuario = ObjUsuario.ValidaUsuario(Nombre, Contraseña)
|
'Usuario = ObjUsuario.ValidaUsuario(Nombre, Contraseña)
|
||||||
|
|
||||||
|
If Not ObjEmpresa.GetEmpresas(pCveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
|
|
||||||
If ObjEmpresa.GetEmpresas(pCveEmpresa, "-1", "-1", "-1", "-1") Then
|
|
||||||
Usuario.Empresa = ObjEmpresa.Empresa
|
|
||||||
Usuario.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
|
|
||||||
Else
|
|
||||||
CveVentasError.Add(PCveVenta.ToEntero)
|
CveVentasError.Add(PCveVenta.ToEntero)
|
||||||
Continue For
|
Continue For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'SOLO SI ESTA CANCELADA ANTE SAT EN SIG SE INTENTARA CANCELAR DE NUEVO CONTRA EL SAT
|
'SOLO SI ESTA CANCELADA ANTE SAT EN SIG SE INTENTARA CANCELAR DE NUEVO CONTRA EL SAT
|
||||||
If CveEstatus = 5 Then
|
If CveEstatus = 5 Then
|
||||||
Dim Resp As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(Usuario.Empresa, FolioFiscal, Total, RFCReceptor, Usuario.Empresa.RFC)
|
Dim Resp As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(ObjEmpresa.Empresa, FolioFiscal, Total, RFCReceptor, ObjEmpresa.Empresa.RFC)
|
||||||
If Resp.Verificado Then
|
If Resp.Verificado Then
|
||||||
|
|
||||||
If Not ObjVentas.UpdateEstatusFactura(5, FolioFiscal, ObjCancelacion.CancelacionAcuse, ClsPaginas.NowADS(), PCveVenta.ToEntero, -1, CvePAC:=Usuario.Empresa.CvePAC) Then
|
If Not ObjVentas.UpdateEstatusFactura(5, FolioFiscal, ObjCancelacion.CancelacionAcuse, ClsPaginas.NowADS(), PCveVenta.ToEntero, -1, CvePAC:=ObjEmpresa.Empresa.CvePAC) Then
|
||||||
CveVentasError.Add(PCveVenta.ToEntero)
|
CveVentasError.Add(PCveVenta.ToEntero)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
@@ -3783,7 +3779,6 @@ Public Class ClsVentas
|
|||||||
Next
|
Next
|
||||||
|
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
ObjUsuario.Dispose()
|
|
||||||
ObjEmpresa.Dispose()
|
ObjEmpresa.Dispose()
|
||||||
Else
|
Else
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ Namespace SIG
|
|||||||
|
|
||||||
Dim Retorno As List(Of String) = Nothing
|
Dim Retorno As List(Of String) = Nothing
|
||||||
If continuar Then
|
If continuar Then
|
||||||
Using objuser As New ClsSisUsuarios
|
Using objuser As New ClsSisUsuarioAutenticacion
|
||||||
Dim user As Usuario = objuser.ValidaUsuario(username, Extensiones.ModExtensiones.Encripta(password), CveEmpresa:=CveEmpresastr.ToEntero())
|
Dim user As Usuario = objuser.ValidaUsuario(username, Extensiones.ModExtensiones.Encripta(password), CveEmpresa:=CveEmpresastr.ToEntero())
|
||||||
|
|
||||||
Dim OjEmpresa As Empresa = Nothing
|
Dim OjEmpresa As Empresa = Nothing
|
||||||
|
|||||||
@@ -23,81 +23,81 @@ Public Class WsSIGWeb
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
#Region " CANCELAR VENTAS ANTE EL SAT - CANCELADAS EN SISTEMA "
|
'#Region " CANCELAR VENTAS ANTE EL SAT - CANCELADAS EN SISTEMA "
|
||||||
<WebMethod()>
|
' <WebMethod()>
|
||||||
Public Function CancelarVentasSAT(PCveVenta As Integer) As Boolean
|
' Public Function CancelarVentasSAT(PCveVenta As Integer) As Boolean
|
||||||
Dim Retorno = False
|
' Dim Retorno = False
|
||||||
Dim MensajeError = ""
|
' Dim MensajeError = ""
|
||||||
|
|
||||||
If PCveVenta > 0 Then
|
' If PCveVenta > 0 Then
|
||||||
Dim ObjVentas As New ClsVentas
|
' Dim ObjVentas As New ClsVentas
|
||||||
Dim ObjCancelacion As New Timbrado
|
' Dim ObjCancelacion As New Timbrado
|
||||||
Dim ObjUsuario As New ClsSisUsuarios
|
' Dim ObjUsuario As New ClsSisUsuarios
|
||||||
Dim Usuario As Usuario = Nothing
|
' Dim Usuario As Usuario = Nothing
|
||||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
' Dim ObjEmpresa As New ClsSisEmpresas()
|
||||||
|
|
||||||
Dim FolioFiscal = "-1"
|
' Dim FolioFiscal = "-1"
|
||||||
Dim CveEstatus = -1
|
' Dim CveEstatus = -1
|
||||||
Dim Total = 0.0D
|
' Dim Total = 0.0D
|
||||||
Dim RFCReceptor = "-1"
|
' Dim RFCReceptor = "-1"
|
||||||
Dim Nombre = "-1"
|
' Dim Nombre = "-1"
|
||||||
Dim DbRowVenta As DataRow
|
' Dim DbRowVenta As DataRow
|
||||||
Dim CveUsuario = -1
|
' Dim CveUsuario = -1
|
||||||
Dim pCveEmpresa = -1
|
' Dim pCveEmpresa = -1
|
||||||
Dim Contraseña = "-1"
|
' Dim Contraseña = "-1"
|
||||||
|
|
||||||
If ObjVentas.GetVenta(PCveVenta.ToEntero, -1) Then
|
' If ObjVentas.GetVenta(PCveVenta.ToEntero, -1) Then
|
||||||
DbRowVenta = ObjVentas.DtResultados.Rows(0)
|
' DbRowVenta = ObjVentas.DtResultados.Rows(0)
|
||||||
|
|
||||||
FolioFiscal = DbRowVenta("FolioFiscal").ToString
|
' FolioFiscal = DbRowVenta("FolioFiscal").ToString
|
||||||
CveEstatus = DbRowVenta("CveEstatusFactura").ToString.ToEntero
|
' CveEstatus = DbRowVenta("CveEstatusFactura").ToString.ToEntero
|
||||||
Total = DbRowVenta("Total").ToString.ToDecimal
|
' Total = DbRowVenta("Total").ToString.ToDecimal
|
||||||
RFCReceptor = DbRowVenta("ClienteRFC").ToString
|
' RFCReceptor = DbRowVenta("ClienteRFC").ToString
|
||||||
CveUsuario = DbRowVenta("CveUsuario").ToString.ToEntero
|
' CveUsuario = DbRowVenta("CveUsuario").ToString.ToEntero
|
||||||
pCveEmpresa = DbRowVenta("CveEmpresa").ToString.ToEntero
|
' pCveEmpresa = DbRowVenta("CveEmpresa").ToString.ToEntero
|
||||||
Nombre = DbRowVenta("Nombre").ToString
|
' Nombre = DbRowVenta("Nombre").ToString
|
||||||
|
|
||||||
If ObjUsuario.GetUsuarios(CveUsuario, -1, -1) Then
|
' If ObjUsuario.GetUsuarios(CveUsuario, -1, -1) Then
|
||||||
Contraseña = ObjUsuario.DtResultados.Rows(0)("Contraseña").ToString
|
' Contraseña = ObjUsuario.DtResultados.Rows(0)("Contraseña").ToString
|
||||||
Usuario = ObjUsuario.ValidaUsuario(Nombre, Contraseña)
|
' Usuario = ObjUsuario.ValidaUsuario(Nombre, Contraseña)
|
||||||
|
|
||||||
If ObjEmpresa.GetEmpresas(pCveEmpresa, "-1", "-1", "-1", "-1") Then
|
' If ObjEmpresa.GetEmpresas(pCveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
Usuario.Empresa = ObjEmpresa.Empresa
|
' Usuario.Empresa = ObjEmpresa.Empresa
|
||||||
Usuario.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
|
' Usuario.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
|
||||||
|
|
||||||
'SOLO SI ESTA CANCELADA ANTE SAT EN SIG SE INTENTARA CANCELAR DE NUEVO CONTRA EL SAT
|
' 'SOLO SI ESTA CANCELADA ANTE SAT EN SIG SE INTENTARA CANCELAR DE NUEVO CONTRA EL SAT
|
||||||
If CveEstatus = 5 Then
|
' If CveEstatus = 5 Then
|
||||||
Dim Resp As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(Usuario.Empresa, FolioFiscal, Total, RFCReceptor, Usuario.Empresa.RFC)
|
' Dim Resp As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(Usuario.Empresa, FolioFiscal, Total, RFCReceptor, Usuario.Empresa.RFC)
|
||||||
If Resp.Verificado Then
|
' If Resp.Verificado Then
|
||||||
If ObjVentas.UpdateEstatusFactura(5, FolioFiscal, ObjCancelacion.CancelacionAcuse, Resp.CancelacionFecha, PCveVenta.ToEntero, -1, CvePAC:=Usuario.Empresa.CvePAC) Then
|
' If ObjVentas.UpdateEstatusFactura(5, FolioFiscal, ObjCancelacion.CancelacionAcuse, Resp.CancelacionFecha, PCveVenta.ToEntero, -1, CvePAC:=Usuario.Empresa.CvePAC) Then
|
||||||
Retorno = True
|
' Retorno = True
|
||||||
Else
|
' Else
|
||||||
MensajeError = $"Ocurrió un error al actualizar la cancelación la CveVenta {PCveVenta}"
|
' MensajeError = $"Ocurrió un error al actualizar la cancelación la CveVenta {PCveVenta}"
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
MensajeError = $"Ocurrió un error al Cancelar ante SAT la CveVenta {PCveVenta}"
|
' MensajeError = $"Ocurrió un error al Cancelar ante SAT la CveVenta {PCveVenta}"
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
MensajeError = $"Ocurrió un error al verificar el estatus de la CveVenta {PCveVenta}"
|
' MensajeError = $"Ocurrió un error al verificar el estatus de la CveVenta {PCveVenta}"
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
MensajeError = $"Ocurrió un error al cargar la empresa de la CveVenta {PCveVenta}"
|
' MensajeError = $"Ocurrió un error al cargar la empresa de la CveVenta {PCveVenta}"
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
MensajeError = $"Ocurrió un error al cargar el usuario de la CveVenta {PCveVenta}"
|
' MensajeError = $"Ocurrió un error al cargar el usuario de la CveVenta {PCveVenta}"
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
MensajeError = $"Ocurrió un error al cargar la CveVenta {PCveVenta}"
|
' MensajeError = $"Ocurrió un error al cargar la CveVenta {PCveVenta}"
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
ObjVentas.Dispose()
|
' ObjVentas.Dispose()
|
||||||
ObjUsuario.Dispose()
|
' ObjUsuario.Dispose()
|
||||||
ObjEmpresa.Dispose()
|
' ObjEmpresa.Dispose()
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
Return Retorno
|
' Return Retorno
|
||||||
End Function
|
' End Function
|
||||||
#End Region
|
'#End Region
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -40,7 +40,7 @@ Public Class wsSIG
|
|||||||
If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
|
If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
|
||||||
|
|
||||||
Dim ttDato As Usuario
|
Dim ttDato As Usuario
|
||||||
Dim tUsuario As New ClsSisUsuarios
|
Dim tUsuario As New ClsSisUsuarioAutenticacion
|
||||||
|
|
||||||
ttDato = tUsuario.ValidaUsuario(Usuario, Encripta(Contrasenia))
|
ttDato = tUsuario.ValidaUsuario(Usuario, Encripta(Contrasenia))
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ Public Class wsSIG
|
|||||||
If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
|
If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
|
||||||
|
|
||||||
Dim ttDato As Usuario = Nothing
|
Dim ttDato As Usuario = Nothing
|
||||||
Using tUsuario As New ClsSisUsuarios()
|
Using tUsuario As New ClsSisUsuarioAutenticacion()
|
||||||
ttDato = tUsuario.ValidaUsuario(Usuario, Encripta(Contrasenia), CveEmpresa:=CveEmpresa)
|
ttDato = tUsuario.ValidaUsuario(Usuario, Encripta(Contrasenia), CveEmpresa:=CveEmpresa)
|
||||||
End Using
|
End Using
|
||||||
If validatesubproyecto Then
|
If validatesubproyecto Then
|
||||||
@@ -691,7 +691,7 @@ Public Class wsSIG
|
|||||||
|
|
||||||
|
|
||||||
Dim ttDato As Usuario
|
Dim ttDato As Usuario
|
||||||
Dim tUsuario As New ClsSisUsuarios
|
Dim tUsuario As New ClsSisUsuarioAutenticacion
|
||||||
|
|
||||||
ttDato = tUsuario.ValidaUsuario(objuser.Usuario, Encripta(objuser.Contrasenia))
|
ttDato = tUsuario.ValidaUsuario(objuser.Usuario, Encripta(objuser.Contrasenia))
|
||||||
|
|
||||||
|
|||||||
@@ -53,38 +53,36 @@ Public Class E119 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe
|
|||||||
#Region "V A L I D A - D A T O S"
|
#Region "V A L I D A - D A T O S"
|
||||||
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
|
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
|
||||||
Dim UsuarioActual As Usuario = Nothing
|
Dim UsuarioActual As Usuario = Nothing
|
||||||
Dim ObjUsuarios As New ClsSisUsuarios(NombreCadena:=NombreCadena)
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa)
|
||||||
If ObjUsuarios.GetUsuarios(CveUsuario) Then
|
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100, CveEmpresa)
|
||||||
Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
If UsuarioActual IsNot Nothing Then
|
||||||
Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa, GenerarMenu:=False)
|
'CreaObjetoEmpresa(UsuarioActual)
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa
|
|
||||||
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
|
||||||
CreaObjetoEmpresa(UsuarioActual)
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
ObjUsuarios.Dispose()
|
ObjUsuarios.Dispose()
|
||||||
|
|
||||||
Return UsuarioActual
|
Return UsuarioActual
|
||||||
End Function
|
End Function
|
||||||
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
|
'Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||||
For Each Row As Data.DataRow In dttmp.Rows
|
' Dim ObjEmpresa As New ClsSisEmpresas()
|
||||||
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
' If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
Next
|
' If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
|
||||||
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
' Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||||
End If
|
|
||||||
|
|
||||||
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
' 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
|
||||||
|
|
||||||
End If
|
' UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||||
ObjEmpresa.Dispose()
|
|
||||||
End Sub
|
' End If
|
||||||
|
' ObjEmpresa.Dispose()
|
||||||
|
'End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||||
|
|||||||
@@ -62,38 +62,36 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe
|
|||||||
#Region "V A L I D A - D A T O S"
|
#Region "V A L I D A - D A T O S"
|
||||||
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
|
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
|
||||||
Dim UsuarioActual As Usuario = Nothing
|
Dim UsuarioActual As Usuario = Nothing
|
||||||
Dim ObjUsuarios As New ClsSisUsuarios(NombreCadena:="ConexionEcono")
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(141)
|
||||||
If ObjUsuarios.GetUsuarios(CveUsuario) Then
|
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100)
|
||||||
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
If UsuarioActual IsNot Nothing Then
|
||||||
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa, GenerarMenu:=False)
|
'CreaObjetoEmpresa(UsuarioActual)
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa
|
|
||||||
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
|
||||||
CreaObjetoEmpresa(UsuarioActual)
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
ObjUsuarios.Dispose()
|
ObjUsuarios.Dispose()
|
||||||
|
|
||||||
Return UsuarioActual
|
Return UsuarioActual
|
||||||
End Function
|
End Function
|
||||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
|
||||||
|
|
||||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
'Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||||
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
|
' Dim ObjEmpresa As New ClsSisEmpresas()
|
||||||
For Each Row As Data.DataRow In dttmp.Rows
|
' If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
' If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
|
||||||
Next
|
' Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||||
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
|
||||||
End If
|
|
||||||
|
|
||||||
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
' Dim EmpresasFuncionalidades As New HybridDictionary
|
||||||
End If
|
' For Each Row As Data.DataRow In dttmp.Rows
|
||||||
ObjEmpresa.Dispose()
|
' EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||||
End Sub
|
' Next
|
||||||
|
' ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||||
|
' End If
|
||||||
|
' ObjEmpresa.Dispose()
|
||||||
|
'End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||||
@@ -1672,20 +1670,7 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe
|
|||||||
Return JsonConvert.SerializeObject(respuesta)
|
Return JsonConvert.SerializeObject(respuesta)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
|
||||||
Dim UsuarioActual As Usuario = Nothing
|
|
||||||
Dim ObjUsuarios As New ClsSisUsuarios(NombreCadena:="ConexionEcono")
|
|
||||||
If ObjUsuarios.GetUsuarios(100) Then
|
|
||||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
|
||||||
Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
|
||||||
Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
|
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa
|
|
||||||
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
|
||||||
CreaObjetoEmpresa(UsuarioActual)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
ObjUsuarios.Dispose()
|
|
||||||
|
|
||||||
Using ObjPS As New ClsProductosServicios()
|
Using ObjPS As New ClsProductosServicios()
|
||||||
If ObjPS.GetExistenciasEmpresa(Codigo, CveEmpresa) Then
|
If ObjPS.GetExistenciasEmpresa(Codigo, CveEmpresa) Then
|
||||||
|
|||||||
@@ -400,17 +400,15 @@ Public Class E48 : Implements IHttpHandler, IRequiresSessionState
|
|||||||
End Property
|
End Property
|
||||||
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
|
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
|
||||||
Dim UsuarioActual As Usuario = Nothing
|
Dim UsuarioActual As Usuario = Nothing
|
||||||
Dim ObjUsuarios As New ClsSisUsuarios
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa)
|
||||||
If ObjUsuarios.GetUsuarios(CveUsuario) Then
|
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100)
|
||||||
Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
If UsuarioActual IsNot Nothing Then
|
||||||
Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
|
'CreaObjetoEmpresa(UsuarioActual)
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa
|
|
||||||
CreaObjetoEmpresa(UsuarioActual)
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
ObjUsuarios.Dispose()
|
ObjUsuarios.Dispose()
|
||||||
|
|
||||||
Return UsuarioActual
|
Return UsuarioActual
|
||||||
End Function
|
End Function
|
||||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ Public Class MobileHandler : Implements IHttpHandler
|
|||||||
|
|
||||||
|
|
||||||
Private Sub ValidaUsuario()
|
Private Sub ValidaUsuario()
|
||||||
Dim ObjUsuario As New ClsSisUsuarios
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(41)
|
||||||
|
Dim ObjUsuario As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
Dim User As Usuario
|
Dim User As Usuario
|
||||||
|
|
||||||
Dim IP As String
|
Dim IP As String
|
||||||
@@ -58,18 +59,18 @@ Public Class MobileHandler : Implements IHttpHandler
|
|||||||
|
|
||||||
Dim Json As New StringBuilder
|
Dim Json As New StringBuilder
|
||||||
|
|
||||||
User = ObjUsuario.ValidaUsuario(Contexto.Request("Usuario"), Contexto.Request("Password"))
|
User = ObjUsuario.ValidaUsuario(Contexto.Request("Usuario"), Contexto.Request("Password"), 41)
|
||||||
|
|
||||||
If User IsNot Nothing Then
|
If User IsNot Nothing Then
|
||||||
|
|
||||||
Dim Token As String = String.Format("{0}*{1}*{2}", ClsPaginas.NowADS().ToString, IP, User.CveUsuario)
|
Dim Token As String = String.Format("{0}*{1}*{2}", ClsPaginas.NowADS().ToString, IP, User.CveUsuario)
|
||||||
Token = Encripta(Token)
|
Token = Encripta(Token)
|
||||||
json.AppendFormat("{{ ""CveUsuario"" : ""{0}"", ""Nombre"" : ""{1}"", ""Token"" : ""{2}"" }} ", User.CveUsuario, User.Nombre, Token)
|
Json.AppendFormat("{{ ""CveUsuario"" : ""{0}"", ""Nombre"" : ""{1}"", ""Token"" : ""{2}"" }} ", User.CveUsuario, User.Nombre, Token)
|
||||||
Else
|
Else
|
||||||
json.Append("{ ""CveUsuario"" : ""-1"", ""Nombre"" : ""No valido"" } ")
|
Json.Append("{ ""CveUsuario"" : ""-1"", ""Nombre"" : ""No valido"" } ")
|
||||||
End If
|
End If
|
||||||
|
ObjUsuario.Dispose()
|
||||||
Contexto.Response.Write(json.ToString)
|
Contexto.Response.Write(Json.ToString)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -222,15 +222,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
|||||||
#Region "V A L I D A - D A T O S"
|
#Region "V A L I D A - D A T O S"
|
||||||
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
||||||
Dim UsuarioActual As Usuario = Nothing
|
Dim UsuarioActual As Usuario = Nothing
|
||||||
Dim ObjUsuarios As New ClsSisUsuarios
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa)
|
||||||
If ObjUsuarios.GetUsuarios(100) Then
|
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100)
|
||||||
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
If UsuarioActual IsNot Nothing Then
|
||||||
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
|
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa
|
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
|
||||||
CreaObjetoEmpresa(UsuarioActual)
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
ObjUsuarios.Dispose()
|
ObjUsuarios.Dispose()
|
||||||
Return UsuarioActual
|
Return UsuarioActual
|
||||||
|
|||||||
@@ -58,17 +58,15 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
|
|||||||
#Region "V A L I D A - D A T O S"
|
#Region "V A L I D A - D A T O S"
|
||||||
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
||||||
Dim UsuarioActual As Usuario = Nothing
|
Dim UsuarioActual As Usuario = Nothing
|
||||||
Dim ObjUsuarios As New ClsSisUsuarios
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(119)
|
||||||
If ObjUsuarios.GetUsuarios(100) Then
|
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100)
|
||||||
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
If UsuarioActual IsNot Nothing Then
|
||||||
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
|
CreaObjetoEmpresa(UsuarioActual)
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa
|
|
||||||
CreaObjetoEmpresa(UsuarioActual)
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
ObjUsuarios.Dispose()
|
ObjUsuarios.Dispose()
|
||||||
|
|
||||||
Return UsuarioActual
|
Return UsuarioActual
|
||||||
End Function
|
End Function
|
||||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||||
|
|||||||
@@ -18,153 +18,152 @@ public class SIGFreightVerify : IHttpHandler, IRequiresSessionState
|
|||||||
private Usuario ValidaUsuarioSistema(int CveEmpresa)
|
private Usuario ValidaUsuarioSistema(int CveEmpresa)
|
||||||
{
|
{
|
||||||
Usuario UsuarioActual = null;
|
Usuario UsuarioActual = null;
|
||||||
ClsSisUsuarios ObjUsuarios = new ClsSisUsuarios();
|
string NombreCadena = ClsPaginas.get_GlobalNombreCadenaConexion(141);
|
||||||
if (ObjUsuarios.GetUsuarios(1727))
|
ClsSisUsuarioAutenticacion ObjUsuarios = new ClsSisUsuarioAutenticacion(NombreCadena: NombreCadena);
|
||||||
{
|
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(1727);
|
||||||
if (ObjUsuarios.DtResultados.Rows.Count > 0)
|
if (UsuarioActual !=null)
|
||||||
{
|
{
|
||||||
var Usuario = ObjUsuarios.DtResultados.Rows[0]["Usuario"].ToString();
|
var Usuario = ObjUsuarios.DtResultados.Rows[0]["Usuario"].ToString();
|
||||||
var Contrasenia = ObjUsuarios.DtResultados.Rows[0]["Contraseña"].ToString();
|
var Contrasenia = ObjUsuarios.DtResultados.Rows[0]["Contraseña"].ToString();
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa: CveEmpresa);
|
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa: CveEmpresa);
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa;
|
UsuarioActual.CveEmpresa = CveEmpresa;
|
||||||
UsuarioActual.CveCliente = 183798;
|
UsuarioActual.CveCliente = 183798;
|
||||||
CreaObjetoEmpresa(ref UsuarioActual);
|
//CreaObjetoEmpresa(ref UsuarioActual);
|
||||||
CargaZonasHorarias(ref UsuarioActual);
|
CargaZonasHorarias(ref UsuarioActual);
|
||||||
}
|
}
|
||||||
}
|
ObjUsuarios.Dispose();
|
||||||
ObjUsuarios.Dispose();
|
return UsuarioActual;
|
||||||
return UsuarioActual;
|
|
||||||
}
|
}
|
||||||
private void CreaObjetoEmpresa(ref Usuario UsuarioActual)
|
private void CreaObjetoEmpresa(ref Usuario UsuarioActual)
|
||||||
|
{
|
||||||
|
ClsSisEmpresas ObjEmpresa = new ClsSisEmpresas();
|
||||||
|
if (ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1"))
|
||||||
{
|
{
|
||||||
ClsSisEmpresas ObjEmpresa = new ClsSisEmpresas();
|
if (ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa))
|
||||||
if (ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1"))
|
|
||||||
{
|
{
|
||||||
if (ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa))
|
System.Data.DataTable dttmp = ObjEmpresa.DtResultados;
|
||||||
{
|
|
||||||
System.Data.DataTable dttmp = ObjEmpresa.DtResultados;
|
|
||||||
|
|
||||||
var EmpresasFuncionalidades = new HybridDictionary();
|
var EmpresasFuncionalidades = new HybridDictionary();
|
||||||
foreach (System.Data.DataRow Row in dttmp.Rows)
|
foreach (System.Data.DataRow Row in dttmp.Rows)
|
||||||
EmpresasFuncionalidades.Add(Convert.ToInt32(Row["CveFuncionalidad"]), Row["Valor"].ToString());
|
EmpresasFuncionalidades.Add(Convert.ToInt32(Row["CveFuncionalidad"]), Row["Valor"].ToString());
|
||||||
|
|
||||||
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades);
|
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades);
|
||||||
}
|
|
||||||
|
|
||||||
UsuarioActual.Empresa = ObjEmpresa.Empresa;
|
|
||||||
}
|
}
|
||||||
ObjEmpresa.Dispose();
|
|
||||||
|
UsuarioActual.Empresa = ObjEmpresa.Empresa;
|
||||||
}
|
}
|
||||||
private void CargaZonasHorarias(ref Usuario UsuarioActual)
|
ObjEmpresa.Dispose();
|
||||||
|
}
|
||||||
|
private void CargaZonasHorarias(ref Usuario UsuarioActual)
|
||||||
|
{
|
||||||
|
ClsClientes ObjClientes = new ClsClientes();
|
||||||
|
try
|
||||||
{
|
{
|
||||||
ClsClientes ObjClientes = new ClsClientes();
|
if (ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus: 1))
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if (ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus: 1))
|
if (ObjClientes.DtResultados.Rows.Count == 1)
|
||||||
{
|
UsuarioActual.UTCOffset = ObjClientes.DtResultados.Rows[0]["UTCOffset"].ToString().ToEntero();
|
||||||
if (ObjClientes.DtResultados.Rows.Count == 1)
|
|
||||||
UsuarioActual.UTCOffset = ObjClientes.DtResultados.Rows[0]["UTCOffset"].ToString().ToEntero();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
ex.ToString().GuardaLog();
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
ObjClientes.Dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
public bool IsReusable => false;
|
|
||||||
|
|
||||||
public void ProcessRequest(HttpContext context)
|
|
||||||
{
|
{
|
||||||
try
|
ex.ToString().GuardaLog();
|
||||||
{
|
|
||||||
context.Response.ContentType = "text/plain";
|
|
||||||
IniciarTransmision(context);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
ex.GuardaLog(ex.Message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
private void IniciarTransmision(HttpContext context)
|
|
||||||
{
|
{
|
||||||
var UsuarioActual = ValidaUsuarioSistema(121);
|
ObjClientes.Dispose();
|
||||||
DataTable dtShipments = null;
|
|
||||||
var FVCARRIERID = "";
|
|
||||||
var SCAC = "";
|
|
||||||
var UsuarioFV = "";
|
|
||||||
var ContraseniaFV = "";
|
|
||||||
var ObjGPS = new ClsGPS();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (ObjGPS.GetShipments(UsuarioActual.CveCliente, -1))
|
|
||||||
{
|
|
||||||
dtShipments = ObjGPS.DtResultados.FiltraParametros("TransmitirTexto = 'Si'");
|
|
||||||
}
|
|
||||||
if (ObjGPS.GetFVConfiguracion(UsuarioActual.CveCliente, -1))
|
|
||||||
{
|
|
||||||
if (ObjGPS.DtResultados.Rows.Count == 1)
|
|
||||||
{
|
|
||||||
var row = ObjGPS.DtResultados.Rows[0];
|
|
||||||
FVCARRIERID = row["fvCarrierId"].ToString().Trim();
|
|
||||||
SCAC = row["scac"].ToString().Trim();
|
|
||||||
UsuarioFV = row["Usuario"].ToString().Trim();
|
|
||||||
ContraseniaFV = row["Contrasenia"].ToString().Trim();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
this.OnError("Ocurrió un error al obtener la configuración", ex);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
ObjGPS.Dispose();
|
|
||||||
var array = new JArray();
|
|
||||||
if (dtShipments != null)
|
|
||||||
{
|
|
||||||
foreach (DataRow Row in dtShipments.Rows)
|
|
||||||
{
|
|
||||||
var datos = GeneraRequestLO(UsuarioActual, Row["CveShipment"].ToString().ToEntero(), FVCARRIERID, SCAC);
|
|
||||||
if (datos != null)
|
|
||||||
{
|
|
||||||
var retorno = EnviarEventoAPI(UsuarioActual, Row["ShipmentID"].ToString(), Row["Customer"].ToString(), FVCARRIERID, UsuarioFV, ContraseniaFV, datos.ToString());
|
|
||||||
array.Add(retorno);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
context.Response.Write(array);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
protected JObject GeneraRequestLO(Usuario UsuarioActual, int CveShipment, string FVCARRIERID, string SCAC)
|
}
|
||||||
{
|
|
||||||
var route_id = "";
|
|
||||||
var trailer_number = "";
|
|
||||||
var trackingAssetId = "";
|
|
||||||
double lat = 0;
|
|
||||||
double lon = 0;
|
|
||||||
|
|
||||||
var ObjGPS = new ClsGPS();
|
public bool IsReusable => false;
|
||||||
if (ObjGPS.GetShipmentDetail(CveShipment))
|
|
||||||
|
public void ProcessRequest(HttpContext context)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
context.Response.ContentType = "text/plain";
|
||||||
|
IniciarTransmision(context);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ex.GuardaLog(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void IniciarTransmision(HttpContext context)
|
||||||
|
{
|
||||||
|
var UsuarioActual = ValidaUsuarioSistema(121);
|
||||||
|
DataTable dtShipments = null;
|
||||||
|
var FVCARRIERID = "";
|
||||||
|
var SCAC = "";
|
||||||
|
var UsuarioFV = "";
|
||||||
|
var ContraseniaFV = "";
|
||||||
|
var ObjGPS = new ClsGPS();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (ObjGPS.GetShipments(UsuarioActual.CveCliente, -1))
|
||||||
|
{
|
||||||
|
dtShipments = ObjGPS.DtResultados.FiltraParametros("TransmitirTexto = 'Si'");
|
||||||
|
}
|
||||||
|
if (ObjGPS.GetFVConfiguracion(UsuarioActual.CveCliente, -1))
|
||||||
{
|
{
|
||||||
if (ObjGPS.DtResultados.Rows.Count == 1)
|
if (ObjGPS.DtResultados.Rows.Count == 1)
|
||||||
{
|
{
|
||||||
var row = ObjGPS.DtResultados.Rows[0];
|
var row = ObjGPS.DtResultados.Rows[0];
|
||||||
lat = row["Lat"].ToString().ToDouble();
|
FVCARRIERID = row["fvCarrierId"].ToString().Trim();
|
||||||
lon = row["Lon"].ToString().ToDouble();
|
SCAC = row["scac"].ToString().Trim();
|
||||||
route_id = row["RouteID"].ToString();
|
UsuarioFV = row["Usuario"].ToString().Trim();
|
||||||
trailer_number = row["TrailerID"].ToString();
|
ContraseniaFV = row["Contrasenia"].ToString().Trim();
|
||||||
trackingAssetId = row["AssetID"].ToString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.OnError("Ocurrió un error al obtener la configuración", ex);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
ObjGPS.Dispose();
|
ObjGPS.Dispose();
|
||||||
|
var array = new JArray();
|
||||||
|
if (dtShipments != null)
|
||||||
|
{
|
||||||
|
foreach (DataRow Row in dtShipments.Rows)
|
||||||
|
{
|
||||||
|
var datos = GeneraRequestLO(UsuarioActual, Row["CveShipment"].ToString().ToEntero(), FVCARRIERID, SCAC);
|
||||||
|
if (datos != null)
|
||||||
|
{
|
||||||
|
var retorno = EnviarEventoAPI(UsuarioActual, Row["ShipmentID"].ToString(), Row["Customer"].ToString(), FVCARRIERID, UsuarioFV, ContraseniaFV, datos.ToString());
|
||||||
|
array.Add(retorno);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
context.Response.Write(array);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected JObject GeneraRequestLO(Usuario UsuarioActual, int CveShipment, string FVCARRIERID, string SCAC)
|
||||||
|
{
|
||||||
|
var route_id = "";
|
||||||
|
var trailer_number = "";
|
||||||
|
var trackingAssetId = "";
|
||||||
|
double lat = 0;
|
||||||
|
double lon = 0;
|
||||||
|
|
||||||
var json = new JObject()
|
var ObjGPS = new ClsGPS();
|
||||||
|
if (ObjGPS.GetShipmentDetail(CveShipment))
|
||||||
|
{
|
||||||
|
if (ObjGPS.DtResultados.Rows.Count == 1)
|
||||||
|
{
|
||||||
|
var row = ObjGPS.DtResultados.Rows[0];
|
||||||
|
lat = row["Lat"].ToString().ToDouble();
|
||||||
|
lon = row["Lon"].ToString().ToDouble();
|
||||||
|
route_id = row["RouteID"].ToString();
|
||||||
|
trailer_number = row["TrailerID"].ToString();
|
||||||
|
trackingAssetId = row["AssetID"].ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ObjGPS.Dispose();
|
||||||
|
|
||||||
|
var json = new JObject()
|
||||||
{
|
{
|
||||||
new JProperty("carrier", new JObject()
|
new JProperty("carrier", new JObject()
|
||||||
{
|
{
|
||||||
@@ -203,35 +202,35 @@ public class SIGFreightVerify : IHttpHandler, IRequiresSessionState
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
private JObject EnviarEventoAPI(Usuario UsuarioActual, string ShipmentID, string Customer, string FVCARRIERID, string UsuarioFV, string ContraseniaFV, string Datos)
|
private JObject EnviarEventoAPI(Usuario UsuarioActual, string ShipmentID, string Customer, string FVCARRIERID, string UsuarioFV, string ContraseniaFV, string Datos)
|
||||||
|
{
|
||||||
|
var retorno = "[]";
|
||||||
|
var token = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(string.Format("{0}:{1}", UsuarioFV, ContraseniaFV)));
|
||||||
|
string correlationId = GuidGenerator.GenerateTimeBasedGuid(UsuarioActual.FechaActualCliente).ToString();
|
||||||
|
HttpClient wc = new HttpClient();
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var retorno = "[]";
|
var fvShipmentId = $"{FVCARRIERID}|{Customer}|{ShipmentID}";
|
||||||
var token = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(string.Format("{0}:{1}", UsuarioFV, ContraseniaFV)));
|
|
||||||
string correlationId = GuidGenerator.GenerateTimeBasedGuid(UsuarioActual.FechaActualCliente).ToString();
|
|
||||||
HttpClient wc = new HttpClient();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var fvShipmentId = $"{FVCARRIERID}|{Customer}|{ShipmentID}";
|
|
||||||
|
|
||||||
var Url = new Uri("https://api.freightverify.com/ws/rest/v2/tl/shipment/event");
|
var Url = new Uri("https://api.freightverify.com/ws/rest/v2/tl/shipment/event");
|
||||||
var content = new StringContent(Datos, Encoding.UTF8, "application/json");
|
var content = new StringContent(Datos, Encoding.UTF8, "application/json");
|
||||||
wc.DefaultRequestHeaders.Add("Authorization", $"Basic {token}");
|
wc.DefaultRequestHeaders.Add("Authorization", $"Basic {token}");
|
||||||
wc.DefaultRequestHeaders.Add("WSS-correlationId", correlationId);
|
wc.DefaultRequestHeaders.Add("WSS-correlationId", correlationId);
|
||||||
wc.DefaultRequestHeaders.Add("X-WSS-fvShipmentId", fvShipmentId);
|
wc.DefaultRequestHeaders.Add("X-WSS-fvShipmentId", fvShipmentId);
|
||||||
var response = wc.PostAsync(Url, content).Result;
|
var response = wc.PostAsync(Url, content).Result;
|
||||||
retorno = response.Content.ReadAsStringAsync().Result;
|
retorno = response.Content.ReadAsStringAsync().Result;
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine(ex);
|
|
||||||
}
|
|
||||||
wc.Dispose();
|
|
||||||
|
|
||||||
return JObject.Parse(retorno);
|
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex);
|
||||||
|
}
|
||||||
|
wc.Dispose();
|
||||||
|
|
||||||
|
return JObject.Parse(retorno);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
namespace FluentGenerator
|
namespace FluentGenerator
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,38 +25,22 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState
|
|||||||
|
|
||||||
Private Function ValidaUsuarioSistema(CveEmpresa As Integer, Optional CveUsuario As Integer = 100) As Usuario
|
Private Function ValidaUsuarioSistema(CveEmpresa As Integer, Optional CveUsuario As Integer = 100) As Usuario
|
||||||
|
|
||||||
Dim UsuarioToken As Usuario = Nothing
|
Dim UsuarioToken As Usuario = Nothing
|
||||||
Dim ObjUsuarios As New ClsSisUsuarios
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa)
|
||||||
If ObjUsuarios.GetUsuarios(CveUsuario) Then
|
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
|
||||||
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
||||||
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
||||||
UsuarioToken = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
|
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
||||||
UsuarioToken.CveEmpresa = CveEmpresa
|
UsuarioToken = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
|
||||||
CreaObjetoEmpresa(UsuarioToken)
|
UsuarioToken.CveEmpresa = CveEmpresa
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjUsuarios.Dispose()
|
ObjUsuarios.Dispose()
|
||||||
Return UsuarioToken
|
Return UsuarioToken
|
||||||
End Function
|
End Function
|
||||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioToken As Usuario)
|
|
||||||
|
|
||||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
|
||||||
If ObjEmpresa.GetEmpresas(UsuarioToken.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
|
||||||
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioToken.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
|
|
||||||
|
|
||||||
UsuarioToken.Empresa = ObjEmpresa.Empresa
|
|
||||||
End If
|
|
||||||
ObjEmpresa.Dispose()
|
|
||||||
End Sub
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||||
|
|||||||
@@ -117,8 +117,9 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
|||||||
|
|
||||||
|
|
||||||
If GlobalDTUsuarios.Rows.Count > 0 Then
|
If GlobalDTUsuarios.Rows.Count > 0 Then
|
||||||
Dim dtrow As DataRow = GlobalDTUsuarios.Rows(0)
|
Dim dtrow As DataRow = GlobalDTUsuarios.Rows(0)
|
||||||
Dim ObjUsuario As New ClsSisUsuarios
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(cveEmpresa)
|
||||||
|
Dim ObjUsuario As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
usuario = ObjUsuario.ValidaUsuario(dtrow("Usuario").ToString, dtrow("Contraseña").ToString, CveEmpresa:=cveEmpresa)
|
usuario = ObjUsuario.ValidaUsuario(dtrow("Usuario").ToString, dtrow("Contraseña").ToString, CveEmpresa:=cveEmpresa)
|
||||||
ObjUsuario.Dispose()
|
ObjUsuario.Dispose()
|
||||||
|
|
||||||
@@ -225,8 +226,9 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
|||||||
End If
|
End If
|
||||||
#End Region
|
#End Region
|
||||||
#Region "obtengo el usuario con el username y la pass"
|
#Region "obtengo el usuario con el username y la pass"
|
||||||
|
'Dim tGrupoEmpresa As String = ClsPaginas.GlobalGrupoEmpresa(Request.Url.Host.ToUpper())
|
||||||
Using ObjUsuario As New ClsSisUsuarios()
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa)
|
||||||
|
Using ObjUsuario As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
usuario = ObjUsuario.ValidaUsuario(username, pass, CveEmpresa:=CveEmpresa)
|
usuario = ObjUsuario.ValidaUsuario(username, pass, CveEmpresa:=CveEmpresa)
|
||||||
End Using
|
End Using
|
||||||
#End Region
|
#End Region
|
||||||
@@ -345,41 +347,19 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
||||||
Dim UsuarioActual As Usuario = Nothing
|
Dim UsuarioActual As Usuario = Nothing
|
||||||
Dim ObjUsuarios As New ClsSisUsuarios
|
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa)
|
||||||
If ObjUsuarios.GetUsuarios(100) Then
|
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
|
||||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100)
|
||||||
Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
If UsuarioActual IsNot Nothing Then
|
||||||
Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
|
'CreaObjetoEmpresa(UsuarioActual)
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa
|
End If
|
||||||
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
|
ObjUsuarios.Dispose()
|
||||||
CreaObjetoEmpresa(UsuarioActual)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
ObjUsuarios.Dispose()
|
|
||||||
Return UsuarioActual
|
|
||||||
End Function
|
|
||||||
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
|
|
||||||
|
|
||||||
|
Return UsuarioActual
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, FechaEnvio As DateTime, FechaActual As DateTime, Optional pCveCliente As Integer = -1) As JObject
|
Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, FechaEnvio As DateTime, FechaActual As DateTime, Optional pCveCliente As Integer = -1) As JObject
|
||||||
Dim ClientesSinEnviar As New JArray()
|
Dim ClientesSinEnviar As New JArray()
|
||||||
|
|||||||
Reference in New Issue
Block a user