Ejemplo n.º 1
0
 public HttpResponseMessage crearUsuarioController(DtoUsuario dtoUsuario)
 {
     try
     {
         var token = Request.Headers.Authorization.Parameter;
         _tokenValidator.ValidarToken(token);
         return(Request.CreateResponse(HttpStatusCode.OK, _usuarioService.CrearUsuario(dtoUsuario, token)));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, _util.crearDtoErrorExceptionMessage(ex)));
     }
 }
 public HttpResponseMessage VEslMnUsr()
 {
     try
     {
         var token = Request.Headers.Authorization.Parameter;
         _tokenValidator.ValidarToken(token);
         return(Request.CreateResponse(HttpStatusCode.OK, _recursoService.ObtenerMenuUsuarioPorToken(token)));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, _apiResponseMessage.crearDtoErrorExceptionMessage(ex)));
     }
 }
        public HttpResponseMessage crearpersonaController(DtoPersona dtopersona)
        {
            try
            {
                var token = Request.Headers.Authorization.Parameter;
                _tokenValidator.ValidarToken(token);

                return(Request.CreateResponse(HttpStatusCode.OK, _personaService.CrearPersona(dtopersona, token)));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, _apiResponseMessage.crearDtoErrorExceptionMessage(ex)));
            }
        }