Esempio n. 1
0
 protected void btnModify_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         Admin admin = (Admin)Session["admin"];
         if (admin.LoginPass == txtOldPassword.Text.Trim())
         {
             string password = txtNewPassword.Text.Trim();
             int    num      = adminManage.ModifiyPassword(password, admin.LoginID);
             if (num > 0)
             {
                 this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('密码修改成功!');</script>");
             }
             else
             {
                 this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('密码修改失败!');</script>");
             }
         }
         else
         {
             this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('原始密码输入错误!');</script>");
         }
     }
 }