Beispiel #1
0
        private void AddUser()
        {
            string str  = LSRequest.qq("userState");
            string str2 = LSRequest.qq("password");
            string str3 = LSRequest.qq("nicker");
            string str4 = LSRequest.qq("userReport");
            string str5 = LSRequest.qq("isLocked");
            string s    = LSRequest.qq("userCreditSix");

            if (this.d_six_iscash.Equals("1"))
            {
                s = this.d_six_credit;
            }
            string str7  = LSRequest.qq("userRateSix");
            string str8  = LSRequest.qq("userAllowSaleSix");
            string str9  = LSRequest.qq("userRateOwnerSix");
            string str10 = LSRequest.qq("userKindSix");
            string str11 = LSRequest.qq("opSix");
            string str12 = "0";
            string str13 = LSRequest.qq("userCreditKc");

            if (this.d_kc_iscash.Equals("1"))
            {
                str13 = this.d_kc_credit;
            }
            string str14   = LSRequest.qq("userRateKc");
            string str15   = LSRequest.qq("userAllowSaleKc");
            string str16   = LSRequest.qq("userRateOwnerKc");
            string str17   = LSRequest.qq("userKindKc");
            string str18   = LSRequest.qq("opKc");
            string str19   = "0";
            string message = "";

            if (!base.ValidParamByUserEditPhone("fgs", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.noRightOptMsg(message);
            }
            if (!string.IsNullOrEmpty(str2.Trim()) && !Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!");
                }
                else
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含字母、和数字!");
                }
                base.Response.End();
            }
            if ((!str.Equals("0") && !str.Equals("1")) && !str.Equals("2"))
            {
                base.Response.End();
            }
            if (!str4.ToUpper().Equals("0") && !str4.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str11.ToUpper().Equals("0") && !str11.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str18.ToUpper().Equals("0") && !str18.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str19.Equals("0") && !str19.Equals("1"))
            {
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((!str10.ToUpper().Equals("A") && !str10.ToUpper().Equals("B")) && (!str10.ToUpper().Equals("C") && !str10.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str8.ToUpper().Equals("0") && !str8.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
                if (!str9.ToUpper().Equals("0") && !str9.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((!str17.ToUpper().Equals("A") && !str17.ToUpper().Equals("B")) && (!str17.ToUpper().Equals("C") && !str17.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str15.ToUpper().Equals("0") && !str15.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
                if (!str16.ToUpper().Equals("0") && !str16.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
            }
            base.En_User_Lock(this.d_u_name);
            double num = 0.0;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if (!string.IsNullOrEmpty(this.lottrty_six) && (double.Parse(str7) < double.Parse(base.get_ZJMinRate_SIX())))
                {
                    base.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("⑥合彩:總監占成不可低於 " + base.get_ZJMinRate_SIX() + "% ,請重新設定!");
                }
                if (double.Parse(str7) > this.d_maxRate_six)
                {
                    base.Un_User_Lock(this.d_u_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.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("⑥合彩: 設定減少‘信用額度’超過可‘回收’餘額!!");
                }
            }
            double num2 = 0.0;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if (!string.IsNullOrEmpty(this.lottrty_kc) && (double.Parse(str14) < double.Parse(base.get_ZJMinRate_KC())))
                {
                    base.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("快彩:總監占成不可低於 " + base.get_ZJMinRate_KC() + "% ,請重新設定!");
                }
                if (double.Parse(str14) > this.d_maxRate_kc)
                {
                    base.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("快彩:總監占成 數不正确,请核实后重新输入!");
                }
                num2 = double.Parse(str13) - double.Parse(this.d_kc_credit);
                if (double.Parse(str13) < (double.Parse(this.d_kc_credit) - Convert.ToDouble(this.d_kc_usable_credit)))
                {
                    base.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("快彩: 設定減少‘信用額度’超過可‘回收’餘額!!");
                }
            }
            int     num3 = 0;
            decimal num4 = 0M;
            decimal num5 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                num3 = Convert.ToInt32(str7);
                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(str14);
                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(str5) && (str5 == "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_allow_view_report(new int?(Convert.ToInt32(str4)));
            _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));
            _users.set_allow_sale(new int?(Convert.ToInt32(str8)));
            _users.set_six_rate_owner(new int?(Convert.ToInt32(str9)));
            _users.set_kc_rate(new int?(num6));
            _users.set_kc_credit(new decimal?(num7));
            _users.set_kc_usable_credit(new decimal?(num8));
            _users.set_kc_allow_sale(new int?(Convert.ToInt32(str15)));
            _users.set_kc_rate_owner(new int?(Convert.ToInt32(str16)));
            _users.set_six_op_odds(new int?(Convert.ToInt32(str11)));
            _users.set_kc_op_odds(new int?(Convert.ToInt32(str18)));
            if (base.get_GetIsShowFgsWT().Equals("0"))
            {
                _users.set_six_op_odds(0);
                _users.set_kc_op_odds(0);
            }
            _users.set_kc_isauto_back(new int?(Convert.ToInt32(str19)));
            _users.set_six_isauto_back(new int?(Convert.ToInt32(str12)));
            bool flag2 = true;
            bool flag3 = true;
            bool flag4 = false;
            bool flag5 = false;

            if (str8.Equals("0") && this.d_six_allow_sale.Equals("1"))
            {
                flag4 = true;
            }
            if (str15.Equals("0") && this.d_kc_allow_sale.Equals("1"))
            {
                flag5 = true;
            }
            if (this.d_six_ExistsBet && this.d_six_OpenPhase)
            {
                flag2 = false;
                _users.set_allow_sale(new int?(int.Parse(this.d_six_allow_sale)));
                flag4 = false;
            }
            if (this.d_kc_ExistsBet && this.d_kc_OpenPhase)
            {
                flag3 = false;
                _users.set_kc_allow_sale(new int?(int.Parse(this.d_kc_allow_sale)));
                flag5 = false;
            }
            DataTable userInfoTableByUID = CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id);

            if (CallBLL.cz_users_bll.UpdateUserInfoFGS(_users, flag2, flag3, flag4, flag5))
            {
                if (!_users.get_six_op_odds().Equals(1))
                {
                    base.RestOddsWT(100, 1, _users.get_u_name());
                }
                if (!_users.get_kc_op_odds().Equals(1))
                {
                    base.RestOddsWT(null, 2, _users.get_u_name());
                }
                if (!_users.get_six_op_odds().Equals(int.Parse(this.d_six_op_odds)) || !_users.get_kc_op_odds().Equals(int.Parse(this.d_kc_op_odds)))
                {
                    if (FileCacheHelper.get_RedisStatOnline().Equals(1))
                    {
                        base.UpdateIsOutOpts(_users.get_u_name());
                    }
                    else if (FileCacheHelper.get_RedisStatOnline().Equals(2))
                    {
                        base.UpdateIsOutOptsStack(_users.get_u_name());
                    }
                    else
                    {
                        CallBLL.cz_stat_online_bll.UpdateIsOutByFgsName(_users.get_u_name());
                    }
                    FileCacheHelper.UpdateUserOutFile();
                    if (!_users.get_six_op_odds().Equals(int.Parse(this.d_six_op_odds)))
                    {
                        FileCacheHelper.UpdateFGSWTFile(1, "");
                    }
                    if (!_users.get_kc_op_odds().Equals(int.Parse(this.d_kc_op_odds)))
                    {
                        FileCacheHelper.UpdateFGSWTFile(2, "");
                    }
                }
                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();
                }
                base.user_edit_fgs_log(userInfoTableByUID, CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id), _users.get_u_name());
                base.Un_User_Lock(this.d_u_name);
                base.successOptMsg("已經成功修改分公司!");
            }
            else
            {
                base.Un_User_Lock(this.d_u_name);
                base.noRightOptMsg("修改分公司失敗!");
            }
        }