Example #1
0
        private void DoModifyAppointment(DisplayAppointmentData appointment)
        {
            viewModelCommunication.Send(new ShowPage(MainPage.Overview));

            viewModelCommunication.Send(new AsureDayIsLoaded(appointment.AppointmentRawData.MedicalPracticeId,
                                                             appointment.Day,
                                                             () =>
            {
                selectedDateVariable.Value = appointment.Day;

                viewModelCommunication.SendTo(
                    Constants.ViewModelCollections.AppointmentViewModelCollection,
                    appointment.AppointmentRawData.Id,
                    new SwitchToEditMode()
                    );
            }));
        }
Example #2
0
        private async void DoDeleteAppointment(DisplayAppointmentData appointment)
        {
            var dialog = new UserDialogBox("", "Wollen Sie den Termin wirklich löschen?",
                                           MessageBoxButton.OKCancel);
            var result = await dialog.ShowMahAppsDialog();

            if (result == MessageDialogResult.Affirmative)
            {
                medicalPracticeRepository.RequestPraticeVersion(
                    practiceVersion =>
                {
                    commandService.TryDeleteAppointment(
                        operationSuccessful =>
                    {
                        if (!operationSuccessful)
                        {
                            viewModelCommunication.Send(new ShowNotification("Termin kann nicht gelöscht werden", 5));
                        }
                    },
                        new AggregateIdentifier(appointment.Day,
                                                appointment.AppointmentRawData.MedicalPracticeId,
                                                practiceVersion),
                        appointment.AppointmentRawData.PatientId,
                        appointment.AppointmentRawData.Id,
                        appointment.Description,
                        appointment.AppointmentRawData.StartTime,
                        appointment.AppointmentRawData.EndTime,
                        appointment.AppointmentRawData.TherapyPlaceId,
                        appointment.AppointmentRawData.LabelId,
                        ActionTag.RegularAction,
                        errorCallBack);
                },
                    appointment.AppointmentRawData.MedicalPracticeId,
                    appointment.Day,
                    errorCallBack
                    );
            }
        }