RRRRHHHH_Code
Diff Revisions
d30bcc ...
vs
ccac99 ...
for ruralHouses/src/gui/HouseFeaturesGUI.java
|
@@ -55,6 +55,7 @@ |
55 |
55 |
|
private JTable table; |
56 |
56 |
|
private DefaultTableModel tableModel; |
57 |
57 |
|
private RuralHouse rh; |
|
58 |
+ |
private Vector<Offer> offers= new Vector<Offer>(); |
58 |
59 |
|
private JTextField telIn; |
59 |
60 |
|
private int row; |
60 |
61 |
|
private JLabel labelPhone; |
|
@@ -238,7 +239,9 @@ |
238 |
239 |
|
Enumeration<Offer> rhs = rh.getAllOffers().elements(); |
239 |
240 |
|
while (rhs.hasMoreElements()) { |
240 |
241 |
|
Offer of = rhs.nextElement(); |
241 |
|
- |
if (of.getBookings() != null) { |
|
242 |
+ |
if (of.getBookings() == null |
|
243 |
+ |
|| !of.isBooked()) { |
|
244 |
+ |
offers.add(of); |
242 |
245 |
|
Vector<Object> row = new Vector<Object>(); |
243 |
246 |
|
row.add(of.getOfferNumber()); |
244 |
247 |
|
row.add(of.getFirstDay()); |
|
@@ -300,8 +303,8 @@ |
300 |
303 |
|
if (table.getRowCount() != 0) { |
301 |
304 |
|
Client cl = new Client(nameField.getText(), |
302 |
305 |
|
mailField.getText(), telIn.getText()); |
303 |
|
- |
book = bookingM.createBooking(rh, rh.offers.get(row) |
304 |
|
- |
.getFirstDay(), rh.offers.get(row).getLastDay(),cl); |
|
306 |
+ |
book = bookingM.createBooking(rh, offers.get(row) |
|
307 |
+ |
.getFirstDay(), offers.get(row).getLastDay(),cl); |
305 |
308 |
|
} |
306 |
309 |
|
} catch (Exception e) { |
307 |
310 |
|
e.printStackTrace(); |