editpsw.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:3k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using com.etong.Inform;
- //using whpower.SQL;
- public partial class editpsw : System.Web.UI.Page
- {
-
- protected void Page_Load(object sender, EventArgs e)
- {
- string spage = Request.QueryString["page"];
- if (spage == "1")
- {
- quxiao.Visible = false;
- }
- //Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + spage +"');</script>");
- }
- protected void quding_Click(object sender, ImageClickEventArgs e)
- {
- string spage = Request.QueryString["page"];
- if (spage != "1" && spage != "2")
- {
- Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:修改密码失败!');</script>");
- return;
- }
- CheckUserInfo checkuserinfo = (CheckUserInfo)Session["checkuserinfo"];
- com.etong.user.AllUser user = new com.etong.user.AllUser();
- string Oldpsw = TB_yuanpsw.Text.Trim().ToString();
- string Newpsw = TB_psw1.Text.Trim().ToString();
- //string UserAccound = Session["UserAccount"].ToString();
- //string UserAccount = checkuserinfo.UserAccount;
- int UserID = checkuserinfo.UserID;
- int i = user.PModifyPwd(UserID, Oldpsw, Newpsw);
- if (i == -2)
- {
- Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:原始密码错误!');</script>");
- return;
- }
- else
- {
- if (i == 1)
- {
- if (spage == "2")
- {
- Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:修改密码成功!');window.returnValue='success';window.close();</script>");
- return;
- //Session["checkuserinfo"] = checkuserinfo;
- }
- else if (spage == "1")
- {
- Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:修改密码成功!');</script>");
- return;
- }
-
-
- }
- else
- {
- Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:修改密码失败!');</script>");
- return;
- }
- }
- }
- }