Пример #1
0
        private void AddUser()
        {
            string str  = LSRequest.qq("userState");
            string str2 = LSRequest.qq("password");
            string str3 = LSRequest.qq("nicker");
            string str4 = LSRequest.qq("isLocked");
            string s    = LSRequest.qq("userCreditSix");

            if (this.d_six_iscash.Equals("1"))
            {
                s = this.d_six_credit;
            }
            string str6 = LSRequest.qq("userRateSix");

            LSRequest.qq("userAllowSaleSix");
            string str7  = LSRequest.qq("userKindSix");
            string str8  = "0";
            string str9  = "0";
            string str10 = LSRequest.qq("userCreditKc");

            if (this.d_kc_iscash.Equals("1"))
            {
                str10 = this.d_kc_credit;
            }
            string str11 = LSRequest.qq("userRateKc");

            LSRequest.qq("userAllowSaleKc");
            string str12   = LSRequest.qq("userKindKc");
            string str13   = "0";
            string str14   = "0";
            string message = "";

            if (!base.ValidParamByUserEditPhone("hy", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.DeleteCreditLock(this.d_u_name);
                base.noRightOptMsg(message);
            }
            if (!string.IsNullOrEmpty(str2.Trim()) && !Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.DeleteCreditLock(this.d_u_name);
                    base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!");
                }
                else
                {
                    base.DeleteCreditLock(this.d_u_name);
                    base.noRightOptMsg("密碼要8-20位,且必需包含字母、和数字!");
                }
            }
            if ((!str.Equals("0") && !str.Equals("1")) && !str.Equals("2"))
            {
                base.DeleteCreditLock(this.d_u_name);
                base.Response.End();
            }
            if ((!string.IsNullOrEmpty(this.lottrty_six) && !str7.ToUpper().Equals("A")) && (!str7.ToUpper().Equals("B") && !str7.ToUpper().Equals("C")))
            {
                base.DeleteCreditLock(this.d_u_name);
                base.Response.End();
            }
            if ((!string.IsNullOrEmpty(this.lottrty_kc) && !str12.ToUpper().Equals("A")) && (!str12.ToUpper().Equals("B") && !str12.ToUpper().Equals("C")))
            {
                base.DeleteCreditLock(this.d_u_name);
                base.Response.End();
            }
            cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(this.d_u_name);

            base.En_User_Lock(rateKCByUserName.get_fgs_name());
            double num = 0.0;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((double.Parse(s) - double.Parse(this.d_six_credit)) > double.Parse(this.d_up_six_usable_credit))
                {
                    base.DeleteCreditLock(this.d_u_name);
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("⑥合彩: 設定增加‘信用額度’超過上级可以用餘額!");
                }
                if (double.Parse(str6) > this.d_maxRate_six)
                {
                    base.DeleteCreditLock(this.d_u_name);
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("⑥合彩: 分公司占成 數不正确,请核实后重新输入!");
                }
                num = double.Parse(s) - double.Parse(this.d_six_credit);
                if (double.Parse(s) < (double.Parse(this.d_six_credit) - Convert.ToDouble(this.d_six_usable_credit)))
                {
                    base.DeleteCreditLock(this.d_u_name);
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("⑥合彩: 設定減少‘信用額度’超過可‘回收’餘額!");
                }
                if (str8.Equals("1"))
                {
                    if (string.IsNullOrEmpty(str9))
                    {
                        base.DeleteCreditLock(this.d_u_name);
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("⑥合彩:‘占成上限’不可為空,請修改!");
                    }
                    try
                    {
                        if (Convert.ToInt32(str9) > 100)
                        {
                            base.DeleteCreditLock(this.d_u_name);
                            base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                            base.noRightOptMsg("⑥合彩: ‘占成上限’不可高於 100%,請重新設定!");
                        }
                        else if (Convert.ToInt32(str9) <= 0)
                        {
                            base.DeleteCreditLock(this.d_u_name);
                            base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                            base.noRightOptMsg("⑥合彩: ‘占成上限’不可低於等於 0%,請重新設定!");
                        }
                    }
                    catch
                    {
                        base.DeleteCreditLock(this.d_u_name);
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("⑥合彩: ‘占成上限’只能為數字,請重新設定!");
                    }
                }
            }
            double num2 = 0.0;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((double.Parse(str10) - double.Parse(this.d_kc_credit)) > double.Parse(this.d_up_kc_usable_credit))
                {
                    base.DeleteCreditLock(this.d_u_name);
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("快彩: 設定增加‘信用額度’超過上级可以用餘額!");
                }
                if (double.Parse(str11) > this.d_maxRate_kc)
                {
                    base.DeleteCreditLock(this.d_u_name);
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("快彩: 分公司占成 數不正确,请核实后重新输入!");
                }
                num2 = double.Parse(str10) - double.Parse(this.d_kc_credit);
                if (double.Parse(str10) < (double.Parse(this.d_kc_credit) - Convert.ToDouble(this.d_kc_usable_credit)))
                {
                    base.DeleteCreditLock(this.d_u_name);
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("快彩: 設定減少‘信用額度’超過可‘回收’餘額!");
                }
                if (str13.Equals("1"))
                {
                    if (string.IsNullOrEmpty(str14))
                    {
                        base.DeleteCreditLock(this.d_u_name);
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("快彩:‘占成上限’不可為空,請修改!");
                    }
                    try
                    {
                        if (Convert.ToInt32(str14) > 100)
                        {
                            base.DeleteCreditLock(this.d_u_name);
                            base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                            base.noRightOptMsg("快彩: ‘占成上限’不可高於 100%,請重新設定!");
                        }
                        else if (Convert.ToInt32(str14) <= 0)
                        {
                            base.DeleteCreditLock(this.d_u_name);
                            base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                            base.noRightOptMsg("快彩: ‘占成上限’不可低於等於 0%,請重新設定!");
                        }
                    }
                    catch
                    {
                        base.DeleteCreditLock(this.d_u_name);
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("快彩: ‘占成上限’只能為數字,請重新設定!");
                    }
                }
            }
            int     num3 = 0;
            decimal num4 = 0M;
            decimal num5 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                num3 = Convert.ToInt32(str6);
                num4 = Convert.ToDecimal(num);
                num5 = Convert.ToDecimal(num);
            }
            int     num6 = 0;
            decimal num7 = 0M;
            decimal num8 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                num6 = Convert.ToInt32(str11);
                num7 = Convert.ToDecimal(num2);
                num8 = Convert.ToDecimal(num2);
            }
            cz_users _users = new cz_users();

            _users.set_u_id(this.r_u_id.ToUpper());
            _users.set_u_name(this.d_u_name);
            if (!string.IsNullOrEmpty(str4) && (str4 == "1"))
            {
                _users.set_retry_times(0);
            }
            if (!string.IsNullOrEmpty(str2))
            {
                string ramSalt = Utils.GetRamSalt(6);
                _users.set_u_psw(DESEncrypt.EncryptString(str2, ramSalt));
                _users.set_salt(ramSalt);
            }
            _users.set_u_nicker(str3);
            _users.set_a_state(new int?(Convert.ToInt32(str)));
            _users.set_u_type(this.d_u_type);
            _users.set_six_rate(new int?(num3));
            _users.set_six_credit(new decimal?(num4));
            _users.set_six_usable_credit(new decimal?(num5));
            if (str8.Equals("1"))
            {
                _users.set_six_allow_maxrate(1);
                _users.set_six_low_maxrate(new int?(Convert.ToInt32(str9)));
            }
            else
            {
                _users.set_six_allow_maxrate(0);
                _users.set_six_low_maxrate(0);
            }
            _users.set_six_kind(str7.ToUpper());
            if (!this.d_up_six_kind.Equals("0"))
            {
                _users.set_six_kind(this.d_up_six_kind.ToUpper());
            }
            if (string.IsNullOrEmpty(this.lottrty_six))
            {
                _users.set_six_kind(this.d_six_kind.ToUpper());
            }
            _users.set_kc_rate(new int?(num6));
            _users.set_kc_credit(new decimal?(num7));
            _users.set_kc_usable_credit(new decimal?(num8));
            if (str13.Equals("1"))
            {
                _users.set_kc_allow_maxrate(1);
                _users.set_kc_low_maxrate(new int?(Convert.ToInt32(str14)));
            }
            else
            {
                _users.set_kc_allow_maxrate(0);
                _users.set_kc_low_maxrate(0);
            }
            _users.set_kc_kind(str12.ToUpper());
            if (!this.d_up_kc_kind.Equals("0"))
            {
                _users.set_kc_kind(this.d_up_kc_kind.ToUpper());
            }
            if (string.IsNullOrEmpty(this.lottrty_kc))
            {
                _users.set_kc_kind(this.d_kc_kind.ToUpper());
            }
            bool flag2 = true;
            bool flag3 = true;

            if (this.d_six_ExistsBet && this.d_six_OpenPhase)
            {
                flag2 = false;
                _users.set_six_kind(this.d_six_kind.ToUpper());
            }
            if (this.d_kc_ExistsBet && this.d_kc_OpenPhase)
            {
                flag3 = false;
                _users.set_kc_kind(this.d_kc_kind.ToUpper());
            }
            DataTable userInfoTableByUID = CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id);

            if (CallBLL.cz_users_bll.UpdateUserInfoHY(_users, flag2, flag3, this.d_up_u_type, this.d_up_u_name))
            {
                base.user_edit_hy_log(userInfoTableByUID, CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id), _users.get_u_name());
                if (!this.d_kc_rate.Equals(_users.get_kc_rate().ToString()))
                {
                    FileCacheHelper.UpdateRateFile_kc();
                }
                if (!this.d_six_rate.Equals(_users.get_six_rate().ToString()))
                {
                    FileCacheHelper.UpdateRateFile_six();
                }
                if (!this.d_six_kind.ToUpper().Equals(_users.get_six_kind().ToUpper()))
                {
                    FileCacheHelper.UpdateDrawbackFile(1, "");
                }
                if (!this.d_kc_kind.ToUpper().Equals(_users.get_kc_kind().ToUpper()))
                {
                    FileCacheHelper.UpdateDrawbackFile(2, "");
                }
                FileCacheHelper.UpdateUserTxt();
                base.DeleteCreditLock(this.d_u_name);
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.successOptMsg("修改會員成功!");
            }
            else
            {
                base.DeleteCreditLock(this.d_u_name);
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("修改會員失敗!");
            }
        }