示例#1
0
        //儲存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BLL.manager   bll   = new BLL.manager();
            Model.manager model = GetAdminInfo();

            if (DESEncrypt.Encrypt(txtOldPassword.Text.Trim(), model.salt) != model.password)
            {
                JscriptMsg("舊密碼不正確!", "");
                return;
            }
            if (txtPassword.Text.Trim() != txtPassword1.Text.Trim())
            {
                JscriptMsg("兩次密碼不一致!", "");
                return;
            }
            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();

            if (!bll.Update(model))
            {
                JscriptMsg("儲存過程中發生錯誤!", "");
                return;
            }
            Session[TWKeys.SESSION_ADMIN_INFO] = null;
            JscriptMsg("密碼修改成功!", "manager_pwd.aspx");
        }
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BLL.manager bll = new BLL.manager();
            Model.manager model = GetAdminInfo();

            if (DESEncrypt.Encrypt(txtOldPwd.Text.Trim()) != model.user_pwd)
            {
                JscriptMsg("旧密码不正确!", "", "Warning");
                return;
            }
            if (txtUserPwd.Text.Trim() != txtUserPwd1.Text.Trim())
            {
                JscriptMsg("两次密码不一致!", "", "Warning");
                return;
            }
            model.user_pwd = DESEncrypt.Encrypt(txtUserPwd.Text.Trim());

            if (!bll.Update(model))
            {
                JscriptMsg("保存过程中发生错误啦!", "", "Error");
                return;
            }
            Session[DTKeys.SESSION_ADMIN_INFO] = null;
            JscriptMsg("密码修改成功啦!", "modifypassword.aspx", "Success");
        }
示例#3
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.manager   bll   = new BLL.manager();
            Model.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);
        }
        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.manager bll = new BLL.manager();
            Model.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;
        }
示例#5
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BLL.manager   bll   = new BLL.manager();
            Model.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.password  = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email     = txtEmail.Text.Trim();

            if (!bll.Update(model))
            {
                JscriptMsg("保存过程中发生错误!", "", "Error");
                return;
            }
            Session[AXKeys.SESSION_ADMIN_INFO] = null;
            JscriptMsg("密码修改成功!", "manager_pwd.aspx", "Success");
        }
示例#6
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BLL.manager bll = new BLL.manager();
            Model.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.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email = txtEmail.Text.Trim();

            if (!bll.Update(model))
            {
                JscriptMsg("保存过程中发生错误!", "", "Error");
                return;
            }
            Session[DTKeys.SESSION_ADMIN_INFO] = null;
            JscriptMsg("密码修改成功!", "manager_pwd.aspx", "Success");
        }
示例#7
0
        private bool DoEdit(int id)
        {
            Model.manager adminEntity = GetAdminInfo(); //取得管理员信息

            BLL.manager   bll   = new BLL.manager();
            Model.manager model = bll.GetModel(id);

            model.is_lock = MyCommFun.Str2Int(rblIsLock.SelectedValue);

            //判断密码是否更改
            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.remark = txtRemark.Text;

            bool updateRet = bll.Update(model);

            if (updateRet)
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改酒店管理员信息:" + model.user_name); //记录日志
                return(true);
            }
            return(false);
        }
示例#8
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            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() != defaultpassword)
            {
                //獲取用戶已生成的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();

            if (bll.Update(model))
            {
                AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改管理員:" + model.user_name); //記錄日誌
                result = true;
            }

            return(result);
        }
示例#9
0
        private bool DoEdit(int _id)
        {
            bool result = true;

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

            model.role_id   = int.Parse(ddlRoleId.SelectedValue);
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            model.is_lock   = int.Parse(rblIsLock.SelectedValue);
            //判斷密碼是否更改
            if (txtUserPwd.Text.Trim() != defaultpassword)
            {
                model.user_pwd = DESEncrypt.Encrypt(txtUserPwd.Text.Trim());
            }
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email     = txtEmail.Text.Trim();

            if (!bll.Update(model))
            {
                result = false;
            }

            return(result);
        }
