예제 #1
0
        public HttpResponseMessage GetRiskAdjustedCharge(HttpRequestMessage request, int RiskAdjustedChargeId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                RiskAdjustedCharge rac = _MPRCoreService.GetRiskAdjustedCharge(RiskAdjustedChargeId);

                // notice no need to create a seperate model object since CaptionMapping entity will do just fine
                response = request.CreateResponse <RiskAdjustedCharge>(HttpStatusCode.OK, rac);

                return response;
            }));
        }
예제 #2
0
        public HttpResponseMessage DeleteRiskAdjustedCharge(HttpRequestMessage request, [FromBody] int RiskAdjustedChargeId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                RiskAdjustedCharge rac = _MPRCoreService.GetRiskAdjustedCharge(RiskAdjustedChargeId);

                if (rac != null)
                {
                    _MPRCoreService.DeleteRiskAdjustedCharge(RiskAdjustedChargeId);

                    response = request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No Risk Adjusted Charge found under that ID.");
                }

                return response;
            }));
        }
예제 #3
0
        public HttpResponseMessage UpdateRiskAdjustedCharge(HttpRequestMessage request, [FromBody] RiskAdjustedCharge racModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var rac = _MPRCoreService.UpdateRiskAdjustedCharge(racModel);

                return request.CreateResponse <RiskAdjustedCharge>(HttpStatusCode.OK, rac);
            }));
        }