public async Task<ActionResult> Check(Guid? id) { ResponseModel response = new ResponseModel(); Deposit model = depositService.GetById(id.Value); //1.入金mt4金额 //2.修改account的金额 //3.修改审核状态 double amount = Math.Round(model.USDAmount, 2); bool flg = await mt4Service.ModifyBalance(model.Account.MT4Account, amount); if (flg) { Account account = accountService.GetById(model.AccountId); account.Amount += amount; model.IsAudit = true; accountService.Update(account); depositService.Update(model); unitOfWork.Commit(); response.Msg = "成功审核入金申请!"; response.Success = true; response.RedirectUrl = RedirectUrl; } else { response.Msg = "链接交易服务器失败!请重试..."; response.Success = false; } return Json(response, JsonRequestBehavior.AllowGet); }
public async Task<ActionResult> Modify(AboutViewModel model, HttpPostedFileBase PhotoUrl) { ResponseModel response = new ResponseModel(); response.RedirectUrl = Request["ReturnUlr"]; try { string path = string.Empty; if (PhotoUrl != null) { path = await SaveImag(PhotoUrl); model.PhotoUrl = path; } else { model.PhotoUrl = Request.Form["PhotoUrl"]; } model.UpdateTime = DateTime.Now; About dbmodel = Mapper.Map<About>(model); _aboutService.Update(dbmodel); _unitOfWork.Commit(); response.Success = true; response.Msg = "保存成功!请稍后..."; } catch (Exception ex) { response.Success = false; response.Msg = "保存失败!" + ex.Message; } return Json(response); }
public async Task<ActionResult> Check(Guid? id) { ResponseModel response = new ResponseModel(); Withdrawals model = withdrawalService.GetById(id.Value); Account account = model.Account; if (model.Amount > account.Amount) { response.Msg = "提现金额已超限!"; response.Success = false; return Json(response, JsonRequestBehavior.AllowGet); } //1.入金mt4金额 //2.修改account的金额 //3.修改审核状态 bool flg = await mt4Service.ModifyBalance(model.Account.MT4Account, model.Amount * -1); if (flg) { account.Amount -= model.Amount; model.IsAudit = true; accountService.Update(account); withdrawalService.Update(model); unitOfWork.Commit(); response.Msg = "成功审核提现申请!"; response.Success = true; response.RedirectUrl = RedirectUrl; } else { response.Msg = "链接交易服务器失败!请重试..."; response.Success = false; } return Json(response, JsonRequestBehavior.AllowGet); }
public ActionResult Modify(AccountViewModel model) { ResponseModel response = new ResponseModel(); response.RedirectUrl = Request["ReturnUlr"]; Account account = Mapper.Map<Account>(model); _accountServie.Update(account); _unitOfWork.Commit(); response.Success = true; response.Msg = "成功修改账户信息"; return Json(response, JsonRequestBehavior.AllowGet); }
public ActionResult Modify(Models.SystemSettingsViewModel model) { ResponseModel response = new ResponseModel(); response.RedirectUrl = Request["ReturnUlr"]; SystemSettings settings = Mapper.Map<SystemSettings>(model); settings.OperationUser = LoginUser.UserName; _systemSettingsService.Update(settings); _unitOfWork.Commit(); response.Success = true; response.Msg = "修改设置成功"; return Json(response); }
/// <summary> /// 修改密码 /// </summary> /// <param name="model"></param> /// <returns></returns> public ActionResult ChangePassword(ChangePasswordViewModel model) { ResponseModel response = new ResponseModel(); Account account = _accountServie.GetById(model.Id); account.LoginPwd = model.Password.ToMd5String(); _accountServie.Update(account); _unitOfWork.Commit(); response.Msg = "重置密码成功!"; response.Success = true; response.RedirectUrl = string.Empty; return Json(response, JsonRequestBehavior.AllowGet); }
public ActionResult Del(Guid? Id) { ResponseModel response = new ResponseModel(); if (Id != null) { SystemSettings model = _systemSettingsService.GetById(Id.Value); _systemSettingsService.Delete(model); _unitOfWork.Commit(); response.Success = true; response.Msg = "删除成功!"; response.RedirectUrl = RedirectUrl; } else { response.Success = false; response.Msg = "无效的请求"; } return Json(response, JsonRequestBehavior.AllowGet); }
public ActionResult Login(Models.UserLoginViewModel model) { UserInfo user = _userInfoService.UserLoginByEmail(model.Email, model.Password); ResponseModel response = new ResponseModel(); response.Msg = "登陆失败,用户名密码错误"; if (Request.IsAuthenticated) { FormsAuthentication.SignOut(); } if (user != null) { string userinfo = JsonConvert.SerializeObject(user); FormsAuthentication.SetAuthCookie(userinfo, false); response.Success = true; response.Msg = "登陆成功,页面将跳转"; response.RedirectUrl = model.ReturnUrl; } return Json(response); }
public async Task<ActionResult> Add(UserViewModel model, HttpPostedFileBase AuthorityUrl) { ResponseModel response = new ResponseModel(); response.RedirectUrl = Request["ReturnUlr"]; try { string path = string.Empty; if (AuthorityUrl != null) { path = await SaveImag(AuthorityUrl); } model.Password = model.Password.ToMd5String(); UserInfo dbmodel = Mapper.Map<UserInfo>(model); dbmodel.AuthorityUrl = path; _userInfoService.Add(dbmodel); _unitOfWork.Commit(); response.Success = true; response.Msg = "保存成功!请稍后..."; } catch (Exception ex) { response.Success = false; response.Msg = "保存失败!" + ex.Message; } return Json(response); }
public ActionResult ChangePassword(ChangePasswordViewModel model) { ResponseModel response = new ResponseModel(); UserInfo user = _userInfoService.GetById(model.Id); user.Password = model.Password.ToMd5String(); _userInfoService.Update(user); _unitOfWork.Commit(); response.Msg = "重置密码成功!"; response.Success = true; response.RedirectUrl = string.Empty; return Json(response, JsonRequestBehavior.AllowGet); }
public ActionResult Unlock(Guid? Id) { ResponseModel response = new ResponseModel(); if (Id != null) { UserInfo user = _userInfoService.GetById(Id.Value); user.LoginErrorCount = 0; _userInfoService.Update(user); _unitOfWork.Commit(); response.Success = true; response.Msg = "解锁成功!"; response.RedirectUrl = RedirectUrl; } else { response.Success = false; response.Msg = "无效的请求"; } return Json(response, JsonRequestBehavior.AllowGet); }