public ActionResult Apply(WithdrawalsViewModel model) { ResponseModel response = new ResponseModel(); //Guid guid = Guid.NewGuid(); Account account = accountService.GetById(LoginAccount.Id); if (string.IsNullOrEmpty(account.Name) || string.IsNullOrEmpty(account.Bank) || string.IsNullOrEmpty(account.BankBranch) || string.IsNullOrEmpty(account.BankNumber)) { response.Success = false; response.Msg = "您还未进行实名认证!请完善个人信息和银行卡信息"; } else { if (!ModelState.IsValid) { foreach (var item in ModelState) { if (item.Value.Errors.Count > 0) { response.Success = false; response.Msg = item.Value.Errors.FirstOrDefault().ErrorMessage; } } } else { Withdrawals entity = AutoMapper.Mapper.Map <Withdrawals>(model); entity.AccountId = LoginAccount.Id; entity.IsAudit = false; withdrawalsService.Add(entity); unitOfWork.Commit(); response.Success = true; response.RedirectUrl = Url.Action("Index"); response.Msg = "已成功申请提现!"; } } return(Json(response)); }
public ActionResult Withdrawal(WithdrawalsViewModel model) { return View(); }