/// <summary>
        /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class.
        /// </summary>
        public WorkbenchViewModel()
        {
            this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();

            PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();

            this.Reputations = new ObservableCollection<ReputationDto>();
            this.Professions = new ObservableCollection<ProfessionDto>();
            this.Insurances = new ObservableCollection<LightInsuranceDto>();
            this.Practices = new ObservableCollection<LightPracticeDto>();
            this.Doctors = new ObservableCollection<LightDoctorDto>();
            this.SearchTags = new ObservableCollection<SearchTagDto>();

            this.Genders = new ObservableCollection<Tuple<string, Gender>>();
            Genders.Add(new Tuple<string, Gender>(Messages.Male, Gender.Male));
            Genders.Add(new Tuple<string, Gender>(Messages.Female, Gender.Female));

            this.sendPrivateMailCommand = new RelayCommand(() => this.SendMail(this.SelectedPatient.PrivateMail), () => this.CanSendMail());
            this.sendProMailCommand = new RelayCommand(() => SendMail(this.SelectedPatient.ProMail), () => this.CanSendMail());
            this.saveCommand = new RelayCommand(() => this.Save(), () => this.CanSave());
            this.changeImageCommand = new RelayCommand(() => this.ChangeImage(), () => this.CanChangeImage());
            this.deactivateCommand = new RelayCommand(() => this.Deactivate(), () => this.CanDeactivate());
            this.setSelectedDoctorCommand = new RelayCommand(() => this.SetSelectedDoctor(), () => this.CanSetSelectedDoctor());
            this.refreshTagsCommand = new RelayCommand(() => this.RefreshTags(), () => this.CanRefreshTags());

            PluginDataContext.Instance.DoctorBinded += (sender, e) => this.Doctors.Add(e.Data);
            PluginDataContext.Instance.DoctorUnbinded += (sender, e) =>
            {
                var thisDoctor = (from d in this.Doctors
                                  where d.Id == e.Data.Id
                                  select d).FirstOrDefault();
                if (thisDoctor == null) { return; }
                this.Doctors.Remove(thisDoctor);
            };
        }
 public AddSpecialisationViewModel()
 {
     if (!Designer.IsDesignMode)
     {
         this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
         PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
     }
     this.Tag = new TagDto(TagCategory.Doctor);
     this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd());
 }
 public AddSpecialisationViewModel()
 {
     if (!Designer.IsDesignMode)
     {
         this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
         PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
     }
     this.Tag        = new TagDto(TagCategory.Doctor);
     this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd());
 }
        public InsertionViewModel()
        {
            this.HasInsertedItem = false;
            this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd());

            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
            }
        }
Example #5
0
        public InsertionViewModel()
        {
            this.HasInsertedItem = false;
            this.AddCommand      = new RelayCommand(() => this.Add(), () => this.CanAdd());

            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
            }
        }
        public AddProfessionViewModel()
        {
            this.Profession = new ProfessionDto();

            this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd());

            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
            }
        }
Example #7
0
        public AddProfessionViewModel()
        {
            this.Profession = new ProfessionDto();

            this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd());

            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
            }
        }
        public AddPracticeViewModel()
        {
            this.Practice = new PracticeDto();

            this.AddCommand       = new RelayCommand(() => this.Add(), () => this.CanAdd());
            this.ShowPopupCommand = new RelayCommand(() => this.IsPopupOpened = true);

            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
            }
        }
        public AddPracticeViewModel()
        {
            this.Practice = new PracticeDto();

            this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd());
            this.ShowPopupCommand = new RelayCommand(() => this.IsPopupOpened = true);

            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
            }
        }
Example #10
0
        public override void Initialise()
        {
            this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();

            PluginContext.Host.UserDisconnecting -= Host_Disconnecting;
            PluginContext.Host.UserDisconnecting += Host_Disconnecting;
            PluginContext.Host.Invoke(() =>
            {
                this.ConfigureViewService();
                this.BuildButtons();
                this.BuildContextMenu();
            });
        }
Example #11
0
        public AddDoctorViewModel()
        {
            this.InitialiseCollections();

            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
            }

            this.Doctor     = new DoctorDto();
            this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd());

            this.Refresh();
        }
Example #12
0
        public AddDoctorViewModel()
        {
            this.InitialiseCollections();

            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
            }

            this.Doctor = new DoctorDto();
            this.AddCommand = new RelayCommand(() => this.Add(), () => this.CanAdd());

            this.Refresh();
        }
Example #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class.
        /// </summary>
        /// <param name="host">The host.</param>
        public WorkbenchViewModel()
            : base()
        {
            this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();

            PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();

            this.InitialiseCollections();

            this.ChangeImageCommand = new RelayCommand(() => this.ChangeImage(), () => this.CanChangePicture());
            this.BindDoctorCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<BindDoctorViewModel>(), () => this.Patient != null);
            this.RemoveLinkCommand = new RelayCommand(() => this.RemoveLink());

            this.SaveCommand = new RelayCommand(() => this.Save(), () => this.CanSave());
        }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class.
        /// </summary>
        /// <param name="host">The host.</param>
        public WorkbenchViewModel()
            : base()
        {
            this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();

            PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();

            this.InitialiseCollections();

            this.ChangeImageCommand = new RelayCommand(() => this.ChangeImage(), () => this.CanChangePicture());
            this.BindDoctorCommand  = new RelayCommand(() => ViewService.Manager.ShowDialog <BindDoctorViewModel>(), () => this.Patient != null);
            this.RemoveLinkCommand  = new RelayCommand(() => this.RemoveLink());

            this.SaveCommand = new RelayCommand(() => this.Save(), () => this.CanSave());
        }
