Пример #1
0
        private void AddPhase(cz_phase_six phaseModel)
        {
            DataSet playByOddsSet = CallBLL.cz_play_six_bll.GetPlayByOddsSet("91025,91026,91027,91028,91029");

            if (((playByOddsSet != null) && (playByOddsSet.Tables.Count > 0)) && (playByOddsSet.Tables[0].Rows.Count > 0))
            {
                DataTable table = playByOddsSet.Tables[0];
                foreach (DataRow row in table.Rows)
                {
                    int         num;
                    cz_play_six _six = new cz_play_six();
                    string      str  = row["play_id"].ToString();
                    string      str2 = row["default_odds"].ToString();
                    string      str3 = row["max_odds"].ToString();
                    string      str4 = row["min_odds"].ToString();
                    row["a_diff"].ToString();
                    string str5 = row["b_diff"].ToString();
                    string str6 = row["c_diff"].ToString();
                    _six.set_play_id(Convert.ToInt32(str));
                    _six.set_default_odds(str2);
                    _six.set_max_odds(str3);
                    _six.set_min_odds(str4);
                    _six.set_b_diff(str5);
                    _six.set_c_diff(str6);
                    if (CallBLL.cz_bet_six_bll.GetIspayment() > 0)
                    {
                        num = 1;
                    }
                    else
                    {
                        num = 0;
                    }
                    try
                    {
                        if (_six.get_play_id().Equals(0x16385))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SB(_six, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x16382))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_ZT(_six, "91010,91025,91026,91027,91028,91029", num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x1637e))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_TMSX(_six, base.get_YearLian(), num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x1637f))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_TMSB(_six, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x1638d))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SXWS(_six, "sx", base.get_YearLian(), num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x1638e))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SXWS(_six, "ws", "0", num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163ae))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SXWS(_six, "sx", base.get_YearLian(), num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163af))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SXWS(_six, "ws", "0", num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x16380))
                        {
                            string[]    strArray  = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray2 = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray3 = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray4 = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray5 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six2     = new cz_odds_six();
                            _six2.set_play_id(new int?(_six.get_play_id()));
                            _six2.set_play_name("半波【單雙】");
                            _six2.set_put_amount("紅波單");
                            _six2.set_current_odds(strArray[0]);
                            _six2.set_max_odds(strArray2[0]);
                            _six2.set_min_odds(strArray3[0]);
                            _six2.set_b_diff(strArray4[0]);
                            _six2.set_c_diff(strArray5[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six2, num.ToString());
                            cz_odds_six _six3 = new cz_odds_six();
                            _six3.set_play_id(new int?(_six.get_play_id()));
                            _six3.set_play_name("半波【單雙】");
                            _six3.set_put_amount("紅波雙");
                            _six3.set_current_odds(strArray[1]);
                            _six3.set_max_odds(strArray2[1]);
                            _six3.set_min_odds(strArray3[1]);
                            _six3.set_b_diff(strArray4[1]);
                            _six3.set_c_diff(strArray5[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six3, num.ToString());
                            cz_odds_six _six4 = new cz_odds_six();
                            _six4.set_play_id(new int?(_six.get_play_id()));
                            _six4.set_play_name("半波【單雙】");
                            _six4.set_put_amount("藍波單");
                            _six4.set_current_odds(strArray[2]);
                            _six4.set_max_odds(strArray2[2]);
                            _six4.set_min_odds(strArray3[2]);
                            _six4.set_b_diff(strArray4[2]);
                            _six4.set_c_diff(strArray5[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six4, num.ToString());
                            cz_odds_six _six5 = new cz_odds_six();
                            _six5.set_play_id(new int?(_six.get_play_id()));
                            _six5.set_play_name("半波【單雙】");
                            _six5.set_put_amount("藍波雙");
                            _six5.set_current_odds(strArray[3]);
                            _six5.set_max_odds(strArray2[3]);
                            _six5.set_min_odds(strArray3[3]);
                            _six5.set_b_diff(strArray4[3]);
                            _six5.set_c_diff(strArray5[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six5, num.ToString());
                            cz_odds_six _six6 = new cz_odds_six();
                            _six6.set_play_id(new int?(_six.get_play_id()));
                            _six6.set_play_name("半波【單雙】");
                            _six6.set_put_amount("綠波單");
                            _six6.set_current_odds(strArray[4]);
                            _six6.set_max_odds(strArray2[4]);
                            _six6.set_min_odds(strArray3[4]);
                            _six6.set_b_diff(strArray4[4]);
                            _six6.set_c_diff(strArray5[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six6, num.ToString());
                            cz_odds_six _six7 = new cz_odds_six();
                            _six7.set_play_id(new int?(_six.get_play_id()));
                            _six7.set_play_name("半波【單雙】");
                            _six7.set_put_amount("綠波雙");
                            _six7.set_current_odds(strArray[5]);
                            _six7.set_max_odds(strArray2[5]);
                            _six7.set_min_odds(strArray3[5]);
                            _six7.set_b_diff(strArray4[5]);
                            _six7.set_c_diff(strArray5[5]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six7, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163b1))
                        {
                            string[]    strArray6  = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray7  = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray8  = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray9  = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray10 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six8      = new cz_odds_six();
                            _six8.set_play_id(new int?(_six.get_play_id()));
                            _six8.set_play_name("半波【大小】");
                            _six8.set_put_amount("紅波大");
                            _six8.set_current_odds(strArray6[0]);
                            _six8.set_max_odds(strArray7[0]);
                            _six8.set_min_odds(strArray8[0]);
                            _six8.set_b_diff(strArray9[0]);
                            _six8.set_c_diff(strArray10[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six8, num.ToString());
                            cz_odds_six _six9 = new cz_odds_six();
                            _six9.set_play_id(new int?(_six.get_play_id()));
                            _six9.set_play_name("半波【大小】");
                            _six9.set_put_amount("紅波小");
                            _six9.set_current_odds(strArray6[1]);
                            _six9.set_max_odds(strArray7[1]);
                            _six9.set_min_odds(strArray8[1]);
                            _six9.set_b_diff(strArray9[1]);
                            _six9.set_c_diff(strArray10[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six9, num.ToString());
                            cz_odds_six _six10 = new cz_odds_six();
                            _six10.set_play_id(new int?(_six.get_play_id()));
                            _six10.set_play_name("半波【大小】");
                            _six10.set_put_amount("藍波大");
                            _six10.set_current_odds(strArray6[2]);
                            _six10.set_max_odds(strArray7[2]);
                            _six10.set_min_odds(strArray8[2]);
                            _six10.set_b_diff(strArray9[2]);
                            _six10.set_c_diff(strArray10[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six10, num.ToString());
                            cz_odds_six _six11 = new cz_odds_six();
                            _six11.set_play_id(new int?(_six.get_play_id()));
                            _six11.set_play_name("半波【大小】");
                            _six11.set_put_amount("藍波小");
                            _six11.set_current_odds(strArray6[3]);
                            _six11.set_max_odds(strArray7[3]);
                            _six11.set_min_odds(strArray8[3]);
                            _six11.set_b_diff(strArray9[3]);
                            _six11.set_c_diff(strArray10[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six11, num.ToString());
                            cz_odds_six _six12 = new cz_odds_six();
                            _six12.set_play_id(new int?(_six.get_play_id()));
                            _six12.set_play_name("半波【大小】");
                            _six12.set_put_amount("綠波大");
                            _six12.set_current_odds(strArray6[4]);
                            _six12.set_max_odds(strArray7[4]);
                            _six12.set_min_odds(strArray8[4]);
                            _six12.set_b_diff(strArray9[4]);
                            _six12.set_c_diff(strArray10[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six12, num.ToString());
                            cz_odds_six _six13 = new cz_odds_six();
                            _six13.set_play_id(new int?(_six.get_play_id()));
                            _six13.set_play_name("半波【大小】");
                            _six13.set_put_amount("綠波小");
                            _six13.set_current_odds(strArray6[5]);
                            _six13.set_max_odds(strArray7[5]);
                            _six13.set_min_odds(strArray8[5]);
                            _six13.set_b_diff(strArray9[5]);
                            _six13.set_c_diff(strArray10[5]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six13, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163ac))
                        {
                            string[]    strArray11 = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray12 = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray13 = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray14 = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray15 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six14     = new cz_odds_six();
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單0、雙7");
                            _six14.set_current_odds(strArray11[0]);
                            _six14.set_max_odds(strArray12[0]);
                            _six14.set_min_odds(strArray13[0]);
                            _six14.set_b_diff(strArray14[0]);
                            _six14.set_c_diff(strArray15[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單1、雙6");
                            _six14.set_current_odds(strArray11[1]);
                            _six14.set_max_odds(strArray12[1]);
                            _six14.set_min_odds(strArray13[1]);
                            _six14.set_b_diff(strArray14[1]);
                            _six14.set_c_diff(strArray15[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單2、雙5");
                            _six14.set_current_odds(strArray11[2]);
                            _six14.set_max_odds(strArray12[2]);
                            _six14.set_min_odds(strArray13[2]);
                            _six14.set_b_diff(strArray14[2]);
                            _six14.set_c_diff(strArray15[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單3、雙4");
                            _six14.set_current_odds(strArray11[3]);
                            _six14.set_max_odds(strArray12[3]);
                            _six14.set_min_odds(strArray13[3]);
                            _six14.set_b_diff(strArray14[3]);
                            _six14.set_c_diff(strArray15[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單4、雙3");
                            _six14.set_current_odds(strArray11[4]);
                            _six14.set_max_odds(strArray12[4]);
                            _six14.set_min_odds(strArray13[4]);
                            _six14.set_b_diff(strArray14[4]);
                            _six14.set_c_diff(strArray15[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單5、雙2");
                            _six14.set_current_odds(strArray11[5]);
                            _six14.set_max_odds(strArray12[5]);
                            _six14.set_min_odds(strArray13[5]);
                            _six14.set_b_diff(strArray14[5]);
                            _six14.set_c_diff(strArray15[5]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單6、雙1");
                            _six14.set_current_odds(strArray11[6]);
                            _six14.set_max_odds(strArray12[6]);
                            _six14.set_min_odds(strArray13[6]);
                            _six14.set_b_diff(strArray14[6]);
                            _six14.set_c_diff(strArray15[6]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單7、雙0");
                            _six14.set_current_odds(strArray11[7]);
                            _six14.set_max_odds(strArray12[7]);
                            _six14.set_min_odds(strArray13[7]);
                            _six14.set_b_diff(strArray14[7]);
                            _six14.set_c_diff(strArray15[7]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163b0))
                        {
                            string[]    strArray16 = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray17 = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray18 = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray19 = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray20 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six15     = new cz_odds_six();
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大0、小7");
                            _six15.set_current_odds(strArray16[0]);
                            _six15.set_max_odds(strArray17[0]);
                            _six15.set_min_odds(strArray18[0]);
                            _six15.set_b_diff(strArray19[0]);
                            _six15.set_c_diff(strArray20[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大1、小6");
                            _six15.set_current_odds(strArray16[1]);
                            _six15.set_max_odds(strArray17[1]);
                            _six15.set_min_odds(strArray18[1]);
                            _six15.set_b_diff(strArray19[1]);
                            _six15.set_c_diff(strArray20[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大2、小5");
                            _six15.set_current_odds(strArray16[2]);
                            _six15.set_max_odds(strArray17[2]);
                            _six15.set_min_odds(strArray18[2]);
                            _six15.set_b_diff(strArray19[2]);
                            _six15.set_c_diff(strArray20[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大3、小4");
                            _six15.set_current_odds(strArray16[3]);
                            _six15.set_max_odds(strArray17[3]);
                            _six15.set_min_odds(strArray18[3]);
                            _six15.set_b_diff(strArray19[3]);
                            _six15.set_c_diff(strArray20[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大4、小3");
                            _six15.set_current_odds(strArray16[4]);
                            _six15.set_max_odds(strArray17[4]);
                            _six15.set_min_odds(strArray18[4]);
                            _six15.set_b_diff(strArray19[4]);
                            _six15.set_c_diff(strArray20[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大5、小2");
                            _six15.set_current_odds(strArray16[5]);
                            _six15.set_max_odds(strArray17[5]);
                            _six15.set_min_odds(strArray18[5]);
                            _six15.set_b_diff(strArray19[5]);
                            _six15.set_c_diff(strArray20[5]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大6、小1");
                            _six15.set_current_odds(strArray16[6]);
                            _six15.set_max_odds(strArray17[6]);
                            _six15.set_min_odds(strArray18[6]);
                            _six15.set_b_diff(strArray19[6]);
                            _six15.set_c_diff(strArray20[6]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大7、小0");
                            _six15.set_current_odds(strArray16[7]);
                            _six15.set_max_odds(strArray17[7]);
                            _six15.set_min_odds(strArray18[7]);
                            _six15.set_b_diff(strArray19[7]);
                            _six15.set_c_diff(strArray20[7]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163ad))
                        {
                            string[]    strArray21 = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray22 = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray23 = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray24 = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray25 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six16     = new cz_odds_six();
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("金");
                            _six16.set_current_odds(strArray21[0]);
                            _six16.set_max_odds(strArray22[0]);
                            _six16.set_min_odds(strArray23[0]);
                            _six16.set_b_diff(strArray24[0]);
                            _six16.set_c_diff(strArray25[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("木");
                            _six16.set_current_odds(strArray21[1]);
                            _six16.set_max_odds(strArray22[1]);
                            _six16.set_min_odds(strArray23[1]);
                            _six16.set_b_diff(strArray24[1]);
                            _six16.set_c_diff(strArray25[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("水");
                            _six16.set_current_odds(strArray21[2]);
                            _six16.set_max_odds(strArray22[2]);
                            _six16.set_min_odds(strArray23[2]);
                            _six16.set_b_diff(strArray24[2]);
                            _six16.set_c_diff(strArray25[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("火");
                            _six16.set_current_odds(strArray21[3]);
                            _six16.set_max_odds(strArray22[3]);
                            _six16.set_min_odds(strArray23[3]);
                            _six16.set_b_diff(strArray24[3]);
                            _six16.set_c_diff(strArray25[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("土");
                            _six16.set_current_odds(strArray21[4]);
                            _six16.set_max_odds(strArray22[4]);
                            _six16.set_min_odds(strArray23[4]);
                            _six16.set_b_diff(strArray24[4]);
                            _six16.set_c_diff(strArray25[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                        }
                        else
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet(_six, num.ToString());
                        }
                    }
                    catch (Exception)
                    {
                        base.Response.Write(base.ShowDialogBox("添加獎期錯誤!", "", 2));
                        base.Response.End();
                    }
                }
                if (CallBLL.cz_phase_six_bll.AddPhase(phaseModel) > 0)
                {
                    cz_lotteryopen_log _log = new cz_lotteryopen_log();
                    string             str7 = null;
                    if (this.userModel.get_users_child_session() != null)
                    {
                        str7 = this.userModel.get_users_child_session().get_u_name();
                    }
                    string str8 = "";
                    string str9 = ((("本期編號: " + phaseModel.get_phase()) + "<br />開獎時間: " + Convert.ToDateTime(phaseModel.get_open_date()).ToString("yyyy-MM-dd HH:mm:ss")) + "<br />截止投注時間: " + Convert.ToDateTime(phaseModel.get_stop_date()).ToString("yyyy-MM-dd HH:mm:ss")) + "<br />特碼投注截止: " + Convert.ToDateTime(phaseModel.get_sn_stop_date()).ToString("yyyy-MM-dd HH:mm:ss");
                    _log.set_phase_id(CallBLL.cz_phase_six_bll.GetModelByPhase(phaseModel.get_phase()).get_p_id());
                    _log.set_phase(phaseModel.get_phase());
                    _log.set_u_name(this.userModel.get_u_name());
                    _log.set_children_name(str7);
                    _log.set_action("新增獎期");
                    _log.set_old_val(str8);
                    _log.set_new_val(str9);
                    _log.set_ip(LSRequest.GetIP());
                    _log.set_add_time(DateTime.Now);
                    _log.set_note(string.Format("【本期編號:{0}】新增獎期", _log.get_phase()));
                    _log.set_type_id(0);
                    _log.set_lottery_id(100);
                    CallBLL.cz_lotteryopen_log_bll.Insert(_log);
                    CallBLL.cz_lm_number_amount_six_bll.ClearNumberAmount();
                    if (CallBLL.cz_system_set_six_bll.GetSystemSet(100).get_single_number_isdown().Equals(1))
                    {
                        CallBLL.cz_lm_number_amount_six_bll.SetWtValueAmount();
                    }
                    string url = "/LotteryPeriod/AwardPeriod.aspx?lid=" + 100;
                    FileCacheHelper.UpdateAudoJPFile();
                    base.Response.Write(base.ShowDialogBox("添加獎期成功!", url, 0));
                    base.Response.End();
                }
                else
                {
                    base.Response.Write(base.ShowDialogBox("添加獎期錯誤!", "", 400));
                    base.Response.End();
                }
            }
        }
Пример #2
0
    protected void out_six_odds_info()
    {
        string str  = LSRequest.qq("playid");
        string str2 = LSRequest.qq("playpage");

        if (string.IsNullOrEmpty(str))
        {
            base.Response.End();
        }
        else
        {
            string str3 = this.Session["user_name"].ToString();
            cz_userinfo_session getUserModelInfo = base.GetUserModelInfo;
            string       str4   = getUserModelInfo.get_su_type().ToString();
            string       str5   = getUserModelInfo.get_u_name().ToString();
            string       str6   = getUserModelInfo.get_six_kind().Trim();
            ReturnResult result = new ReturnResult();
            Dictionary <string, object> dictionary = new Dictionary <string, object>();
            dictionary.Add("type", "get_oddsinfo");
            dictionary.Add("playpage", str2);
            DataTable table = CallBLL.cz_users_bll.GetCredit(str5, str4).Tables[0];
            string    str7  = table.Rows[0]["six_credit"].ToString();
            string    str8  = table.Rows[0]["six_iscash"];
            decimal   num   = Convert.ToDecimal(str7);
            string    str9  = "0";
            if (str8.Equals("1"))
            {
                str9 = "1";
            }
            decimal num2 = Convert.ToDecimal(table.Rows[0]["six_usable_credit"].ToString());
            dictionary.Add("iscash", str9);
            dictionary.Add("credit", num.ToString("F1"));
            dictionary.Add("usable_credit", num2.ToString("F1"));
            cz_phase_six currentPhase = CallBLL.cz_phase_six_bll.GetCurrentPhase();
            if (!this.isOpenLottery(currentPhase))
            {
                dictionary.Add("status", "3");
                base.OutJson(JsonHandle.ObjectToJson(dictionary));
            }
            else
            {
                DateTime now   = DateTime.Now;
                string   str11 = "n";
                string   str12 = "0";
                string   str13 = "";
                string   str14 = currentPhase.get_open_date().ToString();
                string   str15 = "";
                DateTime time2 = Convert.ToDateTime(currentPhase.get_stop_date());
                DateTime time3 = Convert.ToDateTime(currentPhase.get_sn_stop_date());
                TimeSpan span  = Utils.DateDiff(time2, now);
                TimeSpan span2 = Utils.DateDiff(time3, now);
                string   str16 = string.Concat(new object[] { (span.Days * 0x18) + span.Hours, ":", span.Minutes, ":", span.Seconds });
                string   str17 = string.Concat(new object[] { (span2.Days * 0x18) + span2.Hours, ":", span2.Minutes, ":", span2.Seconds });
                if (time2 < now)
                {
                    str15 = str16;
                }
                else
                {
                    str11 = "y";
                    str12 = "1";
                    str15 = str16;
                }
                if (time3 < now)
                {
                    str13 = str17;
                }
                else
                {
                    str11 = "y";
                    str12 = "1";
                    str13 = str17;
                }
                if ((currentPhase != null) && currentPhase.get_is_closed().Equals(0))
                {
                    int num3;
                    if (time2 < now)
                    {
                        num3 = CallBLL.cz_odds_six_bll.UpdateIsOpen(1, "91001,91002,91003,91004,91005,91007,91038");
                    }
                    if (time3 < now)
                    {
                        num3 = CallBLL.cz_odds_six_bll.UpdateIsOpen(0, "");
                    }
                }
                string str18 = (currentPhase != null) ? currentPhase.get_phase() : "";
                string str19 = (currentPhase != null) ? currentPhase.get_p_id().ToString() : "";
                dictionary.Add("openning", str11);
                dictionary.Add("isopen", str12);
                int index = str14.IndexOf(' ');
                dictionary.Add("drawopen_time", str14.Substring(index));
                string   str20    = "";
                string[] strArray = str13.Split(new char[] { ':' });
                str20 = (Convert.ToInt32(strArray[0]) < 10) ? ("0" + strArray[0]) : strArray[0];
                str20 = (str20 + ":" + ((Convert.ToInt32(strArray[1]) < 10) ? ("0" + strArray[1]) : strArray[1])) + ":" + ((Convert.ToInt32(strArray[2]) < 10) ? ("0" + strArray[2]) : strArray[2]);
                dictionary.Add("stop_time", str20);
                dictionary.Add("nn", str18);
                dictionary.Add("p_id", str19);
                dictionary.Add("profit", "");
                DataSet play = CallBLL.cz_play_six_bll.GetPlay(str, str4);
                if (play == null)
                {
                    base.Response.End();
                }
                else
                {
                    DataTable table2 = play.Tables["odds"];
                    if (table2 == null)
                    {
                        base.Response.End();
                    }
                    else
                    {
                        DataSet   cache;
                        DataTable table3  = null;
                        DataTable table4  = null;
                        DataTable table5  = null;
                        DataTable table6  = null;
                        DataTable table7  = null;
                        DataTable table8  = null;
                        DataTable wT      = null;
                        DataTable table10 = null;
                        DataTable table11 = null;
                        DataTable table12 = null;
                        DataTable table13 = null;
                        DataTable table14 = null;
                        DataTable table15 = null;
                        DataTable table16 = null;
                        DataTable table17 = null;
                        DataTable table18 = null;
                        DataTable table19 = null;
                        DataTable table20 = null;
                        DataTable table21 = null;
                        DataTable table22 = null;
                        string    str37   = str2;
                        if (str37 != null)
                        {
                            if (!(str37 == "six_lm"))
                            {
                                if (str37 == "six_lm_b")
                                {
                                    wT      = CallBLL.cz_wt_3qz_b_six_bll.GetWT();
                                    table10 = CallBLL.cz_wt_3z2_b_six_bll.GetWT();
                                    table11 = CallBLL.cz_wt_2qz_b_six_bll.GetWT();
                                    table12 = CallBLL.cz_wt_2zt_b_six_bll.GetWT();
                                    table13 = CallBLL.cz_wt_tc_b_six_bll.GetWT();
                                    table14 = CallBLL.cz_wt_4z1_b_six_bll.GetWT();
                                }
                                else if (str37 == "six_bz")
                                {
                                    table15 = CallBLL.cz_wt_5bz_six_bll.GetWT();
                                    table16 = CallBLL.cz_wt_6bz_six_bll.GetWT();
                                    table17 = CallBLL.cz_wt_7bz_six_bll.GetWT();
                                    table18 = CallBLL.cz_wt_8bz_six_bll.GetWT();
                                    table19 = CallBLL.cz_wt_9bz_six_bll.GetWT();
                                    table20 = CallBLL.cz_wt_10bz_six_bll.GetWT();
                                }
                                else if (str37 == "six_lx")
                                {
                                    table21 = CallBLL.cz_wt_sxlwsl_six_bll.GetWT();
                                    table22 = CallBLL.cz_wt_6xyz_six_bll.GetWT();
                                }
                                else if (str37 == "six_ws")
                                {
                                    table21 = CallBLL.cz_wt_sxlwsl_six_bll.GetWT();
                                }
                            }
                            else
                            {
                                table3 = CallBLL.cz_wt_3qz_six_bll.GetWT();
                                table4 = CallBLL.cz_wt_3z2_six_bll.GetWT();
                                table5 = CallBLL.cz_wt_2qz_six_bll.GetWT();
                                table6 = CallBLL.cz_wt_2zt_six_bll.GetWT();
                                table7 = CallBLL.cz_wt_tc_six_bll.GetWT();
                                table8 = CallBLL.cz_wt_4z1_six_bll.GetWT();
                            }
                        }
                        DataTable drawbackByPlayIds = null;
                        if (FileCacheHelper.get_GetSixPutMoneyCache() == "1")
                        {
                            foreach (string str21 in str.Split(new char[] { ',' }))
                            {
                                DataTable table24;
                                if (CacheHelper.GetCache("six_drawback_FileCacheKey" + str21 + this.Session["user_name"].ToString()) != null)
                                {
                                    cache = CacheHelper.GetCache("six_drawback_FileCacheKey" + str21 + this.Session["user_name"].ToString()) as DataSet;
                                    if (drawbackByPlayIds == null)
                                    {
                                        drawbackByPlayIds = cache.Tables[0];
                                    }
                                    else
                                    {
                                        table24 = drawbackByPlayIds.Clone();
                                        table24 = cache.Tables[0];
                                        if (table24 != null)
                                        {
                                            drawbackByPlayIds.Merge(table24);
                                        }
                                    }
                                }
                                else if (drawbackByPlayIds == null)
                                {
                                    drawbackByPlayIds = CallBLL.cz_drawback_six_bll.GetDrawbackByPlayIds(str21, getUserModelInfo.get_u_name());
                                }
                                else
                                {
                                    table24 = drawbackByPlayIds.Clone();
                                    table24 = CallBLL.cz_drawback_six_bll.GetDrawbackByPlayIds(str21, getUserModelInfo.get_u_name());
                                    if (table24 != null)
                                    {
                                        drawbackByPlayIds.Merge(table24);
                                    }
                                }
                            }
                        }
                        else if (CacheHelper.GetCache("six_drawback_FileCacheKey" + this.Session["user_name"].ToString()) != null)
                        {
                            cache             = CacheHelper.GetCache("six_drawback_FileCacheKey" + this.Session["user_name"].ToString()) as DataSet;
                            drawbackByPlayIds = cache.Tables[0];
                        }
                        else
                        {
                            drawbackByPlayIds = CallBLL.cz_drawback_six_bll.GetDrawbackByPlayIds(str, getUserModelInfo.get_u_name());
                        }
                        Dictionary <string, object> dictionary2 = new Dictionary <string, object>();
                        foreach (DataRow row in table2.Rows)
                        {
                            string        key    = "";
                            string        pl     = "";
                            string        s      = "";
                            string        str25  = "";
                            string        str26  = "";
                            string        str27  = "";
                            string        str28  = "";
                            List <double> source = new List <double>();
                            Dictionary <string, object> dictionary3 = new Dictionary <string, object>();
                            key = row["play_id"].ToString() + "_" + row["odds_id"].ToString();
                            string str29 = row["current_odds"].ToString();
                            string str30 = row[str6 + "_diff"].ToString().Trim();
                            if (!row["is_open"].ToString().Equals("0"))
                            {
                                try
                                {
                                    string[] strArray3 = row["current_odds"].ToString().Split(new char[] { ',' });
                                    string[] strArray4 = row[str6 + "_diff"].ToString().Trim().Split(new char[] { ',' });
                                    base.GetOdds_SIX(row["odds_id"].ToString(), row["current_odds"].ToString(), row[str6 + "_diff"].ToString(), ref pl);
                                }
                                catch (Exception exception)
                                {
                                    string message = exception.Message;
                                }
                            }
                            else if (row["current_odds"].ToString().Split(new char[] { ',' }).Length > 1)
                            {
                                pl = "-,-";
                            }
                            else
                            {
                                pl = "-";
                            }
                            DataRow[] rowArray = drawbackByPlayIds.Select(string.Format(" play_id={0} and u_name='{1}' ", row["play_id"].ToString(), getUserModelInfo.get_u_name()));
                            string    str32    = rowArray[0]["single_phase_amount"].ToString();
                            string    str33    = rowArray[0]["single_max_amount"].ToString();
                            string    str34    = rowArray[0]["single_min_amount"].ToString();
                            s     = row["allow_min_amount"].ToString();
                            str25 = row["allow_max_amount"].ToString();
                            str26 = row["max_appoint"].ToString();
                            str27 = row["total_amount"].ToString();
                            str28 = row["allow_max_put_amount"].ToString();
                            if (Convert.ToDecimal(str25) > Convert.ToDecimal(str28))
                            {
                                str25 = row["allow_max_put_amount"].ToString();
                            }
                            if (Convert.ToDecimal(str25) > Convert.ToDecimal(str27))
                            {
                                str25 = row["total_amount"].ToString();
                            }
                            if (double.Parse(s) < double.Parse(str34))
                            {
                                s = str34;
                            }
                            if (double.Parse(str25) > double.Parse(str33))
                            {
                                str25 = str33;
                            }
                            if ((str2.Equals("six_lm") || str2.Equals("six_lm_b")) || str2.Equals("six_bz"))
                            {
                                switch (row["play_id"].ToString())
                                {
                                case "91016":
                                    foreach (DataRow row2 in table3.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91017":
                                    foreach (DataRow row2 in table4.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91018":
                                    foreach (DataRow row2 in table5.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91019":
                                    foreach (DataRow row2 in table6.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91020":
                                    foreach (DataRow row2 in table7.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91040":
                                    foreach (DataRow row2 in table8.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91060":
                                    foreach (DataRow row2 in wT.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91061":
                                    foreach (DataRow row2 in table10.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91062":
                                    foreach (DataRow row2 in table11.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91063":
                                    foreach (DataRow row2 in table12.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91064":
                                    foreach (DataRow row2 in table13.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91065":
                                    foreach (DataRow row2 in table14.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91037":
                                    foreach (DataRow row2 in table15.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91047":
                                    foreach (DataRow row2 in table16.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91048":
                                    foreach (DataRow row2 in table17.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91049":
                                    foreach (DataRow row2 in table18.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91050":
                                    foreach (DataRow row2 in table19.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;

                                case "91051":
                                    foreach (DataRow row2 in table20.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                    break;
                                }
                            }
                            if (str2.Equals("six_lx"))
                            {
                                string str36 = row["odds_id"].ToString();
                                if (str36.Equals("92565"))
                                {
                                    foreach (DataRow row2 in table22.Rows)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                }
                                else
                                {
                                    DataRow[] rowArray2 = table21.Select(string.Format(" odds_id={0} ", Convert.ToInt32(str36)));
                                    foreach (DataRow row2 in rowArray2)
                                    {
                                        source.Add(double.Parse(row2["wt_value"].ToString()));
                                    }
                                    if (source.Count <double>(p => (p == 0.0)) == source.Count)
                                    {
                                        source.Clear();
                                    }
                                }
                            }
                            dictionary3.Add("pl", pl);
                            dictionary3.Add("plx", new List <double>(source));
                            dictionary3.Add("min_amount", s);
                            dictionary3.Add("max_amount", str25);
                            dictionary3.Add("top_amount", str26);
                            dictionary3.Add("dq_max_amount", str27);
                            dictionary3.Add("dh_max_amount", str28);
                            dictionary2.Add(key, new Dictionary <string, object>(dictionary3));
                        }
                        dictionary.Add("status", "1");
                        dictionary.Add("play_odds", dictionary2);
                        base.OutJson(JsonHandle.ObjectToJson(dictionary));
                    }
                }
            }
        }
    }