public HttpResponseMessage UpdateSlarySchedule(HttpRequestMessage request, [FromBody] SlarySchedule slaryScheduleModel) { return(GetHttpResponse(request, () => { var slarySchedule = _MPRCoreService.UpdateSlarySchedule(slaryScheduleModel); return request.CreateResponse <SlarySchedule>(HttpStatusCode.OK, slarySchedule); })); }
public HttpResponseMessage GetSlarySchedule(HttpRequestMessage request, int slaryscheduleId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; SlarySchedule slarySchedule = _MPRCoreService.GetSlarySchedule(slaryscheduleId); // notice no need to create a seperate model object since CaptionMapping entity will do just fine response = request.CreateResponse <SlarySchedule>(HttpStatusCode.OK, slarySchedule); return response; })); }
public HttpResponseMessage DeleteSlarySchedule(HttpRequestMessage request, [FromBody] int slaryScheduleId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data SlarySchedule slarySchedule = _MPRCoreService.GetSlarySchedule(slaryScheduleId); if (slarySchedule != null) { _MPRCoreService.DeleteSlarySchedule(slaryScheduleId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No slarySchedule found under that ID."); } return response; })); }