private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e) { if (e.DialogViewModel is AppointmentDialogViewModel) { e.Cancel = true; if (Properties.Settings.Default.Role != "Support Staff" && Properties.Settings.Default.Role != "Employee") { if (scheduleView.SelectedSlot != null) { Slot selectedSlot = scheduleView.SelectedSlot; UserControl_AddSchedule addSchd = new UserControl_AddSchedule(selectedSlot, this); addSchd.ShowDialog(); } else if (scheduleView.SelectedAppointment != null) { IOccurrence sel = scheduleView.SelectedAppointment; Appointment selectedAppt = sel as Appointment; UserControl_AddSchedule addSchd = new UserControl_AddSchedule(selectedAppt, this); addSchd.ShowDialog(); } } } if (e.DialogViewModel is ConfirmDialogViewModel) { e.DefaultDialogResult = false; e.Cancel = true; } var dialogViewModel = e.DialogViewModel as RecurrenceChoiceDialogViewModel; if (dialogViewModel != null) { dialogViewModel.IsSeriesModeSelected = true; } }
void Schedule_AddButton_Click(object sender, RoutedEventArgs e) { Slot selectedSlot = scheduleView.SelectedSlot; UserControl_AddSchedule addSchd = new UserControl_AddSchedule(selectedSlot, this); addSchd.ShowDialog(); }
void Schedule_EditButton_Click(object sender, RoutedEventArgs e) { IOccurrence sel = scheduleView.SelectedAppointment; Appointment selectedAppt = sel as Appointment; UserControl_AddSchedule addSchd = new UserControl_AddSchedule(selectedAppt, this); addSchd.ShowDialog(); }