public void AddEmployee() { SelectedEmployees.Add(SelectedEmployeeToAdd); AvailableEmployees.Remove(SelectedEmployeeToAdd); NotifyOfPropertyChange(() => SelectedEmployees); NotifyOfPropertyChange(() => CanPrint); NotifyOfPropertyChange(() => CanReset); }
public void AddEmployee() { foreach (var item in AvailableEmployees.Where(x => x.IsSelected).Reverse()) { SelectedEmployeeToAdd.IsSelected = false; SelectedEmployees.Add(SelectedEmployeeToAdd); AvailableEmployees.Remove(SelectedEmployeeToAdd); } NotifyOfPropertyChange(() => SelectedEmployees); NotifyOfPropertyChange(() => AvailableEmployees); NotifyOfPropertyChange(() => CanSave); NotifyOfPropertyChange(() => CanReset); SortEmployees(SelectedEmployees); SortEmployees(AvailableEmployees); }
private void OnAddEmployeeExecute() { if (SelectedEmployeeToAdd == null) { // _dialogService.ShowInfoDialog("Please select an Employee to add."); _dialogService.ShowInfoDialogUsingMsgBox("Please select an Employee to add."); return; } EmployeesOnAddedState.Add(SelectedEmployeeToAdd); Employees.Add(SelectedEmployeeToAdd); if (AvailableEmployees.Contains(SelectedEmployeeToAdd)) { AvailableEmployees.Remove(SelectedEmployeeToAdd); } IsDirty = true;//_companyRepository.HasChanges(); SaveCommand.RaiseCanExecuteChanged(); }
public void AddSelectedEmployee() { AssignedEmployees.Add(SelectedAvailableEmployee); AvailableEmployees.Remove(SelectedAvailableEmployee); SelectedAvailableEmployee = null; }