예제 #1
0
        public async Task <HttpResponseMessage> ApproveWithdraw(ApproveWithdrawModel model)
        {
            try
            {
                bool res = await IService.ApproveWithdrawRequest(model);

                ResponseObject response = new ResponseObject();
                response.campaignId = model.CampaignId.ToString();
                if (res)
                {
                    response.ResponseMsg = "Campaign Withdrawal request Approved successfully";
                    return(Request.CreateResponse(HttpStatusCode.OK, response));
                }
                else
                {
                    response.ResponseMsg = "Approving Campaign Withdrawal request ended with a error";
                    return(Request.CreateResponse(HttpStatusCode.ExpectationFailed, response));
                }
            }
            catch (Exception ex)
            {
                ResponseObject response = new ResponseObject();
                response.ExceptionMsg = ex.InnerException.ToString();
                response.ResponseMsg  = "Approving Campaign Withdrawal request ended with an exception";
                response.ErrorCode    = HttpStatusCode.InternalServerError.ToString();
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, response));
            }
        }