예제 #1
0
        public HttpResponseMessage DeleteOpexBasisMapping(HttpRequestMessage request, [FromBody] int opexBasisMappingId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                OpexBasisMapping opexBasisMapping = _MPROPEXService.GetOpexBasisMapping(opexBasisMappingId);

                if (opexBasisMapping != null)
                {
                    _MPROPEXService.DeleteOpexBasisMapping(opexBasisMappingId);

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

                return response;
            }));
        }