📄 changepassword.ascx.cs
字号:
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;
public partial class Ctrls_ChangePassword : PageBaseUserCtrl
{
protected void Page_Load(object sender, EventArgs e)
{
if (this.CurrentUser == null)
{
return;
}
if (!Page.IsPostBack)
{
this.txtAccount.Text = this.CurrentUser.account;
}
}
/// <summary>
/// 数据验证
/// </summary>
/// <returns></returns>
private bool CheckData()
{
this.msg = string.Empty;
if (this.txtoldpassword.Text.Trim().Length <= 0)
this.msg += "原始密码不能为空\\r\\n";
if (this.txtNewPassword.Text.Trim().Length <= 0)
this.msg += "新密码不能为空\\r\\n";
if (this.txtConfirmPassword.Text.Trim().Length <= 0)
this.msg += "确认密码不能为空\\r\\n";
if (this.txtNewPassword.Text != this.txtConfirmPassword.Text)
this.msg += "新密码和确认密码不一致\\r\\n";
if (this.msg == string.Empty)
return true;
return false;
}
protected void btnModify_Click(object sender, EventArgs e)
{
if (!CheckData())
{
ShowMessage(msg);
return;
}
Itsv.BLL.SystemManage.UserBLL ubll = new Itsv.BLL.SystemManage.UserBLL();
if (!ubll.UpdatePassword(this.txtAccount.Text.Trim().Replace("'", "\""), this.txtoldpassword.Text.Trim().Replace("'", "\""), this.txtNewPassword.Text.Trim().Replace("'", "\""), ref msg))
{
this.ShowMessage(this.msg);
}
else
{
this.ShowMessage("密码修改成功,请保管好您的密码");
}
ubll = null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -