AddCourseClass() публичный Метод

Bind professor to course
public AddCourseClass ( CourseClass courseClass ) : void
courseClass CourseClass
Результат void
 /// <summary>
 /// Initializes class object
 /// </summary>
 /// <param name="professor">Professor ID</param>
 /// <param name="course">Course ID</param>
 /// <param name="groups">List of Group ID</param>
 /// <param name="lab">Class Lab name</param>
 /// <param name="duration">Class Duration (in hours)</param>
 public CourseClass(Professor professor, Course course, 
        List<StudentsGroup> groups, string lab, int duration, int class_Id)
 {
     _professor = professor;
     _course = course;
     _numberOfSeats = 0;
     _lab = lab;
     _duration = duration;
     Class_ID = class_Id;
     //
     // bind professor to class
     //
     /*
     for (int prof = 0; prof < _professor.Count; prof++)
         // multiple professor for a courseClass (One of several professor will be chosen)
         _professor[prof].AddCourseClass(this);
     */
     _professor.AddCourseClass(this);
     //
     // bind student groups to class
     //
     foreach (StudentsGroup it in groups)
     {
         it.AddCourseClass(this);
         _groups.Add(it);
         _numberOfSeats += it.GetNumberOfStudents;
     }
 }
Пример #2
0
        /// <summary>
        /// Initializes class object
        /// </summary>
        /// <param name="professor">Professor ID</param>
        /// <param name="course">Course ID</param>
        /// <param name="groups">List of Group ID</param>
        /// <param name="lab">Class Lab name</param>
        /// <param name="duration">Class Duration (in hours)</param>
        public CourseClass(Professor professor, Course course,
                           List <StudentsGroup> groups, string lab, int duration, int class_Id)
        {
            _professor     = professor;
            _course        = course;
            _numberOfSeats = 0;
            _lab           = lab;
            _duration      = duration;
            Class_ID       = class_Id;
            //
            // bind professor to class
            //

            /*
             * for (int prof = 0; prof < _professor.Count; prof++)
             *  // multiple professor for a courseClass (One of several professor will be chosen)
             *  _professor[prof].AddCourseClass(this);
             */
            _professor.AddCourseClass(this);
            //
            // bind student groups to class
            //
            foreach (StudentsGroup it in groups)
            {
                it.AddCourseClass(this);
                _groups.Add(it);
                _numberOfSeats += it.GetNumberOfStudents;
            }
        }