Example #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (lbEmployees.SelectedIndex == -1)
            {
                return;
            }

            if (
                MessageBox.Show("Are you sure, that you want to remove the employee?", "Remove",
                                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                _employeeFacade.Remove((Employee)lbEmployees.SelectedItem);
                RebuildList();
                lbEmployees_SelectedValueChanged(null, null);
            }
        }