private void DeleteGivingItemBtn_Click(object sender, EventArgs e) { if (givingItemsDataGridView.Rows.Count == 0) { return; } GivingItemsController gic = new GivingItemsController(); GivingItem g = gic.Show((int)givingItemsDataGridView.SelectedRows[0].Cells["givingItemId"].Value); DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete Oferring Item: " + g.givingType.title + "\n NOTE: this action cannot be undone!", "Delete Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); if (dialogResult == DialogResult.No) { return; } else if (dialogResult == DialogResult.Yes) { g.Delete(); MessageBox.Show("Offering item Deleted from records!", "Offering Item Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadGivingItems(selectedGiving); } }