#region Using directives using System; using System.Text; using System.Globalization; using StefanMenne.stChess; using StefanMenne.stChess.GenerateHtml; #endregion namespace GenerateHtml { public class SwissProgressHtmlPage : SwissProgressHtmlPageBase { public SwissProgressHtmlPage( SwissTournament t, SwissProgressPageModel pm ) : base( t, pm ) { } public override void GenerateHtmlDocument() { HtmlWriteLine( "" ); HtmlWriteLine( "" ); HtmlWriteLine( "" ); ++Indent; HtmlWriteLine( "" + TournamentName + "" ); HtmlWriteLine( "" ); --Indent; HtmlWriteLine( ""); HtmlWriteLine( ""); ++Indent; GenerateHtmlHeading(); GenerateHtmlTable(); CreateFooter(); --Indent; HtmlWriteLine( ""); HtmlWriteLine( ""); } public override void GenerateHtmlTable() { HtmlWriteLine( "" ); ++Indent; HtmlWriteLine( "" ); HtmlWriteLine( "" ); ++Indent; int width = 1 + // number column 5 + // name column ( DisplayClub ? 5 : 0 ) + // club column ( DisplayELO ? 1 : 0 ) + // ELO column ( DisplayDWZ ? 1 : 0 ) + // DWZ column ( DisplayTitle ? 1 : 0 ) + // title column ( DisplayBirthDate ? 2 : 0 ) + // birth date column 1*NofRoundsPaired + // result column's 1 + // score column ( DisplayBuchholz ? 1 : 0 ) + // Buchholz column ( DisplayRefinedBuchholz ? 1 : 0 ) + // refined Buchholz column ( DisplaySonnebornBerger ? 1 : 0 ) + // Sonneborn-Berger column ( DisplaySumOfProgress ? 1 : 0 ) ; // sum of progress column int unitWidth = 100 / width; HtmlWriteLine( "" ); // number HtmlWriteLine( "" ); // name if ( DisplayClub ) HtmlWriteLine( "" ); // club if ( DisplayELO ) HtmlWriteLine( "" ); // elo if ( DisplayDWZ ) HtmlWriteLine( "" ); // dwz if ( DisplayTitle ) HtmlWriteLine( "" ); // title if ( DisplayBirthDate ) HtmlWriteLine( "" ); // birth date for ( int i=0 ; i" ); // results HtmlWriteLine( "" ); // score if ( DisplayBuchholz ) HtmlWriteLine( "" ); // Buchholz if ( DisplayRefinedBuchholz ) HtmlWriteLine( "" ); // refined Buchholz if ( DisplaySonnebornBerger ) HtmlWriteLine( "" ); // Sonneborn Berger if ( DisplaySumOfProgress ) HtmlWriteLine( "" ); // sum of progress --Indent; HtmlWriteLine( "" ); HtmlWriteLine( "" ); ++Indent; HtmlWriteLine( "" ); ++Indent; HtmlWriteLine( "" ); HtmlWriteLine( "" ); if ( DisplayClub ) HtmlWriteLine( "" ); if ( DisplayELO ) HtmlWriteLine( "" ); if ( DisplayDWZ ) HtmlWriteLine( "" ); if ( DisplayTitle ) HtmlWriteLine( "" ); if ( DisplayBirthDate ) HtmlWriteLine( "" ); for ( int i=0 ; i" + (i+1).ToString() + "" ); HtmlWriteLine( "" ); if ( DisplayBuchholz ) HtmlWriteLine( "" ); if ( DisplayRefinedBuchholz ) HtmlWriteLine( "" ); if ( DisplaySonnebornBerger ) HtmlWriteLine( "" ); if ( DisplaySumOfProgress ) HtmlWriteLine( "" ); --Indent; HtmlWriteLine( "" ); --Indent; HtmlWriteLine( "" ); HtmlWriteLine(""); HtmlWriteLine(""); ++Indent; int[] keyArray = new int[NofParticipant], rankToParticipantIndex = new int[NofParticipant], participantIndexToRank = new int[NofParticipant]; for ( int i=0 ; i" ); ++Indent; HtmlWriteLine( "" ); HtmlWriteLine( "" ); if ( DisplayClub ) HtmlWriteLine( "" ); if ( DisplayELO ) HtmlWriteLine( "" ); if ( DisplayDWZ ) HtmlWriteLine( "" ); if ( DisplayTitle ) HtmlWriteLine( "" ); if ( DisplayBirthDate ) HtmlWriteLine( "" ); for ( int i=0 ; i" + ParticipantResultsColor[idx,i] + ParticipantResultsRes[idx,i] + "" ); else HtmlWriteLine( "" ); } HtmlWriteLine( "" ); if ( DisplayBuchholz ) HtmlWriteLine( "" ); if ( DisplayRefinedBuchholz ) HtmlWriteLine( "" ); if ( DisplaySonnebornBerger ) HtmlWriteLine( "" ); if ( DisplaySumOfProgress ) HtmlWriteLine( "" ); --Indent; HtmlWriteLine( "" ); } --Indent; HtmlWriteLine( "" ); --Indent; HtmlWriteLine( "
" + TableTitle + "
 " + TableParticipantCaption + "" + TableClubCaption + "" + "ELO" + "" + "DWZ" + "" + TableTitleCaption + "" + TableBirthDateCaption + "" + TableScoreCaption + "" + TableBuchholzCaption + "" + TableRefinedBuchholzCaption + "SoBo" + TableSumOfProgressCaption + "
" + (row+1).ToString(CultureInfo.InvariantCulture) + "" + ParticipantName[idx] + "" + ParticipantClub[idx] + "" + ParticipantElo[idx].ToString(CultureInfo.InvariantCulture) + "" + ParticipantDwz[idx].ToString(CultureInfo.InvariantCulture) + "" + ParticipantTitle[idx] + "" + ParticipantBirthDate[idx] + "" + (participantIndexToRank[ParticipantResultsOpponent[idx,i]]+1).ToString() + ParticipantResultsColor[idx,i] + ParticipantResultsRes[idx,i] + "" + ParticipantScore[idx].ToString("0.0",CultureInfo.InvariantCulture) + "" + ParticipantBuchholz[idx].ToString("0.0",CultureInfo.InvariantCulture) + "" + ParticipantRefinedBuchholz[idx].ToString("0.0",CultureInfo.InvariantCulture) + "" + ParticipantSonnebornBerger[idx].ToString("0.00",CultureInfo.InvariantCulture) + "" + ParticipantSumOfProgress[idx].ToString("0.0",CultureInfo.InvariantCulture) + "
" ); } } }