+
+ /**
+ * This method creates an offer with a house number, first day, last day and price
+ *
+ * @param House
+ * number, start day, last day and price
+ * @return the created offer, or null, or an exception
+ */
+ public Offer createOffer(RuralHouse ruralHouse, Date firstDay, Date lastDay,
+ float price) throws OverlappingOfferExists, BadDates, RemoteException, Exception {
+ if (firstDay.compareTo(lastDay)>=0) throw new BadDates();
+
+ boolean b = dbMngr.existsOverlappingOffer(ruralHouse,firstDay,lastDay); // The ruralHouse object in the client may not be updated
+ if (!b) return dbMngr.createOffer(ruralHouse,firstDay,lastDay,price);
+ return null;
+ }
+
+