Beispiel #1
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Warning: This will delete the region: '" + CurrentRegion.RegionName +
                                "' and any studies belonging to it. Are you sure you want to delete this region?", "Confirm Delete", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            // delete from database
            if (DBAction.DeleteRegion(CurrentRegion.RegionID) == 1)
            {
                MessageBox.Show("Error deleting this region.");
                return;
            }
            else
            {
                // remove from list after successful deletion from database
                bs.RemoveCurrent();
            }
        }