Example #1
0
        public HttpResponseMessage DeleteIncomeNEAGLSBU(HttpRequestMessage request, [FromBody] int incomeNEAGLSBUId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                IncomeNEAGLSBU incomeNEAGLSBU = _MPROPEXService.GetIncomeNEAGLSBU(incomeNEAGLSBUId);

                if (incomeNEAGLSBU != null)
                {
                    _MPROPEXService.DeleteIncomeNEAGLSBU(incomeNEAGLSBUId);

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

                return response;
            }));
        }