/* * NAME * * Class_Form::Populate_Data_Grid_View - loads data into the data grid view. * * DESCRIPTION * * This function gets the student data from the database and loads it into the data grid view object. */ private void Populate_Data_Grid_View() { //Get list of all students List <Student> all_students = Database_Interface.Query_All_Students(); int num_students = Database_Interface.Query_Num_Students(); //Add each student to student panel for (int i = 0; i < num_students; i++) { string[] student = all_students.ElementAt(i).ToArray(); StudentPanel.Rows.Add(student); } }
/// <summary> /// The class supporting the main menu form. /// </summary> /* * NAME * * App_Form::App - The constructor for the class * * DESCRIPTION * * This function will instantiate the form. It also initializes the sentences on the dashboard. */ public App() { InitializeComponent(); string greeting = "Teacher"; { Teacher teacher = IO.Load_Teacher(); try { if (teacher.First_Name != string.Empty) { greeting = teacher.First_Name; } } catch (Exception e) { new Log(e, "App_Form.cs: Constructor", "Teacher not assigned at start"); } } welcome_label.Text = "Welcome, " + greeting + "!"; num_students_label.Text = "You have " + Database_Interface.Query_Num_Students() + " students in your class."; high_score.Text = "The highest reading level in your class is " + Database_Interface.Query_Max_Level() + "."; }