Пример #1
0
 public HttpResponseMessage Save(JobHistoryModel aJobHistoryModel)
 {
     try
     {
         if (this.ModelState.IsValid)
         {
             var jobHistoryList = service.SaveJobHistory(aJobHistoryModel);
             if (jobHistoryList != null)
             {
                 return(Request.CreateResponse(HttpStatusCode.OK, jobHistoryList));
             }
             else
             {
                 string message = "Error Saving Data";
                 return(Request.CreateErrorResponse(HttpStatusCode.Forbidden, message));
             }
         }
         else
         {
             return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
         }
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.InnerException.Message));
     }
 }