Пример #1
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     Rain.BLL.manager   manager   = new Rain.BLL.manager();
     Rain.Model.manager adminInfo = this.GetAdminInfo();
     if (DESEncrypt.Encrypt(this.txtOldPassword.Text.Trim(), adminInfo.salt) != adminInfo.password)
     {
         this.JscriptMsg("旧密码不正确!", "");
     }
     else if (this.txtPassword.Text.Trim() != this.txtPassword1.Text.Trim())
     {
         this.JscriptMsg("两次密码不一致!", "");
     }
     else
     {
         adminInfo.password  = DESEncrypt.Encrypt(this.txtPassword.Text.Trim(), adminInfo.salt);
         adminInfo.real_name = this.txtRealName.Text.Trim();
         adminInfo.telephone = this.txtTelephone.Text.Trim();
         adminInfo.email     = this.txtEmail.Text.Trim();
         if (!manager.Update(adminInfo))
         {
             this.JscriptMsg("保存过程中发生错误!", "");
         }
         else
         {
             this.Session["dt_session_admin_info"] = (object)null;
             this.JscriptMsg("密码修改成功!", "manager_pwd.aspx");
         }
     }
 }
Пример #2
0
        private bool DoEdit(int _id)
        {
            bool flag = false;

            Rain.BLL.manager   manager = new Rain.BLL.manager();
            Rain.Model.manager model   = manager.GetModel(_id);
            model.role_id   = int.Parse(this.ddlRoleId.SelectedValue);
            model.role_type = new Rain.BLL.manager_role().GetModel(model.role_id).role_type;
            model.is_lock   = !this.cbIsLock.Checked ? 1 : 0;
            if (this.txtPassword.Text.Trim() != this.defaultpassword)
            {
                model.password = DESEncrypt.Encrypt(this.txtPassword.Text.Trim(), model.salt);
            }
            model.real_name = this.txtRealName.Text.Trim();
            model.telephone = this.txtTelephone.Text.Trim();
            model.email     = this.txtEmail.Text.Trim();
            if (manager.Update(model))
            {
                this.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改管理员:" + model.user_name);
                flag = true;
            }
            return(flag);
        }