Exemplo n.º 1
0
        public void SeasonProjection(
            string metricName,
            string season,
            string week,
            DateTime projectionDate)
        {
            Announce($"SeasonProjection metric={metricName} ...");

            FileOut = ProjectionFileName(
                metricName,
                season);

            _html = new HtmlFile(
                FileOut,
                " Win Projections as of " + projectionDate.ToString("ddd dd MMM yy"));

            _html.AddToBody(
                Header("Season Projections " + metricName + " - " + season));
            _html.AddToBody(
                SeasonOut(
                    metricName,
                    projectionDate));
            _html.Render();
            ProjectionList.Add(
                metricName);
            Utility.CopySubFile(
                ProjectionFileName1(
                    metricName,
                    season),
                ProjectionFileName2(
                    metricName,
                    season,
                    week));
        }
Exemplo n.º 2
0
        public void Render(string season)
        {
            var s = Masters.Sm.GetSeason(season);

            foreach (string teamKey in s.TeamKeyList)
            {
                var t = Masters.Tm.GetTeam(teamKey);
                Utility.Announce(string.Format("Unit reports for {0}", t.NameOut()));

                var fileOut = string.Format("{0}\\{2}\\Units\\{1}-Units.htm",
                                            Utility.OutputDirectory(), t.TeamCode, season);
                var h = new HtmlFile(fileOut,
                                     string.Format(" Unit Reports as of {0}  Week {1}",
                                                   DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek()));

                h.AddToBody(Header(t));
                h.AddToBody(t.UnitReport());
                h.Render();

                PoSnippet(t);
                RoSnippet(t);
                PpSnippet(t);
                PrSnippet(t);
                RdSnippet(t);
                PdSnippet(t);
            }
        }
Exemplo n.º 3
0
        public void TeamUnits(string season, string teamKey)
        {
            var t = Masters.Tm.GetTeam(teamKey);

            Utility.Announce($"Unit reports for {t.NameOut()}");

            var fileOut = $"{Utility.OutputDirectory()}\\{season}\\Units\\{t.TeamCode}-Units.htm";

            var h = new HtmlFile(fileOut,
                                 $@" Unit Reports as of {DateTime.Now.ToString("dd MMM yy")}  Week {
				   Utility.CurrentWeek()
				   }"                );

            h.AddToBody(Header(t));
            h.AddToBody(t.UnitReport());
            h.Render();

            PoSnippet(t);
#if !DEBUG2
            RoSnippet(t);
            PpSnippet(t);
            PrSnippet(t);
            RdSnippet(t);
            PdSnippet(t);
#endif
        }
Exemplo n.º 4
0
        /// <summary>
        ///   Express the report in HTML.
        /// </summary>
        /// <param name="fileName">The output DOS file fame.  Include a directory.</param>
        /// <param name="persist">Whether to delete the file or not, sometimes we just want the string.</param>
        public string RenderAsHtml(string fileName, bool persist)
        {
            if (ReportHeader == null)
            {
                ReportHeader = _header;
            }
            ReportHeader = string.Format("{0} as of {1}",
                                         ReportHeader, DateTime.Now.ToString("ddd dd MMM yy HH:MM tt"));
            var h = new HtmlFile(fileName, ReportHeader)
            {
                AnnounceIt = AnnounceIt
            };

            AddStyles(h);
            var html = string.Format("<h3>{0}</h3>", ReportHeader) + Header(_header);

            if (SubHeader.Length > 0)
            {
                html += SubHeader;
            }
            html += BodyOut();
            h.AddToBody(html);
            _et.Stop(DateTime.Now);
            TimeTaken = _et.TimeOut();
            if (!string.IsNullOrEmpty(FootNote))
            {
                h.AddToBody(FootNote);
            }
            h.AddToBody(IsFooter ? ReportFooter : Footer());
            if (persist)
            {
                h.Render();
            }
            return(html);
        }