示例#10
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BLL.manager   bll = new BLL.manager();
            Model.manager model = GetAdminInfo();
            bool          updateName = false, updateContact = false;
            StringBuilder sb = new StringBuilder();

            if (DESEncrypt.Encrypt(txtOldPassword.Text.Trim(), model.salt) != model.password)
            {
                JscriptMsg("旧密码不正确!", "");
                return;
            }
            if (!string.IsNullOrEmpty(txtPassword.Text.Trim()))
            {
                if (txtPassword.Text.Trim().Length < 6 || txtPassword.Text.Trim().Length > 20)
                {
                    JscriptMsg("密码长度须为6-20", "");
                    return;
                }
                if (txtPassword.Text.Trim() != txtPassword1.Text.Trim())
                {
                    JscriptMsg("两次密码不一致!", "");
                    return;
                }
                model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            }
            model.avatar = txtAvatar.Text.Trim();
            if (model.real_name != txtRealName.Text.Trim())
            {
                updateName = true;
                sb.Append("姓名:" + model.real_name + "→<font color='red'>" + txtRealName.Text.Trim() + "</font><br/>");
            }
            model.real_name = txtRealName.Text.Trim();
            if (model.telephone != txtTelephone.Text.Trim())
            {
                updateContact = true;
                sb.Append("电话:" + model.telephone + "→<font color='red'>" + txtTelephone.Text.Trim() + "</font><br/>");
            }
            model.telephone = txtTelephone.Text.Trim();
            if (model.email != txtEmail.Text.Trim())
            {
                sb.Append("邮箱:" + model.email + "→<font color='red'>" + txtEmail.Text.Trim() + "</font><br/>");
            }
            model.email = txtEmail.Text.Trim();
            manager     = GetAdminInfo();
            string result = bll.Update(model, sb.ToString(), manager, false, updateName, updateContact);

            if (!string.IsNullOrEmpty(result))
            {
                JscriptMsg(result, "");
                return;
            }
            Session[DTKeys.SESSION_ADMIN_INFO] = null;
            JscriptMsg("密码修改成功!", "editinfo.aspx");
        }
示例#11
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.manager   bll   = new BLL.manager();
            Model.manager model = bll.GetModel(_id);

            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);
        }
示例#12
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            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() != defaultpassword)
            {
                //获取用户已生成的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();

            var          categoryList = new BLL.article_category().GetAllList(0);
            CheckBoxList cblControl   = FindControl("field_control_category") as CheckBoxList;

            if (cblControl != null)
            {
                StringBuilder tempStr = new StringBuilder();
                for (int i = 0; i < cblControl.Items.Count; i++)
                {
                    if (cblControl.Items[i].Selected)
                    {
                        tempStr.Append(cblControl.Items[i].Value.Replace(',', ',') + ",");
                    }
                }
                model.categorys = Utils.DelLastComma(tempStr.ToString());
            }
            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改管理员:" + model.user_name); //记录日志
                result = true;
            }

            return(result);
        }
