コード例 #1
0
        public ActionResult Login(Manager manager, string returnUrl)
        {
            int u = mb.Login(manager);

            if (u > 0)
            {
                Session["mana_name"] = manager.mana_name;
                Manager managers = mb.GetManagerByName(Session["mana_name"].ToString());
                Session["mana_id"] = managers.mana_id;
                if (returnUrl != null)
                {
                    return(Redirect(returnUrl));
                }
                else
                {
                    return(Content("<script>alert('登录成功!');window.open('" + Url.Action("Index1", "Manager") + "','_self');</script>"));
                }
            }
            else
            {
                return(Content("<script>alert('用户名或密码错误!');window.open('" + Url.Content("~/Manager/Login") + "', '_self')</script>"));
            }
        }