-
Notifications
You must be signed in to change notification settings - Fork 0
/
Manager.java
249 lines (219 loc) · 6.24 KB
/
Manager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import javax.swing.JButton;
import javax.swing.JTable;
import java.awt.EventQueue;
import java.sql.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Image;
public class Manager extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Manager frame = new Manager();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
Connection conn = null;
public void close()
{
System.exit(0);
}
/**
* Create the frame.
* @throws SQLException
*/
public Manager() throws SQLException {
conn = Javaconnect.getDBConnection();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 343, 464);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnNewCustomerForm = new JButton("New Customer Form");
btnNewCustomerForm.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
newCustomer custom = new newCustomer();
custom.setVisible(true);
conn.close();
}catch(Exception e1){
e1.printStackTrace();
}
}
});
btnNewCustomerForm.setBounds(10, 26, 170, 23);
contentPane.add(btnNewCustomerForm);
JButton btnNewButton = new JButton("Room");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try{
Room room = new Room();
room.setVisible(true);
}
catch(Exception e){
e.printStackTrace();
}
}
});
btnNewButton.setBounds(10, 225, 170, 23);
contentPane.add(btnNewButton);
JButton btnNewButton_1 = new JButton("Department");
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
Department dept = new Department();
dept.setVisible(true);
}
catch (Exception e1){
e1.printStackTrace();
}
}
});
btnNewButton_1.setBounds(10, 268, 170, 23);
contentPane.add(btnNewButton_1);
JButton btnNewButton_2 = new JButton("All Employee Info");
btnNewButton_2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
Employee em = new Employee();
em.setVisible(true);
}
catch (Exception e1){
e1.printStackTrace();
}
}
});
btnNewButton_2.setBounds(10, 353, 170, 23);
contentPane.add(btnNewButton_2);
JButton btnNewButton_3 = new JButton("Customer Info");
btnNewButton_3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
CustomerInfo customer = new CustomerInfo();
customer.setVisible(true);
}
catch (Exception e1){
e1.printStackTrace();
}
}
});
btnNewButton_3.setBounds(10, 180, 170, 23);
contentPane.add(btnNewButton_3);
JButton btnManagerInfo = new JButton("Manager Info");
btnManagerInfo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
ManagerInfo mana = new ManagerInfo();
mana.setVisible(true);
}
catch (Exception e1){
e1.printStackTrace();
}
}
});
btnManagerInfo.setBounds(10, 308, 170, 23);
contentPane.add(btnManagerInfo);
JButton btnNewButton_4 = new JButton("Check Out");
btnNewButton_4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkOut check;
try {
check = new checkOut();
check.setVisible(true);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
btnNewButton_4.setBounds(10, 66, 170, 23);
contentPane.add(btnNewButton_4);
JButton btnNewButton_5 = new JButton("Update Check Status");
btnNewButton_5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
updateCheck update = new updateCheck();
update.setVisible(true);
}
catch(Exception e1){
e1.printStackTrace();
}
}
});
btnNewButton_5.setBounds(10, 100, 170, 23);
contentPane.add(btnNewButton_5);
JButton btnNewButton_6 = new JButton("Update Room Status");
btnNewButton_6.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
updateRoom room = new updateRoom();
room.setVisible(true);
}catch(Exception s)
{
s.printStackTrace();
}
}
});
btnNewButton_6.setBounds(10, 146, 170, 23);
contentPane.add(btnNewButton_6);
JButton btnPickUpSerice = new JButton("Pick up Service");
btnPickUpSerice.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try{
pickUp pick = new pickUp();
pick.setVisible(true);
}
catch(Exception e){
e.printStackTrace();
}
}
});
btnPickUpSerice.setBounds(190, 26, 115, 23);
contentPane.add(btnPickUpSerice);
JButton btnSearchRoom = new JButton("Search Room");
btnSearchRoom.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
searchRoom search = new searchRoom();
search.setVisible(true);
}
catch (Exception ss){
ss.printStackTrace();
}
}
});
btnSearchRoom.setBounds(203, 225, 114, 23);
contentPane.add(btnSearchRoom);
JButton btnNewButton_7 = new JButton("Log Out");
btnNewButton_7.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
conn.close();
close();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
btnNewButton_7.setBounds(190, 391, 115, 23);
contentPane.add(btnNewButton_7);
}
}