示例#13
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            model.role_id       = int.Parse(ddlRoleId.SelectedValue);
            model.department_id = int.Parse(ddlDepartment.SelectedValue);
            model.role_type     = new BLL.manager_role().GetModel(model.role_id).role_type;
            if (cbIsLock.Checked)
            {
                model.is_lock = 0;
            }
            else
            {
                model.is_lock = 1;
            }
            //判断密码是否更改
            if (txtPassword.Text.Trim() != defaultpassword)
            {
                //获取用户已生成的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.parent_id = !string.IsNullOrWhiteSpace(ddlLeader.SelectedValue) ? Convert.ToInt32(ddlLeader.SelectedValue) : (int?)null;
            if (ddlDepartment.SelectedValue != "0")
            {
                model.is_default = 1;
            }
            else
            {
                model.is_default = 0;
            }

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改管理员:" + model.user_name); //记录日志
                SaveNotifictionSettings(model.id);
                result = true;
            }

            return(result);
        }
        private bool DoEdit()
        {
            BLL.manager bll_manager = new BLL.manager();
            bool result = true;
            Model.manager model = GetAdminInfo();

            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtMobile.Text.Trim();
            model.email = "";// txtEmail.Text.Trim();
            model.phone = txtPhone.Text.Trim();
            model.address = txtAddress.Text.Trim();
            model.card = txtCard.Text.Trim();
            model.img_url = txtLogo.Text.Trim();
            model.license = txtYingye.Text.Trim();
            model.description = txtContent.Text.Trim();

            if (!bll_manager.Update(model))
            {
                result = false;
            }

            return result;
        }
示例#15
0
        private string DoEdit(int _id)
        {
            BLL.manager   bll = new BLL.manager();
            Model.manager model = bll.GetModel(_id);
            bool          updateName = false, updateContact = false;
            StringBuilder sb = new StringBuilder();

            if (model.role_id != int.Parse(ddlRoleId.SelectedValue))
            {
                sb.Append("用户角色ID:" + model.role_id + "→<font color='red'>" + ddlRoleId.SelectedValue + "</font><br/>");
            }
            model.role_id   = string.IsNullOrEmpty(ddlRoleId.SelectedValue) ? 0 : 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 (cbIsAudit.Checked == true)
            //{
            //    model.is_audit = 1;
            //}
            //else
            //{
            //    model.is_audit = 0;
            //}
            //判断密码是否更改
            if (txtPassword.Text.Trim() != defaultpassword)
            {
                //获取用户已生成的salt作为密钥加密
                model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            }
            model.avatar = txtAvatar.Text.Trim();
            if (model.real_name != txtRealName.Text.Trim())
            {
                updateName = true;
                sb.Append("姓名:" + model.real_name + "→<font color='red'>" + txtRealName.Text.Trim() + "</font><br/>");
            }
            model.real_name = txtRealName.Text.Trim();
            if (model.telephone != txtTelephone.Text.Trim())
            {
                updateContact = true;
                sb.Append("电话:" + model.telephone + "→<font color='red'>" + txtTelephone.Text.Trim() + "</font><br/>");
            }
            model.telephone = txtTelephone.Text.Trim();
            if (model.email != txtEmail.Text.Trim())
            {
                sb.Append("邮箱:" + model.email + "→<font color='red'>" + txtEmail.Text.Trim() + "</font><br/>");
            }
            model.email = txtEmail.Text.Trim();
            if (model.departID != Convert.ToInt32(ddlParentId.SelectedValue))
            {
                sb.Append("岗位:" + model.departTree + "→<font color='red'>" + labdepartStr.Text + "</font><br/>");
            }
            model.departID     = string.IsNullOrEmpty(ddlParentId.SelectedValue) ? 0 : Convert.ToInt32(ddlParentId.SelectedValue);
            model.departTree   = hTextTree.Value;
            model.departTreeID = hIDTree.Value;
            if (model.detaildepart != txtDetailDepart.Text.Trim())
            {
                sb.Append("具体岗位:" + model.detaildepart + "→<font color='red'>" + txtDetailDepart.Text.Trim() + "</font><br/>");
            }
            model.detaildepart = txtDetailDepart.Text.Trim();
            manager            = GetAdminInfo();
            //管理权限
            //string[] codelist = hCodeStr.Value.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            //List<Model.userRolePemission> ps = new List<Model.userRolePemission>();
            //foreach (string item in codelist)
            //{
            //    ps.Add(new Model.userRolePemission() { urp_type = 1, urp_username = model.user_name, urp_code = item });
            //}
            //model.UserPemissionList = ps;

            return(bll.Update(model, sb.ToString(), manager, true, updateName, updateContact));
        }
