private void CancelScheduledActionButton_Click(object sender, RoutedEventArgs e) { RoomSchedulesDTO selectedScheduledAction = (RoomSchedulesDTO)RoomScheduledActionsDataGrid.SelectedItem; if (selectedScheduledAction.ScheduleType == ScheduleType.Appointment) { _appointmentService.DeleteAppointment(selectedScheduledAction.Id); } else if (selectedScheduledAction.ScheduleType == ScheduleType.EquipmentTransfer) { _equipmentService.DeleteEquipmentTransfer(selectedScheduledAction.Id); } else if (selectedScheduledAction.ScheduleType == ScheduleType.Renovation) { _renovationService.DeleteRenovation(selectedScheduledAction.Id); } GetDataAndDisplayItInScheduledActionsDataGrid(); ShowActionSuccessfullyCancelledDialog(); }
private void ShowDetailsForScheduledActionButton_Click(object sender, RoutedEventArgs e) { RoomSchedulesDTO selectedScheduledAction = (RoomSchedulesDTO)RoomScheduledActionsDataGrid.SelectedItem; if (selectedScheduledAction.ScheduleType == ScheduleType.Appointment) { AppointmentInRoomMoreDetailsDialog appointmentInRoomMoreDetailsDialog = new AppointmentInRoomMoreDetailsDialog(selectedScheduledAction.Id); appointmentInRoomMoreDetailsDialog.ShowDialog(); } else if (selectedScheduledAction.ScheduleType == ScheduleType.EquipmentTransfer) { EquipmentRelocationInRoomMoreDetailsDialog equipmentRelocationInRoomMoreDetailsDialog = new EquipmentRelocationInRoomMoreDetailsDialog(selectedScheduledAction.Id); equipmentRelocationInRoomMoreDetailsDialog.ShowDialog(); } else if (selectedScheduledAction.ScheduleType == ScheduleType.Renovation) { RenovationInRoomMoreDetailsDialog renovationInRoomMoreDetailsDialog = new RenovationInRoomMoreDetailsDialog(selectedScheduledAction.Id); renovationInRoomMoreDetailsDialog.ShowDialog(); } GetDataAndDisplayItInScheduledActionsDataGrid(); }