private void DeleteOtherPayments() { var otherPayManage = new OtherFeesPaymentManager(); var result = MessageBox.Show("Do you want to delete this record?", "Are you sure?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result == DialogResult.Yes) { otherPayManage.DeleteOtherPayments(selectedPayId); } }
private void DeleteOldPayments() { var tuitionPayManage = new PaymentManager(); var otherPayManage = new OtherFeesPaymentManager(); 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") { tuitionPayManage.DeletePayment(selectedPayId); } else { otherPayManage.DeleteOtherPayments(selectedPayId); } } }