RRRRHHHH_Code
Diff Revisions
045820 ...
vs
e2ae30 ...
for ruralHouses/src/gui/HouseFeaturesGUI.java
|
@@ -26,7 +26,6 @@ |
26 |
26 |
|
import domain.Booking; |
27 |
27 |
|
import domain.Offer; |
28 |
28 |
|
import domain.RuralHouse; |
29 |
|
- |
import exceptions.OfferCanNotBeBooked; |
30 |
29 |
|
|
31 |
30 |
|
public class HouseFeaturesGUI extends JFrame { |
32 |
31 |
|
|
|
@@ -244,11 +243,12 @@ |
244 |
243 |
|
//RegExp to see if telephone number is correct??TODO |
245 |
244 |
|
Booking book = null; |
246 |
245 |
|
try { |
247 |
|
- |
book = bookingM.createBooking(rh, rh.offers.get(row).getFirstDay(), rh.offers.get(row).getLastDay(), telIn.getText()); |
248 |
|
- |
} catch (OfferCanNotBeBooked e) { |
|
246 |
+ |
if (table.getRowCount()!=0) |
|
247 |
+ |
book = bookingM.createBooking(rh, rh.offers.get(row).getFirstDay(), rh.offers.get(row).getLastDay(), telIn.getText()); |
|
248 |
+ |
} catch (Exception e) { |
249 |
249 |
|
// TODO Auto-generated catch block |
250 |
250 |
|
e.printStackTrace(); |
251 |
|
- |
} |
|
251 |
+ |
} |
252 |
252 |
|
if (book != null) { |
253 |
253 |
|
BookRuralHouseConfirmationWindow confirmWindow = new BookRuralHouseConfirmationWindow( |
254 |
254 |
|
book); |