Exemplo n.º 5
0
        public string RenderHtml()
        {
            FileOut = $@"{Utility.OutputDirectory()}{
				Season
				}//{
				Folder
				}//{
				InstanceName
				}.htm"                ;
            if (!string.IsNullOrEmpty(InstanceName))
            {
                ReportHeader = $"{InstanceName}";
            }
            else
            {
                ReportHeader = $"{ReportType}";
            }

            var reportHeader = $@"{ReportHeader} as of {
				DateTime.Now.ToString("ddd dd MMM yy HH:MM tt")
				}"                ;
            var h            = new HtmlFile(FileOut, reportHeader);
            var html         = $"<h3>{reportHeader}</h3>";

            html += $"<pre>{Body}</pre>";
            h.AddToBody(html);
            h.Render();
            return(html);
        }
Exemplo n.º 6
0
 public void PredictSeason( string season, DateTime projectionDate, string fileOut )
 {
     var html = new HtmlFile( fileOut,
                             " Win Projections as of " + projectionDate.ToString( "ddd dd MMM yy" ) );
     html.AddToBody( Header( "Season Projections - Hillin Predictor - " + season ) );
     html.AddToBody( SeasonOut( "Spread", projectionDate, season ) );
     html.Render();
 }
Exemplo n.º 7
0
        public void PredictSeason(string season, DateTime projectionDate, string fileOut)
        {
            var html = new HtmlFile(fileOut,
                                    " Win Projections as of " + projectionDate.ToString("dd MMM yy"));

            html.AddToBody(Header("Season Projections - Nibble Predictor - " + season));
            html.AddToBody(SeasonOut("Spread", projectionDate, season));
            html.Render();
        }
Exemplo n.º 8
0
        public void Render()
        {
            var fileOut = string.Format("{0}{2}/TeamCards/TeamCard_{1}.htm",
                                        Utility.OutputDirectory(), Team.TeamCode, Team.Season);
            var h = new HtmlFile(fileOut, "Team Card " + DateTime.Now.ToString("dd MMM yy HH:mm"));

            h.AddToBody(CardOut());
            h.Render();
        }
Exemplo n.º 9
0
        public string CurrentRoster()
        {
            FileOut = string.Format( "{0}\\{3}\\Rosters\\{1}\\Roster-{2}-{4}.htm",
                Utility.OutputDirectory(), CurrentLeague, Focus, Season, Utility.CurrentWeek() );
            var h = new HtmlFile( FileOut,
                Utility.CategoryOut( StrCat ) + " Roster as of " + DateTime.Now.ToString("dd MMM yy") +
                                        "  Week " + Utility.CurrentWeek() );

            h.AddToBody( Header() );
            h.AddToBody( TeamListOut() );
            h.AddToBody( Footer() );
            h.Render();

            //  copy to a current report (ignoring week)
            var currentFile = CurrentReportFilename();
            h.Render( currentFile );
            return currentFile;
        }
Exemplo n.º 10
0
        public string CurrentRoster()
        {
            FileOut = string.Format("{0}\\{3}\\Rosters\\{1}\\Roster-{2}-{4}.htm",
                                    Utility.OutputDirectory(), CurrentLeague, Focus, Season, Utility.CurrentWeek());
            var h = new HtmlFile(FileOut,
                                 Utility.CategoryOut(StrCat) + " Roster as of " + DateTime.Now.ToString("dd MMM yy") +
                                 "  Week " + Utility.CurrentWeek());

            h.AddToBody(Header());
            h.AddToBody(TeamListOut());
            h.AddToBody(Footer());
            h.Render();

            //  copy to a current report (ignoring week)
            var currentFile = CurrentReportFilename();

            h.Render(currentFile);
            return(currentFile);
        }
