Пример #1
0
        public MainViewModel(IEventAggregator eventAggregator, IMessageDialogService messageDialogService)
        {
            _eventAggregator      = eventAggregator;
            _messageDialogService = messageDialogService;
            _projectRepository    = new ProjectRepository(new PM202DbContext());
            _lookupDataService    = new LookupDataService();

            _projects = new ObservableCollection <ProjectWrapper>();
            _navigationListViewModel = new NavigationListViewModel();
            _projectDetailViewModel  = new ProjectDetailViewModel();

            EditDetailCommand           = new DelegateCommand(OnEditDetailExecute);
            DeleteDetailCommand         = new DelegateCommand(OnDeleteDetailExecute);
            SaveDetailCommand           = new DelegateCommand(OnSaveDetailExecute, CanSaveDetailExecute);
            CancelPopupCommand          = new DelegateCommand(OnCancelPopup);
            AddProjectSubtaskCommand    = new DelegateCommand(OnAddProjectSubtask);
            RemoveProjectSubtaskCommand = new DelegateCommand(OnRemoveProjectSubtaskExecute, CanRemoveProjectSubtaskExecute);

            _eventAggregator.GetEvent <EditDetailEvent>().Subscribe(OnEditDetailExecute);
            _eventAggregator.GetEvent <AddDetailEvent>().Subscribe(OnAddDetailExecute);
            _eventAggregator.GetEvent <DeleteDetailEvent>().Subscribe(OnDeleteDetailExecute);
            _eventAggregator.GetEvent <RefreshListEvent>().Subscribe(OnRefreshList);

            ComboPriority   = new ObservableCollection <LookupItem>();
            ComboStatus     = new ObservableCollection <LookupItem>();
            ComboSystemList = new ObservableCollection <LookupItem>();
            ProjectSubtasks = new ObservableCollection <ProjectSubtaskWrapper>();
        }
Пример #2
0
 public POProductMapper(IConfiguration configuration, ILogger <POProductMapper> logger, ElasticClient client,
                        LookupDataService lookUpService)
 {
     _configuration = configuration;
     _logger        = logger;
     _client        = client;
     _lookUpService = lookUpService;
 }
Пример #3
0
        private void LoadAdvTypes()
        {
            AdvTypes.Clear();
            LookupDataService lookupDataService = new LookupDataService();
            var lookup = lookupDataService.GetAdvTypes();

            foreach (var lookupItem in lookup)
            {
                AdvTypes.Add(lookupItem);
            }
        }
Пример #4
0
        private async void EmployeeViewClickedAsync(object sender, RoutedEventArgs e)
        {
            //builder.RegisterType<MessageDialogService>().As<IMessageDialogService>();
            MessageDialogService dialog = new MessageDialogService();

            WebServiceDataAccess <Employee> wsDRA = new WebServiceDataAccess <Employee>();
            EmployeeDataService             employeeDataService = new EmployeeDataService(wsDRA);

            WebServiceDataAccess <Department> webServiceDataAccess = new WebServiceDataAccess <Department>();

            LookupDataService <Department> lookupDataService = new LookupDataService <Department>(webServiceDataAccess);

            _supplierViewModel = new EmployeeViewModel(employeeDataService, lookupDataService, dialog);
            await _supplierViewModel.LoadAsync();

            DataContext = _supplierViewModel;
        }