private void btnConfirm_Click(object sender, EventArgs e) { try { if (rdoAddStudent.Checked == false && rdoDeleteStudent.Checked == false && rdoEditStudent.Checked == false) { MessageBox.Show("Please select an specific action", "Missing Information"); return; } StudentBL studentBL = new StudentBL(); if (rdoAddStudent.Checked) { Student student = new Student(); PopulateSudentObject(student); if (studentBL.Add(student)) { int studentId = studentBL.GetLastID(); MessageBox.Show($"New Student Created:" + $" \n Student ID: {studentBL.GetLastID()}"); } } else { PopulateSudentObject(); if (rdoEditStudent.Checked) { if (studentBL.Edit(student)) { MessageBox.Show("Updated SuccessFully"); } } if (rdoDeleteStudent.Checked) { if (studentBL.Remove(student.ID)) { MessageBox.Show("Deleted SuccessFully"); } } } ResetFields(); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.GetType().ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error); } }