예제 #1
0
        public async Task <HttpResponseMessage> ApproveBank(ApproveBankVwModel model)
        {
            try
            {
                bool res = await IService.ApproveCampaignBank(model);

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