private void buttonDelete_Click(object sender, EventArgs e) { UpdateDeleteCoursePresenter updateCoursePresenter = new UpdateDeleteCoursePresenter(this); int id = Convert.ToInt32(textBoxID.Text); if (MessageBox.Show("Are you sure you want to delete this student?", "Delete student", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ; } { if (updateCoursePresenter.DeleteInfo(id)) { MessageBox.Show("Student deleted"); //clear fields textBoxID.Text = ""; textCourseName.Text = ""; textCourseCode.Text = ""; textCourseCredit.Text = ""; } else { MessageBox.Show("Student is not deleted"); } } }
private void buttonEdit_Click(object sender, EventArgs e) { UpdateDeleteCoursePresenter updateCoursePresenter = new UpdateDeleteCoursePresenter(this); if (updateCoursePresenter.updateCourse(Convert.ToInt32(textBoxID.Text), textCourseName.Text, textCourseCode.Text, textCourseCredit.Text)) { MessageBox.Show("Course info Updated!"); } else { MessageBox.Show("Course info not updated!"); } }