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

                // not that calling the WCF service here will authenticate access to the data
                IfrsCustomerAccount ifrscustomeraccount = _IFRSDataService.GetIfrsCustomerAccount(IfrsCustomerAccountId);

                if (ifrscustomeraccount != null)
                {
                    _IFRSDataService.DeleteIfrsCustomerAccount(IfrsCustomerAccountId);

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

                return response;
            }));
        }