Example #1
0
        public List<MatchLite> GenerateFullOddsLiteFromText(string text1, bool flag5, bool flag1, bool flag2, bool flag4, bool flag3)
        {
            List<MatchLite> list2 = new List<MatchLite>();
            DateTime time2 = new DateTime();
            Dictionary<string, JsonMatch> dictionary = new Dictionary<string, JsonMatch>();
            DateTime time = Conversions.ToDate(SpiderFunction.GetEarlyMarketStartTime(DateTime.Now));
            Color blue = Color.Blue;
            Color red = Color.Blue;
            try
            {
                int num4 = 0;
                text1 = CommonFunction.substring(text1, 0, "var odds =", ";", ref num4).Trim();
                text1 = text1.Replace("\"1x2", "\"lx2").Replace("\"1sthf1x2rb", "\"lsthf1x2rb");
                dictionary = JsonConvert.DeserializeObject<Dictionary<string, JsonMatch>>(text1);
                if (dictionary == null)
                {
                    return list2;
                }
                Dictionary<string, JsonMatch>.Enumerator enumerator = dictionary.GetEnumerator();
                try
                {
                    //enumerator;
                    while (enumerator.MoveNext())
                    {
                        ArrayList list3;
                        DateTime now;
                        DateTime time4;
                        KeyValuePair<string, JsonMatch> current = enumerator.Current;
                        MatchLite lite = new MatchLite();
                        JsonMatch match = current.Value;
                        lite.set_MatchID(current.Key.ToString());
                        lite.set_Type(EnumCollection.eMatchType.Match);
                        lite.set_Company("SB188");
                        lite.set_GlobalLastUpdate(DateTime.Now);
                        if (match.info.Count == 15)
                        {
                            lite.set_League(match.info[5].ToString().Trim());
                            lite.set_HomeName(match.info[8].ToString().Trim());
                            lite.set_AwayName(match.info[10].ToString().Trim());
                            list3 = CommonFunction.SeperateStringBySymbol(match.info[6].ToString().Trim(), " ");
                            if ((list3.Count == 2) && (match.info[7].ToString().Trim().Length == 5))
                            {
                                now = DateTime.Now;
                                time4 = new DateTime(now.Year, CommonFunction.ConvertMonthName3CharToNumber(list3[1].ToString().Trim()), (int) Math.Round(Conversion.Val(list3[0].ToString().Trim())), Conversions.ToInteger(match.info[7].ToString().Substring(0, 2)), Conversions.ToInteger(match.info[7].ToString().Substring(3, 2)), 0);
                                lite.set_MatchTime(time4);
                            }
                            if (match.info[11].ToString() == "1")
                            {
                                blue = Color.Red;
                                red = Color.Blue;
                            }
                            else
                            {
                                blue = Color.Blue;
                                red = Color.Red;
                            }
                            if (SpiderFunction.IsEarlyMarket(time, lite.get_MatchTime()))
                            {
                                lite.set_GameType(EnumCollection.eGameType.Early);
                            }
                            else
                            {
                                lite.set_GameType(EnumCollection.eGameType.Today);
                            }
                            if (((lite.get_GameType() == EnumCollection.eGameType.Today) & flag1) | ((lite.get_GameType() == EnumCollection.eGameType.Early) & flag2))
                            {
                                if (match.ah[1].ToString() != string.Empty)
                                {
                                    MatchLite lite2 = lite.CloneObject();
                                    lite2.set_BetType(EnumCollection.eBetType.HDP);
                                    lite2.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                    lite2.set_OddsType(EnumCollection.eOddsType.Malay);
                                    lite2.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ah[1].ToString().Replace("/", "-").Trim()));
                                    lite2.set_HomeOverOddsString(match.ah[3].ToString().Trim());
                                    lite2.set_AwayUnderOddsString(match.ah[5].ToString().Trim());
                                    lite2.set_UniqueID(lite2.get_MatchID() + Conversion.Val(lite2.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite2.get_BetCoverage().ToString())));
                                    lite2.UpdateCommission();
                                    if (lite2.get_Handicap() == "0.0")
                                    {
                                        lite2.set_HomeColor(Color.Blue);
                                        lite2.set_AwayColor(Color.Blue);
                                    }
                                    else
                                    {
                                        lite2.set_HomeColor(blue);
                                        lite2.set_AwayColor(red);
                                    }
                                    switch (base._objBetOddsType)
                                    {
                                        case EnumCollection.eOddsType.HK:
                                            lite2.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite2.get_HomeOverOddsString()));
                                            lite2.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite2.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Euro:
                                            lite2.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite2.get_HomeOverOddsString()));
                                            lite2.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite2.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Indo:
                                            lite2.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite2.get_HomeOverOddsString()));
                                            lite2.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite2.get_AwayUnderOddsString()));
                                            break;
                                    }
                                    list2.Add(lite2);
                                }
                                if (match.ou[1].ToString() != string.Empty)
                                {
                                    MatchLite lite3 = lite.CloneObject();
                                    lite3.set_BetType(EnumCollection.eBetType.OU);
                                    lite3.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                    lite3.set_OddsType(EnumCollection.eOddsType.Malay);
                                    lite3.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ou[1].ToString().Replace("/", "-").Trim()));
                                    lite3.set_HomeOverOddsString(match.ou[3].ToString().Trim());
                                    lite3.set_AwayUnderOddsString(match.ou[5].ToString().Trim());
                                    lite3.set_UniqueID(lite3.get_MatchID() + Conversion.Val(lite3.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite3.get_BetCoverage().ToString())));
                                    lite3.UpdateCommission();
                                    lite3.set_HomeColor(Color.Blue);
                                    lite3.set_AwayColor(Color.Blue);
                                    switch (base._objBetOddsType)
                                    {
                                        case EnumCollection.eOddsType.HK:
                                            lite3.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite3.get_HomeOverOddsString()));
                                            lite3.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite3.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Euro:
                                            lite3.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite3.get_HomeOverOddsString()));
                                            lite3.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite3.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Indo:
                                            lite3.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite3.get_HomeOverOddsString()));
                                            lite3.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite3.get_AwayUnderOddsString()));
                                            break;
                                    }
                                    list2.Add(lite3);
                                }
                                if ((match.lx2[1].ToString() != string.Empty) & flag3)
                                {
                                    MatchLite lite4 = lite.CloneObject();
                                    lite4.set_BetType(EnumCollection.eBetType.lX2);
                                    lite4.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                    lite4.set_OddsType(EnumCollection.eOddsType.Euro);
                                    lite4.set_Handicap("0.0");
                                    lite4.set_HomeOverOddsString(match.lx2[1].ToString().Trim());
                                    lite4.set_AwayUnderOddsString(match.lx2[3].ToString().Trim());
                                    lite4.set_DrawOddsString(match.lx2[5].ToString().Trim());
                                    lite4.set_UniqueID(lite4.get_MatchID() + Conversion.Val(lite4.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite4.get_BetCoverage().ToString())));
                                    lite4.set_HomeColor(Color.Blue);
                                    lite4.set_AwayColor(Color.Blue);
                                    list2.Add(lite4);
                                }
                                if (flag4)
                                {
                                    if (match.ah1st[1].ToString() != string.Empty)
                                    {
                                        MatchLite lite5 = lite.CloneObject();
                                        lite5.set_BetType(EnumCollection.eBetType.HDP);
                                        lite5.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                        lite5.set_OddsType(EnumCollection.eOddsType.Malay);
                                        lite5.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ah1st[1].ToString().Replace("/", "-").Trim()));
                                        lite5.set_HomeOverOddsString(match.ah1st[3].ToString().Trim());
                                        lite5.set_AwayUnderOddsString(match.ah1st[5].ToString().Trim());
                                        lite5.set_UniqueID(lite5.get_MatchID() + Conversion.Val(lite5.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite5.get_BetCoverage().ToString())));
                                        lite5.UpdateCommission();
                                        if (lite5.get_Handicap() == "0.0")
                                        {
                                            lite5.set_HomeColor(Color.Blue);
                                            lite5.set_AwayColor(Color.Blue);
                                        }
                                        else
                                        {
                                            lite5.set_HomeColor(blue);
                                            lite5.set_AwayColor(red);
                                        }
                                        switch (base._objBetOddsType)
                                        {
                                            case EnumCollection.eOddsType.HK:
                                                lite5.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite5.get_HomeOverOddsString()));
                                                lite5.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite5.get_AwayUnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Euro:
                                                lite5.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite5.get_HomeOverOddsString()));
                                                lite5.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite5.get_AwayUnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Indo:
                                                lite5.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite5.get_HomeOverOddsString()));
                                                lite5.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite5.get_AwayUnderOddsString()));
                                                break;
                                        }
                                        list2.Add(lite5);
                                    }
                                    if (match.ou1st[1].ToString() != string.Empty)
                                    {
                                        MatchLite lite6 = lite.CloneObject();
                                        lite6.set_BetType(EnumCollection.eBetType.OU);
                                        lite6.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                        lite6.set_OddsType(EnumCollection.eOddsType.Malay);
                                        lite6.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ou1st[1].ToString().Replace("/", "-").Trim()));
                                        lite6.set_HomeOverOddsString(match.ou1st[3].ToString().Trim());
                                        lite6.set_AwayUnderOddsString(match.ou1st[5].ToString().Trim());
                                        lite6.set_UniqueID(lite6.get_MatchID() + Conversion.Val(lite6.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite6.get_BetCoverage().ToString())));
                                        lite6.UpdateCommission();
                                        lite6.set_HomeColor(Color.Blue);
                                        lite6.set_AwayColor(Color.Blue);
                                        switch (base._objBetOddsType)
                                        {
                                            case EnumCollection.eOddsType.HK:
                                                lite6.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite6.get_HomeOverOddsString()));
                                                lite6.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite6.get_AwayUnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Euro:
                                                lite6.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite6.get_HomeOverOddsString()));
                                                lite6.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite6.get_AwayUnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Indo:
                                                lite6.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite6.get_HomeOverOddsString()));
                                                lite6.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite6.get_AwayUnderOddsString()));
                                                break;
                                        }
                                        list2.Add(lite6);
                                    }
                                    if ((match.lx21st[1].ToString() != string.Empty) & flag3)
                                    {
                                        MatchLite lite7 = lite.CloneObject();
                                        lite7.set_BetType(EnumCollection.eBetType.lX2);
                                        lite7.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                        lite7.set_OddsType(EnumCollection.eOddsType.Euro);
                                        lite7.set_Handicap("0.0");
                                        lite7.set_HomeOverOddsString(match.lx21st[1].ToString().Trim());
                                        lite7.set_AwayUnderOddsString(match.lx21st[3].ToString().Trim());
                                        lite7.set_DrawOddsString(match.lx21st[5].ToString().Trim());
                                        lite7.set_UniqueID(lite7.get_MatchID() + Conversion.Val(lite7.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite7.get_BetCoverage().ToString())));
                                        lite7.set_HomeColor(Color.Blue);
                                        lite7.set_AwayColor(Color.Blue);
                                        list2.Add(lite7);
                                    }
                                }
                            }
                            if (match.child == null)
                            {
                                continue;
                            }
                            MatchLite lite8 = new MatchLite();
                            JsonMatch child = match.child;
                            lite8.set_Company(lite.get_Company());
                            lite8.set_Type(lite.get_Type());
                            lite8.set_SportType(lite.get_SportType());
                            lite8.set_League(lite.get_League());
                            lite8.set_HomeName(lite.get_HomeName());
                            lite8.set_AwayName(lite.get_AwayName());
                            lite8.set_HomeScore(lite.get_HomeScore());
                            lite8.set_AwayScore(lite.get_AwayScore());
                            lite8.set_GameType(lite.get_GameType());
                            lite8.set_RunningStatus(lite.get_RunningStatus());
                            lite8.set_RunningMinutes(lite.get_RunningMinutes());
                            lite8.set_MatchTime(lite.get_MatchTime());
                            lite8.set_MatchID(Conversions.ToString(child.info[0]));
                            if (child.ah[1].ToString() != string.Empty)
                            {
                                MatchLite lite9 = lite8.CloneObject();
                                lite9.set_BetType(EnumCollection.eBetType.HDP);
                                lite9.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                lite9.set_OddsType(EnumCollection.eOddsType.Malay);
                                lite9.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ah[1].ToString().Replace("/", "-").Trim()));
                                lite9.set_HomeOverOddsString(child.ah[3].ToString().Trim());
                                lite9.set_AwayUnderOddsString(child.ah[5].ToString().Trim());
                                lite9.set_UniqueID(lite9.get_MatchID() + Conversion.Val(lite9.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite9.get_BetCoverage().ToString())));
                                lite9.UpdateCommission();
                                if (lite9.get_Handicap() == "0.0")
                                {
                                    lite9.set_HomeColor(Color.Blue);
                                    lite9.set_AwayColor(Color.Blue);
                                }
                                else
                                {
                                    lite9.set_HomeColor(blue);
                                    lite9.set_AwayColor(red);
                                }
                                switch (base._objBetOddsType)
                                {
                                    case EnumCollection.eOddsType.HK:
                                        lite9.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite9.get_HomeOverOddsString()));
                                        lite9.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite9.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Euro:
                                        lite9.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite9.get_HomeOverOddsString()));
                                        lite9.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite9.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Indo:
                                        lite9.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite9.get_HomeOverOddsString()));
                                        lite9.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite9.get_AwayUnderOddsString()));
                                        break;
                                }
                                list2.Add(lite9);
                            }
                            if (child.ou[1].ToString() != string.Empty)
                            {
                                MatchLite lite10 = lite8.CloneObject();
                                lite10.set_BetType(EnumCollection.eBetType.OU);
                                lite10.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                lite10.set_OddsType(EnumCollection.eOddsType.Malay);
                                lite10.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ou[1].ToString().Replace("/", "-").Trim()));
                                lite10.set_HomeOverOddsString(child.ou[3].ToString().Trim());
                                lite10.set_AwayUnderOddsString(child.ou[5].ToString().Trim());
                                lite10.set_UniqueID(lite10.get_MatchID() + Conversion.Val(lite10.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite10.get_BetCoverage().ToString())));
                                lite10.UpdateCommission();
                                lite10.set_HomeColor(Color.Blue);
                                lite10.set_AwayColor(Color.Blue);
                                switch (base._objBetOddsType)
                                {
                                    case EnumCollection.eOddsType.HK:
                                        lite10.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite10.get_HomeOverOddsString()));
                                        lite10.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite10.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Euro:
                                        lite10.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite10.get_HomeOverOddsString()));
                                        lite10.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite10.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Indo:
                                        lite10.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite10.get_HomeOverOddsString()));
                                        lite10.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite10.get_AwayUnderOddsString()));
                                        break;
                                }
                                list2.Add(lite10);
                            }
                            if (!flag4)
                            {
                                continue;
                            }
                            if (child.ah1st[1].ToString() != string.Empty)
                            {
                                MatchLite lite11 = lite8.CloneObject();
                                lite11.set_BetType(EnumCollection.eBetType.HDP);
                                lite11.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                lite11.set_OddsType(EnumCollection.eOddsType.Malay);
                                lite11.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ah1st[1].ToString().Replace("/", "-").Trim()));
                                lite11.set_HomeOverOddsString(child.ah1st[3].ToString().Trim());
                                lite11.set_AwayUnderOddsString(child.ah1st[5].ToString().Trim());
                                lite11.set_UniqueID(lite11.get_MatchID() + Conversion.Val(lite11.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite11.get_BetCoverage().ToString())));
                                lite11.UpdateCommission();
                                if (lite11.get_Handicap() == "0.0")
                                {
                                    lite11.set_HomeColor(Color.Blue);
                                    lite11.set_AwayColor(Color.Blue);
                                }
                                else
                                {
                                    lite11.set_HomeColor(blue);
                                    lite11.set_AwayColor(red);
                                }
                                switch (base._objBetOddsType)
                                {
                                    case EnumCollection.eOddsType.HK:
                                        lite11.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite11.get_HomeOverOddsString()));
                                        lite11.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite11.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Euro:
                                        lite11.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite11.get_HomeOverOddsString()));
                                        lite11.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite11.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Indo:
                                        lite11.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite11.get_HomeOverOddsString()));
                                        lite11.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite11.get_AwayUnderOddsString()));
                                        break;
                                }
                                list2.Add(lite11);
                            }
                            if (child.ou1st[1].ToString() == string.Empty)
                            {
                                continue;
                            }
                            MatchLite item = lite8.CloneObject();
                            item.set_BetType(EnumCollection.eBetType.OU);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                            item.set_OddsType(EnumCollection.eOddsType.Malay);
                            item.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ou1st[1].ToString().Replace("/", "-").Trim()));
                            item.set_HomeOverOddsString(child.ou1st[3].ToString().Trim());
                            item.set_AwayUnderOddsString(child.ou1st[5].ToString().Trim());
                            item.set_UniqueID(item.get_MatchID() + Conversion.Val(item.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(item.get_BetCoverage().ToString())));
                            item.UpdateCommission();
                            item.set_HomeColor(Color.Blue);
                            item.set_AwayColor(Color.Blue);
                            switch (base._objBetOddsType)
                            {
                                case EnumCollection.eOddsType.HK:
                                    item.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_HomeOverOddsString()));
                                    item.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_AwayUnderOddsString()));
                                    break;

                                case EnumCollection.eOddsType.Euro:
                                    item.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_HomeOverOddsString()));
                                    item.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_AwayUnderOddsString()));
                                    break;

                                case EnumCollection.eOddsType.Indo:
                                    item.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_HomeOverOddsString()));
                                    item.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_AwayUnderOddsString()));
                                    break;
                            }
                            list2.Add(item);
                            continue;
                        }
                        if ((match.info.Count == 0x13) & flag5)
                        {
                            lite.set_League(match.info[5].ToString().Trim());
                            lite.set_HomeName(match.info[9].ToString().Trim());
                            lite.set_AwayName(match.info[11].ToString().Trim());
                            lite.set_GameType(EnumCollection.eGameType.Running);
                            lite.set_HomeScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(match.info[13]))));
                            lite.set_AwayScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(match.info[14]))));
                            if (match.info[1].ToString() == "ht")
                            {
                                lite.set_RunningMinutes(0x2d);
                                lite.set_RunningStatus(EnumCollection.eRunningStatus.HT);
                            }
                            else
                            {
                                if (match.info[1].ToString().Length == 1)
                                {
                                    lite.set_RunningMinutes((int) Math.Round(Conversion.Val("0" + match.info[1].ToString())));
                                }
                                else
                                {
                                    lite.set_RunningMinutes((int) Math.Round(Conversion.Val(match.info[1].ToString())));
                                }
                                lite.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            }
                            list3 = CommonFunction.SeperateStringBySymbol(match.info[7].ToString().Trim(), " ");
                            if ((list3.Count == 2) && (match.info[8].ToString().Trim().Length == 5))
                            {
                                time4 = DateTime.Now;
                                now = new DateTime(time4.Year, CommonFunction.ConvertMonthName3CharToNumber(list3[1].ToString().Trim()), (int) Math.Round(Conversion.Val(list3[0].ToString().Trim())), (int) Math.Round(Conversion.Val(match.info[8].ToString().Substring(0, 2))), (int) Math.Round(Conversion.Val(match.info[8].ToString().Substring(3, 2))), 0);
                                lite.set_MatchTime(now);
                            }
                            if (match.info[12].ToString() == "1")
                            {
                                blue = Color.Red;
                                red = Color.Blue;
                            }
                            else
                            {
                                blue = Color.Blue;
                                red = Color.Red;
                            }
                            if (match.rb[1].ToString() != string.Empty)
                            {
                                MatchLite lite13 = lite.CloneObject();
                                lite13.set_BetType(EnumCollection.eBetType.HDP);
                                lite13.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                lite13.set_OddsType(EnumCollection.eOddsType.Malay);
                                lite13.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rb[1].ToString().Replace("/", "-").Trim()));
                                lite13.set_HomeOverOddsString(match.rb[3].ToString().Trim());
                                lite13.set_AwayUnderOddsString(match.rb[5].ToString().Trim());
                                lite13.set_UniqueID(lite13.get_MatchID() + Conversion.Val(lite13.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite13.get_BetCoverage().ToString())));
                                lite13.UpdateCommission();
                                if (lite13.get_Handicap() == "0.0")
                                {
                                    lite13.set_HomeColor(Color.Blue);
                                    lite13.set_AwayColor(Color.Blue);
                                }
                                else
                                {
                                    lite13.set_HomeColor(blue);
                                    lite13.set_AwayColor(red);
                                }
                                switch (base._objBetOddsType)
                                {
                                    case EnumCollection.eOddsType.HK:
                                        lite13.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite13.get_HomeOverOddsString()));
                                        lite13.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite13.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Euro:
                                        lite13.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite13.get_HomeOverOddsString()));
                                        lite13.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite13.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Indo:
                                        lite13.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite13.get_HomeOverOddsString()));
                                        lite13.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite13.get_AwayUnderOddsString()));
                                        break;
                                }
                                list2.Add(lite13);
                            }
                            if (match.rbou[1].ToString() != string.Empty)
                            {
                                MatchLite lite14 = lite.CloneObject();
                                lite14.set_BetType(EnumCollection.eBetType.OU);
                                lite14.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                lite14.set_OddsType(EnumCollection.eOddsType.Malay);
                                lite14.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rbou[1].ToString().Replace("/", "-").Trim()));
                                lite14.set_HomeOverOddsString(match.rbou[3].ToString().Trim());
                                lite14.set_AwayUnderOddsString(match.rbou[5].ToString().Trim());
                                lite14.set_UniqueID(lite14.get_MatchID() + Conversion.Val(lite14.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite14.get_BetCoverage().ToString())));
                                lite14.UpdateCommission();
                                lite14.set_HomeColor(Color.Blue);
                                lite14.set_AwayColor(Color.Blue);
                                switch (base._objBetOddsType)
                                {
                                    case EnumCollection.eOddsType.HK:
                                        lite14.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite14.get_HomeOverOddsString()));
                                        lite14.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite14.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Euro:
                                        lite14.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite14.get_HomeOverOddsString()));
                                        lite14.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite14.get_AwayUnderOddsString()));
                                        break;

                                    case EnumCollection.eOddsType.Indo:
                                        lite14.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite14.get_HomeOverOddsString()));
                                        lite14.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite14.get_AwayUnderOddsString()));
                                        break;
                                }
                                list2.Add(lite14);
                            }
                            if ((match.lx2rb[1].ToString() != string.Empty) & flag3)
                            {
                                MatchLite lite15 = lite.CloneObject();
                                lite15.set_BetType(EnumCollection.eBetType.lX2);
                                lite15.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                lite15.set_OddsType(EnumCollection.eOddsType.Euro);
                                lite15.set_Handicap("0.0");
                                lite15.set_HomeOverOddsString(match.lx2rb[1].ToString().Trim());
                                lite15.set_AwayUnderOddsString(match.lx2rb[3].ToString().Trim());
                                lite15.set_DrawOddsString(match.lx2rb[5].ToString().Trim());
                                lite15.set_UniqueID(lite15.get_MatchID() + Conversion.Val(lite15.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite15.get_BetCoverage().ToString())));
                                lite15.set_HomeColor(Color.Blue);
                                lite15.set_AwayColor(Color.Blue);
                                list2.Add(lite15);
                            }
                            if (flag4)
                            {
                                if (match.rb1st[1].ToString() != string.Empty)
                                {
                                    MatchLite lite16 = lite.CloneObject();
                                    lite16.set_BetType(EnumCollection.eBetType.HDP);
                                    lite16.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                    lite16.set_OddsType(EnumCollection.eOddsType.Malay);
                                    lite16.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rb1st[1].ToString().Replace("/", "-").Trim()));
                                    lite16.set_HomeOverOddsString(match.rb1st[3].ToString().Trim());
                                    lite16.set_AwayUnderOddsString(match.rb1st[5].ToString().Trim());
                                    lite16.set_UniqueID(lite16.get_MatchID() + Conversion.Val(lite16.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite16.get_BetCoverage().ToString())));
                                    lite16.UpdateCommission();
                                    if (lite16.get_Handicap() == "0.0")
                                    {
                                        lite16.set_HomeColor(Color.Blue);
                                        lite16.set_AwayColor(Color.Blue);
                                    }
                                    else
                                    {
                                        lite16.set_HomeColor(blue);
                                        lite16.set_AwayColor(red);
                                    }
                                    switch (base._objBetOddsType)
                                    {
                                        case EnumCollection.eOddsType.HK:
                                            lite16.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite16.get_HomeOverOddsString()));
                                            lite16.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite16.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Euro:
                                            lite16.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite16.get_HomeOverOddsString()));
                                            lite16.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite16.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Indo:
                                            lite16.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite16.get_HomeOverOddsString()));
                                            lite16.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite16.get_AwayUnderOddsString()));
                                            break;
                                    }
                                    list2.Add(lite16);
                                }
                                if (match.rbou1st[1].ToString() != string.Empty)
                                {
                                    MatchLite lite17 = lite.CloneObject();
                                    lite17.set_BetType(EnumCollection.eBetType.OU);
                                    lite17.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                    lite17.set_OddsType(EnumCollection.eOddsType.Malay);
                                    lite17.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rbou1st[1].ToString().Replace("/", "-").Trim()));
                                    lite17.set_HomeOverOddsString(match.rbou1st[3].ToString().Trim());
                                    lite17.set_AwayUnderOddsString(match.rbou1st[5].ToString().Trim());
                                    lite17.set_UniqueID(lite17.get_MatchID() + Conversion.Val(lite17.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite17.get_BetCoverage().ToString())));
                                    lite17.UpdateCommission();
                                    lite17.set_HomeColor(Color.Blue);
                                    lite17.set_AwayColor(Color.Blue);
                                    switch (base._objBetOddsType)
                                    {
                                        case EnumCollection.eOddsType.HK:
                                            lite17.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite17.get_HomeOverOddsString()));
                                            lite17.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite17.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Euro:
                                            lite17.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite17.get_HomeOverOddsString()));
                                            lite17.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite17.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Indo:
                                            lite17.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite17.get_HomeOverOddsString()));
                                            lite17.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite17.get_AwayUnderOddsString()));
                                            break;
                                    }
                                    list2.Add(lite17);
                                }
                                if ((match.lsthf1x2rb[1].ToString() != string.Empty) & flag3)
                                {
                                    MatchLite lite18 = lite.CloneObject();
                                    lite18.set_BetType(EnumCollection.eBetType.lX2);
                                    lite18.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                    lite18.set_OddsType(EnumCollection.eOddsType.Euro);
                                    lite18.set_Handicap("0.0");
                                    lite18.set_HomeOverOddsString(match.lsthf1x2rb[1].ToString().Trim());
                                    lite18.set_AwayUnderOddsString(match.lsthf1x2rb[3].ToString().Trim());
                                    lite18.set_DrawOddsString(match.lsthf1x2rb[5].ToString().Trim());
                                    lite18.set_UniqueID(lite18.get_MatchID() + Conversion.Val(lite18.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite18.get_BetCoverage().ToString())));
                                    lite18.set_HomeColor(Color.Blue);
                                    lite18.set_AwayColor(Color.Blue);
                                    list2.Add(lite18);
                                }
                            }
                            if (match.child != null)
                            {
                                MatchLite lite19 = new MatchLite();
                                JsonMatch match3 = match.child;
                                lite19.set_Company(lite.get_Company());
                                lite19.set_Type(lite.get_Type());
                                lite19.set_SportType(lite.get_SportType());
                                lite19.set_League(lite.get_League());
                                lite19.set_HomeName(lite.get_HomeName());
                                lite19.set_AwayName(lite.get_AwayName());
                                lite19.set_HomeScore(lite.get_HomeScore());
                                lite19.set_AwayScore(lite.get_AwayScore());
                                lite19.set_GameType(lite.get_GameType());
                                lite19.set_RunningStatus(lite.get_RunningStatus());
                                lite19.set_RunningMinutes(lite.get_RunningMinutes());
                                lite19.set_MatchTime(lite.get_MatchTime());
                                lite19.set_MatchID(Conversions.ToString(match3.info[0]));
                                if (match3.rb[1].ToString() != string.Empty)
                                {
                                    MatchLite lite20 = lite19.CloneObject();
                                    lite20.set_BetType(EnumCollection.eBetType.HDP);
                                    lite20.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                    lite20.set_OddsType(EnumCollection.eOddsType.Malay);
                                    lite20.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rb[1].ToString().Replace("/", "-").Trim()));
                                    lite20.set_HomeOverOddsString(match3.rb[3].ToString().Trim());
                                    lite20.set_AwayUnderOddsString(match3.rb[5].ToString().Trim());
                                    lite20.set_UniqueID(lite20.get_MatchID() + Conversion.Val(lite20.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite20.get_BetCoverage().ToString())));
                                    lite20.UpdateCommission();
                                    if (lite20.get_Handicap() == "0.0")
                                    {
                                        lite20.set_HomeColor(Color.Blue);
                                        lite20.set_AwayColor(Color.Blue);
                                    }
                                    else
                                    {
                                        lite20.set_HomeColor(blue);
                                        lite20.set_AwayColor(red);
                                    }
                                    switch (base._objBetOddsType)
                                    {
                                        case EnumCollection.eOddsType.HK:
                                            lite20.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite20.get_HomeOverOddsString()));
                                            lite20.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite20.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Euro:
                                            lite20.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite20.get_HomeOverOddsString()));
                                            lite20.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite20.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Indo:
                                            lite20.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite20.get_HomeOverOddsString()));
                                            lite20.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite20.get_AwayUnderOddsString()));
                                            break;
                                    }
                                    list2.Add(lite20);
                                }
                                if (match3.rbou[1].ToString() != string.Empty)
                                {
                                    MatchLite lite21 = lite19.CloneObject();
                                    lite21.set_BetType(EnumCollection.eBetType.OU);
                                    lite21.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                    lite21.set_OddsType(EnumCollection.eOddsType.Malay);
                                    lite21.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rbou[1].ToString().Replace("/", "-").Trim()));
                                    lite21.set_HomeOverOddsString(match3.rbou[3].ToString().Trim());
                                    lite21.set_AwayUnderOddsString(match3.rbou[5].ToString().Trim());
                                    lite21.set_UniqueID(lite21.get_MatchID() + Conversion.Val(lite21.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite21.get_BetCoverage().ToString())));
                                    lite21.UpdateCommission();
                                    lite21.set_HomeColor(Color.Blue);
                                    lite21.set_AwayColor(Color.Blue);
                                    switch (base._objBetOddsType)
                                    {
                                        case EnumCollection.eOddsType.HK:
                                            lite21.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite21.get_HomeOverOddsString()));
                                            lite21.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite21.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Euro:
                                            lite21.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite21.get_HomeOverOddsString()));
                                            lite21.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite21.get_AwayUnderOddsString()));
                                            break;

                                        case EnumCollection.eOddsType.Indo:
                                            lite21.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite21.get_HomeOverOddsString()));
                                            lite21.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite21.get_AwayUnderOddsString()));
                                            break;
                                    }
                                    list2.Add(lite21);
                                }
                                if (flag4)
                                {
                                    if (match3.rb1st[1].ToString() != string.Empty)
                                    {
                                        MatchLite lite22 = lite19.CloneObject();
                                        lite22.set_BetType(EnumCollection.eBetType.HDP);
                                        lite22.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                        lite22.set_OddsType(EnumCollection.eOddsType.Malay);
                                        lite22.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rb1st[1].ToString().Replace("/", "-").Trim()));
                                        lite22.set_HomeOverOddsString(match3.rb1st[3].ToString().Trim());
                                        lite22.set_AwayUnderOddsString(match3.rb1st[5].ToString().Trim());
                                        lite22.set_UniqueID(lite22.get_MatchID() + Conversion.Val(lite22.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite22.get_BetCoverage().ToString())));
                                        lite22.UpdateCommission();
                                        if (lite22.get_Handicap() == "0.0")
                                        {
                                            lite22.set_HomeColor(Color.Blue);
                                            lite22.set_AwayColor(Color.Blue);
                                        }
                                        else
                                        {
                                            lite22.set_HomeColor(blue);
                                            lite22.set_AwayColor(red);
                                        }
                                        switch (base._objBetOddsType)
                                        {
                                            case EnumCollection.eOddsType.HK:
                                                lite22.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite22.get_HomeOverOddsString()));
                                                lite22.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite22.get_AwayUnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Euro:
                                                lite22.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite22.get_HomeOverOddsString()));
                                                lite22.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite22.get_AwayUnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Indo:
                                                lite22.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite22.get_HomeOverOddsString()));
                                                lite22.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite22.get_AwayUnderOddsString()));
                                                break;
                                        }
                                        list2.Add(lite22);
                                    }
                                    if (match3.rbou1st[1].ToString() != string.Empty)
                                    {
                                        MatchLite lite23 = lite19.CloneObject();
                                        lite23.set_BetType(EnumCollection.eBetType.OU);
                                        lite23.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                        lite23.set_OddsType(EnumCollection.eOddsType.Malay);
                                        lite23.set_Handicap(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rbou1st[1].ToString().Replace("/", "-").Trim()));
                                        lite23.set_HomeOverOddsString(match3.rbou1st[3].ToString().Trim());
                                        lite23.set_AwayUnderOddsString(match3.rbou1st[5].ToString().Trim());
                                        lite23.set_UniqueID(lite23.get_MatchID() + Conversion.Val(lite23.get_BetType()).ToString() + Conversions.ToString(Conversion.Val(lite23.get_BetCoverage().ToString())));
                                        lite23.UpdateCommission();
                                        lite23.set_HomeColor(Color.Blue);
                                        lite23.set_AwayColor(Color.Blue);
                                        switch (base._objBetOddsType)
                                        {
                                            case EnumCollection.eOddsType.HK:
                                                lite23.set_HomeOverOddsString(SportBookFunction.ConvertHKToMalayOdds(lite23.get_HomeOverOddsString()));
                                                lite23.set_AwayUnderOddsString(SportBookFunction.ConvertHKToMalayOdds(lite23.get_AwayUnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Euro:
                                                lite23.set_HomeOverOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite23.get_HomeOverOddsString()));
                                                lite23.set_AwayUnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(lite23.get_AwayUnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Indo:
                                                lite23.set_HomeOverOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite23.get_HomeOverOddsString()));
                                                lite23.set_AwayUnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(lite23.get_AwayUnderOddsString()));
                                                break;
                                        }
                                        list2.Add(lite23);
                                    }
                                }
                            }
                        }
                    }
                }
                finally
                {
                    enumerator.Dispose();
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateFullOddsFromText: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GenerateFullOddsFromText: " + exception.Message);
                ProjectData.ClearProjectError();
            }
            return list2;
        }