Example #1
0
        //冻结与解冻账号
        protected void lbtnOper_Click(object sender, EventArgs e)
        {
            LinkButton lbtn    = (LinkButton)sender;
            int        user_id = Convert.ToInt32(lbtn.CommandArgument);

            AUTO.Model.YouthUsers model = new Model.YouthUsers();
            model = user_bll.GetUserById(user_id);
            if (model.User_status.Trim().ToString().Equals("Y"))
            {
                //冻结账号
                model.User_id     = user_id;
                model.User_status = "N";
                if (user_bll.FrezzeUsers(model))
                {
                    //冻结成功
                    MyUtil.ShowMessage(this.Page, "成功冻结账号");
                    bindUsers();
                }
            }
            else
            {
                //解冻账号
                model.User_id     = user_id;
                model.User_status = "Y";
                if (user_bll.FrezzeUsers(model))
                {
                    //解冻成功
                    MyUtil.ShowMessage(this.Page, "成功解冻账号");
                    bindUsers();
                }
            }
        }
        protected void lbtnAdd_Click(object sender, EventArgs e)
        {
            int user_id = Convert.ToInt32(Session[Constant.adminID].ToString());
            int roleID  = Convert.ToInt32(Session[Constant.roleID].ToString());

            user_model = user_bll.GetUserById(user_id);
            if (MyUtil.MD5(txtOldPsw.Text) != user_model.User_pwd)
            {
                lblInfo.Text    = "原密码错误";
                lblInfo.Visible = true;
                return;
            }
            if (txtNewPsw.Text.Trim() != txtNewPsw2.Text.Trim())
            {
                lblInfo.Text    = "两次密码不一致!";
                lblInfo.Visible = true;
                return;
            }

            string new_user_pwd = MyUtil.MD5(txtNewPsw.Text.Trim());

            user_model.User_pwd = new_user_pwd;
            user_model.User_id  = user_id;
            if (user_bll.ResetPwd(user_model))
            {
                //修改密码成功
                MyUtil.ShowMessage(this.Page, "成功修改登录密码");
            }
        }