Exemplo n.º 1
0
        public ChoosingCourse ChooseCourse(TeachingTask task)
        {
            ChoosingCourse cc = task.AddStudent(this);

            _choosingCourses.Add(cc);
            return(cc);
        }
Exemplo n.º 2
0
        public void SignScore(Student student, double score)
        {
            ChoosingCourse cc = this.GetChoosingCourse(student);

            if (cc != null)
            {
                cc.Score = score;
            }
        }
Exemplo n.º 3
0
        public ChoosingCourse AddStudent(Student student)
        {
            if (this.GetChoosingCourse(student) != null)
            {
                throw new System.Exception(
                          string.Format("{0} has chosen the course '{1}' of teacher '{2}'.",
                                        student.Name, this.Teacher.Name, this.Course.Name));
            }
            ChoosingCourse cc = new ChoosingCourse(this, student);

            _choosingCourses.Add(cc);
            return(cc);
        }
Exemplo n.º 4
0
        public ChoosingCourse GetChoosingCourse(Student student)
        {
            ChoosingCourse cc = null;

            foreach (ChoosingCourse v in this.ChoosingCourses)
            {
                if (v.Student == student)
                {
                    cc = v; break;
                }
            }
            return(cc);
        }