Example #1
0
        public UomsListViewModel()
        {
            SelectedUoms = new ObservableCollection <UomViewModel>();
            CreateFilter();
            emh.Add(this.Subscribe(Event.NewSession, (e) => CreateFilter()));

            Filter.Filtered += (s, e) =>
            {
                MakeVms(Filter.Results);
            };

            filterHelper = new FilterableListHelper <Uom, UomViewModel>(this, (v) => v.uom);
            filterHelper.AddAfterEntitySavedAction(() => NoUoms = false);

            Title = "Единицы измерения";
            Filter.Clear(); // показываем все
            NoUoms = !EntityQuery <Uom> .Any(Session)();
        }
Example #2
0
        public WordsListViewModel()
        {
            Contract.Assume(AuthorityController.CurrentDoctor != null);

            CreateFilter();
            emh.Add(this.Subscribe(Event.NewSession, (e) => CreateFilter()));

            Filter.Filtered += (s, e) =>
            {
                // показываем только слова, доступные врачу
                var doctor = AuthorityController.CurrentDoctor;
                MakeVms(Filter.Results.Where(x => doctor.Words.Contains(x)));
            };

            filterHelper = new FilterableListHelper <Word, WordViewModel>(this, (v) => v.word);
            filterHelper.AddAfterEntitySavedAction(() => OnPropertyChanged(() => NoWords));

            Title = "Словарь";
            Filter.Clear(); // показываем все
        }
Example #3
0
        public PatientsListViewModel()
        {
            CreateFilter();
            emh.Add(this.Subscribe(Event.NewSession, (e) => CreateFilter()));

            Filter.Filtered += (s, e) =>
            {
                MakeVms(Filter.Results);
            };

            filterHelper = new FilterableListHelper <Patient, PatientViewModel>(this, (v) => v.patient);
            filterHelper.AddAfterEntitySavedAction(() => NoPatients = false);

            SetupSorting();
            SetupColumnsVisibility();

            Title = "Пациенты";
            Filter.Clear(); // показываем всех
            NoPatients = !EntityQuery <Patient> .Any(Session)();

            SelectLastPatient();
        }