Exemplo n.º 11
0
 public void PpSnippet(NflTeam t)
 {
     FileOut = string.Format("{0}\\Prot\\PP-{1}.htm", RootPath(t.Season), t.TeamCode);
      var h = new HtmlFile(FileOut,
              string.Format(" {2} Pass Protection Unit as of {0}  Week {1}",
                             DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut()));
      h.AddToBody(HeaderPp(t));
      h.AddToBody(t.PpReport());
      h.Render();
 }
Exemplo n.º 12
0
        public void RoSnippet(NflTeam t)
        {
            FileOut = string.Format("{0}\\RunOff\\RO-{1}.htm", RootPath(t.Season), t.TeamCode);
            var h = new HtmlFile(FileOut,
                                 string.Format(" {2} Rushing Unit as of {0}  Week {1}",
                                               DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut()));

            h.AddToBody(HeaderRo(t));
            h.AddToBody(t.RoReport());
            h.Render();
        }
Exemplo n.º 13
0
        public void PdSnippet(NflTeam t)
        {
            FileOut = string.Format("{0}\\PassDef\\PD-{1}.htm", RootPath(t.Season), t.TeamCode);
            var h = new HtmlFile(FileOut,
                                 string.Format(" {2} Pass Defense Unit as of {0}  Week {1}",
                                               DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut()));

            h.AddToBody(HeaderPd(t));
            h.AddToBody(t.PdReport());
            h.Render();
        }
Exemplo n.º 14
0
        public string Render()
        {
            var fileOut = $"{Utility.OutputDirectory()}{Team.Season}/TeamCards/TeamCard_{Team.TeamCode}.htm";
            var h       = new HtmlFile(
                fileOut,
                "Team Card "
                + DateTime.Now.ToString("dd MMM yy HH:mm"));

            h.AddToBody(CardOut());
            h.Render();
            return(fileOut);
        }
Exemplo n.º 15
0
        public void KickerProjection()
        {
            Announce("Kicker Projections");
            FileOut = string.Format("{0}Kickers\\Kickers_{1}.htm", Utility.OutputDirectory(), Utility.CurrentSeason());

            _html = new HtmlFile(FileOut,
                                 " Kicker Projections as of " + DateTime.Now.ToString("ddd dd MMM yy"));

            _html.AddToBody(Header("Kicker Projections"));
            _html.AddToBody(KickersOut());
            _html.Render();
        }
Exemplo n.º 16
0
 public void CurrentInjuries()
 {
     FileOut = string.Format("{0}Rosters\\{2}\\{3}\\Injuries{1}.htm", Utility.OutputDirectory(), StrCat,
         Season, CurrentLeague );
     var h = new HtmlFile( FileOut, Utility.CategoryOut( StrCat ) + " Injuries as of " +
                                          DateTime.Now.ToString("dd MMM yy") +
                                                     "  Week " + Utility.CurrentWeek() );
     h.AddToBody( Header() );
     h.AddToBody( InjuryListOut() );
     h.AddToBody( Footer() );
     h.Render();
 }
Exemplo n.º 17
0
        public string RenderHtml()
        {
            FileOut      = string.Format("{0}{1}//{2}//{3}.htm", Utility.OutputDirectory(), Season, Folder, InstanceName);
            ReportHeader = string.Format("{0} for {1}", ReportType, InstanceName);
            var reportHeader = string.Format("{0} as of {1}", ReportHeader, DateTime.Now.ToString("dd MMM yy HH:MM tt"));
            var h            = new HtmlFile(FileOut, reportHeader);
            var html         = string.Format("<h3>{0}</h3>", reportHeader);

            html += string.Format("<pre>{0}</pre>", Body);
            h.AddToBody(html);
            h.Render();
            return(html);
        }
Exemplo n.º 18
0
        public void CurrentInjuries()
        {
            FileOut = string.Format("{0}Rosters\\{2}\\{3}\\Injuries{1}.htm", Utility.OutputDirectory(), StrCat,
                                    Season, CurrentLeague);
            var h = new HtmlFile(FileOut, Utility.CategoryOut(StrCat) + " Injuries as of " +
                                 DateTime.Now.ToString("dd MMM yy") +
                                 "  Week " + Utility.CurrentWeek());

            h.AddToBody(Header());
            h.AddToBody(InjuryListOut());
            h.AddToBody(Footer());
            h.Render();
        }
