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

            // delete from database
            if (DBAction.DeleteStudy(CurrentStudy.StudyID) == 1)
            {
                MessageBox.Show("Error deleting this study.");
                return;
            }
            else
            {
                // remove from list after successful deletion from database
                bs.RemoveCurrent();
            }
        }