public static List <Report> loadReport(string semester, string schoolYear, string subject, List <string> listNameClass) { List <Report> result = new List <Report>(); int n = listNameClass.Count; if (semester == "System.Windows.Controls.ComboBoxItem: I") { for (int i = 0; i < n; i++) { Report student = new Report(); student.stt = i + 1; student.nameClass = listNameClass[i]; student.tt = AcademicAffairsOfficeBUS.getSumStudent(listNameClass[i], schoolYear); student.pass = AcademicAffairsOfficeBUS.getSumStudentPass(listNameClass[i], schoolYear, subject, "1"); student.scale = AcademicAffairsOfficeBUS.getRatio(listNameClass[i], schoolYear, subject, "1"); result.Add(student); } } else { for (int i = 0; i < n; i++) { Report student = new Report(); student.stt = i + 1; student.nameClass = listNameClass[i]; student.tt = AcademicAffairsOfficeBUS.getSumStudent(listNameClass[i], schoolYear); student.pass = AcademicAffairsOfficeBUS.getSumStudentPass(listNameClass[i], schoolYear, subject, "2"); student.scale = AcademicAffairsOfficeBUS.getRatio(listNameClass[i], schoolYear, subject, "2"); result.Add(student); } } return(result); }
public static List <Report> loadReport(string semester, string schoolYear, List <string> listSubject, List <string> listNameClass) { List <Report> result = new List <Report>(); int n = listNameClass.Count; if (semester == "System.Windows.Controls.ComboBoxItem: I") { for (int i = 0; i < n; i++) { Report student = new Report(); student.stt = i + 1; student.nameClass = listNameClass[i]; student.tt = AcademicAffairsOfficeBUS.getSumStudent(listNameClass[i], schoolYear); List <StudentDTO> students = AcademicAffairsOfficeBUS.loadListStudent(listNameClass[i], schoolYear); for (int j = 0; j < students.Count; j++) { if (isPassAllSubject(students[j].Id, listNameClass[i], schoolYear, listSubject, "1")) { student.pass++; } } student.scale = (double)student.pass / student.tt; student.scale = Math.Round(student.scale, 2); result.Add(student); } } else { for (int i = 0; i < n; i++) { Report student = new Report(); student.stt = i + 1; student.nameClass = listNameClass[i]; student.tt = AcademicAffairsOfficeBUS.getSumStudent(listNameClass[i], schoolYear); List <StudentDTO> students = AcademicAffairsOfficeBUS.loadListStudent(listNameClass[i], schoolYear); for (int j = 0; j < students.Count; j++) { if (isPassAllSubject(students[j].Id, listNameClass[i], schoolYear, listSubject, "2")) { student.pass++; } } student.scale = (double)student.pass / student.tt; student.scale = Math.Round(student.scale, 2); result.Add(student); } } return(result); }