Exemplo n.º 19
0
 public string RenderHtml()
 {
     FileOut = string.Format( "{0}{1}//{2}//{3}.htm", Utility.OutputDirectory(), Season, Folder, InstanceName );
     ReportHeader = string.Format( "{0} for {1}", ReportType, InstanceName );
     var reportHeader = string.Format( "{0} as of {1}", ReportHeader,
     DateTime.Now.ToString( "ddd dd MMM yy HH:MM tt" ) );
     var h = new HtmlFile( FileOut, reportHeader );
     var html = string.Format( "<h3>{0}</h3>", reportHeader );
     html += string.Format( "<pre>{0}</pre>", Body );
     h.AddToBody( html );
     h.Render();
     return html;
 }
Exemplo n.º 20
0
        public void SeasonProjection(string metricName, string season, string week, DateTime projectionDate)
        {
#if DEBUG
            Utility.Announce(string.Format("SeasonProjection metric={0} ...", metricName));
#endif
            FileOut = ProjectionFileName(metricName, season, week);

            _html = new HtmlFile(FileOut,
                                 " Win Projections as of " + projectionDate.ToString("dd MMM yy"));

            _html.AddToBody(Header("Season Projections " + metricName + " - " + season));
            _html.AddToBody(SeasonOut(metricName, projectionDate));
            _html.Render();
            ProjectionList.Add(metricName);
        }
Exemplo n.º 21
0
        public void PoSnippet(NflTeam t)
        {
            FileOut = $"{RootPath(t.Season)}\\PassOff\\PO-{t.TeamCode}.htm";
            var h = new HtmlFile(
                FileOut,
                $@" {t.NameOut()} Passing Unit as of {DateTime.Now.ToString("dd MMM yy")}  Week {
				 Utility.CurrentWeek()
				 }"                );

            h.AddToBody(
                HeaderPo(t));
            h.AddToBody(
                t.PoReport());
            h.Render();
        }
Exemplo n.º 22
0
        public void Render()
        {
            var s = Masters.Sm.GetSeason(Utility.CurrentSeason());

            foreach (string teamKey in s.TeamKeyList)
            {
                var t       = Masters.Tm.GetTeam(teamKey);
                var fileOut = string.Format("{0}FreeAgents\\FA-{1}.htm", Utility.OutputDirectory(), t.TeamCode);
                var h       = new HtmlFile(fileOut, " Free Agents as of " + DateTime.Now.ToString("dd MMM yy") +
                                           "  Week " + Utility.CurrentWeek());
                h.AddToBody(Header(t));
                h.AddToBody(t.FreeAgents(true, true, true));
                h.Render();
                TeamCount++;
#if DEBUG
                break;
#endif
            }
        }
Exemplo n.º 23
0
 public void Render()
 {
     var s = Masters.Sm.GetSeason(Utility.CurrentSeason());
     foreach (string teamKey in s.TeamKeyList)
     {
         var t = Masters.Tm.GetTeam(teamKey);
         var fileOut = string.Format("{0}FreeAgents\\FA-{1}.htm", Utility.OutputDirectory(), t.TeamCode);
         var h = new HtmlFile(fileOut, " Free Agents as of " +
        DateTime.Now.ToString("ddd dd MMM yy") +
                                       "  Week " + Utility.CurrentWeek());
         h.AddToBody(Header(t));
         h.AddToBody(t.FreeAgents(true, true, true));
         h.Render();
         TeamCount++;
     #if DEBUG
         break;
     #endif
     }
 }
