Esempio n. 1
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        string id     = Request.Cookies["id"].Value.ToString();
        int    typeId = 0;

        //  typeId =Convert.ToInt32(Session["typeId"].ToString());
        typeId = Convert.ToInt32(Request.Cookies["typeId"].Value);
        string pwd    = tbANewPwd.Text;
        string oldPwd = tbOldPwd.Text;

        Fannie.Users user = new Fannie.Users();
        DataTable    dt   = user.IsPwdRight(id, oldPwd, typeId).Tables[0];

        if (dt.Rows.Count == 0)
        {
            Response.Write("<script>alert('原密码输入错误');location.href='ModifyPwd.aspx'</script>");
        }
        else
        {
            if (user.ModifyPwd(id, pwd, typeId) > 0)
            {
                Response.Write("<script>alert('修改成功');location.href='ModifyPwd.aspx'</script>");
            }
            else
            {
                Response.Write("<script>alert('修改失败');location.href='ModifyPwd.aspx'</script>");
            }
        }
    }
Esempio n. 2
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     if (tbTID.Text != "")
     {
         Fannie.Users user = new Fannie.Users();
         if (user.ModifyPwd(tbTID.Text, tbTID.Text, 1) > 0)
         {
             Response.Write("<script>alert('密码重置已经重置为该教师的账号')</script>");
         }
     }
 }
Esempio n. 3
0
 protected void btnOk_Click(object sender, EventArgs e)
 {
     if (tbID.Text != "")
     {
         Fannie.Users user = new Fannie.Users();
         if (user.ModifyPwd(tbID.Text, tbID.Text, 2) > 0)
         {
             Response.Write("<script>alert('密码重置已经重置为该学生的学号')</script>");
         }
     }
 }