Esempio n. 1
0
        public HttpResponseMessage GetMonthlyDiscountFactorPlacement(HttpRequestMessage request, int MonthlyDiscountFactorPlacement_Id)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                MonthlyDiscountFactorPlacement monthlydiscountfactorplacement = _IFRS9Service.GetMonthlyDiscountFactorPlacement(MonthlyDiscountFactorPlacement_Id);

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

                return response;
            }));
        }
Esempio n. 2
0
        public HttpResponseMessage DeleteMonthlyDiscountFactorPlacement(HttpRequestMessage request, [FromBody] int MonthlyDiscountFactorPlacement_Id)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                MonthlyDiscountFactorPlacement monthlydiscountfactorplacement = _IFRS9Service.GetMonthlyDiscountFactorPlacement(MonthlyDiscountFactorPlacement_Id);

                if (monthlydiscountfactorplacement != null)
                {
                    _IFRS9Service.DeleteMonthlyDiscountFactorPlacement(MonthlyDiscountFactorPlacement_Id);

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

                return response;
            }));
        }
Esempio n. 3
0
        public HttpResponseMessage UpdateMonthlyDiscountFactorPlacement(HttpRequestMessage request, [FromBody] MonthlyDiscountFactorPlacement monthlydiscountfactorplacementModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var monthlydiscountfactorplacement = _IFRS9Service.UpdateMonthlyDiscountFactorPlacement(monthlydiscountfactorplacementModel);

                return request.CreateResponse <MonthlyDiscountFactorPlacement>(HttpStatusCode.OK, monthlydiscountfactorplacement);
            }));
        }