// Update properties in Account class from the input object public void Update(AccountModel modelAccount) { // If adding new account, set created date if (modelAccount.AccountId == 0) { CreatedDate = DateTime.Now; } // Copy values from input object to Account properties AccountNumber = modelAccount.AccountNumber; Balance = modelAccount.Balance; CustomerId = modelAccount.CustomerId; }
public ActionResult Index(LoginModel model) { AccountModel temp = new AccountModel(); var result = temp.Login(model.UserName, model.Password); if (result && ModelState.IsValid) { SessionHelper.SetSession(new UserSession() { UserName= model.UserName }); return RedirectToAction("Index", "Home"); } else { ModelState.AddModelError("", "Tên đăng nhập hoặc mật khẩu không đúng"); } return View(model); }
/// <summary> /// 获取当前登陆人的账户信息 /// </summary> /// <returns>账户信息</returns> public Account GetCurrentAccount() { var account = AccountModel.GetCurrentAccount(); return(account); }
/// <summary> /// 获取当前登陆人的账户信息 /// </summary> /// <returns>账户信息</returns> public Account GetCurrentAccount() {//在2.0版本中修改 return(AccountModel.GetCurrentAccount()); }
/// <summary> /// 获取当前登陆人的名称 /// </summary> /// <returns></returns> public string GetCurrentPerson() { //在2.0版本中修改 return(AccountModel.GetCurrentPerson()); }
/// <summary> /// 获取当前登陆人的用户名 /// </summary> /// <returns></returns> public string GetCurrentPerson() { return(AccountModel.GetCurrentPerson()); }