Esempio n. 1
0
        public HttpResponseMessage DeleteExpenseProductMapping(HttpRequestMessage request, [FromBody] int expenseProductId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                ExpenseProductMapping expenseProductMapping = _MPROPEXService.GetExpenseProductMapping(expenseProductId);

                if (expenseProductMapping != null)
                {
                    _MPROPEXService.DeleteExpenseProductMapping(expenseProductId);

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

                return response;
            }));
        }