Exemplo n.º 1
0
        public HttpResponseMessage GetIncomeProductstable(HttpRequestMessage request, int productid)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                IncomeProductsTable ipt = _MPRIncomeService.Getincomeproducttable(productid);

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

                return response;
            }));
        }
Exemplo n.º 2
0
        public HttpResponseMessage DeleteIncomeProductsTable(HttpRequestMessage request, [FromBody] int productid)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                IncomeProductsTable ipt = _MPRIncomeService.Getincomeproducttable(productid);

                if (ipt != null)
                {
                    _MPRIncomeService.Deleteincomeproducttable(productid);

                    response = request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No IncomeProduct found under the productid.");
                }

                return response;
            }));
        }
Exemplo n.º 3
0
 public IncomeProductsTable Updateincomeproducttable(IncomeProductsTable incomeproducttable)
 {
     return(Channel.Updateincomeproducttable(incomeproducttable));
 }
Exemplo n.º 4
0
        public HttpResponseMessage UpdateIncomeProductsTable(HttpRequestMessage request, [FromBody] IncomeProductsTable iptModel)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                var ipt = _MPRIncomeService.Updateincomeproducttable(iptModel);

                //var response =  request.CreateResponse<ScoreCardMetrics>(HttpStatusCode.OK, scm);
                response = request.CreateResponse <IncomeProductsTable>(HttpStatusCode.OK, ipt);

                return response;
            }));
        }