tijian_tieying/web/Web/Personal/ChangPwd2.aspx.cs

53 lines
2.0 KiB
C#
Raw Normal View History

2025-02-20 12:14:39 +08:00
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 Personal_ChangPwd2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
ZWL.Common.PublicMethod.CheckSession();
this.Label1.Text = ZWL.Common.PublicMethod.GetSessionValue("UserName");
string type = Request.QueryString["type"];
switch (type)
{
case "1": lableType.Text = "密码简单,请修改密码后在继续操作"; break;
case "2": lableType.Text = "默认密码,请修改密码后在继续操作"; break;
case "3": lableType.Text = "密码超过90天请修改密码后在继续操作"; break;
}
//设定按钮权限
//Button1.Visible = ZWL.Common.PublicMethod.StrIFIn("|012M|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
}
}
protected void Button1_Click(object sender, EventArgs e)
{
ZWL.BLL.ERPUser MyModel = new ZWL.BLL.ERPUser();
MyModel.ID = int.Parse(ZWL.Common.PublicMethod.GetSessionValue("UserID"));
MyModel.UserPwd = ZWL.Common.DEncrypt.DESEncrypt.Encrypt(this.TextBox1.Text);
MyModel.Pwdtime = DateTime.Now;
MyModel.UpdatePwd();
ZWL.Common.MessageBox.Show(this, "修改用户密码成功!");
//写系统日志
ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
MyRiZhi.DoSomething = "用户修改密码";
MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
MyRiZhi.Add();
//跳转主页
Response.Redirect("/Main/Main.aspx", false);
}
}