Exemplo n.º 1
0
        // 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;
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
        /// <summary>
        /// 获取当前登陆人的账户信息
        /// </summary>
        /// <returns>账户信息</returns>
        public Account GetCurrentAccount()
        {
            var account = AccountModel.GetCurrentAccount();

            return(account);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 获取当前登陆人的账户信息
 /// </summary>
 /// <returns>账户信息</returns>
 public Account GetCurrentAccount()
 {//在2.0版本中修改
     return(AccountModel.GetCurrentAccount());
 }
Exemplo n.º 5
0
 /// <summary>
 /// 获取当前登陆人的名称
 /// </summary>
 /// <returns></returns>
 public string GetCurrentPerson()
 {
     //在2.0版本中修改
     return(AccountModel.GetCurrentPerson());
 }
Exemplo n.º 6
0
 /// <summary>
 /// 获取当前登陆人的用户名
 /// </summary>
 /// <returns></returns>
 public string GetCurrentPerson()
 {
     return(AccountModel.GetCurrentPerson());
 }