Пример #1
0
        public HttpResponseMessage UpdateMISTP(HttpRequestMessage request, [FromBody] MISTransferPrice mistpModel)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                var mistp = _MPRCoreService.UpdateMISTransferPrice(mistpModel);

                response = request.CreateResponse <MISTransferPrice>(HttpStatusCode.OK, mistp);

                return response;
            }));
        }
Пример #2
0
        public HttpResponseMessage GetMISTP(HttpRequestMessage request, int mistransferpriceId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                MISTransferPrice mistp = _MPRCoreService.GetMISTransferPrice(mistransferpriceId);

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

                return response;
            }));
        }
Пример #3
0
        public HttpResponseMessage DeleteMISTP(HttpRequestMessage request, [FromBody] int mistransferpriceId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                MISTransferPrice mistp = _MPRCoreService.GetMISTransferPrice(mistransferpriceId);

                if (mistp != null)
                {
                    _MPRCoreService.DeleteMISTransferPrice(mistransferpriceId);

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

                return response;
            }));
        }