Ejemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string code     = this.Code.Value.Trim().ToString();
            string userName = this.userName.Value.Trim().ToString();
            string passWord = this.PassWord.Value.Trim().ToString();

            if (code.ToUpper() != Request.Cookies["CheckCode"].Value.ToString().ToUpper())
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "alert('验证码错误!')", true);
            }
            else
            {
                AdminModel admin = new AdminModel();
                admin.Name = userName;
                admin.Pass = passWord;

                UserResult result = EispAdminBLL.GetAdminInfo(admin);

                //5~1~a~s~p~x
                if (!result.HasError && result.Result.Name != null && result.Result.Name != "")
                {
                    EispAdminSession save = new EispAdminSession();
                    save.SaveSessionTicketInCookie(admin);

                    Response.Redirect("Index.aspx");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "alert('用户名或密码错误!')", true);
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                EispAdminSession Logout = new EispAdminSession();


                Logout.Logout();
                Response.Redirect(SystemConfig.LoginPage);
            }
        }
Ejemplo n.º 3
0
 // 获取当前线程
 protected void RefreshCurrentUser()
 {
     _currentUser = new EispAdminSession();
 }