public HttpResponseMessage GetGeneralTransferPrice(HttpRequestMessage request, int generaltransferpriceId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; GeneralTransferPrice generaltransferprice = _MPRCoreService.GetGeneralTransferPrice(generaltransferpriceId); // notice no need to create a seperate model object since GeneralTransferPrice entity will do just fine response = request.CreateResponse <GeneralTransferPrice>(HttpStatusCode.OK, generaltransferprice); return response; })); }
public HttpResponseMessage DeleteGeneralTransferPrice(HttpRequestMessage request, [FromBody] int generaltransferpriceId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data GeneralTransferPrice generaltransferprice = _MPRCoreService.GetGeneralTransferPrice(generaltransferpriceId); if (generaltransferprice != null) { _MPRCoreService.DeleteGeneralTransferPrice(generaltransferpriceId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No Account Transfer Price found under that ID."); } return response; })); }
public GeneralTransferPrice UpdateGeneralTransferPrice(GeneralTransferPrice generalTransferPrice) { return(Channel.UpdateGeneralTransferPrice(generalTransferPrice)); }
public HttpResponseMessage UpdateGeneralTransferPrice(HttpRequestMessage request, [FromBody] GeneralTransferPrice generaltransferpriceModel) { return(GetHttpResponse(request, () => { var generaltransferprice = _MPRCoreService.UpdateGeneralTransferPrice(generaltransferpriceModel); return request.CreateResponse <GeneralTransferPrice>(HttpStatusCode.OK, generaltransferprice); })); }