Ejemplo n.º 1
0
 public void RenderTvAsHtml()
 {
     ReportType = "TV Show Report";
     var str = new SimpleTableReport( string.Format( "{1} {0}", Inits, ReportType ) );
     str.AddStyle(
         "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }" );
     str.AddStyle( "#main { margin-left:1em; }" );
     str.AddStyle( "#dtStamp { font-size:0.8em; }" );
     str.AddStyle( ".end { clear: both; }" );
     str.AddStyle( ".gponame { color:white; background:black }" );
     str.ColumnHeadings = true;
     str.DoRowNumbers = true;
     str.ShowElapsedTime = false;
     str.IsFooter = false;
     str.AddColumn( new ReportColumn( "Show", "TITLE", "{0}", typeof (String) ) );
     str.AddColumn( new ReportColumn( "Format", "FORMAT", "{0}", typeof (String) ) );
     str.AddColumn( new ReportColumn( "Date Added", "ADDED", "{0}", typeof (String) ) );
     BuildTable( str, "TV", false );
     str.SetSortOrder( "TITLE" );
     str.RenderAsHtml( string.Format( "{0}//TV-{1}.htm", OutputDirectory, Inits ), true );
 }
Ejemplo n.º 2
0
        private void BuildTable( SimpleTableReport str, string type, [Optional] bool latest )
        {
            FindMedia( latest );

            if (MediaList != null)
            {
                foreach ( var i in MediaList )
                {
                    if (i == null) continue;

                    if (!i.Type.Equals( type ) && !latest) continue;

                    var dr = str.Body.NewRow();
                    dr[ "TITLE" ] = i.Title;
                    dr[ "FORMAT" ] = i.Format;
                    dr[ "ADDED" ] = i.LibraryDate.ToShortDateString();
                    if (type.Equals( "TV" ) && latest)
                        dr[ "EPISODE" ] = i.Episode;
                    str.Body.Rows.Add( dr );
                }
            }
            return;
        }
Ejemplo n.º 3
0
 public void RenderLatestFilesAsHtml()
 {
     ReportType = "Added since";
     var ts = new TimeSpan( DaysBack, 0, 0, 0 );
     CutoffDate = DateTime.Now.Subtract( ts );
     var str = new SimpleTableReport( string.Format( "{2} {0} ({1} days ago)",
                                                     CutoffDate.ToShortDateString(), DaysBack, ReportType ) );
     str.AddStyle(
         "#container { text-align: left; background-color: #ccc; margin: 0 auto; border: 1px solid #545454; width: 641px; padding:10px; font: 13px/19px Trebuchet MS, Georgia, Times New Roman, serif; }" );
     str.AddStyle( "#main { margin-left:1em; }" );
     str.AddStyle( "#dtStamp { font-size:0.8em; }" );
     str.AddStyle( ".end { clear: both; }" );
     str.AddStyle( ".gponame { color:white; background:black }" );
     str.ColumnHeadings = true;
     str.DoRowNumbers = true;
     str.ShowElapsedTime = false;
     str.IsFooter = false;
     str.AddColumn( new ReportColumn( "Title", "TITLE", "{0}", typeof (String) ) );
     str.AddColumn( new ReportColumn( "Episode", "EPISODE", "{0}", typeof (String) ) );
     str.AddColumn( new ReportColumn( "Format", "FORMAT", "{0}", typeof (String) ) );
     str.AddColumn( new ReportColumn( "Date Added", "ADDED", "{0}", typeof (String) ) );
     BuildTable( str, "TV", true );
     str.SetSortOrder( "ADDED DESC" );
     str.RenderAsHtml( string.Format( "{0}//Latest-{1}.htm", OutputDirectory, Inits ), true );
 }