|
@@ -62,10 +62,8 @@ |
62 |
62 |
|
setContentPane(contentPane); |
63 |
63 |
|
contentPane.setLayout(null); |
64 |
64 |
|
|
65 |
|
- |
BookingInterface bm = null; |
66 |
|
- |
|
67 |
65 |
|
try { |
68 |
|
- |
bm = (BookingInterface) Naming |
|
66 |
+ |
bookM = (BookingInterface) Naming |
69 |
67 |
|
.lookup(___IntNames.BookingManager); |
70 |
68 |
|
|
71 |
69 |
|
} catch (Exception e1) { |
|
@@ -73,11 +71,11 @@ |
73 |
71 |
|
+ e1.toString()); |
74 |
72 |
|
} |
75 |
73 |
|
try { |
76 |
|
- |
this.bookings = bm.getOffersbookings(this.off); |
|
74 |
+ |
this.bookings = bookM.getOffersbookings(this.off); |
77 |
75 |
|
} catch (RemoteException e1) { |
78 |
76 |
|
e1.printStackTrace(); |
79 |
77 |
|
} |
80 |
|
- |
|
|
78 |
+ |
|
81 |
79 |
|
JLabel lblNewLabel = new JLabel(); |
82 |
80 |
|
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 27)); |
83 |
81 |
|
lblNewLabel.setBounds(23, 41, 536, 33); |
|
@@ -101,17 +99,11 @@ |
101 |
99 |
|
|
102 |
100 |
|
table.setModel(tableModel); |
103 |
101 |
|
|
|
102 |
+ |
JButton btnDenyAddition = new JButton("Deny Booking"); |
104 |
103 |
|
JButton btnNewButton = new JButton("Confirm Booking"); |
105 |
104 |
|
btnNewButton.addActionListener(new ActionListener() { |
106 |
105 |
|
public void actionPerformed(ActionEvent e) { |
107 |
|
- |
try { |
108 |
|
- |
bookM = (BookingInterface) Naming |
109 |
|
- |
.lookup(___IntNames.BookingManager); |
110 |
|
- |
} catch (Exception e1) { |
111 |
|
- |
System.out |
112 |
|
- |
.println("Error accessing remote authentication: " |
113 |
|
- |
+ e1.toString()); |
114 |
|
- |
} |
|
106 |
+ |
|
115 |
107 |
|
if (table.getRowCount() != 0 && table.getSelectedRow() != -1) { |
116 |
108 |
|
if (table.getRowCount() != 0 |
117 |
109 |
|
&& table.getSelectedRow() != -1) { |
|
@@ -121,8 +113,19 @@ |
121 |
113 |
|
} catch (RemoteException e1) { |
122 |
114 |
|
e1.printStackTrace(); |
123 |
115 |
|
} |
124 |
|
- |
contentPane.setVisible(false); |
125 |
|
- |
|
|
116 |
+ |
int rows = table.getModel().getRowCount(); |
|
117 |
+ |
for(int i = rows - 1; i >=0; i--){ |
|
118 |
+ |
((DefaultTableModel) table.getModel()).removeRow(i); |
|
119 |
+ |
} |
|
120 |
+ |
Vector<Object> row = new Vector<Object>(); |
|
121 |
+ |
row.add(book.getBookNumber()); |
|
122 |
+ |
row.add(book.getBookDate()); |
|
123 |
+ |
row.add(book.getClient().getName()); |
|
124 |
+ |
row.add(book.getClient().getMailAccount()); |
|
125 |
+ |
row.add(book.getClient().getTelephone()); |
|
126 |
+ |
tableModel.addRow(row); |
|
127 |
+ |
btnNewButton.setEnabled(false); |
|
128 |
+ |
btnDenyAddition.setEnabled(false); |
126 |
129 |
|
} |
127 |
130 |
|
|
128 |
131 |
|
} |
|
@@ -131,17 +134,9 @@ |
131 |
134 |
|
btnNewButton.setBounds(33, 396, 169, 25); |
132 |
135 |
|
contentPane.add(btnNewButton); |
133 |
136 |
|
|
134 |
|
- |
JButton btnDenyAddition = new JButton("Deny Booking"); |
135 |
137 |
|
btnDenyAddition.addActionListener(new ActionListener() { |
136 |
138 |
|
public void actionPerformed(ActionEvent arg0) { |
137 |
|
- |
try { |
138 |
|
- |
bookM = (BookingInterface) Naming |
139 |
|
- |
.lookup(___IntNames.BookingManager); |
140 |
|
- |
} catch (Exception e1) { |
141 |
|
- |
System.out |
142 |
|
- |
.println("Error accessing remote authentication: " |
143 |
|
- |
+ e1.toString()); |
144 |
|
- |
} |
|
139 |
+ |
|
145 |
140 |
|
if (table.getRowCount() != 0 && table.getSelectedRow() != -1) { |
146 |
141 |
|
Booking book = bookings.get(table.getSelectedRow()); |
147 |
142 |
|
try { |
|
@@ -166,7 +161,7 @@ |
166 |
161 |
|
btnNewButton.setEnabled(false); |
167 |
162 |
|
} |
168 |
163 |
|
} |
169 |
|
- |
|
|
164 |
+ |
|
170 |
165 |
|
btnDenyAddition.setBounds(390, 395, 169, 25); |
171 |
166 |
|
contentPane.add(btnDenyAddition); |
172 |
167 |
|
|