public HttpResponseMessage GetCategoryTransferPrice(HttpRequestMessage request, int CategoryTransferPriceId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; CategoryTransferPrice categoryTransferPrice = _MPRBSService.GetCategoryTransferPrice(CategoryTransferPriceId); // notice no need to create a seperate model object since CategoryTransferPrice entity will do just fine response = request.CreateResponse <CategoryTransferPrice>(HttpStatusCode.OK, categoryTransferPrice); return response; })); }
public HttpResponseMessage DeleteCategoryTransferPrice(HttpRequestMessage request, [FromBody] int CategoryTransferPriceId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data CategoryTransferPrice categoryTransferPrice = _MPRBSService.GetCategoryTransferPrice(CategoryTransferPriceId); if (categoryTransferPrice != null) { _MPRBSService.DeleteCategoryTransferPrice(CategoryTransferPriceId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No Opex Business Rule found under that ID."); } return response; })); }
public HttpResponseMessage UpdateCategoryTransferPrice(HttpRequestMessage request, [FromBody] CategoryTransferPrice categoryTransferPriceModel) { return(GetHttpResponse(request, () => { var categoryTransferPrice = _MPRBSService.UpdateCategoryTransferPrice(categoryTransferPriceModel); return request.CreateResponse <CategoryTransferPrice>(HttpStatusCode.OK, categoryTransferPrice); })); }
public CategoryTransferPrice UpdateCategoryTransferPrice(CategoryTransferPrice categoryTransferPrice) { return(Channel.UpdateCategoryTransferPrice(categoryTransferPrice)); }