Ejemplo n.º 1
0
        public List <string> GetDoneClasses()
        {
            List <Subject> subjects = new SubjectController().LoadSubjects();

            if (subjects == null)
            {
                return(null);
            }
            int max = subjects.Count * 2;
            Dictionary <string, int> doneClass = new Dictionary <string, int>();
            bool success = classDA.GetAssignedDoneClass(doneClass);

            if (!success)
            {
                return(null);
            }
            List <string> result = new List <string>();

            foreach (KeyValuePair <string, int> pair in doneClass)
            {
                if (pair.Value == max)
                {
                    result.Add(pair.Key);
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
        public bool AddNewStudentLearnResult(string _studentID, string _classID)
        {
            SubjectController subjectController = new SubjectController();
            List <Subject>    subjects          = subjectController.LoadSubjects();
            Student           student           = new Student();

            student.ID      = _studentID;
            student.ClassID = _classID;
            return(studentDA.AddStudentLearnResult(student, subjects));
        }
Ejemplo n.º 3
0
        public bool AddNewStudentToDataBase(Student student)
        {
            SubjectController subjectController = new SubjectController();
            List <Subject>    subjects          = subjectController.LoadSubjects();
            bool success = studentDA.AddStudent(student);

            if (success)
            {
                success = studentDA.AddStudentLearnResult(student, subjects);
            }
            return(success);
        }