public ForecastRegistrationViewModel(ForecastRegistrationDataGenerator forecastRegistrationDataGenerator
                                             , ProjectSearchViewModel projectSearchViewModel
                                             , IForecastService forecastService
                                             , ICommonDialogs commonDialogs
                                             , SaveForecastCommandHandler saveForecastCommandHandler
                                             , ResetForecastCommandHandler resetForecastCommandHandler
                                             , CopyPreviousMonthCommandHandler copyPreviousMonthCommandHandler
                                             , ForecastTypeProvider forecastTypeProvider
                                             , ITimeEntryService timeEntryService
                                             , IAppSettings appSettings
                                             , ForecastRegistrationSelectedUserHandler selectedUserHandler)
        {
            _selectedDate   = DateTime.Now.FirstDayOfMonth();
            ForecastMonthId = 0;
            _forecastRegistrationDataGenerator = forecastRegistrationDataGenerator;
            _projectSearchViewModel            = projectSearchViewModel;
            _forecastService                 = forecastService;
            _commonDialogs                   = commonDialogs;
            _saveForecastCommandHandler      = saveForecastCommandHandler;
            _resetForecastCommandHandler     = resetForecastCommandHandler;
            _copyPreviousMonthCommandHandler = copyPreviousMonthCommandHandler;
            _forecastTypeProvider            = forecastTypeProvider;
            _timeEntryService                = timeEntryService;
            _appSettings         = appSettings;
            _selectedUserHandler = selectedUserHandler;

            _projectRegistrations.InitializeDirtyCheck();
        }
Пример #2
0
        private async void GetCompaniesByString(ProjectSearchViewModel x)
        {
            // Is null in designtime
            if (_projectRepository == null)
            {
                return;
            }

            // Empty search string. Clear search results
            if (string.IsNullOrEmpty(x.CompanyProjectSearchString))
            {
                x.SearchResult = new ObservableCollection <Project>();
                return;
            }

            var projects = _projectRepository.GetBySearchString(x.CompanyProjectSearchString);

            x.SearchResult = new ObservableCollection <Project>(projects);
        }