private void loadEnrolledCourses(UserInfo user) { foreach (var pair in user.allEnrolledCourses) { var courseID = pair.Key; CourseInfo course = allCourses.getInfoOfACourse(courseID); allCourseInfo.Add(course); var courseName = course.name; lst_Course.Items.Add(courseName); } }
private void loadEnrolledCourses(UserInfo user, string userType) { allCourseInfo.Clear(); lst_Course.Items.Clear(); foreach (var pair in user.allEnrolledCourses) { var courseID = pair.Key; CourseInfo course = allCourses.getInfoOfACourse(courseID); allCourseInfo.Add(course); var courseName = course.name; if (userType.Equals("Professor")) { lst_Course.Items.Add(courseName); } } }
public void addNewCourse(string course_id, string name, string professor, string type) { CourseInfo aNewCourse = new CourseInfo(course_id, name, professor, type); allCourses.Add(course_id, aNewCourse); }