コード例 #1
0
        private static void CalculateFourFactorsByOpp(string[] args)
        {
            if (args.Length <= 1)
            {
                return;
            }
            NBAGameStatsHelper nbaGameStatsHelper = new NBAGameStatsHelper();
            string             date1 = args[1];

            if (string.Compare(args[1], "today", true) == 0)
            {
                string date2 = DateTime.Today.ToString("yyyy-MM-dd");
                nbaGameStatsHelper.SaveFourFactorPerTeamToDB(date2);
            }
            else if (args.Length > 2)
            {
                DateTime date2 = Convert.ToDateTime(args[2]);
                for (DateTime dateTime = Convert.ToDateTime(args[1]); date2 <= dateTime; date2 = date2.AddDays(1.0))
                {
                    nbaGameStatsHelper.SaveFourFactorPerTeamToDB(date2);
                }
            }
            else
            {
                nbaGameStatsHelper.SaveFourFactorPerTeamToDB(date1);
            }
        }
コード例 #2
0
        private static void PredictPTSByR(string[] args)
        {
            if (args.Length <= 1)
            {
                return;
            }
            string             date1 = args[1];
            NBAGameStatsHelper nbaGameStatsHelper = new NBAGameStatsHelper();

            if (string.Compare(args[1], "today", true) == 0)
            {
                string date2 = DateTime.Today.ToString("yyyy-MM-dd");
                nbaGameStatsHelper.SaveNewPredictionToDB(date2);
            }
            else if (args.Length > 2)
            {
                DateTime dateTime1 = Convert.ToDateTime(args[2]);
                for (DateTime dateTime2 = Convert.ToDateTime(args[1]); dateTime1 <= dateTime2; dateTime1 = dateTime1.AddDays(1.0))
                {
                    nbaGameStatsHelper.SaveNewPredictionToDB(dateTime1.ToString("yyyy-MM-dd"));
                }
            }
            else
            {
                nbaGameStatsHelper.SaveNewPredictionToDB(date1);
            }
        }
コード例 #3
0
        private static void CalculateFourFactors(string[] args)
        {
            if (args.Length <= 1)
            {
                return;
            }
            string             str = args[1];
            NBAGameStatsHelper nbaGameStatsHelper = new NBAGameStatsHelper();

            if (string.Compare(args[1], "today", true) == 0)
            {
                str = DateTime.Today.ToString("yyyy-MM-dd");
            }
            nbaGameStatsHelper.SaveFourFactorPerGameToDB(Convert.ToDateTime(str));
        }
コード例 #4
0
        public void DownloadNBAStats2(string date)
        {
            string   str1     = date.Insert(6, "-").Insert(4, "-");
            DateTime gameTime = Convert.ToDateTime(str1);

            if (DataAccess.DataHandlerNBA.GetGameInfosByDate(gameTime.AddDays(1.0)).Rows.Count == 0)
            {
                this.InitialGameInfo("214");
            }
            DataTable gameInfosByDate = DataAccess.DataHandlerNBA.GetGameInfosByDate(gameTime);
            string    str2            = string.Empty;

            foreach (DataRow dataRow in (InternalDataCollectionBase)gameInfosByDate.Rows)
            {
                int    gameId   = Convert.ToInt32(dataRow["id"]);
                string str3     = this.RetrieveText(string.Format("http://stats.nba.com/stats/boxscore?GameID={0}&RangeType=0&StartPeriod=0&EndPeriod=0&StartRange=0&EndRange=0", (object)gameId.ToString("D10")), Encoding.UTF8);
                int    gameType = gameId.ToString().StartsWith("2") ? 2 : 3;
                object obj1     = JsonConvert.DeserializeObject(str3);
                // ISSUE: reference to a compiler-generated field
                if (DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site5 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site5 = CallSite <Func <CallSite, object, IEnumerable> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(IEnumerable), typeof(DownloadNBABll)));
                }
                // ISSUE: reference to a compiler-generated field
                Func <CallSite, object, IEnumerable> func = DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site5.Target;
                // ISSUE: reference to a compiler-generated field
                CallSite <Func <CallSite, object, IEnumerable> > callSite = DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site5;
                // ISSUE: reference to a compiler-generated field
                if (DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site6 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site6 = CallSite <Func <CallSite, object, object> > .Create(Binder.GetMember(CSharpBinderFlags.None, "Root", typeof(DownloadNBABll), (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 = DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site6.Target((CallSite)DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site6, obj1);
                foreach (object obj3 in func((CallSite)callSite, obj2))
                {
                    // ISSUE: reference to a compiler-generated field
                    if (DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site7 == null)
                    {
                        // ISSUE: reference to a compiler-generated field
                        DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site7 = CallSite <Func <CallSite, object, JProperty> > .Create(Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(JProperty), typeof(DownloadNBABll)));
                    }
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    JProperty root = DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site7.Target((CallSite)DownloadNBABll.\u003CDownloadNBAStats2\u003Eo__SiteContainer4.\u003C\u003Ep__Site7, obj3);
                    if (!(root.Name != "resultSets"))
                    {
                        str2 = this.ReadGameSummary(gameId.ToString(), gameType, root);
                        if (str2 == "3")
                        {
                            this.ReadTeamStats(gameId.ToString(), root);
                            this.ReadLineScore(gameId, root);
                        }
                    }
                }
            }
            if (str2 != "3")
            {
                this.DownloadOddsFrom500(str1);
                this.DownloadTodayOddsFromSina(DateTime.Parse(str1));
                System.IO.File.WriteAllText("C:\\Users\\dxiao1\\Desktop\\Data\\date.txt", str1);
            }
            else
            {
                DataAccess.DataHandlerNBA.UpdateGameResults();
            }
            if (DataAccess.DataHandlerNBA.IsPredictFinished(str1))
            {
                return;
            }
            NBAGameStatsHelper nbaGameStatsHelper = new NBAGameStatsHelper();

            nbaGameStatsHelper.SaveFourFactorPerGameToDB(str1);
            nbaGameStatsHelper.SaveFourFactorPerTeamToDB(str1);
            nbaGameStatsHelper.SaveNewPredictionToDB(str1);
        }