Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public static double getRatio(string nameClass, string schoolYear, string subject, string semester)
        {
            double ratio = (double)AcademicAffairsOfficeBUS.getSumStudentPass(nameClass, schoolYear, subject, semester) / getSumStudent(nameClass, schoolYear);

            ratio = Math.Round(ratio, 2);
            return(ratio);
        }
Ejemplo n.º 3
0
        public static bool isPass(string idStudent, string nameClass, string schoolYear, string subject, string semester)
        {
            List <MarkDTO> mark = MarkBUS.loadMark(idStudent, nameClass, schoolYear, semester, subject);

            double average = mark[0].AverageMark;

            return(average >= AcademicAffairsOfficeBUS.getPassScore());
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        public static bool isPassAllSubject(string idStudent, string nameClass, string schoolYear, List <string> listSubject, string semester)
        {
            int    n   = listSubject.Count;
            double sum = 0;

            for (int i = 0; i < n; i++)
            {
                List <MarkDTO> mark = MarkBUS.loadMark(idStudent, nameClass, schoolYear, semester, listSubject[i]);
                sum += mark[0].AverageMark;
            }
            sum = sum / n;
            sum = Math.Round(sum, 2);
            return(sum >= AcademicAffairsOfficeBUS.getPassScore());
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
        public static int getMaxCurrentStudent(string schoolYear)
        {
            List <string> listNameClass = AcademicAffairsOfficeBUS.loadListClassToComboBox(schoolYear);
            int           max           = getCurrentStudent(listNameClass[0], schoolYear);
            int           n             = listNameClass.Count;

            for (int i = 1; i < n; i++)
            {
                int temp = getCurrentStudent(listNameClass[i], schoolYear);
                if (temp > max)
                {
                    max = temp;
                }
            }
            return(max);
        }