Exemplo n.º 1
0
        public HttpResponseMessage Put([FromBody] UserDetailsBO user)
        {
            UserOperationsBL bll    = new UserOperationsBL();
            bool             result = bll.UpdateUser(user);

            if (result)
            {
                return(Request.CreateResponse(HttpStatusCode.OK,
                                              result, Configuration.Formatters.JsonFormatter));
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "User update failed!"));
            }
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetAllUser()
        {
            UserOperationsBL userOperationsBL = new UserOperationsBL();
            var result = userOperationsBL.GetAllUser();

            if (result != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK,
                                              result, Configuration.Formatters.JsonFormatter));
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "User Not Found"));
            }
        }