ChangePassword.aspx.cs
上传用户:autodoor
上传日期:2022-08-04
资源大小:9973k
文件大小:3k
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- using qminoa.DA;
- using qminoa.Common;
- namespace qminoa.Webs.sysSecurity
- {
- public class ChangePassword : qminoa.Webs.PageBase
- {
- protected System.Web.UI.WebControls.RequiredFieldValidator LoginIDRequiredFieldValidator;
- protected System.Web.UI.WebControls.RequiredFieldValidator LoginPasswordRequiredFieldValidator;
- protected System.Web.UI.WebControls.ValidationSummary LogonValidationSummary;
- protected System.Web.UI.WebControls.TextBox old_password;
- protected System.Web.UI.WebControls.TextBox new_password;
- protected System.Web.UI.WebControls.TextBox repeat_password;
- protected System.Web.UI.WebControls.RequiredFieldValidator Requiredfieldvalidator1;
- protected System.Web.UI.WebControls.CompareValidator CompareValidator1;
- protected System.Web.UI.WebControls.Button btnOK;
- protected System.Web.UI.HtmlControls.HtmlForm login;
-
- private void Page_Load(object sender, System.EventArgs e)
- {
- this.PageBegin("修改密码",false);
- }
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
- //
- InitializeComponent();
- base.OnInit(e);
- }
-
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器修改
- /// 此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
- this.Load += new System.EventHandler(this.Page_Load);
- }
- #endregion
- private void btnOK_Click(object sender, System.EventArgs e)
- {
- EmpDB EmpDataAccess=new EmpDB();
- string strloginid = this.EmpName;
- string strEmpID = this.Empid;
- string strOldPassword = old_password.Text.ToString();
- string strNewPassword = new_password.Text.ToString();
- String[] strLoginflag =EmpDataAccess.Login (strloginid,strOldPassword);
-
- if(strLoginflag[0]=="usererror"||strLoginflag[0]=="pwderror"||strLoginflag[0]=="noacount")
- JScript.Alert("旧密码不正确!");
- else
- {
- if(EmpDataAccess.ChangePassword(strEmpID,strNewPassword))
- {
- this.WriteOptLog("修改密码");
- JScript.Alert("修改密码成功!");
- Response.Redirect("../desktop.aspx",false);
- }
- else
- JScript.Alert("修改密码失败!");
- }
- }
- }
- }