public ActionResult Account() { MallConfigInfo mallConfigInfo = BMAConfig.MallConfig; AccountModel model = new AccountModel(); model.RegType = StringToIntArray(mallConfigInfo.RegType); model.ReservedName = mallConfigInfo.ReservedName; model.RegTimeSpan = mallConfigInfo.RegTimeSpan; model.IsWebcomeMsg = mallConfigInfo.IsWebcomeMsg; model.WebcomeMsg = mallConfigInfo.WebcomeMsg; model.LoginType = StringToIntArray(mallConfigInfo.LoginType); model.ShadowName = mallConfigInfo.ShadowName; model.IsRemember = mallConfigInfo.IsRemember; model.LoginFailTimes = mallConfigInfo.LoginFailTimes; return View(model); }
public ActionResult Account(AccountModel model) { if (ModelState.IsValid) { MallConfigInfo mallConfigInfo = BMAConfig.MallConfig; mallConfigInfo.RegType = model.RegType == null ? "" : CommonHelper.IntArrayToString(model.RegType, ""); mallConfigInfo.ReservedName = model.ReservedName ?? ""; mallConfigInfo.RegTimeSpan = model.RegTimeSpan; mallConfigInfo.IsWebcomeMsg = model.IsWebcomeMsg; mallConfigInfo.WebcomeMsg = model.WebcomeMsg ?? ""; mallConfigInfo.LoginType = model.LoginType == null ? "" : CommonHelper.IntArrayToString(model.LoginType, ""); mallConfigInfo.ShadowName = model.ShadowName ?? ""; mallConfigInfo.IsRemember = model.IsRemember; mallConfigInfo.LoginFailTimes = model.LoginFailTimes; BMAConfig.SaveMallConfig(mallConfigInfo); Emails.ResetMall(); SMSes.ResetMall(); AddMallAdminLog("修改账号设置"); return PromptView(Url.Action("account"), "修改账号设置成功"); } return View(model); }