public AddPatientViewModel() { base.DisplayName = "Ajouter un patient"; this._patientService = new CSPatient(); this.Name = ""; this.FirstName = ""; this.Birthdate = DateTime.Now; this.SaveCommand = new RelayCommand(param => Save(), param => MainWindowViewModel.CheckUserRole()); this.CancelCommand = new RelayCommand(param => Cancel(), param => true); }
/// <summary> /// Constructeur du ViewModel de la page d'accueil. /// </summary> public HomeViewModel(MainWindowViewModel mainView) { base.DisplayName = "Udokotela - Accueil"; this._userService = new CSUser(); this._mainView = mainView; GetUsersInfo(); AddUserCommand = new RelayCommand(param => AddUser(), param => MainWindowViewModel.CheckUserRole()); AddPatientCommand = new RelayCommand(param => AddPatient(), param => MainWindowViewModel.CheckUserRole()); UserManagementCommand = new RelayCommand(param => UserManagement(), param => this._mainView.UserManagementCommand.CanExecute(param)); PatientManagementCommand = new RelayCommand(param => PatientManagement(), param => this._mainView.PatientManagementCommand.CanExecute(param)); LiveDataCommand = new RelayCommand(param => LiveData(), param => this._mainView.LiveDataCommand.CanExecute(param)); }
/// <summary> /// Constructeur du ViewModel d'ajout d'un utilisateur. /// </summary> public AddUserViewModel() { base.DisplayName = "Ajouter un utilisateur"; this._userService = new CSUser(); Name = ""; FirstName = ""; Role = ""; Picture = ""; Login = ""; Password = new SecureString(); SaveCommand = new RelayCommand(param => Save(), param => MainWindowViewModel.CheckUserRole()); CancelCommand = new RelayCommand(param => Cancel(), param => true); OpenFileCommand = new RelayCommand(param => OpenFile(), param => true); }
public AddObservationViewModel(int patientId, IParentWindow caller) { base.DisplayName = "Ajouter une observation"; this._observationService = new CSObservation(); this._patientId = patientId; this._caller = caller; this._weight = 0; this._bloodPressure = 0; this._prescriptionItem = ""; this.Prescription = new ObservableCollection <string>(); this._picture = ""; this.Pictures = new ObservableCollection <byte[]>(); this._comment = ""; this.SaveCommand = new RelayCommand(param => Save(), param => MainWindowViewModel.CheckUserRole()); this.CancelCommand = new RelayCommand(param => Cancel(), param => true); this.AddPrescriptionItemCommand = new RelayCommand(param => AddPrescriptionItem(), param => this.PrescriptionItem != null && this.PrescriptionItem.Length > 0); this.AddPictureCommand = new RelayCommand(param => AddPictureItem(), param => this.Picture != null && this.Picture.Length > 0); this.OpenFileCommand = new RelayCommand(param => OpenImageExplorer(), param => true); }
/// <summary> /// Constructeur du ViewModel de connexion. /// </summary> public UserManagementViewModel(MainWindowViewModel mainView) { base.DisplayName = "Udokotela - Gestion des utilisateurs"; this._userService = new CSUser(); this._mainView = mainView; GetUsersInfo(); this.AddUserCommand = new RelayCommand(param => AddUser(), param => MainWindowViewModel.CheckUserRole()); this.DeleteSelectedUsersCommand = new RelayCommand(param => DeleteSelectedUser(), param => MainWindowViewModel.CheckUserRole() && this.UserSelected != null); this.OnRowDoubleClic = new RelayCommand(param => ShowSelectedUserProfile(), param => this.UserSelected != null); }
public PatientSheetViewModel(Patient patientToDisplay, MainWindowViewModel mainView = null) { this._patientToDisplay = patientToDisplay; this._observations = patientToDisplay.Observations == null ? new ObservableCollection <Observation>() : new ObservableCollection <Observation>(patientToDisplay.Observations); this._mainView = mainView; base.DisplayName = $"Udokotela - {FirstName} {Name}"; this.BackCommand = new RelayCommand(param => DismissBack(), param => this._mainView != null && this._mainView.HasBackgroundContent()); this.OnRowDoubleClic = new RelayCommand(param => ShowObservation(param as Observation), param => true); this.AddObservationCommand = new RelayCommand(param => AddObservation(), param => MainWindowViewModel.CheckUserRole()); }
/// <summary> /// Constructeur du ViewModel de connexion. /// </summary> public PatientManagementViewModel(MainWindowViewModel mainView) { base.DisplayName = "Udokotela - Gestion des patients"; this._patientService = new CSPatient(); this._mainView = mainView; GetPatientsInfo(); this.AddPatientCommand = new RelayCommand(param => AddPatient(), param => MainWindowViewModel.CheckUserRole()); this.DeleteSelectedPatientsCommand = new RelayCommand(param => DeleteSelectedPatient(), param => MainWindowViewModel.CheckUserRole() && this.PatientSelected != null); this.OnRowDoubleClic = new RelayCommand(param => ShowSelectedPatient(), param => this.PatientSelected != null); }