public void addSection(Section section) { if (section != null) { sectionList.Add(section); } }
public void addComponent(HtmlAgilityPack.HtmlNode row) { RowInterpreter interpreter = new RowInterpreter(row); if (!interpreter.isCancelled()) { if (interpreter.isNewCourse()) { if (course != null && section != null) { course.addSection(section); courseList.Add(course); } // new course course = new Course(); course.addCourseID(interpreter.getCourseID()); course.addSectionCode(interpreter.getSectionCode()); course.addTitle(interpreter.getTitle()); // new section AND add it to course section = new Section(); section.addSectionID(interpreter.getSectionID()); section.addTime(interpreter.getTime()); section.addlocation(interpreter.getLocation()); section.addInstructor(interpreter.getInstructor()); } else { if (interpreter.hasSectionID()) { course.addSection(section); // new section section = new Section(); section.addSectionID(interpreter.getSectionID()); section.addTime(interpreter.getTime()); section.addlocation(interpreter.getLocation()); section.addInstructor(interpreter.getInstructor()); } else { // same section more info section.addTime(interpreter.getTime()); section.addlocation(interpreter.getLocation()); section.addInstructor(interpreter.getInstructor()); } } } else { /* // cancelled (Implies old course ended) if (course != null && section != null) { course.addSection(section); courseList.Add(course); } */ } }
public ScheduleSlot(string courseID, string semester, Section section) { this.courseID = courseID; this.semester = semester; this.section = section; }
public List<Course> getResult() { if (finalized == false) { if (section != null && course != null) { course.addSection(section); courseList.Add(course); } else { //meaning all departmental courses are cancelled //EX: www.artsandscience.utoronto.ca/ofr/timetable/winter/mst.html //Medieval Studies, Centre for [MST courses] } course = null; section = null; finalized = true; } return courseList; }
public bool HasConflict(Section otherSection) { bool hasConflict = false; List<SectionInfo> otherSectionInfoList = otherSection.sectionInfoList; foreach (SectionInfo sectionInfo in sectionInfoList) { foreach (SectionInfo otherSectionInfo in otherSectionInfoList) { hasConflict = sectionInfo.HasConflict(otherSectionInfo); if (hasConflict) { return true; } } } return false; }