private void TeacherCourseForm_Load(object sender, EventArgs e) { clsTeacherCourse objTeacherCourse = new clsTeacherCourse(); ComboBox[] cmb = new ComboBox[] { cmbTeacherID, cmbTeacherName, cmbCourseID, cmbCourseName }; objTeacherCourse.Load(cmb); objTeacherCourse.ViewAll(dgvTeacherCourse); }
private void mnuDelete_Click(object sender, EventArgs e) { if (!clsValidation.ValidateComboBox(cmbTeacherID)) { return; } if (!clsValidation.ValidateComboBox(cmbCourseID)) { return; } clsTeacherCourse objTeacherCourse = new clsTeacherCourse(Convert.ToInt32(cmbTeacherID.Text), Convert.ToInt32(cmbCourseID.Text)); objTeacherCourse.Delete(); MessageBox.Show("Teacher-Course record successfully deleted!"); objTeacherCourse.ViewAll(dgvTeacherCourse); }
private void mnuViewAll_Click(object sender, EventArgs e) { clsTeacherCourse objTeacherCourse = new clsTeacherCourse(); objTeacherCourse.ViewAll(dgvTeacherCourse); }