private void frmTeacherProfile_Load(object sender, EventArgs e) { //Goes through all courses and adds onto the list box for (int i = 0; i < t.getTeacherCourses().Length; i++) { //If the course exist if (t.getTeacherCourse(i) != null) { //Add the course to the listbox lsb_Courses.Items.Add(t.getTeacherCourse(i).getCourseID().ToString());//A course is added to the list box } } //Teacher related information lbl_tID.Text = "Teacher ID: " + t.getTeacherNumber().ToString(); //Displays the teacher's number lbl_tName.Text = "Teacher Name: " + t.getTeacherName(); //Displays the teacher's name }
//-------------------------------------------------------------------- /// <summary> /// This method sets the course teacher /// </summary> /// <param name="tGiven">Takes in the course teacher</param> public void setCourseTeacher(Teacher tGiven) { courseTeacher = tGiven.getTeacherNumber(); // Takes the the course teacher taken in and assigns it to the class variable }