Ejemplo n.º 1
0
        // add 1x2
        public List<MatchBetNew> GenerateMemberBetlistFromText(string text1)
        {
            List<MatchBetNew> list3 = new List<MatchBetNew>();
            ArrayList list2 = new ArrayList();
            ArrayList list4 = new ArrayList();
            int num = 0;
            string str = "";
            string str2 = "";
            string str3 = "";
            try
            {
                IEnumerator enumerator = null;
                int num2 = 0;
                str3 = CommonFunction.substring(text1, 0, "Bet List ", "- ", "<", ref num2).Trim();
                if (str3 == string.Empty)
                {
                    return list3;
                }
                while (num > -1)
                {
                    str2 = CommonFunction.substring(text1, num, "w-order", "</tr>", ref num);
                    if (str2 != string.Empty)
                    {
                        list2.Add(str2);
                    }
                }
                try
                {
                    enumerator = list2.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        str = Conversions.ToString(enumerator.Current);
                        bool flag = false;
                        MatchBetNew item = new MatchBetNew();
                        num = 0;
                        item.set_MemberName(str3);
                        if (base._objMemberList.get_MemberRange() == EnumCollection.eMemberRange.AllMember)
                        {
                            item.set_BetFollowMethod(base._objMemberList.get_GlobalBetFollowMethod());
                        }
                        else
                        {
                            Member member = base._objMemberList.get_Item(item.get_MemberName());
                            if (member != null)
                            {
                                item.set_BetFollowMethod(member.get_BetFollowMethod());
                            }
                            else
                            {
                                item.set_BetFollowMethod(EnumCollection.eBetFollowMethod.Normal);
                            }
                        }
                        str2 = CommonFunction.substring(str, num, "Ref No:", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_ID(str2);
                        str2 = CommonFunction.substring(str, num, "bl_time mt10\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_BetDate(str2);
                        str2 = CommonFunction.substring(str, num, "<span", ">", "<", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_SelectedMatch(str2);
                        // 1x2不包含HDP eg <font color='#606060'>-1.5</font>
                        if (str.Contains("<font color='#606060'>"))
                        {
                            str2 = CommonFunction.substring(str, num, ">", "</", ref num).Trim();
                            if (num <= -1)
                            {
                                continue;
                            }
                            item.set_HDP(str2);
                            item.HDPValue = str2;
                            str2 = CommonFunction.substring(str, num, ">", "<", ref num).Trim();
                            if (num <= -1)
                            {
                                continue;
                            }
                        }
                        num2 = 0;
                        str2 = CommonFunction.substring(str2, 0, "[", "]", ref num2).Trim();
                        if (str2 != string.Empty)
                        {
                            list4 = CommonFunction.SeperateStringBySymbol(str2, "-");
                            if (list4.Count == 2)
                            {
                                item.set_HomeScore((int) Math.Round(Conversion.Val(list4[0].ToString().Trim())));
                                item.set_AwayScore((int) Math.Round(Conversion.Val(list4[1].ToString().Trim())));
                                item.set_GameType(EnumCollection.eGameType.Running);
                                item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            }
                        }
                        str2 = CommonFunction.substring(str, num, "bl_btype b\">", "<", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_MatchType(str2);
                        switch (str2.ToLower())
                        {
                            case "handicap":
                                item.set_BetType(EnumCollection.eBetType.HDP);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                break;

                            case "over/under":
                                item.set_BetType(EnumCollection.eBetType.OU);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                break;

                            case "1st handicap":
                                item.set_BetType(EnumCollection.eBetType.HDP);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                break;

                            case "1st over/under":
                                item.set_BetType(EnumCollection.eBetType.OU);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                break;
                            // Add 1x2
                            case "ft.1x2":
                                item.set_BetType(EnumCollection.eBetType.lX2);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                if (item.get_SelectedMatch().ToLower() == "ft.1")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_1);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ft.x")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_X);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ft.2")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_2);
                                }
                                break;
                            case "1st 1x2":
                                item.set_BetType(EnumCollection.eBetType.lX2);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                if (item.get_SelectedMatch().ToLower() == "ht.1")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_1);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ht.x")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_X);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ht.2")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_2);
                                }
                                break;
                        }
                        str2 = CommonFunction.substring(str, num, "bl_match\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        list4 = CommonFunction.SeperateStringBySymbol(str2, "- vs -");
                        if (list4.Count != 2)
                        {
                            continue;
                        }
                        item.set_HomeName(Conversions.ToString(NewLateBinding.LateGet(list4[0], null, "trim", new object[0], null, null, null)).Replace("&nbsp;", ""));
                        item.set_AwayName(Conversions.ToString(NewLateBinding.LateGet(list4[1], null, "trim", new object[0], null, null, null)).Replace("&nbsp;", ""));

                        string sportType = CommonFunction.substring(str, num, "bl_stype", ">", "<", ref num).Trim();
                        if (Enum.IsDefined(typeof(EnumCollection.eSportType), sportType))
                        {
                            item.set_SportType((EnumCollection.eSportType)Enum.Parse(typeof(EnumCollection.eSportType), sportType));
                        }

                        // 只扫描足球赛事
                        /***if (CommonFunction.substring(str, num, "bl_stype", ">", "<", ref num).Trim() != "Soccer")
                        {
                            continue;
                        }***/
                        str2 = CommonFunction.substring(str, num, "span>", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_League(str2);
                        str2 = CommonFunction.substring(str, num, "span class=\"bl_underdog\">", "</span>", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_OddsString(str2);
                        str2 = CommonFunction.substring(str, num, "<span class=\"bl_oddtype\">", "</span>", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        string str5 = str2.ToUpper();
                        if (str5 == "MY")
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Malay);
                        }
                        else if (str5 == "INDO")
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Indo);
                            item.set_Odds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Odds()));
                        }
                        else
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Malay);
                            if (item.get_BetType() != EnumCollection.eBetType.lX2)
                            item.set_Odds(SportBookFunction.ConvertHKToMalayOdds(item.get_Odds()));
                        }
                        str2 = CommonFunction.substring(str, num, "span class=\"stake\">", "</span>", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_BetAmount(str2.Replace(",", ""));
                        if (item.get_HDP().Length > 0)
                        {
                            if (item.get_HDP().Substring(0, 1) == "-")
                            {
                                if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    item.set_AwayColor(Color.Red);
                                    item.set_HomeColor(Color.Blue);
                                }
                                else
                                {
                                    item.set_AwayColor(Color.Blue);
                                    item.set_HomeColor(Color.Red);
                                }
                            }
                            else if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                            {
                                item.set_AwayColor(Color.Blue);
                                item.set_HomeColor(Color.Red);
                            }
                            else
                            {
                                item.set_AwayColor(Color.Red);
                                item.set_HomeColor(Color.Blue);
                            }
                        }
                        if ("null" != item.get_HDP())
                        {

                            item.set_HDP(SportBookFunction.ConvertHDPType(item.get_HDP()));
                        }
                        if (item.get_HDP() == "0.0")
                        {
                            item.set_HomeColor(Color.Blue);
                            item.set_AwayColor(Color.Blue);
                        }
                        if (item.get_BetCoverage() != EnumCollection.eBetCoverage.FT)
                        {
                            goto Label_0757;
                        }
                        switch (item.get_BetType())
                        {
                            case EnumCollection.eBetType.HDP:
                                if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    break;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.FT_Away);
                                goto Label_0841;

                            case EnumCollection.eBetType.OU:
                                if (item.get_SelectedMatch().ToLower() != "over")
                                {
                                    goto Label_072B;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.FT_Over);
                                goto Label_0841;

                            default:
                                goto Label_0841;
                        }
                        if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Home);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_0841;
                    Label_072B:
                        if (item.get_SelectedMatch().ToLower() == "under")
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Under);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_0841;
                    Label_0757:
                        switch (item.get_BetType())
                        {
                            case EnumCollection.eBetType.HDP:
                                if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    break;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.Half_Away);
                                goto Label_0841;

                            case EnumCollection.eBetType.OU:
                                if (item.get_SelectedMatch().ToLower() != "over")
                                {
                                    goto Label_081A;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.Half_Over);
                                goto Label_0841;

                            default:
                                goto Label_0841;
                        }
                        if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Home);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_0841;
                    Label_081A:
                        if (item.get_SelectedMatch().ToLower() == "under")
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Under);
                        }
                        else
                        {
                            flag = true;
                        }
                    Label_0841:
                        num2 = 0;
                        item.set_IPAddress(CommonFunction.substring(str, 0, "\"iplink\">", "<", ref num2).Trim());
                        item.set_CreateDate(DateTime.Now);
                        item.set_Company(base._strAgentSiteName);
                        if (!flag)
                        {
                            list3.Add(item);
                        }
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateMemberBetlistFromText: " + exception.Message);
                ProjectData.ClearProjectError();
            }
            return list3;
        }
