public ChoosingCourse ChooseCourse(TeachingTask task) { ChoosingCourse cc = task.AddStudent(this); _choosingCourses.Add(cc); return(cc); }
public void SignScore(Student student, double score) { ChoosingCourse cc = this.GetChoosingCourse(student); if (cc != null) { cc.Score = score; } }
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); }
public ChoosingCourse GetChoosingCourse(Student student) { ChoosingCourse cc = null; foreach (ChoosingCourse v in this.ChoosingCourses) { if (v.Student == student) { cc = v; break; } } return(cc); }