public HttpResponseMessage GetOpexTimeAllocationMPR(HttpRequestMessage request, int ID) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; OpexTimeAllocationMPR opex = _MPROPEXService.GetOpexTimeAllocationMPR(ID); // notice no need to create a seperate model object since ActivityBase entity will do just fine response = request.CreateResponse <OpexTimeAllocationMPR>(HttpStatusCode.OK, opex); return response; })); }
public HttpResponseMessage DeleteOpexTimeAllocationMPR(HttpRequestMessage request, [FromBody] int ID) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data OpexTimeAllocationMPR opex = _MPROPEXService.GetOpexTimeAllocationMPR(ID); if (opex != null) { //_MPROPEXService.DeleteActivityBase(ID); _MPROPEXService.DeleteOpexTimeAllocationMPR(ID); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No OpexTimeAllocationMPR found under that ID."); } return response; })); }
public HttpResponseMessage UpdateOpexTimeAllocationMPR(HttpRequestMessage request, [FromBody] OpexTimeAllocationMPR opexModel) { return(GetHttpResponse(request, () => { var opex = _MPROPEXService.UpdateOpexTimeAllocationMPR(opexModel); return request.CreateResponse <OpexTimeAllocationMPR>(HttpStatusCode.OK, opex); })); }
public OpexTimeAllocationMPR UpdateOpexTimeAllocationMPR(OpexTimeAllocationMPR opexTimeAllocationMPR) { return(Channel.UpdateOpexTimeAllocationMPR(opexTimeAllocationMPR)); }