Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard

Diff Revisions fca164 ... vs ad3773 ... for ruralHouses client/src/gui/HouseFeaturesGUI.java

Diff revisions: vs.
  @@ -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;
  @@ -238,9 +237,7 @@
238 237 Enumeration<Offer> rhs = rh.getAllOffers().elements();
239 238 while (rhs.hasMoreElements()) {
240 239 Offer of = rhs.nextElement();
241 - if (of.getBookings() == null
242 - || !of.isBooked()) {
243 - offers.add(of);
240 + if (of.getBookings() != null) {
244 241 Vector<Object> row = new Vector<Object>();
245 242 row.add(of.getOfferNumber());
246 243 row.add(of.getFirstDay());
  @@ -290,7 +287,6 @@
290 287 + e1.toString());
291 288 }
292 289
293 - //RegExp to see if telephone number is correct??TODO
294 290 if (telIn.getText().matches("[976]\\d{2}[.\\- ]?\\d{3}[.\\- ]?\\d{3}")
295 291 && mailField
296 292 .getText()
  @@ -303,8 +299,8 @@
303 299 if (table.getRowCount() != 0) {
304 300 Client cl = new Client(nameField.getText(),
305 301 mailField.getText(), telIn.getText());
306 - book = bookingM.createBooking(rh, offers.get(row)
307 - .getFirstDay(), offers.get(row).getLastDay(),cl);
302 + book = bookingM.createBooking(rh, rh.offers.get(row)
303 + .getFirstDay(), rh.offers.get(row).getLastDay(),cl);
308 304 }
309 305 } catch (Exception e) {
310 306 e.printStackTrace();