예제 #1
0
파일: SBOBet.cs 프로젝트: yjtang/AutoBws
        public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string format = "";
                string str5 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                format = base._strRootURL + "/webroot/restricted/plain/ticket.aspx?{0}&loginname=" + this._strLoginName;
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_FT_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_FT_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_1:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_X:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_2:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_Half_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_Half_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;
                    case EnumCollection.eBetTarget.Half_1:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_X:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_2:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                }
                string url = string.Format(format, str5);
                new3 = new4;
                new2 = new1.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                request.Timeout = 0x7530;
                request.Method = "GET";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.ContentType = "application/x-www-form-urlencoded";
                //request.KeepAlive = true;

                this.WriteProgramLogger("POST: " + url);
                base._objBetListLogger.write("POST: " + str5);
                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true);
                this.allDone.WaitOne();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null);
                this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4);
                ProjectData.ClearProjectError();
            }
        }
예제 #2
0
파일: SB188.cs 프로젝트: yjtang/AutoBws
        public List<MatchNew> GenerateFullOddsFromText(string text1, bool flag4, bool flag2, bool flag3, bool flag1)
        {
            List<MatchNew> list2 = new List<MatchNew>();
            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;
                        MatchNew item = new MatchNew();
                        JsonMatch match = current.Value;
                        item.set_FT_ID(current.Key.ToString());
                        item.set_FT_ID(item.get_FT_ID().Replace("m", ""));
                        item.set_Half_ID(item.get_FT_ID());
                        item.set_UniqueID(item.get_FT_ID());
                        item.set_Type(EnumCollection.eMatchType.Match);
                        item.set_Website("SB188");
                        item.set_GlobalLastUpdate(DateTime.Now);
                        if (match.info.Count == 15)
                        {
                            item.set_League(match.info[5].ToString().Trim());
                            item.set_HomeName(match.info[8].ToString().Trim());
                            item.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);
                                item.set_MatchTime(time4);
                            }
                            if (match.ah[1].ToString() != string.Empty)
                            {
                                item.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ah[1].ToString().Replace("/", "-").Trim()));
                                item.set_FT_HomeOddsString(match.ah[3].ToString().Trim());
                                item.set_FT_AwayOddsString(match.ah[5].ToString().Trim());
                            }
                            if (match.ou[1].ToString() != string.Empty)
                            {
                                item.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ou[1].ToString().Replace("/", "-").Trim()));
                                item.set_FT_OverOddsString(match.ou[3].ToString().Trim());
                                item.set_FT_UnderOddsString(match.ou[5].ToString().Trim());
                            }
                            if (flag1)
                            {
                                if (match.ah1st[1].ToString() != string.Empty)
                                {
                                    item.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ah1st[1].ToString().Replace("/", "-").Trim()));
                                    item.set_Half_HomeOddsString(match.ah1st[3].ToString().Trim());
                                    item.set_Half_AwayOddsString(match.ah1st[5].ToString().Trim());
                                }
                                if (match.ou1st[1].ToString() != string.Empty)
                                {
                                    item.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ou1st[1].ToString().Replace("/", "-").Trim()));
                                    item.set_Half_OverOddsString(match.ou1st[3].ToString().Trim());
                                    item.set_Half_UnderOddsString(match.ou1st[5].ToString().Trim());
                                }
                            }
                            if (match.info[11].ToString() == "1")
                            {
                                blue = Color.Red;
                                red = Color.Blue;
                            }
                            else
                            {
                                blue = Color.Blue;
                                red = Color.Red;
                            }
                            if (item.get_FTHDP() == "0.0")
                            {
                                item.set_FTHomeColor(Color.Blue);
                                item.set_FTAwayColor(Color.Blue);
                            }
                            else
                            {
                                item.set_FTHomeColor(blue);
                                item.set_FTAwayColor(red);
                            }
                            if (item.get_HalfHDP() == "0.0")
                            {
                                item.set_HalfHomeColor(Color.Blue);
                                item.set_HalfAwayColor(Color.Blue);
                            }
                            else
                            {
                                item.set_HalfHomeColor(blue);
                                item.set_HalfAwayColor(red);
                            }
                            if (SpiderFunction.IsEarlyMarket(time, item.get_MatchTime()))
                            {
                                item.set_GameType(EnumCollection.eGameType.Early);
                            }
                            else
                            {
                                item.set_GameType(EnumCollection.eGameType.Today);
                            }
                            if (((item.get_GameType() == EnumCollection.eGameType.Today) & flag2) | ((item.get_GameType() == EnumCollection.eGameType.Early) & flag3))
                            {
                                switch (base._objBetOddsType)
                                {
                                    case EnumCollection.eOddsType.HK:
                                        item.set_FT_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_AwayOdds()));
                                        item.set_FT_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_HomeOdds()));
                                        item.set_FT_OverOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_OverOdds()));
                                        item.set_FT_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_UnderOdds()));
                                        item.set_Half_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_AwayOdds()));
                                        item.set_Half_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_HomeOdds()));
                                        item.set_Half_OverOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_OverOdds()));
                                        item.set_Half_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_UnderOdds()));
                                        break;

                                    case EnumCollection.eOddsType.Euro:
                                        item.set_FT_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_AwayOdds()));
                                        item.set_FT_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_HomeOdds()));
                                        item.set_FT_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_OverOdds()));
                                        item.set_FT_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_UnderOdds()));
                                        item.set_Half_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_AwayOdds()));
                                        item.set_Half_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_HomeOdds()));
                                        item.set_Half_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_OverOdds()));
                                        item.set_Half_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_UnderOdds()));
                                        break;

                                    case EnumCollection.eOddsType.Indo:
                                        item.set_FT_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_AwayOdds()));
                                        item.set_FT_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_HomeOdds()));
                                        item.set_FT_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_OverOdds()));
                                        item.set_FT_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_UnderOdds()));
                                        item.set_Half_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_AwayOdds()));
                                        item.set_Half_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_HomeOdds()));
                                        item.set_Half_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_OverOdds()));
                                        item.set_Half_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_UnderOdds()));
                                        break;
                                }
                                list2.Add(item);
                            }
                            if (match.child == null)
                            {
                                continue;
                            }
                            MatchNew new3 = new MatchNew();
                            JsonMatch child = match.child;
                            new3.set_Website(item.get_Website());
                            new3.set_Type(item.get_Type());
                            new3.set_SportType(item.get_SportType());
                            new3.set_League(item.get_League());
                            new3.set_HomeName(item.get_HomeName());
                            new3.set_AwayName(item.get_AwayName());
                            new3.set_HomeScore(item.get_HomeScore());
                            new3.set_AwayScore(item.get_AwayScore());
                            new3.set_GameType(item.get_GameType());
                            new3.set_RunningStatus(item.get_RunningStatus());
                            new3.set_FTHomeColor(item.get_FTHomeColor());
                            new3.set_FTAwayColor(item.get_FTAwayColor());
                            new3.set_HalfHomeColor(item.get_HalfHomeColor());
                            new3.set_HalfAwayColor(item.get_HalfAwayColor());
                            new3.set_RunningMinutes(item.get_RunningMinutes());
                            new3.set_MatchTime(item.get_MatchTime());
                            new3.set_FT_ID(Conversions.ToString(child.info[0]));
                            new3.set_Half_ID(new3.get_FT_ID());
                            new3.set_UniqueID(new3.get_FT_ID());
                            if (child.ah[1].ToString() != string.Empty)
                            {
                                new3.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ah[1].ToString().Replace("/", "-").Trim()));
                                new3.set_FT_HomeOddsString(child.ah[3].ToString().Trim());
                                new3.set_FT_AwayOddsString(child.ah[5].ToString().Trim());
                            }
                            if (child.ou[1].ToString() != string.Empty)
                            {
                                new3.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ou[1].ToString().Replace("/", "-").Trim()));
                                new3.set_FT_OverOddsString(child.ou[3].ToString().Trim());
                                new3.set_FT_UnderOddsString(child.ou[5].ToString().Trim());
                            }
                            if (flag1)
                            {
                                if (child.ah1st[1].ToString() != string.Empty)
                                {
                                    new3.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ah1st[1].ToString().Replace("/", "-").Trim()));
                                    new3.set_Half_HomeOddsString(child.ah1st[3].ToString().Trim());
                                    new3.set_Half_AwayOddsString(child.ah1st[5].ToString().Trim());
                                }
                                if (child.ou1st[1].ToString() != string.Empty)
                                {
                                    new3.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ou1st[1].ToString().Replace("/", "-").Trim()));
                                    new3.set_Half_OverOddsString(child.ou1st[3].ToString().Trim());
                                    new3.set_Half_UnderOddsString(child.ou1st[5].ToString().Trim());
                                }
                                if (new3.get_FTHDP() == "0.0")
                                {
                                    new3.set_FTHomeColor(Color.Blue);
                                    new3.set_FTAwayColor(Color.Blue);
                                }
                                else
                                {
                                    new3.set_FTHomeColor(blue);
                                    new3.set_FTAwayColor(red);
                                }
                                if (new3.get_HalfHDP() == "0.0")
                                {
                                    new3.set_HalfHomeColor(Color.Blue);
                                    new3.set_HalfAwayColor(Color.Blue);
                                }
                                else
                                {
                                    new3.set_HalfHomeColor(blue);
                                    new3.set_HalfAwayColor(red);
                                }
                            }
                            if (!(((new3.get_GameType() == EnumCollection.eGameType.Today) & flag2) | ((new3.get_GameType() == EnumCollection.eGameType.Early) & flag3)))
                            {
                                continue;
                            }
                            switch (base._objBetOddsType)
                            {
                                case EnumCollection.eOddsType.HK:
                                    new3.set_FT_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_AwayOdds()));
                                    new3.set_FT_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_HomeOdds()));
                                    new3.set_FT_OverOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_OverOdds()));
                                    new3.set_FT_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_UnderOdds()));
                                    new3.set_Half_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_Half_AwayOdds()));
                                    new3.set_Half_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_Half_HomeOdds()));
                                    new3.set_Half_OverOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_Half_OverOdds()));
                                    new3.set_Half_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_Half_UnderOdds()));
                                    break;

                                case EnumCollection.eOddsType.Euro:
                                    new3.set_FT_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_AwayOdds()));
                                    new3.set_FT_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_HomeOdds()));
                                    new3.set_FT_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_OverOdds()));
                                    new3.set_FT_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_UnderOdds()));
                                    new3.set_Half_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_Half_AwayOdds()));
                                    new3.set_Half_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_Half_HomeOdds()));
                                    new3.set_Half_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_Half_OverOdds()));
                                    new3.set_Half_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_Half_UnderOdds()));
                                    break;

                                case EnumCollection.eOddsType.Indo:
                                    new3.set_FT_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_AwayOdds()));
                                    new3.set_FT_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_HomeOdds()));
                                    new3.set_FT_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_OverOdds()));
                                    new3.set_FT_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_UnderOdds()));
                                    new3.set_Half_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_Half_AwayOdds()));
                                    new3.set_Half_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_Half_HomeOdds()));
                                    new3.set_Half_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_Half_OverOdds()));
                                    new3.set_Half_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_Half_UnderOdds()));
                                    break;
                            }
                            list2.Add(new3);
                            continue;
                        }
                        if ((match.info.Count == 0x13) & flag4)
                        {
                            item.set_League(match.info[5].ToString().Trim());
                            item.set_HomeName(match.info[9].ToString().Trim());
                            item.set_AwayName(match.info[11].ToString().Trim());
                            item.set_GameType(EnumCollection.eGameType.Running);
                            item.set_HomeScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(match.info[13]))));
                            item.set_AwayScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(match.info[14]))));
                            if (match.info[1].ToString() == "ht")
                            {
                                item.set_RunningMinutes(0x2d);
                                item.set_RunningStatus(EnumCollection.eRunningStatus.HT);
                            }
                            else
                            {
                                if (match.info[1].ToString().Length == 1)
                                {
                                    item.set_RunningMinutes((int) Math.Round(Conversion.Val("0" + match.info[1].ToString())));
                                }
                                else
                                {
                                    item.set_RunningMinutes((int) Math.Round(Conversion.Val(match.info[1].ToString())));
                                }
                                item.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);
                                item.set_MatchTime(now);
                            }
                            if (match.rb[1].ToString() != string.Empty)
                            {
                                item.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rb[1].ToString().Replace("/", "-").Trim()));
                                item.set_FT_HomeOddsString(match.rb[3].ToString().Trim());
                                item.set_FT_AwayOddsString(match.rb[5].ToString().Trim());
                            }
                            if (match.rbou[1].ToString() != string.Empty)
                            {
                                item.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rbou[1].ToString().Replace("/", "-").Trim()));
                                item.set_FT_OverOddsString(match.rbou[3].ToString().Trim());
                                item.set_FT_UnderOddsString(match.rbou[5].ToString().Trim());
                            }
                            if (flag1)
                            {
                                if (match.rb1st[1].ToString() != string.Empty)
                                {
                                    item.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rb1st[1].ToString().Replace("/", "-").Trim()));
                                    item.set_Half_HomeOddsString(match.rb1st[3].ToString().Trim());
                                    item.set_Half_AwayOddsString(match.rb1st[5].ToString().Trim());
                                }
                                if (match.rbou1st[1].ToString() != string.Empty)
                                {
                                    item.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rbou1st[1].ToString().Replace("/", "-").Trim()));
                                    item.set_Half_OverOddsString(match.rbou1st[3].ToString().Trim());
                                    item.set_Half_UnderOddsString(match.rbou1st[5].ToString().Trim());
                                }
                            }
                            if (match.info[12].ToString() == "1")
                            {
                                blue = Color.Red;
                                red = Color.Blue;
                            }
                            else
                            {
                                blue = Color.Blue;
                                red = Color.Red;
                            }
                            if (item.get_FTHDP() == "0.0")
                            {
                                item.set_FTHomeColor(Color.Blue);
                                item.set_FTAwayColor(Color.Blue);
                            }
                            else
                            {
                                item.set_FTHomeColor(blue);
                                item.set_FTAwayColor(red);
                            }
                            if (item.get_HalfHDP() == "0.0")
                            {
                                item.set_HalfHomeColor(Color.Blue);
                                item.set_HalfAwayColor(Color.Blue);
                            }
                            else
                            {
                                item.set_HalfHomeColor(blue);
                                item.set_HalfAwayColor(red);
                            }
                            switch (base._objBetOddsType)
                            {
                                case EnumCollection.eOddsType.HK:
                                    item.set_FT_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_AwayOdds()));
                                    item.set_FT_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_HomeOdds()));
                                    item.set_FT_OverOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_OverOdds()));
                                    item.set_FT_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_UnderOdds()));
                                    item.set_Half_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_AwayOdds()));
                                    item.set_Half_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_HomeOdds()));
                                    item.set_Half_OverOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_OverOdds()));
                                    item.set_Half_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_UnderOdds()));
                                    break;

                                case EnumCollection.eOddsType.Euro:
                                    item.set_FT_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_AwayOdds()));
                                    item.set_FT_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_HomeOdds()));
                                    item.set_FT_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_OverOdds()));
                                    item.set_FT_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_UnderOdds()));
                                    item.set_Half_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_AwayOdds()));
                                    item.set_Half_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_HomeOdds()));
                                    item.set_Half_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_OverOdds()));
                                    item.set_Half_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_UnderOdds()));
                                    break;

                                case EnumCollection.eOddsType.Indo:
                                    item.set_FT_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_AwayOdds()));
                                    item.set_FT_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_HomeOdds()));
                                    item.set_FT_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_OverOdds()));
                                    item.set_FT_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_UnderOdds()));
                                    item.set_Half_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_AwayOdds()));
                                    item.set_Half_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_HomeOdds()));
                                    item.set_Half_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_OverOdds()));
                                    item.set_Half_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_UnderOdds()));
                                    break;
                            }
                            list2.Add(item);
                            if (match.child != null)
                            {
                                MatchNew new4 = new MatchNew();
                                JsonMatch match3 = match.child;
                                new4.set_Website(item.get_Website());
                                new4.set_Type(item.get_Type());
                                new4.set_SportType(item.get_SportType());
                                new4.set_League(item.get_League());
                                new4.set_HomeName(item.get_HomeName());
                                new4.set_AwayName(item.get_AwayName());
                                new4.set_HomeScore(item.get_HomeScore());
                                new4.set_AwayScore(item.get_AwayScore());
                                new4.set_GameType(item.get_GameType());
                                new4.set_RunningStatus(item.get_RunningStatus());
                                new4.set_FTHomeColor(item.get_FTHomeColor());
                                new4.set_FTAwayColor(item.get_FTAwayColor());
                                new4.set_HalfHomeColor(item.get_HalfHomeColor());
                                new4.set_HalfAwayColor(item.get_HalfAwayColor());
                                new4.set_RunningMinutes(item.get_RunningMinutes());
                                new4.set_MatchTime(item.get_MatchTime());
                                new4.set_FT_ID(Conversions.ToString(match3.info[0]));
                                new4.set_Half_ID(new4.get_FT_ID());
                                new4.set_UniqueID(new4.get_FT_ID());
                                if (match3.rb[1].ToString() != string.Empty)
                                {
                                    new4.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rb[1].ToString().Replace("/", "-").Trim()));
                                    new4.set_FT_HomeOddsString(match3.rb[3].ToString().Trim());
                                    new4.set_FT_AwayOddsString(match3.rb[5].ToString().Trim());
                                }
                                if (match3.rbou[1].ToString() != string.Empty)
                                {
                                    new4.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rbou[1].ToString().Replace("/", "-").Trim()));
                                    new4.set_FT_OverOddsString(match3.rbou[3].ToString().Trim());
                                    new4.set_FT_UnderOddsString(match3.rbou[5].ToString().Trim());
                                }
                                if (flag1)
                                {
                                    if (match3.rb1st[1].ToString() != string.Empty)
                                    {
                                        new4.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rb1st[1].ToString().Replace("/", "-").Trim()));
                                        new4.set_Half_HomeOddsString(match3.rb1st[3].ToString().Trim());
                                        new4.set_Half_AwayOddsString(match3.rb1st[5].ToString().Trim());
                                    }
                                    if (match3.rbou1st[1].ToString() != string.Empty)
                                    {
                                        new4.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rbou1st[1].ToString().Replace("/", "-").Trim()));
                                        new4.set_Half_OverOddsString(match3.rbou1st[3].ToString().Trim());
                                        new4.set_Half_UnderOddsString(match3.rbou1st[5].ToString().Trim());
                                    }
                                }
                                if (new4.get_FTHDP() == "0.0")
                                {
                                    new4.set_FTHomeColor(Color.Blue);
                                    new4.set_FTAwayColor(Color.Blue);
                                }
                                else
                                {
                                    new4.set_FTHomeColor(blue);
                                    new4.set_FTAwayColor(red);
                                }
                                if (new4.get_HalfHDP() == "0.0")
                                {
                                    new4.set_HalfHomeColor(Color.Blue);
                                    new4.set_HalfAwayColor(Color.Blue);
                                }
                                else
                                {
                                    new4.set_HalfHomeColor(blue);
                                    new4.set_HalfAwayColor(red);
                                }
                                switch (base._objBetOddsType)
                                {
                                    case EnumCollection.eOddsType.HK:
                                        new4.set_FT_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_AwayOdds()));
                                        new4.set_FT_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_HomeOdds()));
                                        new4.set_FT_OverOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_OverOdds()));
                                        new4.set_FT_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_UnderOdds()));
                                        new4.set_Half_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_Half_AwayOdds()));
                                        new4.set_Half_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_Half_HomeOdds()));
                                        new4.set_Half_OverOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_Half_OverOdds()));
                                        new4.set_Half_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_Half_UnderOdds()));
                                        break;

                                    case EnumCollection.eOddsType.Euro:
                                        new4.set_FT_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_AwayOdds()));
                                        new4.set_FT_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_HomeOdds()));
                                        new4.set_FT_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_OverOdds()));
                                        new4.set_FT_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_UnderOdds()));
                                        new4.set_Half_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_Half_AwayOdds()));
                                        new4.set_Half_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_Half_HomeOdds()));
                                        new4.set_Half_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_Half_OverOdds()));
                                        new4.set_Half_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_Half_UnderOdds()));
                                        break;

                                    case EnumCollection.eOddsType.Indo:
                                        new4.set_FT_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_AwayOdds()));
                                        new4.set_FT_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_HomeOdds()));
                                        new4.set_FT_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_OverOdds()));
                                        new4.set_FT_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_UnderOdds()));
                                        new4.set_Half_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_Half_AwayOdds()));
                                        new4.set_Half_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_Half_HomeOdds()));
                                        new4.set_Half_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_Half_OverOdds()));
                                        new4.set_Half_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_Half_UnderOdds()));
                                        break;
                                }
                                list2.Add(new4);
                            }
                        }
                    }
                }
                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;
        }