Beispiel #1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            PersonBLL perbll = new PersonBLL();
            string name = username.Text;
            string pwd = txtpwd.Text;
            int type = rdol.SelectedIndex;
            string msg;
            Person per = new Person();
            if (perbll.Login(name, pwd, type, out msg, out per))
            {
                cookieUse("islogin", "1", 30);
                cookieUse("username", per.PLoginName, 30);
                cookieUse("id", per.PID.ToString(), 30);
                Response.Redirect(HttpUtility.UrlDecode(Request.QueryString["url"].ToString()));

            }
            else
            {
                Response.Write("<script>alert('" + msg + "');</script>");
            }
        }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     PersonBLL bll = new PersonBLL();
     Person per = new Person();
     per.PID = id;
     per.PName = reg_name.Text;
     per.PQQNumber = reg_qq.Text;
     per.PAreas = reg_area.Text;
     per.PEmail = reg_email.Text;
     per.PTelNum = reg_telnum.Text;
     if (bll.ModifyInfo(per))
     {
         string msg;
         int type = per.PType;
         string pwd = per.PPwd;
         string name = username;
         bool y = bll.Login(name, pwd, type, out msg, out per);
         cookieUse("islogin", "1", 30);
         cookieUse("username", per.PLoginName, 30);
         cookieUse("id", (per.PID).ToString(), 30);
         Response.Redirect(HttpUtility.UrlDecode(Request.QueryString["url"].ToString()));
     }
     else
     {
         Response.Write("<script>alert('修改失败');</script>");
     }
 }