/** * supprime une reservation * * @param lesReservs */ public static void supprimeReservation(ArrayList<Reservation> lesReservs) { FabriqueCategorie fc = FabriqueCategorie.getInstance(); FabriqueVol fv = FabriqueVol.getInstance(); for (Reservation res : lesReservs) { Date aujourd = BDDConnection.getDateDuJour(); Date reservVol = res.getDateVol(); Date reservChambre = res.getDateReservation(); Categorie cat = fc.getCategorieWithIdCategorie(res.getIdCategorie()); int delaiCat = cat.getDelai(); Vol vol = fv.getVolBDDWithIdVol(res.getIdVol()); int delaiVol = vol.getDelaiAnnulation(); int difference = reservChambre.compareTo(aujourd); int difference2 = reservVol.compareTo(aujourd); if (difference >= delaiCat && difference2 >= delaiVol) { BDDConnection.supprimeReservation(res.getId_reservation()); } } }