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); } } }
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); } }
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); } }
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); } }
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); } }
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); }
public void addNewCourse(string course_id, string username) { enrolledCourseInfo aNewCourseInfo = new enrolledCourseInfo(course_id); allUsers[username].allEnrolledCourses.Add(course_id, aNewCourseInfo); }