Exemplo n.º 1
0
 public List <Usuario> getByFilters(string usuario, int id_rol, ref string resultado)
 {
     try
     {
         return(UsuarioDataProvider.getByFilters(usuario, id_rol));
     }
     catch (Exception ex)
     {
         LogueadorService.loguear(ex.Message, GetType().Namespace, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name);
         return(new List <Usuario>());
     }
 }
Exemplo n.º 2
0
 public void delete(Sesion sesionActual)
 {
     try
     {
         SesionDataProvider.delete(sesionActual);
     }
     catch (Exception ex)
     {
         LogueadorService.loguear(ex.Message, GetType().Namespace, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name);
         throw ex;
     }
 }
Exemplo n.º 3
0
 public void updateRoles(Usuario user, ref string resultado)
 {
     try
     {
         UsuarioDataProvider.updateRoles(user);
     }
     catch (Exception ex)
     {
         LogueadorService.loguear(ex.Message, GetType().Namespace, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name);
         resultado = ex.Message;
     }
 }
Exemplo n.º 4
0
 public List <Rol> getByIdUser(int id_usuario, ref string resultado)
 {
     try
     {
         return(RolDataProvider.getByIdUsuario(id_usuario));
     }
     catch (Exception ex)
     {
         LogueadorService.loguear(ex.Message, "Servicios", "RolService", "getByIdUser");
         resultado = ex.Message;
         return(new List <Rol>());
     }
 }
Exemplo n.º 5
0
 public Sesion getByToken(string token, ref string respuesta)
 {
     try
     {
         return(SesionDataProvider.getByToken(token));
     }
     catch (Exception ex)
     {
         LogueadorService.loguear(ex.Message, GetType().Namespace, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name);
         respuesta = ex.Message;
         return(null);
     }
 }
Exemplo n.º 6
0
 public int crear(Usuario nuevoUsuario, ref string resultado)
 {
     try
     {
         return(UsuarioDataProvider.crear(nuevoUsuario));
     }
     catch (Exception ex)
     {
         LogueadorService.loguear(ex.Message, GetType().Namespace, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name);
         resultado = ex.Message;
         return(0);
     }
 }
Exemplo n.º 7
0
        public void insert(Sesion sesion, ref string respuesta)
        {
            try
            {
                Sesion sesionExistente = SesionDataProvider.getByIdUser(sesion.usuario_logueado.id_usuario);

                if (sesionExistente != null)
                {
                    SesionDataProvider.delete(sesionExistente);
                }

                SesionDataProvider.insert(sesion);
            }
            catch (Exception ex)
            {
                LogueadorService.loguear(ex.Message, GetType().Namespace, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name);
                respuesta = ex.Message;
            }
        }
Exemplo n.º 8
0
        public Usuario getByUserNamePassword(string login_name, string password, ref string resultado)
        {
            try
            {
                Usuario usuario = UsuarioDataProvider.getByUserNamePassword(login_name, password);

                if (usuario.id_usuario > 0)
                {
                    usuario.roles = RolDataProvider.getByIdUsuario(usuario.id_usuario);
                }

                return(usuario);
            }
            catch (Exception ex)
            {
                LogueadorService.loguear(ex.Message, GetType().Namespace, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name);
                resultado = ex.Message;
                return(null);
            }
        }