/// <summary> /// Open a new window with the list of student strings /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnListAll_Click(object sender, RoutedEventArgs e) { // Declare a temporary student Student current = new Student(); // Create a list of matrics using the matrics from the store List <int> matrics = store.matrics; // Create a list of strings for the string representations of each student List <string> studentStrings = new List <string>(); // Loop through the number of matric numbers in the matric list for (int i = 0; i < matrics.Count; i++) { // Set the current student to the current student current = store.find(matrics[i]); // Add the current student string to the list of student strings studentStrings.Add(current.ToString()); } // Create a new window and pass in the list of student strings ListAllStudents listAllWindow = new ListAllStudents(studentStrings); // Show the new window for listing all of the student details listAllWindow.Show(); }
// Opens a new window when the button is clicked showing the // user a list of all the students in the system along with // all their details and their final mark. It passes the list // of all the students into the new window in order to dispay them. private void btnListAll_Click(object sender, RoutedEventArgs e) { ListAllStudents newWin = new ListAllStudents(store); newWin.ShowDialog(); }