Ejemplo n.º 1
0
        public ActionResult LoginIn(FormCollection form)
        {
            var username = form["username"];
            var password = form["password"];
            var rows     = AccountBLL.GetAccountByUsernamePwd(username, password);

            if (rows != null)
            {
                HttpContext.Session["userName"]  = rows["userName"];
                HttpContext.Session["LoginUser"] = rows["id"];
                return(Redirect("/Home/Index/"));
            }
            else
            {
                return(JavaScript("alert('用户名或密码错误')"));
            }
        }