コード例 #1
0
        private void DownloadGame(GameInfo game)
        {
            string          str1 = this.RetrieveText(string.Format("http://live.aicai.com/xiyaou/odds!getOuzhi.htm?betId={0}&propId=0&start=0&size=9999", (object)game.GameId));
            List <OddsInfo> list = new List <OddsInfo>();
            object          obj1 = JsonConvert.DeserializeObject(str1);

            // ISSUE: reference to a compiler-generated field
            if (DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site5 == null)
            {
                // ISSUE: reference to a compiler-generated field
                DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site5 = CallSite <Func <CallSite, object, IEnumerable> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(IEnumerable), typeof(DownloadSinaHistoryBll)));
            }
            // ISSUE: reference to a compiler-generated field
            Func <CallSite, object, IEnumerable> func = DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site5.Target;
            // ISSUE: reference to a compiler-generated field
            CallSite <Func <CallSite, object, IEnumerable> > callSite = DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site5;

            // ISSUE: reference to a compiler-generated field
            if (DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site6 == null)
            {
                // ISSUE: reference to a compiler-generated field
                DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site6 = CallSite <Func <CallSite, object, object> > .Create(Binder.GetMember(CSharpBinderFlags.None, "Root", typeof(DownloadSinaHistoryBll), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[1]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj2 = DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site6.Target((CallSite)DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site6, obj1);

            foreach (object obj3 in func((CallSite)callSite, obj2))
            {
                // ISSUE: reference to a compiler-generated field
                if (DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site7 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site7 = CallSite <Func <CallSite, object, JProperty> > .Create(Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(JProperty), typeof(DownloadSinaHistoryBll)));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                JProperty jproperty = DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site7.Target((CallSite)DownloadSinaHistoryBll.\u003CDownloadGame\u003Eo__SiteContainer4.\u003C\u003Ep__Site7, obj3);
                if (!(jproperty.Name != "result"))
                {
                    string leagueId = string.Empty;
                    foreach (JProperty data1 in (IEnumerable <JToken>)jproperty.Value)
                    {
                        if (data1.Name == "matchTime")
                        {
                            game.GameTime = this.RetrieveUpdateTime(data1);
                        }
                        else if (data1.Name == "leagueId")
                        {
                            leagueId = data1.Value.ToString();
                        }
                        else if (data1.Name == "hostRank")
                        {
                            game.HostRank = data1.Value.ToString().Replace("\"", "");
                        }
                        else if (data1.Name == "awayRank")
                        {
                            game.GuestRank = data1.Value.ToString().Replace("\"", "");
                        }
                        else if (data1.Name == "hostHalfScore")
                        {
                            game.HalfScore = data1.Value.ToString();
                        }
                        else if (data1.Name == "hostScore")
                        {
                            game.FinalScore = data1.Value.ToString();
                        }
                        else if (data1.Name == "awayHalfScore")
                        {
                            GameInfo gameInfo = game;
                            string   str2     = gameInfo.HalfScore + "-" + data1.Value.ToString();
                            gameInfo.HalfScore = str2;
                        }
                        else if (data1.Name == "awayScore")
                        {
                            GameInfo gameInfo = game;
                            string   str2     = gameInfo.FinalScore + "-" + data1.Value.ToString();
                            gameInfo.FinalScore = str2;
                        }
                        if (!(data1.Name != "europOddsList"))
                        {
                            foreach (JToken jtoken in (IEnumerable <JToken>)data1.Value)
                            {
                                OddsInfo oddsInfo1 = new OddsInfo();
                                OddsInfo oddsInfo2 = new OddsInfo();
                                oddsInfo1.GameId = game.GameId;
                                oddsInfo2.GameId = game.GameId;
                                foreach (JProperty data2 in (IEnumerable <JToken>)jtoken)
                                {
                                    if (data2.Name == "createTime")
                                    {
                                        oddsInfo2.UpdateTime = this.RetrieveUpdateTime(data2);
                                    }
                                    else if (data2.Name == "drowOdds")
                                    {
                                        oddsInfo1.Tie = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "loseOdds")
                                    {
                                        oddsInfo1.Lose = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "winOdds")
                                    {
                                        oddsInfo1.Win = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "companyId")
                                    {
                                        oddsInfo1.CompanyId = Convert.ToInt32(data2.Value.ToString());
                                        oddsInfo2.CompanyId = oddsInfo1.CompanyId;
                                    }
                                    else if (data2.Name == "lastUpdateTime")
                                    {
                                        oddsInfo1.UpdateTime = this.RetrieveUpdateTime(data2);
                                    }
                                    else if (data2.Name == "firstDrowOdds")
                                    {
                                        oddsInfo2.Tie = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "firstLoseOdds")
                                    {
                                        oddsInfo2.Lose = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "firstWinOdds")
                                    {
                                        oddsInfo2.Win = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                }
                                if (oddsInfo2.CompanyId != 28 && oddsInfo2.CompanyId != 31 && (oddsInfo2.CompanyId != 45 && oddsInfo2.CompanyId != 59) && (oddsInfo2.CompanyId != 65 && oddsInfo2.CompanyId != 15))
                                {
                                    list.Add(oddsInfo2);
                                }
                            }
                        }
                    }
                    if (list.Count > 0)
                    {
                        DataHandlerSina.SaveDailyGameInfo(game, leagueId, "Data2014");
                        DataHandler500.SaveOddsInfo((IEnumerable <OddsInfo>)list, "Data2014.dbo.OddsInfo_Daily");
                    }
                }
            }
            DataHandlerSina.UpdateDailyGameInfo(game, "Data2014");
        }
コード例 #2
0
        private List <int> RetrieveOdds(GameInfo game, Dictionary <int, DateTime> maxUpdateTimes, bool updateGameInfo, bool downloadHistory)
        {
            string          str1  = this.RetrieveText(string.Format("http://live.aicai.com/xiyaou/odds!getOuzhi.htm?betId={0}&propId=0&start=0&size=9999", (object)game.GameId));
            List <int>      list1 = new List <int>();
            List <int>      list2 = new List <int>();
            List <OddsInfo> list3 = new List <OddsInfo>();
            object          obj1  = JsonConvert.DeserializeObject(str1);

            // ISSUE: reference to a compiler-generated field
            if (DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Site9 == null)
            {
                // ISSUE: reference to a compiler-generated field
                DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Site9 = CallSite <Func <CallSite, object, IEnumerable> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(IEnumerable), typeof(DownloadSinaDailyBll)));
            }
            // ISSUE: reference to a compiler-generated field
            Func <CallSite, object, IEnumerable> func = DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Site9.Target;
            // ISSUE: reference to a compiler-generated field
            CallSite <Func <CallSite, object, IEnumerable> > callSite = DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Site9;

            // ISSUE: reference to a compiler-generated field
            if (DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Sitea == null)
            {
                // ISSUE: reference to a compiler-generated field
                DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Sitea = CallSite <Func <CallSite, object, object> > .Create(Binder.GetMember(CSharpBinderFlags.None, "Root", typeof(DownloadSinaDailyBll), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[1]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj2 = DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Sitea.Target((CallSite)DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Sitea, obj1);

            foreach (object obj3 in func((CallSite)callSite, obj2))
            {
                // ISSUE: reference to a compiler-generated field
                if (DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Siteb == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Siteb = CallSite <Func <CallSite, object, JProperty> > .Create(Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(JProperty), typeof(DownloadSinaDailyBll)));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                JProperty jproperty = DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Siteb.Target((CallSite)DownloadSinaDailyBll.\u003CRetrieveOdds\u003Eo__SiteContainer8.\u003C\u003Ep__Siteb, obj3);
                if (!(jproperty.Name != "result"))
                {
                    string leagueId = string.Empty;
                    foreach (JProperty data1 in (IEnumerable <JToken>)jproperty.Value)
                    {
                        if (data1.Name == "matchTime")
                        {
                            game.GameTime = this.RetrieveUpdateTime(data1);
                        }
                        else if (data1.Name == "leagueId")
                        {
                            leagueId = data1.Value.ToString();
                        }
                        else if (data1.Name == "hostRank")
                        {
                            game.HostRank = data1.Value.ToString().Replace("\"", "");
                        }
                        else if (data1.Name == "awayRank")
                        {
                            game.GuestRank = data1.Value.ToString().Replace("\"", "");
                        }
                        if (updateGameInfo || downloadHistory)
                        {
                            if (data1.Name == "hostHalfScore")
                            {
                                game.HalfScore = data1.Value.ToString();
                            }
                            else if (data1.Name == "hostScore")
                            {
                                game.FinalScore = data1.Value.ToString();
                            }
                            else if (data1.Name == "awayHalfScore")
                            {
                                GameInfo gameInfo = game;
                                string   str2     = gameInfo.HalfScore + "-" + data1.Value.ToString();
                                gameInfo.HalfScore = str2;
                            }
                            else if (data1.Name == "awayScore")
                            {
                                GameInfo gameInfo = game;
                                string   str2     = gameInfo.FinalScore + "-" + data1.Value.ToString();
                                gameInfo.FinalScore = str2;
                            }
                        }
                        if (!(data1.Name != "europOddsList"))
                        {
                            if (updateGameInfo)
                            {
                                DataHandlerSina.UpdateDailyGameInfo(game, "FootballSinaDaily");
                                return(list1);
                            }
                            foreach (JToken jtoken in (IEnumerable <JToken>)data1.Value)
                            {
                                OddsInfo oddsInfo1 = new OddsInfo();
                                OddsInfo oddsInfo2 = new OddsInfo();
                                oddsInfo1.GameId = game.GameId;
                                oddsInfo2.GameId = game.GameId;
                                foreach (JProperty data2 in (IEnumerable <JToken>)jtoken)
                                {
                                    if (data2.Name == "createTime")
                                    {
                                        oddsInfo2.UpdateTime = this.RetrieveUpdateTime(data2);
                                    }
                                    else if (data2.Name == "drowOdds")
                                    {
                                        oddsInfo1.Tie = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "loseOdds")
                                    {
                                        oddsInfo1.Lose = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "winOdds")
                                    {
                                        oddsInfo1.Win = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "companyId")
                                    {
                                        oddsInfo1.CompanyId = Convert.ToInt32(data2.Value.ToString());
                                        oddsInfo2.CompanyId = oddsInfo1.CompanyId;
                                        if (oddsInfo1.CompanyId != 28 && oddsInfo1.CompanyId != 31 && (oddsInfo1.CompanyId != 45 && oddsInfo1.CompanyId != 59) && oddsInfo1.CompanyId != 65)
                                        {
                                            list2.Add(oddsInfo1.CompanyId);
                                        }
                                    }
                                    else if (data2.Name == "lastUpdateTime")
                                    {
                                        oddsInfo1.UpdateTime = this.RetrieveUpdateTime(data2);
                                    }
                                    else if (data2.Name == "firstDrowOdds")
                                    {
                                        oddsInfo2.Tie = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "firstLoseOdds")
                                    {
                                        oddsInfo2.Lose = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                    else if (data2.Name == "firstWinOdds")
                                    {
                                        oddsInfo2.Win = Convert.ToDecimal(data2.Value.ToString()) / new Decimal(10000);
                                    }
                                }
                                if (maxUpdateTimes != null && maxUpdateTimes.ContainsKey(oddsInfo1.CompanyId) && maxUpdateTimes[oddsInfo1.CompanyId] < oddsInfo1.UpdateTime)
                                {
                                    list1.Add(oddsInfo1.CompanyId);
                                }
                                if (oddsInfo2.CompanyId != 28 && oddsInfo2.CompanyId != 31 && (oddsInfo2.CompanyId != 45 && oddsInfo2.CompanyId != 59) && oddsInfo2.CompanyId != 65)
                                {
                                    list3.Add(oddsInfo2);
                                }
                            }
                        }
                    }
                    if (list3.Count > 0 && maxUpdateTimes == null)
                    {
                        DataHandlerSina.SaveDailyGameInfo(game, leagueId, "FootballSinaDaily");
                        DataHandler500.SaveOddsInfo((IEnumerable <OddsInfo>)list3, "FootballSinaDaily.dbo.OddsInfo_Daily");
                    }
                }
            }
            if (list3.Count > 0 && maxUpdateTimes == null)
            {
                DataHandlerSina.SaveGameCompanyMap(game.GameId, string.Join <int>(",", (IEnumerable <int>)list2), "FootballSinaDaily");
                DataHandlerSina.UpdateDataReady(game.GameId, DataReady.YesSimpleNotDetail, "FootballSinaDaily");
            }
            return(list1);
        }