public ActionResult DoLogon(YYBDAP.ViewModel.LoginFormViewModel login)
        {
            if (null == TempData["VerificationCode"] || TempData["VerificationCode"].ToString() != login.VerificationCode.ToUpper())
            {
                login.ErrorMsg         = "验证码输入错误!";
                login.VerificationCode = "";
                return(View("Logon", login));
            }

            YYBDAP.Model.User user = this.userService.Verification(login.UserName, SecurityEncrypt.DesEncrypt(login.Password));
            if (user != null)
            {
                FormsAuthentication.SetAuthCookie(user.UserName, false);
                user.LastLoginIP   = WebHelper.GetIP();
                user.LastLoginTime = DateTime.Now;
                this.userService.Update(user);
                LoginUserViewModel loginUser = new LoginUserViewModel();
                loginUser.UserId           = user.UserId;
                loginUser.UserName         = user.UserName;
                loginUser.Description      = user.Description;
                loginUser.DisplayName      = user.DisplayName;
                loginUser.Status           = user.Status;
                loginUser.LastLoginIP      = user.LastLoginIP;
                loginUser.LastLoginTime    = user.LastLoginTime;
                loginUser.RegistrationTime = user.RegistrationTime;
                Session["LoginUserVM"]     = loginUser;
                return(RedirectToAction("Index", "Home"));
                //return RedirectToAction("Index", "User", new { area = "Manage" });
            }
            else
            {
                login.ErrorMsg = "用户名或密码错误!";
                return(View("Logon", login));
            }
        }
 public ActionResult DoLogin(YYBDAP.Model.User loginUser)
 {
     YYBDAP.Model.User user = this.userService.Verification(loginUser.UserName, loginUser.Password);
     if (user != null)
     {
         FormsAuthentication.SetAuthCookie(user.UserName, false);
         user.LastLoginIP   = WebHelper.GetIP();
         user.LastLoginTime = DateTime.Now;
         this.userService.Update(user);
         return(RedirectToAction("Index", "User", new { area = "Manage" }));
     }
     else
     {
         LoginErrorViewModel levm = new LoginErrorViewModel();
         levm.UserName = loginUser.UserName;
         levm.ErrorMsg = "用户名或密码错误!";
         return(View("Login", levm));
     }
 }