public HttpResponseMessage GetOpexBasisMapping(HttpRequestMessage request, int opexBasisMappingId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; OpexBasisMapping opexBasisMapping = _MPROPEXService.GetOpexBasisMapping(opexBasisMappingId); // notice no need to create a seperate model object since OpexBasisMapping entity will do just fine response = request.CreateResponse <OpexBasisMapping>(HttpStatusCode.OK, opexBasisMapping); return response; })); }
public HttpResponseMessage DeleteOpexBasisMapping(HttpRequestMessage request, [FromBody] int opexBasisMappingId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data OpexBasisMapping opexBasisMapping = _MPROPEXService.GetOpexBasisMapping(opexBasisMappingId); if (opexBasisMapping != null) { _MPROPEXService.DeleteOpexBasisMapping(opexBasisMappingId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No Expense Basis found under that ID."); } return response; })); }
public OpexBasisMapping UpdateOpexBasisMapping(OpexBasisMapping opexBasisMapping) { return(Channel.UpdateOpexBasisMapping(opexBasisMapping)); }
public HttpResponseMessage UpdateOpexBasisMapping(HttpRequestMessage request, [FromBody] OpexBasisMapping opexBasisMappingModel) { return(GetHttpResponse(request, () => { var opexBasisMapping = _MPROPEXService.UpdateOpexBasisMapping(opexBasisMappingModel); return request.CreateResponse <OpexBasisMapping>(HttpStatusCode.OK, opexBasisMapping); })); }