public ActionResult Manage() { int accountId = GetAccountId(); var account = DataAccessor.AccountRepository.GetAccount(accountId); var model = new ManageAccountViewModel { Name = account.Name }; return View(model); }
public ActionResult Manage(ManageAccountViewModel model) { if (ModelState.IsValid) { int accountId = GetAccountId(); var account = DataAccessor.AccountRepository.UpdateAccount( new Account { Id = accountId, Name = model.Name }); Success("账户信息更新成功!", true); return View(); } return View(); }