import domain.Booking;
import domain.Offer;
import domain.RuralHouse;
-import exceptions.OfferCanNotBeBooked;
public class HouseFeaturesGUI extends JFrame {
//RegExp to see if telephone number is correct??TODO
Booking book = null;
try {
- book = bookingM.createBooking(rh, rh.offers.get(row).getFirstDay(), rh.offers.get(row).getLastDay(), telIn.getText());
- } catch (OfferCanNotBeBooked e) {
+ if (table.getRowCount()!=0)
+ book = bookingM.createBooking(rh, rh.offers.get(row).getFirstDay(), rh.offers.get(row).getLastDay(), telIn.getText());
+ } catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
if (book != null) {
BookRuralHouseConfirmationWindow confirmWindow = new BookRuralHouseConfirmationWindow(
book);