Esempio n. 1
0
 // PUT: api/LeaveRequests/5
 public HttpResponseMessage PutLeaveRequest(int id, LeaveRequestVM leaveRequestVM)
 {
     try
     {
         var message = Request.CreateErrorResponse(HttpStatusCode.NotFound, "404 : Data Not Found");
         var result  = iLeaveRequestService.Update(id, leaveRequestVM);
         if (result)
         {
             message = Request.CreateResponse(HttpStatusCode.OK, leaveRequestVM);
         }
         return(message);
     }
     catch (Exception e)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "500 : Internal Server Error"));
     }
 }