private void DeleteOther() { var otherManage = new OtherFeesManager(); var result = MessageBox.Show("Do you want to delete this record?", "Are you sure?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result == DialogResult.Yes) { otherManage.DeleteOther(selectedOtherId); } }
private void DeleteOld() { var otherManage = new OtherFeesManager(); var oldManage = new OldTuitionManager(); var result = MessageBox.Show("Do you want to delete this record?", "Are you sure?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result == DialogResult.Yes) { if (gridOld[gridOld.RowSel, 2].ToString() == "Tuition Fee") { oldManage.DeleteOld(selectedOldId); } else { otherManage.DeleteOther(selectedOldId); } } }