editpsw.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:3k
源码类别:

.net编程

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using com.etong.Inform;
  12. //using whpower.SQL;
  13. public partial class editpsw : System.Web.UI.Page
  14. {
  15.    
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         string spage = Request.QueryString["page"];
  19.         if (spage == "1")
  20.         {
  21.             quxiao.Visible = false;
  22.         }
  23.         //Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + spage +"');</script>");
  24.     }
  25.    protected void quding_Click(object sender, ImageClickEventArgs e)
  26.     {
  27.         string spage = Request.QueryString["page"];
  28.         if (spage != "1" && spage != "2")
  29.         {
  30.             Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:修改密码失败!');</script>");
  31.             return;
  32.         }
  33.         CheckUserInfo checkuserinfo = (CheckUserInfo)Session["checkuserinfo"];
  34.         com.etong.user.AllUser user = new com.etong.user.AllUser();
  35.         string Oldpsw = TB_yuanpsw.Text.Trim().ToString();
  36.         string Newpsw = TB_psw1.Text.Trim().ToString();
  37.         //string UserAccound = Session["UserAccount"].ToString();
  38.         //string UserAccount = checkuserinfo.UserAccount;
  39.         int UserID = checkuserinfo.UserID;     
  40.         int i = user.PModifyPwd(UserID, Oldpsw, Newpsw);
  41.         if (i == -2)
  42.         {
  43.             Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:原始密码错误!');</script>");
  44.             return;
  45.         }
  46.         else
  47.         {
  48.             if (i == 1)
  49.             {
  50.                 if (spage == "2")
  51.                 {
  52.                     Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:修改密码成功!');window.returnValue='success';window.close();</script>");
  53.                     return;
  54.                     //Session["checkuserinfo"] = checkuserinfo; 
  55.                 }
  56.                 else if (spage == "1")
  57.                 {
  58.                     Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:修改密码成功!');</script>");
  59.                    return;
  60.                 }      
  61.                
  62.                
  63.             }
  64.             else
  65.             {
  66.                 Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:修改密码失败!');</script>");
  67.                 return;
  68.             }
  69.         }
  70.     }
  71. }