Exemplo n.º 24
0
        private void RenderMatchup(string s)
        {
            if ((_game.HomeNflTeam == null) || (_game.AwayNflTeam == null))
            {
                Utility.Announce("RenderMatchup: null team");
            }
            else
            {
                FileOut =
                    string.Format(Utility.OutputDirectory() + "{3}\\Matchups\\Week{2}\\Matchup_Wk{2}_{0}v{1}.htm",
                                  _game.HomeNflTeam.TeamCode,
                                  _game.AwayNflTeam.TeamCode,
                                  _game.Week,
                                  _game.Season);

                var h = new HtmlFile(FileOut, " Matchup as of " + DateTime.Now.ToString("dd MMM yy"));
                h.AddToBody(s);
                h.Render();
            }
        }
Exemplo n.º 25
0
        public void EmptyFileTest()
        {
            var testFile = ".\\Output\\test1.html";
             var cut = new HtmlFile( testFile,"Test Html File" );
             cut.AddTopScript( "src='https://www.gstatic.com/charts/loader.js'" );
             cut.AddTopScript( "src='https://www.google.com/jsapi'" );
             cut.AddTopScript( "google.charts.load('current', {packages: ['treemap']});" );
             var chart = new GoogleChart();
             chart.title = "Quick Stats";
             chart.width = 250;
             chart.height = 200;
             chart.addColumn( "string", "Year" );
             chart.addColumn( "number", "Value" );
             chart.addColumn( "number", "Profit" );
             chart.addRow( "'2014', 2000, 1000" );
             var gcText = chart.generateChart( GoogleChart.ChartType.TreeMap );

             cut.AddScript( gcText );
             cut.Render();
             Assert.IsTrue( File.Exists( testFile ) );
        }
Exemplo n.º 26
0
        public string RenderHtml()
        {
            FileOut = string.Format("{0}{1}//{2}//{3}.htm", Utility.OutputDirectory(), Season, Folder, InstanceName);
            if (!string.IsNullOrEmpty(InstanceName))
            {
                ReportHeader = string.Format("{0}", InstanceName);
            }
            else
            {
                ReportHeader = string.Format("{0}", ReportType);
            }

            var reportHeader = $@"{ReportHeader} as of {
				DateTime.Now.ToString( "ddd dd MMM yy HH:MM tt" )
				}"                ;
            var h            = new HtmlFile(FileOut, reportHeader);
            var html         = string.Format("<h3>{0}</h3>", reportHeader);

            html += string.Format("<pre>{0}</pre>", Body);
            h.AddToBody(html);
            h.Render();
            return(html);
        }
Exemplo n.º 27
0
        public void TeamUnits( string season, string teamKey )
        {
            var t = Masters.Tm.GetTeam( teamKey );
               Utility.Announce( string.Format( "Unit reports for {0}", t.NameOut() ) );

               var fileOut = string.Format( "{0}\\{2}\\Units\\{1}-Units.htm",
               Utility.OutputDirectory(), t.TeamCode, season );

               var h = new HtmlFile( fileOut,
               string.Format( " Unit Reports as of {0}  Week {1}",
                   DateTime.Now.ToString( "dd MMM yy" ), Utility.CurrentWeek() ) );

               h.AddToBody( Header( t ) );
               h.AddToBody( t.UnitReport() );
               h.Render();

               PoSnippet( t );
            #if !DEBUG
             RoSnippet( t );
               PpSnippet( t );
               PrSnippet( t );
               RdSnippet( t );
               PdSnippet( t );
            #endif
        }
Exemplo n.º 28
0
 public void Render()
 {
     _html.AddToBody(Header("NFL Rosters"));
     _html.AddToBody(TeamListOut());
     _html.Render();
 }
Exemplo n.º 29
0
 public string Render()
 {
     var fileOut = string.Format( "{0}{2}/TeamCards/TeamCard_{1}.htm",
         Utility.OutputDirectory(), Team.TeamCode, Team.Season );
     var h = new HtmlFile(fileOut, "Team Card " + DateTime.Now.ToString("dd MMM yy HH:mm"));
     h.AddToBody(CardOut());
     h.Render();
     return fileOut;
 }
