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();
        }
Beispiel #2
0
        public WeeklyOverviewViewmodel(ITimeEntryService timeEntryService, IBusyService busyService, ITimeEntryRepository timeEntryRepository,
                                       ITaskItemViewmodelFactory taskItemViewmodelFactory, ITimeEntryTypeRepository timeEntryTypeRepository,
                                       ISyncService syncService, ICommonDialogs commonDialogs)
        {
            _timeEntryService = timeEntryService;
            //_busyService = busyService;
            _timeEntryRepository      = timeEntryRepository;
            _taskItemViewmodelFactory = taskItemViewmodelFactory;
            _timeEntryTypeRepository  = timeEntryTypeRepository;
            _syncService                    = syncService;
            _commonDialogs                  = commonDialogs;
            _syncCompletedCommand           = new DelegateCommand <object>(SyncCompletedExecute);
            PreviousDateCommand             = new DelegateCommand <object>(a => StartDate = StartDate.AddDays(-7));
            NextDayCommand                  = new DelegateCommand <object>(a => StartDate = StartDate.AddDays(7));
            TodayCommand                    = new DelegateCommand <object>(a => TodayCommandExecute());
            SwitchToDayViewCommand          = new DelegateCommand <object>(SwitchToDayViewCommandExecute);
            CopyPreviousTasksToSelectedDate = new DelegateCommand <object>(CopyPreviousTasksToSelectedDateExecute);
            AddTaskCommand                  = new DelegateCommand <object>(AddTaskCommandExecute);
            SaveCommand     = new DelegateCommand <object>(SaveCommandExecute);
            DeleteTimeEntry = new DelegateCommand <object>(DeleteTimeEntryExecute);
            ApplicationCommands.SyncCompleted.RegisterCommand(_syncCompletedCommand);
            TaskCommands.TaskSelectCompleted.RegisterCommand(new DelegateCommand <Task>(TaskSelectCompleted));
            TaskCommands.SaveTaskCancelled.RegisterCommand(new DelegateCommand <TimeEntry>(TaskSelectCompleted));

            Rows                    = new ObservableItemCollection <TaskItemViewmodel>();
            Rows.ItemChanged       += TasksOnItemChanged;
            _deletedRows            = new List <TaskItemViewmodel>();
            _timeEntriesForThisWeek = new List <TimeEntry>();

            TimeEntryTypes = _timeEntryTypeRepository.GetGlobal();
            StartDate      = DateTime.Today.FirstDayOfWeek();
        }
Beispiel #3
0
 public CopyPreviousMonthCommandHandler(IForecastService forecastService
                                        , ForecastRegistrationDataGenerator forecastRegistrationDataGenerator
                                        , ICommonDialogs commonDialogs
                                        , ForecastTypeProvider forecastTypeProvider
                                        , MostFrequentDayLayoutSelector mostFrequentDayLayoutSelector
                                        , ForecastRegistrationSelectedUserHandler selectedUserHandler)
 {
     _forecastService = forecastService;
     _forecastRegistrationDataGenerator = forecastRegistrationDataGenerator;
     _commonDialogs                 = commonDialogs;
     _forecastTypeProvider          = forecastTypeProvider;
     _mostFrequentDayLayoutSelector = mostFrequentDayLayoutSelector;
     _selectedUserHandler           = selectedUserHandler;
 }
 public ResetForecastCommandHandler(ICommonDialogs commonDialogs)
 {
     _commonDialogs = commonDialogs;
 }