コード例 #1
0
ファイル: ReportViewModel.cs プロジェクト: soujam69/EmpTrain
 public void AddEmployee()
 {
     SelectedEmployees.Add(SelectedEmployeeToAdd);
     AvailableEmployees.Remove(SelectedEmployeeToAdd);
     NotifyOfPropertyChange(() => SelectedEmployees);
     NotifyOfPropertyChange(() => CanPrint);
     NotifyOfPropertyChange(() => CanReset);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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();
        }
コード例 #4
0
 public void AddSelectedEmployee()
 {
     AssignedEmployees.Add(SelectedAvailableEmployee);
     AvailableEmployees.Remove(SelectedAvailableEmployee);
     SelectedAvailableEmployee = null;
 }