示例#16
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            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() != defaultpassword)
            {
                //获取用户已生成的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();
            if (model.role_id == 3)//酒厂
            {
                model.brand_id = int.Parse(ddlBrandId.SelectedValue);
            }

            model.str_code      = this.provinces1.Value;
            model.str_code_rage = this.city1.Value;

            //else if (model.role_id == 4)//经销商
            //{
            //    model.str_code = txtStrCode.Text;
            //    model.str_code_rage = txtCodeRage.Text;
            //    model.winery_id = int.Parse(ddlWineryId.SelectedValue);
            //    BuysingooShop.Model.manager manModel = new BuysingooShop.BLL.manager().GetModel(model.winery_id);
            //    if (manModel != null)
            //    {
            //        model.brand_id = manModel.brand_id;
            //    }
            //}
            //else if (model.role_id == 5)//设计师
            //{
            //    model.age = int.Parse(txtAge.Text);
            //    model.workAge = int.Parse(txtWorkAge.Text);
            //    model.img_url = txtImgUrl.Text;
            //    model.remark = txtRemark.Text;
            //    model.QQ = txtQQ.Text;
            //    if (txtStyle.Text != "")
            //    {
            //        model.style = txtStyle.Text;
            //    }
            //}

            if (bll.Update(model))
            {
                AddAdminLog(Vincent._DTcms.DTEnums.ActionEnum.Edit.ToString(), "修改管理员:" + model.user_name); //记录日志
                result = true;
            }

            return(result);
        }
示例#17
0
        private string DoEdit(int _id)
        {
            BLL.manager   bll = new BLL.manager();
            Model.manager model = bll.GetModel(_id);
            bool          updateName = false, updateContact = false;
            StringBuilder sb = new StringBuilder();

            if (model.role_id != int.Parse(ddlRoleId.SelectedValue))
            {
                sb.Append("用户角色ID:" + model.role_id + "→<font color='red'>" + ddlRoleId.SelectedValue + "</font><br/>");
            }
            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 (cbIsAudit.Checked == true)
            //{
            //    model.is_audit = 1;
            //}
            //else
            //{
            //    model.is_audit = 0;
            //}
            //判断密码是否更改
            if (txtPassword.Text.Trim() != defaultpassword)
            {
                //获取用户已生成的salt作为密钥加密
                model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            }
            model.avatar = txtAvatar.Text.Trim();
            if (model.real_name != txtRealName.Text.Trim())
            {
                updateName = true;
                sb.Append("姓名:" + model.real_name + "→<font color='red'>" + txtRealName.Text.Trim() + "</font><br/>");
            }
            model.real_name = txtRealName.Text.Trim();
            if (model.telephone != txtTelephone.Text.Trim())
            {
                updateContact = true;
                sb.Append("电话:" + model.telephone + "→<font color='red'>" + txtTelephone.Text.Trim() + "</font><br/>");
            }
            model.telephone = txtTelephone.Text.Trim();
            if (model.email != txtEmail.Text.Trim())
            {
                sb.Append("邮箱:" + model.email + "→<font color='red'>" + txtEmail.Text.Trim() + "</font><br/>");
            }
            model.email = txtEmail.Text.Trim();
            if (model.departID != Convert.ToInt32(ddlParentId.SelectedValue))
            {
                sb.Append("岗位:" + model.departTree + "→<font color='red'>" + labdepartStr.Text + "</font><br/>");
            }
            model.departID     = Convert.ToInt32(ddlParentId.SelectedValue);
            model.departTree   = hTextTree.Value;
            model.departTreeID = hIDTree.Value;
            if (model.detaildepart != txtDetailDepart.Text.Trim())
            {
                sb.Append("具体岗位:" + model.detaildepart + "→<font color='red'>" + txtDetailDepart.Text.Trim() + "</font><br/>");
            }
            model.detaildepart = txtDetailDepart.Text.Trim();
            manager            = GetAdminInfo();
            return(bll.Update(model, sb.ToString(), manager, true, updateName, updateContact));
        }
