public AppointmentSet(IClientPatientRepository patientRepository, IClientLabelRepository labelRepository, IEnumerable <AppointmentTransferData> initialAppointmentData, ClientMedicalPracticeData medicalPractice, Action <string> errorCallback) { this.patientRepository = patientRepository; this.labelRepository = labelRepository; this.medicalPractice = medicalPractice; ObservableAppointments = new ObservableAppointmentCollection(); foreach (var appointmentTransferData in initialAppointmentData) { AddAppointment(appointmentTransferData.PatientId, appointmentTransferData.Description, appointmentTransferData.StartTime, appointmentTransferData.EndTime, appointmentTransferData.Day, appointmentTransferData.TherapyPlaceId, appointmentTransferData.Id, appointmentTransferData.LabelId, errorCallback); } }
public EditDescriptionWindowBuilder(Appointment appointmentToEdit, IClientLabelRepository labelRepository, ISharedState <AppointmentModifications> modificationsVar, Action <string> errorCallback) { this.modificationsVar = modificationsVar; this.errorCallback = errorCallback; this.appointmentToEdit = appointmentToEdit; this.labelRepository = labelRepository; }
public ClientReadModelRepository(IClientEventBus eventBus, IClientPatientRepository patientsRepository, IClientMedicalPracticeRepository medicalPracticeRepository, IClientLabelRepository labelRepository, IConnectionService connectionService) { this.eventBus = eventBus; this.patientsRepository = patientsRepository; this.medicalPracticeRepository = medicalPracticeRepository; this.labelRepository = labelRepository; this.connectionService = connectionService; cachedDayReadmodels = new ConcurrentDictionary <AggregateIdentifier, AppointmentsOfADayReadModel>(); cachedPatientReadmodel = new ConcurrentDictionary <Guid, AppointmentsOfAPatientReadModel>(); }
public FixedAppointmentSet(ClientMedicalPracticeData medicalPractice, IClientPatientRepository patientsRepository, IClientLabelRepository labelRepository, IEnumerable <AppointmentTransferData> initialAppointmentData, uint aggregateVersion, AggregateIdentifier identifier, Action <string> errorCallback) { AggregateVersion = aggregateVersion; Identifier = identifier; var appointmentSet = new AppointmentSet(patientsRepository, labelRepository, initialAppointmentData, medicalPractice, errorCallback); Appointments = appointmentSet.AppointmentList; }
public AppointmentViewModelBuilder(IViewModelCommunication viewModelCommunication, IClientLabelRepository labelRepository, ICommandService commandService, ISharedState <ViewModels.AppointmentView.Helper.AppointmentModifications> appointmentModificationsVariable, ISharedState <Date> selectedDateVariable, AdornerControl adornerControl, IAppointmentModificationsBuilder appointmentModificationsBuilder) { this.viewModelCommunication = viewModelCommunication; this.labelRepository = labelRepository; this.commandService = commandService; this.appointmentModificationsVariable = appointmentModificationsVariable; this.selectedDateVariable = selectedDateVariable; this.adornerControl = adornerControl; this.appointmentModificationsBuilder = appointmentModificationsBuilder; }
public AddAppointmentDialogWindowBuilder(IClientPatientRepository patientRepository, IClientReadModelRepository readModelRepository, IClientMedicalPracticeRepository medicalPracticeRepository, IClientLabelRepository labelRepository, ISharedStateReadOnly <Guid> selectedMedicalPractiveVariable, ISharedStateReadOnly <Date> selectedDateVariable, IAppointmentViewModelBuilder appointmentViewModelBuilder, Action <string> errorCallback) { this.patientRepository = patientRepository; this.readModelRepository = readModelRepository; this.medicalPracticeRepository = medicalPracticeRepository; this.labelRepository = labelRepository; this.selectedMedicalPractiveVariable = selectedMedicalPractiveVariable; this.selectedDateVariable = selectedDateVariable; this.appointmentViewModelBuilder = appointmentViewModelBuilder; this.errorCallback = errorCallback; }
public AppointmentsOfADayReadModel(IClientEventBus eventBus, IClientPatientRepository patientsRepository, IClientLabelRepository labelRepository, ClientMedicalPracticeData medicalPractice, IEnumerable <AppointmentTransferData> initialAppointmentData, AggregateIdentifier identifier, uint initialAggregateVersion, Action <string> errorCallback) : base(eventBus) { this.errorCallback = errorCallback; AggregateVersion = initialAggregateVersion; Identifier = identifier; var initialAppointmentList = initialAppointmentData.ToList(); appointmentSet = new AppointmentSet(patientsRepository, labelRepository, initialAppointmentList, medicalPractice, errorCallback); }
public EditDescriptionViewModel(Appointment appointmentToEdit, IClientLabelRepository labelRepository, ISharedState <AppointmentModifications> modificationsVar, Action <string> errorCallback) { this.modificationsVar = modificationsVar; Description = appointmentToEdit.Description; AllAvailablesLabels = new ObservableCollection <Label>(); Cancel = new Command(CloseWindow); Accept = new Command(SaveAndClose); labelRepository.RequestAllLabels( labelList => { labelList.Do(AllAvailablesLabels.Add); SelectedLabel = labelList.First(label => label.Id == appointmentToEdit.Label.Id); }, errorCallback ); }
public MainWindowBuilder(ILocalSettingsRepository localSettingsRepository, IClientPatientRepository patientRepository, IClientMedicalPracticeRepository medicalPracticeRepository, IClientReadModelRepository readModelRepository, IClientTherapyPlaceTypeRepository therapyPlaceTypeRepository, IClientLabelRepository labelRepository, ICommandService commandService, IViewModelCommunication viewModelCommunication, ISession session, Action <string> errorCallback) { this.localSettingsRepository = localSettingsRepository; this.patientRepository = patientRepository; this.medicalPracticeRepository = medicalPracticeRepository; this.readModelRepository = readModelRepository; this.therapyPlaceTypeRepository = therapyPlaceTypeRepository; this.labelRepository = labelRepository; this.commandService = commandService; this.viewModelCommunication = viewModelCommunication; this.session = session; this.errorCallback = errorCallback; }
public MainViewModelBuilder(IClientMedicalPracticeRepository medicalPracticeRepository, IClientReadModelRepository readModelRepository, IClientPatientRepository patientRepository, IClientTherapyPlaceTypeRepository therapyPlaceTypeRepository, IClientLabelRepository labelRepository, ICommandService commandService, ILocalSettingsRepository localSettingsRepository, IViewModelCommunication viewModelCommunication, ISession session, AdornerControl adornerControl) { this.medicalPracticeRepository = medicalPracticeRepository; this.readModelRepository = readModelRepository; this.patientRepository = patientRepository; this.therapyPlaceTypeRepository = therapyPlaceTypeRepository; this.labelRepository = labelRepository; this.commandService = commandService; this.localSettingsRepository = localSettingsRepository; this.viewModelCommunication = viewModelCommunication; this.session = session; this.adornerControl = adornerControl; }
public AddAppointmentDialogViewModel(IClientMedicalPracticeRepository medicalPracticeRepository, IClientReadModelRepository readModelRepository, IClientLabelRepository labelRepository, IPatientSelectorViewModel patientSelectorViewModel, ISharedStateReadOnly <Patient> selectedPatientVariable, Date creationDate, Guid medicalPracticeId, IAppointmentViewModelBuilder appointmentViewModelBuilder, Action <string> errorCallback) { this.readModelRepository = readModelRepository; this.creationDate = creationDate; this.appointmentViewModelBuilder = appointmentViewModelBuilder; this.errorCallback = errorCallback; this.selectedPatientVariable = selectedPatientVariable; ComputeTimeSlots(medicalPracticeRepository, medicalPracticeId); selectedPatientVariable.StateChanged += OnSelectedPatientVariableChanged; PatientSelectorViewModel = patientSelectorViewModel; CloseDialog = new Command(CloseWindow); CreateAppointment = new Command(DoCreateAppointment, () => CreationState != AppointmentCreationState.NoPatientSelected && CreationState != AppointmentCreationState.NoSpaceAvailable, new PropertyChangedCommandUpdater(this, nameof(CreationState))); HourPlusOne = new Command(DoHourPlusOne, CanHourPlusOne, new PropertyChangedCommandUpdater(this, nameof(DurationHours))); HourMinusOne = new Command(DoHourMinusOne, CanHourMinusOne, new PropertyChangedCommandUpdater(this, nameof(DurationHours), nameof(DurationMinutes))); MinutePlusFifteen = new Command(DoMinutePlusFifteen, CanMinutePlusFifteen, new PropertyChangedCommandUpdater(this, nameof(DurationHours), nameof(DurationMinutes))); MinuteMinusFifteen = new Command(DoMinuteMinusFifteen, CanMinuteMinusFifteen, new PropertyChangedCommandUpdater(this, nameof(DurationHours), nameof(DurationMinutes))); SelectedPatient = Patient.Dummy; Description = string.Empty; DurationMinutes = 0; DurationHours = 2; CreationState = AppointmentCreationState.NoPatientSelected; AllAvailablesLabels = new ObservableCollection <Label>(); labelRepository.RequestAllLabels( labelList => { Application.Current.Dispatcher.Invoke(() => { labelList.Do(AllAvailablesLabels.Add); SelectedLabel = labelList.First(); }); }, errorCallback ); }