/// <summary> /// Method that opens the student informations window when the admin selects a student in the list /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { string[] studentInfo = this.StudentList.Text.Split(' '); Student selectedStudent = new Student(Convert.ToInt32(studentInfo[2])); StudentInformationsWindow studentInfoWin = new StudentInformationsWindow(connection, selectedStudent, "Admin"); studentInfoWin.Show(); }
/// <summary> /// Open the Student Information window (Student's environment) /// </summary> /// <param name="id"></param> public static void RunStudent(string id) { String query = "Select * from users Where userID = ' " + id + "'"; MySqlDataAdapter SDA = new MySqlDataAdapter(query, connection); DataTable userTable = new DataTable(); SDA.Fill(userTable); Student selectedStudent = new Student(Convert.ToInt32(userTable.Rows[0]["userID"].ToString())); StudentInformationsWindow studentInfoWin = new StudentInformationsWindow(connection, selectedStudent, "Student"); studentInfoWin.Show(); }