private void WriteCountLine( DataTable dt, string stat ) { var dr = dt.NewRow(); dr[ "STAT" ] = stat; var tot = 0; foreach ( var week in NflSeason.RegularWeeks ) { var weekNo = string.Format( "WK{0}", week.Week ); var actuals = GetActuals( NflSeason.Year, week.Week ); var nInWeek = 0; var predTab = actuals.Tables[ "sched" ]; foreach ( DataRow row in predTab.Rows ) { var g = new NFLGame( row ); #if DEBUG Utility.Announce( g.ScoreOut() ); #endif if ( g.TotalTds() == 0 || ForceRefresh ) g.RefreshTotals(); g.TallyMetrics( string.Empty ); switch ( stat ) { case "TDr": nInWeek += g.HomeTDr + g.AwayTDr; break; case "TDp": nInWeek += g.HomeTDp + g.AwayTDp; break; case "TDd": nInWeek += g.HomeTDd + g.AwayTDd; break; case "TDs": nInWeek += g.HomeTDs + g.AwayTDs; break; case "FG": nInWeek += g.HomeFg + g.AwayFg; break; case "YDp": nInWeek += g.HomeYDp + g.AwayYDp; break; case "YDr": nInWeek += g.HomeYDr + g.AwayYDr; break; default: break; } } if ( nInWeek > 0 ) { tot += nInWeek; dr[ weekNo ] = string.Format( "{0}", nInWeek ); } #if DEBUG //break; // dont iterate v not got time #endif } dr[ "TOT" ] = tot; dt.Rows.Add( dr ); }