public string RenderPlayerCsv()
        {
            WeekMaster weekMaster = CollectPlayers();

            Lister.Folder        = "Starters";
            Lister.LongStats     = true;
            Lister.RenderToHtml  = false;
            Lister.FantasyLeague = "GS";

            var fileOut = DoProjections ?
                          Lister.RenderProjection(
                "PlayerCsv",
                weekMaster,
                AdpMaster)
                           : Lister.Render("PlayerCsv");

            if (DoProjections)
            {
                if (DoProjections)
                {
                    // also do short csv for listpro (limited)
                    Lister.RenderProjection(
                        "PlayerCsvShort",
                        weekMaster,
                        AdpMaster);
                }
            }

            Lister.Clear();

            return(fileOut);
        }
        public string ProjectYahooPerformance( string catCode, int weekNo, 
			[System.Runtime.InteropServices.Optional] string sPos )
        {
            if ( String.IsNullOrEmpty( sPos ) || sPos.Equals( "PK" ) )
                sPos = "*";

            var nextWeek = new NFLWeek( Int32.Parse( Utility.CurrentSeason() ), weekNo, false );
            var gs = new StatProjector( nextWeek );

            Lister.SetScorer( gs );
            Lister.StartersOnly = true;
            Lister.SetFormat( "weekly" );
            Lister.Week = nextWeek.WeekNo;
            Lister.AllWeeks = false; //  just the regular saeason
            Lister.Season = nextWeek.Season;
            Lister.Collect( catCode, sPos, Constants.K_LEAGUE_Yahoo );

            if ( String.IsNullOrEmpty( sPos ) || sPos.Equals("*") ) sPos = "All";

            FileOut = String.Format( "{0}\\Yahoo\\{1}\\{1} Projection W{2:00}", Lister.Season, sPos, Lister.Week );
             var weekMaster = new WeekMaster();
            FileOut = Lister.RenderProjection( FileOut, weekMaster );
            FileOut = Lister.FileOut;
            return Lister.FileOut;
        }
        public string ProjectYahooPerformance(string catCode, int weekNo,
                                              [System.Runtime.InteropServices.Optional] string sPos)
        {
            if (String.IsNullOrEmpty(sPos) || sPos.Equals("PK"))
            {
                sPos = "*";
            }

            var nextWeek = new NFLWeek(Int32.Parse(Utility.CurrentSeason()), weekNo, false);
            var gs       = new StatProjector(nextWeek);

            Lister.SetScorer(gs);
            Lister.StartersOnly = true;
            Lister.SetFormat("weekly");
            Lister.Week     = nextWeek.WeekNo;
            Lister.AllWeeks = false;             //  just the regular saeason
            Lister.Season   = nextWeek.Season;
            Lister.Collect(catCode, sPos, Constants.K_LEAGUE_Yahoo);

            if (String.IsNullOrEmpty(sPos) || sPos.Equals("*"))
            {
                sPos = "All";
            }

            FileOut = String.Format("{0}\\Yahoo\\{1}\\{1} Projection W{2:00}", Lister.Season, sPos, Lister.Week);
            var weekMaster = new WeekMaster();

            FileOut = Lister.RenderProjection(FileOut, weekMaster);
            FileOut = Lister.FileOut;
            return(Lister.FileOut);
        }
 public void TestGetFromMaster()
 {
     var sut = new WeekMaster();
      var w = sut.GetWeek( "2014", 1 );
      Assert.IsTrue(w.WeekKey().Equals( "2014:01" ) );
      w = sut.GetWeek("2014", 1);
      Assert.IsTrue(sut.CacheHits == 1);
      Assert.IsTrue(sut.CacheMisses == 1);
 }
Exemple #5
0
        public string RenderPlayerCsv()
        {
            Lister.SortOrder = "CURSCORES DESC";

            var nWeek = int.Parse(Utility.CurrentWeek());

            if (nWeek == 0)
            {
                nWeek = 1;
            }

            var theWeek = new NFLWeek(int.Parse(Utility.CurrentSeason()), nWeek, loadGames: false);

            var weekMaster = new WeekMaster();

            Lister.RenderToCsv  = true;
            Lister.StartersOnly = true;
            if (!DoProjections)
            {
                var scorer = new YahooScorer(theWeek);
                Lister.SetScorer(scorer);
            }

            foreach (var sc in Configs)
            {
                Lister.Collect(sc.Category, sc.Position, string.Empty);
            }

            Lister.Folder       = "Starters";
            Lister.LongStats    = true;
            Lister.RenderToHtml = false;

            var fileOut = DoProjections ?
                          Lister.RenderProjection("PlayerCsv", weekMaster)
                           : Lister.Render("PlayerCsv");

            Lister.Clear();

            return(fileOut);
        }
        public WeekMaster CollectPlayers()
        {
            Lister.SortOrder = "POINTS DESC";

            var nWeek = int.Parse(Utility.CurrentWeek());

            if (nWeek == 0)
            {
                nWeek = 1;
            }

            var theWeek = new NFLWeek(
                int.Parse(Utility.CurrentSeason()),
                nWeek,
                loadGames: false);

            var weekMaster = new WeekMaster();

            Lister.RenderToCsv  = true;
            Lister.StartersOnly = true;
            if (!DoProjections)
            {
                var scorer = new YahooScorer(theWeek);
                Lister.SetScorer(scorer);
            }

            foreach (var sc in Configs)
            {
                Lister.Collect(
                    sc.Category,
                    sc.Position,
                    fantasyLeague: string.Empty);
            }

            return(weekMaster);
        }
Exemple #7
0
        public string RenderPlayerCsv()
        {
            Lister.SortOrder = "CURSCORES DESC";

             var nWeek = int.Parse(Utility.CurrentWeek());
             if (nWeek == 0) nWeek = 1;

             var theWeek = new NFLWeek( int.Parse(Utility.CurrentSeason()), nWeek, loadGames:false);

             var weekMaster = new WeekMaster();

             Lister.RenderToCsv = true;
             Lister.StartersOnly = true;
             if ( !DoProjections )
             {
            var scorer = new YahooScorer( theWeek );
            Lister.SetScorer( scorer );
             }

             foreach ( var sc in Configs)
             {
            Lister.Collect(sc.Category, sc.Position, string.Empty);
             }

             Lister.Folder = "Starters";
             Lister.LongStats = true;
             Lister.RenderToHtml = false;

             var fileOut = DoProjections ?
            Lister.RenderProjection("PlayerCsv", weekMaster)
            : Lister.Render("PlayerCsv");

             Lister.Clear();

             return fileOut;
        }