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