public HttpResponseMessage SaveMasterEstimationServiceType(EstimationServiceTypeModel aMEestiSR) { try { if (this.ModelState.IsValid) { var mecList = _mesService.SaveEstimationServiceType(aMEestiSR); if (mecList != null) { return(Request.CreateResponse(HttpStatusCode.OK, mecList)); } 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)); } }
public HttpResponseMessage GetAllEstimationServiceTypeList(EstimationServiceTypeModel model, string type) { try { if (this.ModelState.IsValid) { var mecList = _mesService.GetAllEstimationServiceTypeList(model, type); if (mecList != null) { return(Request.CreateResponse(HttpStatusCode.OK, mecList)); } 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)); } }
public HttpResponseMessage DeleteEstimationServiceType(EstimationServiceTypeModel merModel) { try { if (this.ModelState.IsValid) { var result = _mesService.DeleteEstimationServiceType(merModel); 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)); } }