private void btnRetrieve_Click(object sender, EventArgs e) { try { IDBManager dbManager = new MySQLDBManager(); gridStudents.DataSource = dbManager.RetrieveStudents(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnListStudents_Click(object sender, EventArgs e) { try { IDBManager dbManager = new MySQLDBManager(); int CourseId = Convert.ToInt32(textBox7.Text); gridStudents.DataSource = dbManager.RetrieveStudents(CourseId); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnRetrieve2_Click(object sender, EventArgs e) { try { IDBManager dbManager = new MySQLDBManager(); dataGridView1.DataSource = dbManager.RetrieveCourses(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnEnroll_Click(object sender, EventArgs e) { try { IDBManager db = new MySQLDBManager(); Enroll enroll = RetrieveEnrollInformation(); db.EnrollStudent(enroll); EmptyControlsEnroll(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnAddStudent_Click(object sender, EventArgs e) { try { Student student = RetrieveStudentInformation(); IDBManager db = new MySQLDBManager(); db.AddStudent(student); EmptyControls(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnDeleteCourse_Click(object sender, EventArgs e) { try { Course course = RetrieveCourseInformation(); IDBManager db = new MySQLDBManager(); db.DeleteCourse(course); EmptyControlsCours(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }