コード例 #1
0
        private void lst_Course_SelectedIndexChanged(object sender, EventArgs e)
        {
            cbAssignmentBox.Items.Clear();
            lst_Student.Items.Clear();
            lst_Assignment.Items.Clear();
            lst_Grade.Items.Clear();
            allStudentInfo.Clear();

            if (lst_Course.SelectedIndex != -1)
            {
                enrolledCourseInfo enrolled = thisUserInfo.allEnrolledCourses[allCourseInfo[lst_Course.SelectedIndex].id];

                foreach (string assignmentName in allAssignments.getInfoOfAAssignment(allCourseInfo[lst_Course.SelectedIndex].id).totalAssignment)
                {
                    cbAssignmentBox.Items.Add(assignmentName);
                }

                if (allAssignments.getInfoOfAAssignment(allCourseInfo[lst_Course.SelectedIndex].id).totalAssignment.Count > 0)
                {
                    cbAssignmentBox.SelectedIndex = 0;
                }
                else
                {
                    getAssignmentInfoList(-1);
                }
            }
        }
コード例 #2
0
        private void loadAssignments()
        {
            enrolledCourseInfo enrolled = thisUserInfo.allEnrolledCourses[allCourseInfo[lstCoursesList.SelectedIndex].id];

            foreach (string id in enrolled.assignmentIDList)
            {
                AssignmentInfo assignment = allAssignments.getInfoOfAAssignment(allCourseInfo[lstCoursesList.SelectedIndex].id).aStudentInfo[thisUserInfo.id].allAssignmentsOfAStudent[id];
                lstAssignmentList.Items.Add(assignment.name);
                lstGrade.Items.Add(assignment.grade);
            }
        }
コード例 #3
0
        private void lst_Course_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lst_Course.SelectedIndex != -1)
            {
                enrolledCourseInfo enrolled = thisUserInfo.allEnrolledCourses[allCourseInfo[lst_Course.SelectedIndex].id];

                foreach (string assignmentName in allAssignments.getInfoOfAAssignment(allCourseInfo[lst_Course.SelectedIndex].id).totalAssignment)
                {
                    cbAssignmentBox.Items.Add(assignmentName);
                }
                cbAssignmentBox.SelectedIndex = 0;
                getAssignmentInfoList(cbAssignmentBox.SelectedIndex);
            }
        }
コード例 #4
0
        private void getAssignmentInfoList(int index)
        {
            lst_Student.Items.Clear();
            lst_Assignment.Items.Clear();
            lst_Grade.Items.Clear();
            foreach (var pair in allCourseInfo[lst_Course.SelectedIndex].allEnrolledStudent)
            {
                UserInfo user = allUsers.getInfoOfAUser(pair.Key, true);
                lst_Student.Items.Add(user.name);

                enrolledCourseInfo enroll     = user.allEnrolledCourses[allCourseInfo[lst_Course.SelectedIndex].id];
                AssignmentInfo     assignment = allAssignments.getInfoOfAAssignment(allCourseInfo[lst_Course.SelectedIndex].id).aStudentInfo[user.id].allAssignmentsOfAStudent[(string)enroll.assignmentIDList[index]];
                lst_Assignment.Items.Add(assignment.name);
                lst_Grade.Items.Add(assignment.grade);
            }
        }
コード例 #5
0
ファイル: User.cs プロジェクト: tuancuongitit/CS3321-Project
        public UserInfo(string id, string name, string major, string userType, string username, string password, string courseID, ArrayList assignmentIDList)
        {
            this.id                 = id;
            this.name               = name;
            this.major              = major;
            this.userType           = userType;
            this.username           = username;
            this.password           = password;
            this.allEnrolledCourses = new Dictionary <string, enrolledCourseInfo>();

            if (!courseID.Equals(""))
            {
                enrolledCourseInfo newCourse = new enrolledCourseInfo(courseID, assignmentIDList);
                allEnrolledCourses.Add(courseID, newCourse);
            }
        }
コード例 #6
0
ファイル: User.cs プロジェクト: tuancuongitit/CS3321-Project
        public void addAnExistingUsertoACourse(string course_id, string student_id, ArrayList assignmentIDList)
        {
            enrolledCourseInfo enroll = new enrolledCourseInfo(course_id, assignmentIDList);

            allUsers[getInfoOfAUser(student_id, true).username].allEnrolledCourses.Add(course_id, enroll);
        }
コード例 #7
0
ファイル: User.cs プロジェクト: tuancuongitit/CS3321-Project
        public void addNewCourse(string course_id, string username)
        {
            enrolledCourseInfo aNewCourseInfo = new enrolledCourseInfo(course_id);

            allUsers[username].allEnrolledCourses.Add(course_id, aNewCourseInfo);
        }