Esempio n. 1
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            BaseWindowTitle = "Hromadné generování PDF dokumentů";

            CanGenerate = false;

            _years  = Date.GetYears(2010, "DESC");
            _months = new List <string>(Date.Months);
            _months.Reverse();
            _months.Insert(0, "Celý rok");

            if (SelectedYear == 0)   // month can be 0 -> displays entire year
            {
                SetDefaultPeriod(DateTime.Today.Year, DateTime.Today.Month);
            }

            _defaultSettings = _settingFacade.GetDefaultSettings();

            PdfGenerationSettingsViewModel = GetViewModel <PdfGenerationSettingsViewModel>();
            PdfGenerationSettingsViewModel.OnSettingsPropertyChanged += (s, arg) => {
                ResetSettingsCommand.RaiseCanExecuteChanged();
            };
        }
Esempio n. 2
0
        public void Reset()
        {
            _defaultSetting = _settingFacade.GetDefaultSettings();

            PdfSetting = CreateNewPdfSetting(_defaultSetting.Pdfsetting);

            if (_workedTimeViewModel == null)
            {
                _workedTimeViewModel = new WorkedTimeSettingViewModel(_defaultSetting.Time, _defaultSetting.Time, _defaultSetting.TimeTickInMinutes);
                _workedTimeViewModel.OnTimeChanged += (object sender, WorkedTimeEventArgs args) =>
                {
                    CancelChangesCommand.RaiseCanExecuteChanged();
                    SaveSettingsCommand.RaiseCanExecuteChanged();
                };
                _workedTimeViewModel.OnTimeTickChanged += (object sender, EventArgs args) =>
                {
                    CancelChangesCommand.RaiseCanExecuteChanged();
                    SaveSettingsCommand.RaiseCanExecuteChanged();
                };
            }
            _workedTimeViewModel.SetTime(_defaultSetting.Time);
            _workedTimeViewModel.SelectedTimeTickInMinutes = _defaultSetting.TimeTickInMinutes;

            ImportDataResultMessage = null;
        }
Esempio n. 3
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            EventAggregator.Subscribe(this);

            BaseWindowTitle = "Generování PDF dokumentu";

            _defaultSettings = _settingFacade.GetDefaultSettings();

            PdfGenerationSettingsViewModel = GetViewModel <PdfGenerationSettingsViewModel>();
            PdfGenerationSettingsViewModel.OnSettingsPropertyChanged += (s, arg) => {
                ResetSettingsCommand.RaiseCanExecuteChanged();
            };
        }
Esempio n. 4
0
        protected override void OnActivate()
        {
            base.OnActivate();

            _defaultSettings = _settingFacade.GetDefaultSettings();
            ResetSettings();
        }
Esempio n. 5
0
        public ListingPdfGenerationViewModel(
            SettingFacade settingFacade,
            IWindowManager windowManager,
            ISavingFilePathSelector savingFilePathSelector,
            IListingPdfDocumentFactory listingPdfDocumentFactory,
            IListingReportGenerator listingReportGenerator
            )
        {
            BaseWindowTitle = "Generování PDF dokumentu";

            _settingFacade             = settingFacade;
            _windowManager             = windowManager;
            _savingFilePathSelector    = savingFilePathSelector;
            _listingPdfDocumentFactory = listingPdfDocumentFactory;
            _listingReportGenerator    = listingReportGenerator;

            _defaultSettings = settingFacade.GetDefaultSettings();

            PdfSetting = new DefaultListingPdfReportSetting(_defaultSettings.Pdfsetting);
            PdfSetting.OnPropertyChanged += (object sender, EventArgs args) => { ResetSettingsCommand.RaiseCanExecuteChanged(); };
        }
        private void Reset(DayItem dayItem)
        {
            string date = CultureInfo.CurrentCulture.TextInfo.ToTitleCase((new DateTime(dayItem.Year, dayItem.Month, dayItem.Day)).ToLongDateString().ToLower());

            WindowTitle.Text = String.Format("{0} - {1}", date, dayItem.Listing.Name);
            _defaultSettings = _settingFacade.GetDefaultSettings();
            Locality         = null;

            if (dayItem.ListingItem != null)
            {
                ListingItem l = dayItem.ListingItem;
                Locality = l.Locality;

                WorkedTimeViewModel = new WorkedTimeSettingViewModel(_defaultSettings.Time, l.TimeSetting, _defaultSettings.TimeTickInMinutes);
            }
            else
            {
                WorkedTimeViewModel = new WorkedTimeSettingViewModel(_defaultSettings.Time, _defaultSettings.Time, _defaultSettings.TimeTickInMinutes);
            }

            Localities = new ObservableCollection <string>(dayItem.Localities);
        }