コード例 #1
0
 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);
     }
 }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
0
        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);
        }