Ejemplo n.º 2
0
        public MatchBetNew GenerateMatchBet(EnumCollection.eBetTarget target1)
        {
            MatchBetNew new3 = new MatchBetNew();
            new3.set_HomeName(this.get_HomeName());
            new3.set_AwayName(this.get_AwayName());
            new3.set_HomeMatchingID(this.get_HomeMatchingID());
            new3.set_AwayMatchingID(this.get_AwayMatchingID());
            new3.set_League(this.get_League());
            new3.set_MatchDate(this.get_MatchTime().ToString());
            new3.set_ManualMatchID(this._intManualMatchingID);
            new3.set_HomeScore(this._intHomeScore);
            new3.set_AwayScore(this._intAwayScore);
            new3.set_RunningStatus(this._objRunningStatus);
            new3.set_GameType(this._objGameType);
            new3.set_Company(this._strWebsite);
            new3.set_BetTarget(target1);
            new3.set_Info1(this._strInfo1);
            new3.set_Info2(this._strInfo2);
            new3.set_Info3(this._strInfo3);
            new3.set_Info4(this._strInfo4);
            switch (target1)
            {
                case EnumCollection.eBetTarget.FT_Home:
                    new3.set_SelectedMatch(this.get_HomeName());
                    new3.set_HDP(this.get_FTHDP());
                    new3.set_Odds(this.get_FT_HomeOdds());
                    new3.set_BetType(EnumCollection.eBetType.HDP);
                    new3.set_ID(this.get_FTHDP_ID());
                    new3.set_ID2(this.get_FTHDP_ID2());
                    new3.set_HomeColor(this.get_FTHomeColor());
                    new3.set_AwayColor(this.get_FTAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                    new3.set_HomeBetLink(this._strFT_HomeBetLink);
                    new3.set_AwayBetLink(this._strFT_AwayBetLink);
                    new3.set_SelectedBetLink(this._strFT_HomeBetLink);
                    new3.set_MatchID(this._strFT_ID);
                    return new3;

                case EnumCollection.eBetTarget.FT_Away:
                    new3.set_SelectedMatch(this.get_AwayName());
                    new3.set_HDP(this.get_FTHDP());
                    new3.set_Odds(this.get_FT_AwayOdds());
                    new3.set_BetType(EnumCollection.eBetType.HDP);
                    new3.set_ID(this.get_FTHDP_ID());
                    new3.set_ID2(this.get_FTHDP_ID2());
                    new3.set_HomeColor(this.get_FTHomeColor());
                    new3.set_AwayColor(this.get_FTAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                    new3.set_HomeBetLink(this._strFT_HomeBetLink);
                    new3.set_AwayBetLink(this._strFT_AwayBetLink);
                    new3.set_SelectedBetLink(this._strFT_AwayBetLink);
                    new3.set_MatchID(this._strFT_ID);
                    return new3;

                case EnumCollection.eBetTarget.FT_Over:
                    new3.set_SelectedMatch("Over");
                    new3.set_HDP(this.get_FTOU());
                    new3.set_Odds(this.get_FT_OverOdds());
                    new3.set_BetType(EnumCollection.eBetType.OU);
                    new3.set_ID(this.get_FTOU_ID());
                    new3.set_ID2(this.get_FTOU_ID2());
                    new3.set_HomeColor(this.get_FTHomeColor());
                    new3.set_AwayColor(this.get_FTAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                    new3.set_HomeBetLink(this._strFT_OverBetLink);
                    new3.set_AwayBetLink(this._strFT_UnderBetLink);
                    new3.set_SelectedBetLink(this._strFT_OverBetLink);
                    new3.set_MatchID(this._strFT_ID);
                    return new3;

                case EnumCollection.eBetTarget.FT_Under:
                    new3.set_SelectedMatch("Under");
                    new3.set_HDP(this.get_FTOU());
                    new3.set_Odds(this.get_FT_UnderOdds());
                    new3.set_BetType(EnumCollection.eBetType.OU);
                    new3.set_ID(this.get_FTOU_ID());
                    new3.set_ID2(this.get_FTOU_ID2());
                    new3.set_HomeColor(this.get_FTHomeColor());
                    new3.set_AwayColor(this.get_FTAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                    new3.set_HomeBetLink(this._strFT_OverBetLink);
                    new3.set_AwayBetLink(this._strFT_UnderBetLink);
                    new3.set_SelectedBetLink(this._strFT_UnderBetLink);
                    new3.set_MatchID(this._strFT_ID);
                    return new3;

                case EnumCollection.eBetTarget.Half_Home:
                    new3.set_SelectedMatch(this.get_HomeName());
                    new3.set_HDP(this.get_HalfHDP());
                    new3.set_Odds(this.get_Half_HomeOdds());
                    new3.set_BetType(EnumCollection.eBetType.HDP);
                    new3.set_ID(this.get_HalfHDP_ID());
                    new3.set_ID2(this.get_HalfHDP_ID2());
                    new3.set_HomeColor(this.get_HalfHomeColor());
                    new3.set_AwayColor(this.get_HalfAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                    new3.set_HomeBetLink(this._strHalf_HomeBetLink);
                    new3.set_AwayBetLink(this._strHalf_AwayBetLink);
                    new3.set_SelectedBetLink(this._strHalf_HomeBetLink);
                    new3.set_MatchID(this._strHalf_ID);
                    return new3;

                case EnumCollection.eBetTarget.Half_Away:
                    new3.set_SelectedMatch(this.get_AwayName());
                    new3.set_HDP(this.get_HalfHDP());
                    new3.set_Odds(this.get_Half_AwayOdds());
                    new3.set_BetType(EnumCollection.eBetType.HDP);
                    new3.set_ID(this.get_HalfHDP_ID());
                    new3.set_ID2(this.get_HalfHDP_ID2());
                    new3.set_HomeColor(this.get_HalfHomeColor());
                    new3.set_AwayColor(this.get_HalfAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                    new3.set_HomeBetLink(this._strHalf_HomeBetLink);
                    new3.set_AwayBetLink(this._strHalf_AwayBetLink);
                    new3.set_SelectedBetLink(this._strHalf_AwayBetLink);
                    new3.set_MatchID(this._strHalf_ID);
                    return new3;

                case EnumCollection.eBetTarget.Half_Over:
                    new3.set_SelectedMatch("Over");
                    new3.set_HDP(this.get_HalfOU());
                    new3.set_Odds(this.get_Half_OverOdds());
                    new3.set_BetType(EnumCollection.eBetType.OU);
                    new3.set_ID(this.get_HalfOU_ID());
                    new3.set_ID2(this.get_HalfOU_ID2());
                    new3.set_HomeColor(this.get_HalfHomeColor());
                    new3.set_AwayColor(this.get_HalfAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                    new3.set_HomeBetLink(this._strHalf_OverBetLink);
                    new3.set_AwayBetLink(this._strHalf_UnderBetLink);
                    new3.set_SelectedBetLink(this._strHalf_OverBetLink);
                    new3.set_MatchID(this._strHalf_ID);
                    return new3;

                case EnumCollection.eBetTarget.Half_Under:
                    new3.set_SelectedMatch("Under");
                    new3.set_HDP(this.get_HalfOU());
                    new3.set_Odds(this.get_Half_UnderOdds());
                    new3.set_BetType(EnumCollection.eBetType.OU);
                    new3.set_ID(this.get_HalfOU_ID());
                    new3.set_ID2(this.get_HalfOU_ID2());
                    new3.set_HomeColor(this.get_HalfHomeColor());
                    new3.set_AwayColor(this.get_HalfAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                    new3.set_HomeBetLink(this._strHalf_OverBetLink);
                    new3.set_AwayBetLink(this._strHalf_UnderBetLink);
                    new3.set_SelectedBetLink(this._strHalf_UnderBetLink);
                    new3.set_MatchID(this._strHalf_ID);
                    return new3;
                // add 1x2
                case EnumCollection.eBetTarget.FT_1:
                    new3.set_SelectedMatch("1");
                    new3.set_HDP(this.get_FT1X2());
                    new3.set_Odds(this.get_FT_1X2HomeOddsString());
                    new3.set_BetType(EnumCollection.eBetType.lX2);
                    new3.set_ID(this.get_FT1X2_ID());
                    new3.set_ID2(this.get_FT1X2_ID());
                    new3.set_HomeColor(this.get_FTHomeColor());
                    new3.set_AwayColor(this.get_FTAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                    new3.set_MatchID(this.get_FT_ID());
                    return new3;
                case EnumCollection.eBetTarget.FT_X:
                    new3.set_SelectedMatch("X");
                    new3.set_HDP(this.get_FT1X2());
                    new3.set_Odds(this.get_FT_1X2DrawOddsString());
                    new3.set_BetType(EnumCollection.eBetType.lX2);
                    new3.set_ID(this.get_FT1X2_ID());
                    new3.set_ID2(this.get_FT1X2_ID());
                    new3.set_HomeColor(this.get_FTHomeColor());
                    new3.set_AwayColor(this.get_FTAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                    new3.set_MatchID(this.get_FT_ID());
                    return new3;
                case EnumCollection.eBetTarget.FT_2:
                    new3.set_SelectedMatch("2");
                    new3.set_HDP(this.get_FT1X2());
                    new3.set_Odds(this.get_FT_1X2AwayOddsString());
                    new3.set_BetType(EnumCollection.eBetType.lX2);
                    new3.set_ID(this.get_FT1X2_ID());
                    new3.set_ID2(this.get_FT1X2_ID());
                    new3.set_HomeColor(this.get_FTHomeColor());
                    new3.set_AwayColor(this.get_FTAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                    new3.set_MatchID(this.get_FT_ID());
                    return new3;
                case EnumCollection.eBetTarget.Half_1:
                    new3.set_SelectedMatch("1");
                    new3.set_HDP(this.get_Half1X2());
                    new3.set_Odds(this.get_Half_1X2HomeOddsString());
                    new3.set_BetType(EnumCollection.eBetType.lX2);
                    new3.set_ID(this.get_Half1X2_ID());
                    new3.set_ID2(this.get_Half1X2_ID());
                    new3.set_HomeColor(this.get_HalfHomeColor());
                    new3.set_AwayColor(this.get_HalfAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                    new3.set_MatchID(this.get_Half_ID());
                    return new3;
                case EnumCollection.eBetTarget.Half_X:
                    new3.set_SelectedMatch("X");
                    new3.set_HDP(this.get_Half1X2());
                    new3.set_Odds(this.get_Half_1X2DrawOddsString());
                    new3.set_BetType(EnumCollection.eBetType.lX2);
                    new3.set_ID(this.get_Half1X2_ID());
                    new3.set_ID2(this.get_Half1X2_ID());
                    new3.set_HomeColor(this.get_HalfHomeColor());
                    new3.set_AwayColor(this.get_HalfAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                    new3.set_MatchID(this.get_Half_ID());
                    return new3;
                case EnumCollection.eBetTarget.Half_2:
                    new3.set_SelectedMatch("2");
                    new3.set_HDP(this.get_Half1X2());
                    new3.set_Odds(this.get_Half_1X2AwayOddsString());
                    new3.set_BetType(EnumCollection.eBetType.lX2);
                    new3.set_ID(this.get_Half1X2_ID());
                    new3.set_ID2(this.get_Half1X2_ID());
                    new3.set_HomeColor(this.get_HalfHomeColor());
                    new3.set_AwayColor(this.get_HalfAwayColor());
                    new3.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                    new3.set_MatchID(this.get_Half_ID());
                    return new3;
            }
            return new3;
        }
Ejemplo n.º 3
0
        protected List<MatchBetNew> ProcessMatchDetails(string text1)
        {
            List<MatchBetNew> list2 = new List<MatchBetNew>();
            ArrayList list = new ArrayList();
            ArrayList list3 = new ArrayList();
            int num = 0;
            string str = "";
            string str2 = "";
            try
            {
                IEnumerator enumerator = null;
                while (num > -1)
                {
                    str2 = CommonFunction.substring(text1, num, "w-order", "</tr>", ref num);
                    if (str2 != string.Empty)
                    {
                        list.Add(str2);
                    }
                }
                try
                {
                    enumerator = list.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        str = Conversions.ToString(enumerator.Current);
                        bool flag = false;
                        MatchBetNew item = new MatchBetNew();
                        num = 0;
                        str2 = CommonFunction.substring(str, num, "<td class=\"c\" valign=\"top\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_MemberName(str2);
                        if (base._objMemberList.get_MemberRange() == EnumCollection.eMemberRange.AllMember)
                        {
                            item.set_BetFollowMethod(base._objMemberList.get_GlobalBetFollowMethod());
                        }
                        else
                        {
                            Member member = base._objMemberList.get_Item(item.get_MemberName());
                            if (member != null)
                            {
                                item.set_BetFollowMethod(member.get_BetFollowMethod());
                            }
                            else
                            {
                                item.set_BetFollowMethod(EnumCollection.eBetFollowMethod.Normal);
                            }
                        }
                        str2 = CommonFunction.substring(str, num, "Ref No:", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_ID(str2);
                        str2 = CommonFunction.substring(str, num, "bl_time\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_BetDate(str2);
                        str2 = CommonFunction.substring(str, num, "{class}\">", ">", "<", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_SelectedMatch(str2);
                        // 1x2不包含HDP eg <font color='#606060'>-1.5</font>
                        if (str.Contains("<font color='#606060'>"))
                        {
                            str2 = CommonFunction.substring(str, num, ">", "</", ref num).Trim();
                            if (num <= -1)
                            {
                                continue;
                            }
                            item.set_HDP(str2);
                            str2 = CommonFunction.substring(str, num, ">", "<", ref num).Trim();
                            if (num <= -1)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            item.set_HDP("null");
                        }
                        int num2 = 0;
                        str2 = CommonFunction.substring(str2, 0, "[", "]", ref num2).Trim();
                        if (str2 != string.Empty)
                        {
                            list3 = CommonFunction.SeperateStringBySymbol(str2, "-");
                            if (list3.Count == 2)
                            {
                                item.set_HomeScore((int) Math.Round(Conversion.Val(list3[0].ToString().Trim())));
                                item.set_AwayScore((int) Math.Round(Conversion.Val(list3[1].ToString().Trim())));
                                item.set_GameType(EnumCollection.eGameType.Running);
                                item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            }
                        }
                        str2 = CommonFunction.substring(str, num, "bl_btype b\">", "<", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        switch (str2.ToLower())
                        {
                            case "handicap":
                                item.set_BetType(EnumCollection.eBetType.HDP);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                break;

                            case "over/under":
                                item.set_BetType(EnumCollection.eBetType.OU);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                break;

                            case "1st handicap":
                                item.set_BetType(EnumCollection.eBetType.HDP);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                break;

                            case "1st over/under":
                                item.set_BetType(EnumCollection.eBetType.OU);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                break;
                            // Add 1x2
                            case "ft.1 x 2":
                                item.set_BetType(EnumCollection.eBetType.lX2);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                if (item.get_SelectedMatch().ToLower() == "ft.1")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_1);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ft.x")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_X);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ft.2")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_2);
                                }
                                break;
                            case "ht.1 x 2":
                                item.set_BetType(EnumCollection.eBetType.lX2);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                if (item.get_SelectedMatch().ToLower() == "ht.1")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_1);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ht.x")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_X);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ht.2")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_2);
                                }
                                break;
                        }
                        str2 = CommonFunction.substring(str, num, "bl_match\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        list3 = CommonFunction.SeperateStringBySymbol(str2, "-vs-");
                        if (list3.Count != 2)
                        {
                            continue;
                        }
                        item.set_HomeName(Conversions.ToString(NewLateBinding.LateGet(list3[0], null, "trim", new object[0], null, null, null)));
                        item.set_AwayName(Conversions.ToString(NewLateBinding.LateGet(list3[1], null, "trim", new object[0], null, null, null)));
                        if (CommonFunction.substring(str, num, "bl_stype", ">", "<", ref num).Trim() != "Soccer")
                        {
                            continue;
                        }
                        str2 = CommonFunction.substring(str, num, "span>", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_League(str2);
                        str2 = CommonFunction.substring(str, num, "'>", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_OddsString(str2);
                        str2 = CommonFunction.substring(str, num, "\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        string str4 = str2.ToUpper();
                        if (str4 == "MY")
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Malay);
                        }
                        else if (str4 == "INDO")
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Indo);
                            item.set_Odds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Odds()));
                        }
                        else
                        {
                            item.set_OddsType(EnumCollection.eOddsType.HK);
                            item.set_Odds(SportBookFunction.ConvertHKToMalayOdds(item.get_Odds()));
                        }
                        str2 = CommonFunction.substring(str, num, "\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_BetAmount(str2.Replace(",", ""));
                        if (item.get_HDP().Length > 0)
                        {
                            if (item.get_HDP().Substring(0, 1) == "-")
                            {
                                if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    item.set_AwayColor(Color.Red);
                                    item.set_HomeColor(Color.Blue);
                                }
                                else
                                {
                                    item.set_AwayColor(Color.Blue);
                                    item.set_HomeColor(Color.Red);
                                }
                            }
                            else if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                            {
                                item.set_AwayColor(Color.Blue);
                                item.set_HomeColor(Color.Red);
                            }
                            else
                            {
                                item.set_AwayColor(Color.Red);
                                item.set_HomeColor(Color.Blue);
                            }
                        }
                        if ("null" != item.get_HDP())
                        {
                            item.set_HDP(SportBookFunction.ConvertHDPType(item.get_HDP()));
                        }
                        if (item.get_HDP() == "0.0")
                        {
                            item.set_HomeColor(Color.Blue);
                            item.set_AwayColor(Color.Blue);
                        }
                        if (item.get_BetCoverage() != EnumCollection.eBetCoverage.FT)
                        {
                            goto Label_0734;
                        }
                        switch (item.get_BetType())
                        {
                            case EnumCollection.eBetType.HDP:
                                if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    break;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.FT_Away);
                                goto Label_081E;

                            case EnumCollection.eBetType.OU:
                                if (item.get_SelectedMatch().ToLower() != "over")
                                {
                                    goto Label_0708;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.FT_Over);
                                goto Label_081E;

                            default:
                                goto Label_081E;
                        }
                        if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Home);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_081E;
                    Label_0708:
                        if (item.get_SelectedMatch().ToLower() == "under")
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Under);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_081E;
                    Label_0734:
                        switch (item.get_BetType())
                        {
                            case EnumCollection.eBetType.HDP:
                                if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    break;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.Half_Away);
                                goto Label_081E;

                            case EnumCollection.eBetType.OU:
                                if (item.get_SelectedMatch().ToLower() != "over")
                                {
                                    goto Label_07F7;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.Half_Over);
                                goto Label_081E;

                            default:
                                goto Label_081E;
                        }
                        if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Home);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_081E;
                    Label_07F7:
                        if (item.get_SelectedMatch().ToLower() == "under")
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Under);
                        }
                        else
                        {
                            flag = true;
                        }
                    Label_081E:
                        num2 = 0;
                        item.set_IPAddress(CommonFunction.substring(str, 0, "\"iplink\">", "<", ref num2).Trim());
                        item.set_CreateDate(DateTime.Now);
                        item.set_Company(base._strAgentSiteName);
                        if (!flag)
                        {
                            list2.Add(item);
                        }
                    }
                    return list2;
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN ProcessMatchDetails: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN ProcessMatchDetails: " + exception.Message);
                ProjectData.ClearProjectError();
            }
            return list2;
        }
Ejemplo n.º 4
0
 public MatchBetNew Clone()
 {
     MatchBetNew new3 = new MatchBetNew();
     new3.set_CreateDate(this._datCreate);
     new3.set_SportType(this._objSportType);
     new3.set_MatchID(this._strMatchID);
     new3.set_ID(this._strID);
     new3.set_ID2(this._strID2);
     new3.set_Company(this._strCompany);
     new3.set_League(this._strLeague);
     new3.set_HomeName(this._strHomeName);
     new3.set_AwayName(this._strAwayName);
     new3.set_SelectedMatch(this._strMatchSelected);
     new3.set_HomeColor(this._clrHome);
     new3.set_AwayColor(this._clrAway);
     new3.set_HomeBetLink(this._strHomeBetLink);
     new3.set_AwayBetLink(this._strAwayBetLink);
     new3.set_SelectedBetLink(this._strSelectedBetLink);
     new3.set_MatchDate(this._strMatchDate);
     new3.set_BetDate(this._strBetDate);
     new3.set_HDP(this._strHdp);
     new3.set_Odds(this._dblOdds);
     new3.set_BetAmount(this._strAmount);
     new3.set_OddsType(this._objOddsType);
     new3.set_BetCoverage(this._objBetCoverage);
     new3.set_BetType(this._objBetType);
     new3.set_BetTarget(this._objBetTarget);
     new3.set_BetFollowMethod(this._objBetFollowMethod);
     new3.set_MemberName(this._strMemberName);
     new3.set_MaxBetAmount(this._strMaxBet);
     new3.set_HomeScore(this._intHomeScore);
     new3.set_AwayScore(this._intAwayScore);
     new3.set_Description(this._strDescription);
     new3.set_HomeMatchingID(this._intHomeMatchingID);
     new3.set_AwayMatchingID(this._intAwayMatchingID);
     new3.set_HomeMatchingName(this._strHomeMatchingName);
     new3.set_AwayMatchingName(this._strAwayMatchingName);
     new3.set_LeagueMatchingID(this._intLeagueMatchingID);
     new3.set_GameType(this._objGameType);
     new3.set_RunningStatus(this._objRunningStatus);
     new3.set_EstimatePayout(this._dclEstimatePayout);
     new3.set_MatchResult(this._objMatchResult);
     if (this._objMatchResultInfo != null)
     {
         new3.set_MatchResultInfo(this._objMatchResultInfo.CloneObject());
     }
     new3.set_Company(this._strCompany);
     new3.set_ReceiptID(this._strReceiptID);
     new3.set_IPAddress(this._strIPAddress);
     new3.set_ClientName(this._strClientName);
     new3.set_IsUpdated(this.get_IsUpdated());
     new3.set_UniqueID(this.get_UniqueID());
     new3.set_ReceiptStatus(this._objReceiptStatus);
     new3.set_IsReceiptOccupied(this._isReceiptOccupied);
     new3.set_Info1(this.get_Info1());
     new3.set_Info2(this.get_Info2());
     new3.set_Info3(this.get_Info3());
     new3.set_Info4(this.get_Info4());
     new3.GenerateUpperCaseInfo();
     return new3;
 }