PassWordChangeUserForm.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
源码类别:
OA系统
开发平台:
C#
- 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 PassWordChangeUserForm : System.Web.UI.Page
- {
- Model.Users nc_Users = new Model.Users();
- BLL.Users bll_Users = new BLL.Users();
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- int IdNum = int.Parse(SessionInclude.Id);
- nc_Users = bll_Users.GetModel(IdNum);
- }
- }
- public void LoadSet()
- {
- try
- {
- //Password
- if (KeyValue_Password.Text == "")
- {
- throw new Exception("密码不能为空!");
- }
- if (KeyValue_Password.Text != KeyValue_Password1.Text)
- {
- throw new Exception("确认密码不符!");
- }
- int IdNum = int.Parse(SessionInclude.Id);
- nc_Users = bll_Users.GetModel(IdNum);
- nc_Users.Password = KeyValue_Password1.Text;
- bll_Users.Update(nc_Users);
- MessageBox.Show("更新成功!");
- }
- catch(Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- LoadSet();
- }
- }