Example #1
0
        public HttpResponseMessage GetIncomeAccountPoolRate(HttpRequestMessage request, int Id)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                IncomeAccountPoolRate incomeAccountPoolRate = _MPRCoreService.GetIncomeAccountPoolRate(Id);

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

                return response;
            }));
        }
Example #2
0
        public HttpResponseMessage DeleteIncomeAccountPoolRate(HttpRequestMessage request, [FromBody] int Id)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                IncomeAccountPoolRate incomeAccountPoolRate = _MPRCoreService.GetIncomeAccountPoolRate(Id);

                if (incomeAccountPoolRate != null)
                {
                    _MPRCoreService.DeleteIncomeAccountPoolRate(Id);

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

                return response;
            }));
        }
Example #3
0
        public HttpResponseMessage UpdateIncomeAccountPoolRate(HttpRequestMessage request, [FromBody] IncomeAccountPoolRate incomeAccountPoolRateModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var incomeAccountPoolRate = _MPRCoreService.UpdateIncomeAccountPoolRate(incomeAccountPoolRateModel);

                return request.CreateResponse <IncomeAccountPoolRate>(HttpStatusCode.OK, incomeAccountPoolRate);
            }));
        }