Beispiel #1
0
 public void Init()
 {
     EventDateViewModel.ClearDict();
     h      = session.Load <HealthRecord>(IntToGuid <HealthRecord>(1));
     emptyH = session.Load <HealthRecord>(IntToGuid <HealthRecord>(71));
     vm     = EventDateViewModel.FromHr(h);
 }
Beispiel #2
0
        public void EmptySetAge()
        {
            var vm = EventDateViewModel.FromHr(emptyH);

            vm.AtAge = 5;

            Assert.AreEqual(EventDateViewModel.ShowAs.AtAge, vm.FirstSet);
        }
Beispiel #3
0
        public void EmptySetOffset()
        {
            var vm = EventDateViewModel.FromHr(emptyH);

            vm.Offset = 5;

            Assert.AreEqual(EventDateViewModel.ShowAs.Offset, vm.FirstSet);
        }
Beispiel #4
0
        public void EmptySetToMonth()
        {
            var vm = EventDateViewModel.FromHr(emptyH);

            vm.to.Month = 5;

            Assert.AreEqual(EventDateViewModel.ShowAs.Date, vm.FirstSet);
        }
Beispiel #5
0
        public void EmptySetUnit()
        {
            var vm = EventDateViewModel.FromHr(emptyH);

            vm.Unit = DateUnit.Month;

            Assert.IsTrue(vm.IsEmpty);
            Assert.AreEqual(null, vm.FirstSet);
        }
Beispiel #6
0
        public DateEditorViewModel(HealthRecord hr)
        {
            Contract.Requires(hr != null);
            this.healthRecord            = hr;
            hr.FromDate.PropertyChanged += FromDate_PropertyChanged;

            healthRecord.PropertyChanged += healthRecord_PropertyChanged;

            EventDate = EventDateViewModel.FromHr(healthRecord);
            EventDate.PropertyChanged += EventDateVm_PropertyChanged;
            DateSuggestions            = new ObservableCollection <DateSuggestion>();

            IsIntervalEditorOpened = hr.FromDate != hr.ToDate;

            SetupDateSuggsetions();
        }
Beispiel #7
0
        public ShortHealthRecordViewModel(HealthRecord hr)
        {
            Contract.Requires(hr != null);
            this.healthRecord = hr;

            patient = hr.GetPatient();
            patient.PropertyChanged += patient_PropertyChanged;

            healthRecord.PropertyChanged += healthRecord_PropertyChanged;
            healthRecord.ItemsChanged    += healthRecord_ItemsChanged;

            SyncCheckedAndSelected = true;
            EventDate = EventDateViewModel.FromHr(healthRecord);
            EventDate.PropertyChanged += (s, e) =>
            {
                OnPropertyChanged(() => EventDateString);
            };
            DropHandler         = new DropTargetHandler(this);
            IsDropTargetEnabled = true;
        }