Beispiel #1
0
        public void Test7182014()
        {
            ErrorLog log = new ErrorLog( @".\Test_7-18-14.txt" );
            Season season = new Season( new DateTime( 2014, 7, 18 ), new DateTime( 2014, 7, 18 ), new PostSeason( DateTime.Now, DateTime.Now) );
            DBContextFactory factory = DBContextFactory.Instance;

            BoxscoreDownloader downloader = new BoxscoreDownloader( new BoxscoreParser( log, factory.CreateBoxscoreSqlServerDBContext(log) ), season, log );
            downloader.Download();
        }
 public DBContextOld(ErrorLog log)
 {
     _logger = log;
 }
Beispiel #3
0
        static void Main(string[] args)
        {
            //Test test = new Test();
            //test.PopulateTestPlays();
            //test.TestSubstitutions();

            ErrorLog log = new ErrorLog(@".\ErrorLog_1_13_2016.txt");
            log.Timestamp();

            try
            {
                SeasonFactory seasonFactory = SeasonFactory.Instance;
                DBContextFactory databaseFactory = DBContextFactory.Instance;

                // 2006 : no sb,cs,sac,hbp, or sf in batting stats, no np, strikes in pitching stats
                //Season season = seasonFactory.Create2006Season();

                // 2007 : no sb,cs, OR sac in batting stats
                // Season season = seasonFactory.Create2007Season();

                // 2008 Season
                 Season season = seasonFactory.Create2008Season();

                // 2009 Season
                // Season season = seasonFactory.Create2009Season();

                // 2010 Season
                // Season season = seasonFactory.Create2010Season();

                // 2011 Season
                // Season season = seasonFactory.Create2011Season();

                // 2012 Season
                // Season season = seasonFactory.Create2012Season();

                // 2013 Season
                // Season season = seasonFactory.Create2013Season();

                // 2014 Season
                // Season season = seasonFactory.Create2014Season();

                // 2015 Season
                // Season season = seasonFactory.Create2015Season();

                DownloadManager manager = new DownloadManager( log );
                manager.RegisterDownloader( new TeamScheduleDownloader( new TeamScheduleParser( log, databaseFactory.CreateTeamScheduleSqlServerDBContext(log) ), season, log ), 1 );
                manager.RegisterDownloader( new CheckPlayerDownloader( new CheckPlayerParser( log, databaseFactory.CreateCheckPlayersTeamDBContext( log ) ), season, log ), 2 );
                manager.RegisterDownloader( new BoxscoreDownloader( new BoxscoreParser( log, databaseFactory.CreateBoxscoreSqlServerDBContext(log) ), season, log ), 3 );
                //manager.RegisterDownloader( new GameDownloader( new GameParser( log, databaseFactory.CreateGameSqlServerDBContext( log ) ), season, log ), 4 );

                manager.Download();

                IGeneralDBContext db = databaseFactory.CreateGeneralSqlServerDBContext( log );
                db.UpdateTeamSeasonDetails( season.begin.Year );
                db.UpdatePlayerSeasonStats( season.begin.Year );
                db.UpdateRecordLastTenGames( season.begin.Year );
                db.UpdateTeamsCurrentStreak( season.begin.Year );
                db.UpdateTeamSeasonStatistics( season.begin.Year );
            }
            catch(Exception e)
            {
                Console.WriteLine( "ERROR IN MAIN PROGRAM" );
                Console.WriteLine( e.Message );
                Console.WriteLine( e.StackTrace );
                Console.WriteLine( e.Data );
            }
            finally
            {
                log.Timestamp();
                log.CloseLog();
            }

            Console.ReadKey();
        }