Esempio n. 1
0
 public HttpResponseMessage DeleteJobHistorys(JobHistoryModel aJobHistoryModel)
 {
     try
     {
         if (this.ModelState.IsValid)
         {
             var result = service.DeleteJobHistory(aJobHistoryModel);
             if (result != null)
             {
                 return(Request.CreateResponse(HttpStatusCode.OK, result));
             }
             else
             {
                 string message = "Not deleted successfully";
                 return(Request.CreateErrorResponse(HttpStatusCode.Forbidden, message));
             }
         }
         else
         {
             return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
         }
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
     }
 }