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