⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userchangepassword.aspx.cs

📁 CRM管理系统 CRM管理系统
💻 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;
using Itsv.Model;
using Itsv.BLL.SystemManage;

public partial class SystemManage_UserChangePassword : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            if (CurrentUser == null)
            {
                return;
            }
            this.txtAccount.Text = this.CurrentUser.account;
        }
    }
    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.txtconfigpassword.Text.Trim().Length <= 0)
            this.msg += "确认密码不能为空\\r\\n";
        if (this.txtNewPassword.Text != this.txtconfigpassword.Text)
            this.msg += "新密码和确认密码不一致\\r\\n";

        if (this.msg == string.Empty)
            return true;
        return false;
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (!this.CheckData())
        {
            this.ShowMessage(this.msg);
            return;
        }
        UserBLL ubll = new UserBLL();
        if(!ubll.UpdatePassword(this.txtAccount.Text,this.txtoldpassword.Text,this.txtNewPassword.Text,ref msg))
        {
            this.ShowMessage(this.msg);
        }
        else
        {
            this.ShowAndRedirect(Page,"密码修改成功,请保管好您的密码","../main.aspx");
        }
        ubll=null;

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -