Пример #1
0
        private bool DoEdit()
        {
            int _id = MyCommFun.Str2Int(lblid.Text);
            //地区
            string prov = ddlProvince.SelectedItem.Value;
            string city = ddlCity.SelectedItem.Value;
            string dist = txtArea.Text.Trim();


            bool result = false;

            BLL.dt_manager   bll   = new BLL.dt_manager();
            Model.dt_manager model = bll.GetModel(_id);


            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email     = txtEmail.Text.Trim();
            model.qq        = txtqq.Text;
            model.email     = txtEmail.Text;

            model.province = prov;
            model.city     = city;
            model.county   = dist;


            if (bll.Update(model))
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改个人资料:" + model.user_name); //记录日志
                result = true;
            }

            return(result);
        }
Пример #2
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BLL.dt_manager   bll   = new BLL.dt_manager();
            Model.dt_manager model = GetAdminInfo();

            if (DESEncrypt.Encrypt(txtOldPassword.Text.Trim(), model.salt) != model.password)
            {
                JscriptMsg("旧密码不正确!", "", "Warning");
                return;
            }
            if (txtPassword.Text.Trim() != txtPassword1.Text.Trim())
            {
                JscriptMsg("两次密码不一致!", "", "Warning");
                return;
            }
            Model.dt_manager NewModel = new Model.dt_manager();
            NewModel.id       = model.id;
            NewModel.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            if (!bll.Update(NewModel))
            {
                JscriptMsg("保存过程中发生错误!", "", "Error");
                return;
            }
            Session[MXKeys.SESSION_ADMIN_INFO] = null;
            JscriptMsg("密码修改成功!", "manager_pwd.aspx", "Success");
        }
Пример #3
0
        private bool DoEdit(int _id)
        {
            //地区
            string prov = ddlProvince.SelectedItem.Value;
            string city = ddlCity.SelectedItem.Value;
            string dist = txtArea.Text.Trim();


            bool result = false;

            BLL.dt_manager   bll   = new BLL.dt_manager();
            Model.dt_manager model = bll.GetModel(_id);
            model.id        = _id;
            model.SectionId = Convert.ToInt32(ddlSection.SelectedValue);
            model.role_id   = int.Parse(ddlRoleId.SelectedValue);
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            if (cbIsLock.Checked == true)
            {
                model.is_lock = 0;
            }
            else
            {
                model.is_lock = 1;
            }
            //判断密码是否更改
            if (txtPassword.Text.Trim() != "")
            {
                //获取用户已生成的salt作为密钥加密
                model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            }
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email     = txtEmail.Text.Trim();
            model.wxNum     = int.Parse(txtMaxNum.Text);

            model.qq    = txtqq.Text;
            model.email = txtEmail.Text;

            model.province = prov;
            model.city     = city;
            model.county   = dist;
            model.sort_id  = MyCommFun.Str2Int(txtSortid.Text);

            if (bll.Update(model))
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改用户:" + model.user_name); //记录日志
                result = true;
            }

            return(result);
        }