Beispiel #1
0
        private void btnDeleteAll_Click(object sender, EventArgs e)
        {
            if (gridDepartments.SelectedRows.Count > 0)
            {
                if (MessageBox.Show($"Are you sure you want to delete all departments?", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }

                //Delete the selected department
                department.DeleteAllDepartment();
                Logger.WriteToFile(Logger.FullName, "successfully deleted all files");
                MessageBox.Show($"All Departments has been successfully deleted", "Delete", MessageBoxButtons.OK, MessageBoxIcon.Information);
                WireUp();
            }
        }