Пример #1
0
 public void OnMessageDok(RejWagaMessage msg)
 {
     if (msg.RodzajMessage == 2)
     {
         LoadDOkData();
     }
 }
Пример #2
0
        public ViewModelDokumenty()
        {
            //https://www.rapidtables.com/web/color/blue-color.html
            Kolory = Color.FromRgb(255, 0, 0);
            Kolor  = Brushes.Red;
            RisePropertyChanged("Kolor");

            Samochody = new ObservableCollection <IHP_SAMOCHOD>(context.IHP_SAMOCHOD);
            Kierowcy  = new ObservableCollection <IHP_KIEROWCA>(context.IHP_KIEROWCA);

            KontrahsArch = new ObservableCollection <IHP_KONTRAHENT_ARCH>(context.IHP_KONTRAHENT_ARCH.Where(x => x.AKTYWNY == 1));
            Kartoteki    = new ObservableCollection <IHP_KARTOTEKA>(context.IHP_KARTOTEKA);
            RodzajeDok   = new ObservableCollection <IHP_RODZAJDOK>(context.IHP_RODZAJDOK);

            Dokumenty                   = new ObservableCollection <IHP_NAGLDOK>(context.IHP_NAGLDOK);
            DeleteCommand               = new RelayCommand(Delete, CanDelete);
            AddWazenieCommand           = new RelayCommand(WykonajWazenie, CanSave);
            ClearNewProgCommand         = new DelegateCommand(Clear);
            PrintCommand                = new DelegateCommand(Print);
            UpdNewProgCommand           = new RelayCommand(Update, CanUpdate);
            ItemSelSamochodCommand      = new DelegateCommand(SelectSamochod);
            ItemSelKontrahentCommand    = new DelegateCommand(SelectKonrahent);
            ItemSelKierowcaCommand      = new DelegateCommand(SelectKierowca);
            CommandPanelFiltr           = new DelegateCommand(PanelFiltr);
            CommandPanelListaWazen      = new DelegateCommand(PanelListaWazen);
            CommandPanelUtawienieDanych = new DelegateCommand(UstawienieDanychVd);
            ShowDokCommand              = new DelegateCommand(ShowDok);
            CommandFiltruj              = new DelegateCommand(Flitr);
            DayCommand                  = new DelegateCommand(UstawDzien);
            WeekCommand                 = new DelegateCommand(UstawTydzien);
            MonthCommand                = new DelegateCommand(UstawMiesiac);
            YearCommand                 = new DelegateCommand(UstawRok);

            rejmsg    = new RejWagaMessage();
            RodzajDok = new IHP_RODZAJDOK();

            LoadCollection();
            UstawienieDanych = true;
            wybierzdzien     = true;
            LoadDOkData();

            Messenger.Default.Register <List <IHP_KIEROWCA> >(this, OnMessageKierowca);
            Messenger.Default.Register <List <IHP_KONTRAHENT_ARCH> >(this, OnMessageKontrahent);
            Messenger.Default.Register <List <IHP_KARTOTEKA> >(this, OnMessageKartoteka);

            Messenger.Default.Register <int>(this, OnRefresh);
            Messenger.Default.Register <RejWagaMessage>(this, OnMessageDok);
            _timer = new Timer(TimerCallback, null, 1000, 1000);

            //  OnMessagewagaRamkaTest();
        }