private void Button_DeleteReservation(object sender, RoutedEventArgs e)
        {
            var            viewModel           = (ReservationViewModel)DataContext;
            var            client              = new AutoReservationServiceClient();
            ReservationDto selectedReservation = client.getReservationByNr(viewModel.SelectedReservation.ReservationsNr);

            client.removeRerservation(selectedReservation);
        }
Beispiel #2
0
 public void CreateReservation(ReservationHinzufügenViewModel viewModel)
 {
     if (viewModel.IsNew)
     {
         client.addRerservation(new ReservationDto
         {
             Von   = viewModel.Von,
             Bis   = viewModel.Bis,
             Kunde = viewModel.Kunde,
             Auto  = viewModel.Auto,
         });
     }
     else
     {
         ReservationDto selectedReservation = client.getReservationByNr(viewModel.ReservationsNr);
         selectedReservation.Von   = selectedReservation.Von;
         selectedReservation.Bis   = selectedReservation.Bis;
         selectedReservation.Kunde = selectedReservation.Kunde;
         selectedReservation.Auto  = selectedReservation.Auto;
         client.modifyRerservation(selectedReservation);
     }
 }