/// <summary> /// When clicked, it opens a new window with the Faculty Assignment Form, /// and shows the faculty assignment for the specific course /// matching the course code inputed by the user. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnClickSearch(object sender, EventArgs e) { // Clears the list _facultyAssignmentForm._lstResult.Items.Clear(); // Reads the course code from the text box and sets it to uppercase. string _courseCode = _txtCourseCode.Text.ToUpper(); // Runs the query var _queryResult = _repo.ListFacultyAssgn(_courseCode, ref _faculties); // Populates the list foreach (var item in _queryResult) { if (item != null) { _facultyAssignmentForm._lstResult.Items.Add(item.ToString()); } } // Opens the window with the list _facultyAssignmentForm.ShowDialog(); }