Exemplo n.º 30
0
        public void SeasonProjection(string metricName, string season, string week, DateTime projectionDate)
        {
            #if DEBUG
            Utility.Announce(string.Format("SeasonProjection metric={0} ...", metricName));
            #endif
            FileOut = ProjectionFileName( metricName, season);

            _html = new HtmlFile(FileOut,
                                 " Win Projections as of " + projectionDate.ToString("ddd dd MMM yy"));

            _html.AddToBody(Header("Season Projections " + metricName + " - " + season));
            _html.AddToBody( SeasonOut( metricName, projectionDate));
            _html.Render();
            ProjectionList.Add( metricName );
             Utility.CopySubFile(ProjectionFileName1(metricName, season),
            ProjectionFileName2(metricName, season, week));
        }
Exemplo n.º 31
0
        public void KickerProjection()
        {
            Utility.Announce("Kicker Projections");
            FileOut = string.Format("{0}Kickers\\Kickers_{1}.htm", Utility.OutputDirectory(), Utility.CurrentSeason());

            _html = new HtmlFile(FileOut,
                                 " Kicker Projections as of " + DateTime.Now.ToString("ddd dd MMM yy"));

            _html.AddToBody(Header("Kicker Projections"));
            _html.AddToBody(KickersOut());
            _html.Render();
        }
Exemplo n.º 32
0
        public void RdSnippet(NflTeam t)
        {
            FileOut = string.Format("{0}\\RunDef\\RD-{1}.htm", RootPath(t.Season), t.TeamCode);
             var h = new HtmlFile(FileOut,
                                   string.Format(" {2} Run Defense Unit as of {0}  Week {1}",
                                                 DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut()));

             h.AddToBody(HeaderRd(t));
             h.AddToBody(t.RdReport());
             h.Render();
        }
Exemplo n.º 33
0
 /// <summary>
 ///   Express the report in HTML. 
 /// </summary>
 /// <param name="fileName">The output DOS file fame.  Include a directory.</param>
 /// <param name="persist">Whether to delete the file or not, sometimes we just want the string.</param>
 public string RenderAsHtml(string fileName, bool persist)
 {
     if (ReportHeader == null) ReportHeader = _header;
     ReportHeader = string.Format("{0} as of {1}",
        ReportHeader, DateTime.Now.ToString("ddd dd MMM yy HH:MM tt") );
      var h = new HtmlFile( fileName, ReportHeader ) {AnnounceIt = AnnounceIt};
      AddStyles(h);
      var html = string.Format("<h3>{0}</h3>", ReportHeader) + Header(_header);
      if (SubHeader.Length > 0) html += SubHeader;
      html += BodyOut();
      h.AddToBody(html);
      _et.Stop(DateTime.Now);
      TimeTaken = _et.TimeOut();
      if (!string.IsNullOrEmpty( FootNote ))
     h.AddToBody(FootNote);
      h.AddToBody(IsFooter ? ReportFooter : Footer());
      if (persist) h.Render();
      return html;
 }
Exemplo n.º 34
0
        private void RenderMatchup( string s )
        {
            if ( ( _game.HomeNflTeam == null ) || ( _game.AwayNflTeam == null ) )
                Utility.Announce( "RenderMatchup: null team" );
            else
            {
                FileOut =
                    string.Format(Utility.OutputDirectory() + "{3}\\Matchups\\Week{2}\\Matchup_Wk{2}_{0}v{1}.htm",
                                        _game.HomeNflTeam.TeamCode,
                                        _game.AwayNflTeam.TeamCode,
                                        _game.Week,
                                        _game.Season );

                var h = new HtmlFile( FileOut, " Matchup as of " +
               DateTime.Now.ToString( "ddd dd MMM yy" ) );
                h.AddToBody( s );
                h.Render();
            }
        }