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

                // not that calling the WCF service here will authenticate access to the data
                OpexSBUBaseCost opex = _MPROPEXService.GetOpexSBUBaseCost(ID);

                if (opex != null)
                {
                    _MPROPEXService.DeleteOpexSBUBaseCost(ID);

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

                return response;
            }));
        }