public int GetStudentCount(string className) { ReportGroupByStudent groupByStudent = null; int count = 0; if (groupByClassName.TryGetValue(className, out groupByStudent)) { count = groupByStudent.GetCollection().Count(); } return(count); }
public void AddReport(Report report) { ReportGroupByStudent reports = null; ReportGroupByCategory reportStats = null; if (!groupByClassName.TryGetValue(report.ClassName, out reports)) { reports = new ReportGroupByStudent(); groupByClassName[report.ClassName] = reports; } if (!groupByClassNameStats.TryGetValue(report.ClassName, out reportStats)) { reportStats = new ReportGroupByCategory(); groupByClassNameStats[report.ClassName] = reportStats; } reportStats.AddReport(report); reports.AddReport(report); }