password.aspx.cs

来自「OA自动化办公系统,就是OA自动化办公系统」· CS 代码 · 共 51 行

CS
51
字号
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 COM.OA.BLL;
using COM.OA.Entity;

public partial class index_top_password : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //取登陆人信息 
        COM.OA.Entity.users loginuser = Session["loginuser"] as COM.OA.Entity.users;
        //如果取不到跳转到登陆页
        if (loginuser == null)
        {
            this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../login.aspx"));
        }
        int loginuid= loginuser.u_id;
        string oldpd = this.Request["oldpd"];
        if (oldpd != loginuser.u_password)
        {
            this.Response.Write(string.Format(GetRedirect.WINALERT, "原始密码错误"));
            this.Response.Write(string.Format(GetRedirect.REDIRECT, "updatepassword.aspx"));
        }
        else
        {
            string newpd = this.Request["newpd"];
            users uu = usersBLL.Select(loginuid);
            uu.u_password = newpd;
            int flag = usersBLL.Update(uu);
            if (flag != 0)
            {
                this.Response.Write(string.Format(GetRedirect.WINALERT, "密码修改成功"));
                this.Response.Write(string.Format(GetRedirect.REDIRECT, "../officetable.aspx"));
            }
            else
            {
                this.Response.Write(string.Format(GetRedirect.WINALERT, "密码修改失败"));
                this.Response.Write(string.Format(GetRedirect.REDIRECT, "../login.aspx"));
            }
        }
    }
}

⌨️ 快捷键说明

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