Example #1
0
 private async void save(object sender, EventArgs e)
 {
     if (fineCheckbox.Checked)
     {
         Fine fine = new Fine();
         await saveFine(fine, reservation).ContinueWith(async task =>
         {
             int fineId = (int)task.Result;
             if (fineId > 0)
             {
                 reservation.fineId   = fineId;
                 reservation._checked = true;
                 await DatabaseService.updateReservation(reservation);
             }
             else
             {
                 MessageBox.Show("Przepraszamy, nie udało się zapisać opłaty.");
             }
         });
     }
     if (!efficientCheckbox.Checked)
     {
         Car car = new Car();
         car.registrationNumber = reservation.registrationNumber;
         car.carEfficiency      = efficientCheckbox.Checked;
         await DatabaseService.updateCar(car);
     }
     showParent();
 }