protected void Bt_Update_Click(object sender, EventArgs e) { if (Page.IsValid) { Expert expert = new Expert(); expert.LoadInfo(Request.Cookies["userID"].Value.ToString()); if (txtPwdold.Text == expert.expertPwd) { string xwhere = "where expertID=" + SQLString.GetQuotedString(Request.Cookies["userID"].Value.ToString()); Hashtable ht = new Hashtable(); ht.Add("expertPwd", SQLString.GetQuotedString(txtPwdnew.Text)); if (expert.Update(ht, xwhere)) { Response.Write("<Script Language=JavaScript>alert(\"密码修改成功!\")</Script>"); } else { Response.Write("<Script Language=JavaScript>alert(\"密码修改失败!\")</Script>"); } } else { Response.Write("<Script Language=JavaScript>alert(\"旧密码错误!\")</Script>"); } } }
protected void Bt_update_Click(object sender, EventArgs e) { string userID = Request.Cookies["userID"].Value.ToString(); string where = " where editorID=" + SQLString.GetQuotedString(userID); Hashtable ht = new Hashtable(); ht.Add("expertName", SQLString.GetQuotedString(txtName.Text)); ht.Add("expertSex", SQLString.GetQuotedString(rblSex.SelectedValue)); ht.Add("expertMail", SQLString.GetQuotedString(txtMail.Text)); ht.Add("expertPhone", SQLString.GetQuotedString(txtPhone.Text)); ht.Add("expertAddress", SQLString.GetQuotedString(txtAddress.Text)); ht.Add("expertInfo", SQLString.GetQuotedString(txtInfo.Text)); Expert expert = new Expert(); if (expert.Update(ht, where)) { Response.Write("<Script Language=JavaScript>alert(\"修改成功!\")</Script>"); } }