示例#18
0
        private bool DoEdit(int _id)
        {
            int oldMaxNum = MyCommFun.Str2Int(hidOldMaxNum.Value);
            int newMaxNum = MyCommFun.Str2Int(ddlMaxNum.SelectedItem.Value);
            int addNewNum = newMaxNum - oldMaxNum; //新增的帐号


            Model.manager       adminEntity = GetAdminInfo(); //取得管理员信息
            Model.wx_agent_info agent       = new Model.wx_agent_info();
            bool isAgent = false;

            if (adminEntity.agentLevel < 0)
            {
                return(false);
            }
            if (adminEntity.agentLevel > 0)
            {
                agent   = aBll.GetAgentModel(adminEntity.id);
                isAgent = true;
                if (agent.remainMony < agent.agentPrice * addNewNum)
                {
                    JscriptMsg("余额不足,请联系管理员充值!", "", "Error");
                    return(false);
                }
            }


            //地区
            string prov = ddlProvince.SelectedItem.Value;
            string city = ddlCity.SelectedItem.Value;
            string dist = txtArea.Text.Trim();


            bool result = false;

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

            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(ddlMaxNum.SelectedItem.Value);

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

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

            bool updateRet = bll.Update(model);

            if (updateRet && isAgent && addNewNum > 0)
            {
                int xfjine = addNewNum * agent.agentPrice.Value;//消费金额

                agent.remainMony -= xfjine;
                agent.wcodeNum   += newMaxNum;

                bool updateRet2 = aBll.Update(agent);
                if (updateRet2)
                {
                    BLL.wx_manager_bill   bBll = new BLL.wx_manager_bill();
                    Model.wx_manager_bill bill = new Model.wx_manager_bill();
                    bill.billMoney    = xfjine;
                    bill.managerId    = agent.managerId;
                    bill.operPersonId = agent.managerId;
                    bill.operDate     = DateTime.Now;
                    bill.billUsed     = "原用户" + model.user_name + "新增了" + addNewNum + "个微帐号";
                    bill.moneyType    = "扣减";
                    int addBillId = bBll.Add(bill);
                }
                else
                {
                    bll.Delete(_id);
                    updateRet = false;
                }
            }

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

            return(result);
        }
示例#19
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.manager bll = new BLL.manager();
            Model.manager model = bll.GetModel(_id);

            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;
        }
示例#20
0
        private bool DoEdit(int id)
        {
            Model.manager adminEntity = GetAdminInfo(); //取得管理员信息

            BLL.manager bll = new BLL.manager();
            Model.manager model = bll.GetModel(id);

            model.is_lock = MyCommFun.Str2Int(rblIsLock.SelectedValue);

            //判断密码是否更改
            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.remark = txtRemark.Text;

            bool updateRet = bll.Update(model);
            if (updateRet)
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改酒店管理员信息:" + model.user_name); //记录日志
                return true;
            }
            return false;
        }
示例#21
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.manager bll = new BLL.manager();
            Model.manager model = bll.GetModel(_id);

            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() != defaultpassword)
            {
                //获取用户已生成的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();

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

            return result;
        }
示例#22
0
        private bool DoEdit(int _id)
        {
            bool result = true;
            BLL.manager bll = new BLL.manager();
            Model.manager model = bll.GetModel(_id);

            model.role_id = int.Parse(ddlRoleId.SelectedValue);
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            model.is_lock = int.Parse(rblIsLock.SelectedValue);
            //判断密码是否更改
            if (txtUserPwd.Text.Trim() != defaultpassword)
            {
                model.user_pwd = DESEncrypt.Encrypt(txtUserPwd.Text.Trim());
            }
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email = txtEmail.Text.Trim();

            if (!bll.Update(model))
            {
                result = false;
            }

            return result;
        }