Beispiel #1
0
        public HttpResponseMessage GetProductTransferPrice(HttpRequestMessage request, int ID)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                ProductTransferPrice ptp = _MPRCoreService.Getproducttransferprice(ID);

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

                return response;
            }));
        }
Beispiel #2
0
        public HttpResponseMessage DeleteProductTransferPrice(HttpRequestMessage request, [FromBody] int ID)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                ProductTransferPrice ptp = _MPRCoreService.Getproducttransferprice(ID);

                if (ptp != null)
                {
                    _MPRCoreService.Deleteproducttransferprice(ID);

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

                return response;
            }));
        }
Beispiel #3
0
        public HttpResponseMessage UpdateProductTransferPrice(HttpRequestMessage request, [FromBody] ProductTransferPrice ptpModel)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                var ptp = _MPRCoreService.Updateproducttransferprice(ptpModel);

                //var response =  request.CreateResponse<ProductTransferPrice>(HttpStatusCode.OK, scm);
                response = request.CreateResponse <ProductTransferPrice>(HttpStatusCode.OK, ptp);

                return response;
            }));
        }