Exemple #1
0
        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);
        }
Exemple #2
0
        public static int getSumStudentPass(string nameClass, string schoolYear, string subject, string semester)
        {
            List <StudentDTO> students = AcademicAffairsOfficeBUS.loadListStudent(nameClass, schoolYear);
            int count = 0;
            int n     = students.Count;

            for (int i = 0; i < n; i++)
            {
                if (AcademicAffairsOfficeBUS.isPass(students[i].Id, nameClass, schoolYear, subject, semester))
                {
                    count++;
                }
            }
            return(count);
        }