Example #15
0
        public BindDoctorViewModel()
        {
            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();
            }

            this.FoundDoctors        = new ObservableCollection <LightDoctorDto>();
            this.SearchCommand       = new RelayCommand(() => this.Search(), () => this.CanSearch());
            this.SelectDoctorCommand = new RelayCommand(() => this.SelectDoctor(), () => this.CanSelectDoctor());

            Countdown.Elapsed += (sender, e) => PluginContext.Host.Invoke(() =>
            {
                this.SearchCommand.TryExecute();
                Countdown.Stop();
            });
        }
        public BindDoctorViewModel()
        {
            if (!Designer.IsDesignMode)
            {
                this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
                PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IPatientDataComponent>();
            }

            this.FoundDoctors = new ObservableCollection<LightDoctorDto>();
            this.SearchCommand = new RelayCommand(() => this.Search(), () => this.CanSearch());
            this.SelectDoctorCommand = new RelayCommand(() => this.SelectDoctor(), () => this.CanSelectDoctor());

            Countdown.Elapsed += (sender, e) => PluginContext.Host.Invoke(() =>
            {
                this.SearchCommand.TryExecute();
                Countdown.Stop();
            });
        }
Example #17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class.
        /// </summary>
        public WorkbenchViewModel()
        {
            this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();

            PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();

            this.Reputations = new ObservableCollection <ReputationDto>();
            this.Professions = new ObservableCollection <ProfessionDto>();
            this.Insurances  = new ObservableCollection <LightInsuranceDto>();
            this.Practices   = new ObservableCollection <LightPracticeDto>();
            this.Doctors     = new ObservableCollection <LightDoctorDto>();
            this.SearchTags  = new ObservableCollection <SearchTagDto>();

            this.Genders = new ObservableCollection <Tuple <string, Gender> >();
            Genders.Add(new Tuple <string, Gender>(Messages.Male, Gender.Male));
            Genders.Add(new Tuple <string, Gender>(Messages.Female, Gender.Female));

            this.sendPrivateMailCommand   = new RelayCommand(() => this.SendMail(this.SelectedPatient.PrivateMail), () => this.CanSendMail());
            this.sendProMailCommand       = new RelayCommand(() => SendMail(this.SelectedPatient.ProMail), () => this.CanSendMail());
            this.saveCommand              = new RelayCommand(() => this.Save(), () => this.CanSave());
            this.changeImageCommand       = new RelayCommand(() => this.ChangeImage(), () => this.CanChangeImage());
            this.deactivateCommand        = new RelayCommand(() => this.Deactivate(), () => this.CanDeactivate());
            this.setSelectedDoctorCommand = new RelayCommand(() => this.SetSelectedDoctor(), () => this.CanSetSelectedDoctor());
            this.refreshTagsCommand       = new RelayCommand(() => this.RefreshTags(), () => this.CanRefreshTags());

            PluginDataContext.Instance.DoctorBinded   += (sender, e) => this.Doctors.Add(e.Data);
            PluginDataContext.Instance.DoctorUnbinded += (sender, e) =>
            {
                var thisDoctor = (from d in this.Doctors
                                  where d.Id == e.Data.Id
                                  select d).FirstOrDefault();
                if (thisDoctor == null)
                {
                    return;
                }
                this.Doctors.Remove(thisDoctor);
            };
        }
Example #18
0
 protected Action(IPatientDataComponent component, LightPatientDto patient)
 {
     this.Component = component;
     this.Patient = patient;
 }
Example #19
0
 protected DoctorAction(IPatientDataComponent component, LightPatientDto patient, LightDoctorDto doctor)
     : base(component, patient)
 {
     this.Doctor = doctor;
 }
Example #20
0
 public UnbindDoctorAction(IPatientDataComponent component, LightPatientDto patient, LightDoctorDto doctor)
     : base(component, patient, doctor)
 {
 }
Example #21
0
 protected Action(IPatientDataComponent component, LightPatientDto patient)
 {
     this.Component = component;
     this.Patient   = patient;
 }
Example #22
0
 public AddThumbnailAction(IPatientDataComponent component, LightPatientDto patient, byte[] thumbnail)
     : base(component, patient)
 {
     this.Thumbnail = thumbnail;
 }
Example #23
0
 public AddThumbnailAction(IPatientDataComponent component, LightPatientDto patient, byte[] thumbnail)
     : base(component, patient)
 {
     this.Thumbnail = thumbnail;
 }
Example #24
0
 public UnbindDoctorAction(IPatientDataComponent component, LightPatientDto patient, LightDoctorDto doctor)
     : base(component, patient, doctor)
 {
 }