public bool CheckSelectionValidity(RoomSelectorData data)
        {
            if (appointmentModificationsVariable.Value == null || data == allRoomFilter)
            {
                return(true);
            }

            return(data.RoomId != null &&
                   currentMedicalPractice.GetRoomById(data.RoomId.Value)
                   .TherapyPlaces
                   .Select(therapyPlace => therapyPlace.Id)
                   .Contains(appointmentModificationsVariable.Value.CurrentLocation.TherapyPlaceId));
        }
Esempio n. 2
0
        private void OnGlobalRoomFilterVariableChanged(Guid?newRoomFilter)
        {
            if (IsActive)
            {
                if (displayedMedicalPracticeVariable.Value == medicalPractice.Id)
                {
                    if (newRoomFilter == null)
                    {
                        TherapyPlaceRowViewModels.Do(viewModel =>
                        {
                            viewModelCommunication.SendTo(
                                Constants.ViewModelCollections.TherapyPlaceRowViewModelCollection,
                                viewModel.Identifier,
                                new SetVisibility(true)
                                );
                        });
                    }
                    else
                    {
                        TherapyPlaceRowViewModels.Do(viewModel =>
                        {
                            viewModelCommunication.SendTo(
                                Constants.ViewModelCollections.TherapyPlaceRowViewModelCollection,
                                viewModel.Identifier,
                                new SetVisibility(false)
                                );
                        });

                        medicalPractice.GetRoomById(newRoomFilter.Value)
                        .TherapyPlaces
                        .Select(therapyPlace => therapyPlace.Id)
                        .Do(id =>
                        {
                            viewModelCommunication.SendTo(
                                Constants.ViewModelCollections.TherapyPlaceRowViewModelCollection,
                                new TherapyPlaceRowIdentifier(Identifier, id),
                                new SetVisibility(true)
                                );
                        });
                    }
                }
            }
        }