public void DeleteExecute() { try { if (Manager != null) { MessageBoxResult result = MessageBox.Show("Are you sure you want to delete this manager?", "Confirmation", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { bool isDeleted = managers.DeleteManager(Manager); if (isDeleted == true) { MessageBox.Show("Manager is deleted.", "Notification", MessageBoxButton.OK); ManagerList = managers.ViewAllManager(); } else { MessageBox.Show("Manager cannot be deleted.", "Notification", MessageBoxButton.OK); } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }