Ejemplo n.º 1
0
 public HttpResponseMessage GetJobHistorys(BaseViewModel model)
 {
     try
     {
         if (this.ModelState.IsValid)
         {
             var jobHistoryList = service.GetAllJobHistoryList(model);
             if (jobHistoryList != null)
             {
                 return(Request.CreateResponse(HttpStatusCode.OK, jobHistoryList));
             }
             else
             {
                 string message = "Error in getting 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));
     }
 }