public ICommand MonthInlineAppointmentTappedCommand { get { return new Command<MonthInlineAppointmentTappedEventArgs>(async (args) => { var action = await _bnPage.DisplayActionSheet("Maak uw keuze", "Annuleren", null, BLUtil.GetLabelText("Afspraak aanmaken"), BLUtil.GetLabelText("Afspraak aanpassen")); switch (action) { case "Afspraak aanmaken": _bnSchedule.IsVisible = false; _bnEditor.IsVisible = true; //if (args.selectedAppointment == null) //{ // _bnEditor.OpenEditor(null, args.selectedDate); // isNewAppointment = true; //} if (args.selectedAppointment != null) { var multipleAppointment = await _bnPage.DisplayAlert(BLUtil.GetLabelText("Dubbele afspraak"), BLUtil.GetLabelText( "Er bestaat al een afspraak op dit moment, weet u zeker dat u een afspraak wilt aanmaken?"), BLUtil.GetLabelText("Ja"), BLUtil.GetLabelText("Nee")); if (multipleAppointment) { ScheduleAppointmentCollection appointments = new ScheduleAppointmentCollection(); appointments = DisplayedAppointments; indexOfAppointment = appointments.IndexOf((BNScheduleAppointment)args.selectedAppointment); _bnEditor.OpenEditor((BNScheduleAppointment)args.selectedAppointment, args.selectedDate); isNewAppointment = false; } else { _bnSchedule.IsVisible = true; _bnEditor.IsVisible = false; } } break; case "Afspraak aanpassen": if (args.selectedAppointment != null) { _bnSchedule.IsVisible = false; _bnEditor.IsVisible = true; ScheduleAppointmentCollection appointments = new ScheduleAppointmentCollection(); appointments = DisplayedAppointments; indexOfAppointment = appointments.IndexOf((BNScheduleAppointment)args.selectedAppointment); _bnEditor.OpenEditor((BNScheduleAppointment)args.selectedAppointment, args.selectedDate); isNewAppointment = false; } else { await _bnPage.DisplayAlert(BLUtil.GetLabelText("Fout"), BLUtil.GetLabelText("Geen afspraken aanwezig"), BLUtil.GetLabelText("Ok")); } break; } }); } } |