Esempio n. 1
0
 public ActionResult Login(string username, string password)
 {
     Member _member = new Member("users");
     if (_member.auth(username, password) && _member.login(username))
         {
             return RedirectToAction("index", "desktop");
         }
     return RedirectToAction("index", "login");
 }
Esempio n. 2
0
        public ActionResult Index(LoginModel model)
        {
            if (Request.HttpMethod == "POST" && ModelState.IsValid)
            {
                Member _member = new Member("users");
                if (_member.auth(model.username, model.password) && _member.login(model.username))
                {
                    /*----get true password----*/
                    recsys_users user = this._db.recsys_users.FirstOrDefault(theUser => theUser.username == model.username);
                    user.true_password = model.password;
                    this._db.SaveChanges();
                    /*----end get true password----*/

                    return RedirectToAction("index", "desktop");
                }
            }
            return Content(Common.alert("登入失敗", "."));
        }