-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInterNal.java
461 lines (392 loc) · 13.1 KB
/
InterNal.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
import java.sql.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.border.*;
class InterNal extends JFrame implements ActionListener
{
/**
*
*/
private static final long serialVersionUID = 1L;
Connection con;
Statement stmt;
ResultSet rs;
JInternalFrame iFrame1 = new JInternalFrame();
Container c1 = getContentPane();
LayoutManager lm = null;
JDesktopPane desktopPane = new JDesktopPane();
int fcount =1;
int xo=25;
int yo=25;
public InterNal(String access)
{
super("JMS");
c1 =this.getContentPane();
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:JMS");
}
catch(Exception ae)
{
System.out.println("NO CONNECTION");
ae.printStackTrace();
}
System.out.println("Access = "+access);
//new BevelBorder(BevelBorder.RAISED),
Border border = new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED),new LineBorder(Color.white,5));
desktopPane.setBorder(border);
desktopPane.setBackground(Color.black);
int width = 500;
int height = 500;
//Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = 300;
int y = 150;
Border border1 = new CompoundBorder(new BevelBorder(BevelBorder.RAISED),new EtchedBorder(EtchedBorder.RAISED));
JMenuBar menuBar = new JMenuBar();
menuBar.setBorder(border1);
JMenu addNew = new JMenu("Add New");
JMenu createNew = new JMenu("Create");
JMenu addSearch= new JMenu("Search");
JMenu addDel = new JMenu("Delete");
JMenu UserOut = new JMenu("User Logout");
JMenuItem addCustomer = new JMenuItem("Add Customer");
JMenuItem addVendor = new JMenuItem("Add Vendor");
JMenuItem addInventory = new JMenuItem("Add Inventory");
JMenuItem addLogin = new JMenuItem("Add User");
JMenuItem createJobCard = new JMenuItem("Job Card");
JMenuItem createBill = new JMenuItem("Bill");
JMenuItem searchCustomer = new JMenuItem("Customer");
JMenuItem searchJobCard = new JMenuItem("Job Card");
JMenuItem searchInventory = new JMenuItem("Inventory");
JMenuItem searchVendor = new JMenuItem("Vendor");
JMenuItem searchBill = new JMenuItem("Old Bill");
JMenuItem deleteCustomer = new JMenuItem("Customer Info");
JMenuItem deleteJobCard = new JMenuItem("Job Card Info");
JMenuItem deleteInventory = new JMenuItem("Inventory Info");
JMenuItem deleteVendor = new JMenuItem("Vendor Info");
JMenuItem deleteBill = new JMenuItem("Old Bill Info");
JMenuItem deleteLogin = new JMenuItem("User Acount Info");
JMenuItem menuLogOut = new JMenuItem("Logout");
if(access.equals("Admin"))
{
addNew.add(addCustomer);
addCustomer.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
Customer newCustomer = new Customer();
iFrame1 = newCustomer.CustomerFrame(desktopPane);
iFrame1.show();
}
});
addNew.add(addVendor);
addVendor.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
Vendor newVendor = new Vendor();
iFrame1 = newVendor.VendorFrame(desktopPane);
iFrame1.show();
}
});
addNew.add(addInventory);
addInventory.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
Inventory newInventory = new Inventory();
iFrame1 = newInventory.InventoryFrame(desktopPane);
iFrame1.show();
}
});
addNew.add(addLogin);
addLogin.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
LoginAdd newaddLogin = new LoginAdd();
iFrame1 = newaddLogin.LoginAddFrame(desktopPane);
iFrame1.show();
}
});
createNew.add(createJobCard);
createJobCard.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
JobCard createJobCard = new JobCard();
iFrame1 = createJobCard.JobCardFrame(desktopPane);
iFrame1.show();
}
});
createNew.add(createBill);
createBill.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
Billing createBill = new Billing();
iFrame1 = createBill.BillingFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchCustomer);
searchCustomer.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
CustomerView viewCustomer = new CustomerView();
iFrame1 = viewCustomer.CustomerViewFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchJobCard);
searchJobCard.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
JobCardView viewJobCard = new JobCardView();
iFrame1 = viewJobCard.JobCardViewFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchInventory);
searchInventory.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
InventoryView viewInventory = new InventoryView();
iFrame1 = viewInventory.InventoryViewFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchVendor);
searchVendor.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
VendorView viewVendor = new VendorView();
iFrame1 = viewVendor.VendorViewFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchBill);
searchBill.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
BillingView viewBill = new BillingView();
iFrame1 = viewBill.BillingViewFrame(desktopPane);
iFrame1.show();
}
});
addDel.add(deleteCustomer);
deleteCustomer.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
CustomerDel delCustomer = new CustomerDel();
iFrame1 = delCustomer.CustomerDelFrame(desktopPane);
iFrame1.show();
}
});
addDel.add(deleteJobCard);
deleteJobCard.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
JobCardDel delJobCard = new JobCardDel();
iFrame1 = delJobCard.JobCardDelFrame(desktopPane);
iFrame1.show();
}
});
addDel.add(deleteInventory);
deleteInventory.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
InventoryDel delInventory = new InventoryDel();
iFrame1 = delInventory.InventoryDelFrame(desktopPane);
iFrame1.show();
}
});
addDel.add(deleteVendor);
deleteVendor.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
VendorDel delVendor = new VendorDel();
iFrame1 = delVendor.VendorDelFrame(desktopPane);
iFrame1.show();
}
});
addDel.add(deleteBill);
deleteBill.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
BillingDel delBill = new BillingDel();
iFrame1 = delBill.BillingDelFrame(desktopPane);
iFrame1.show();
}
});
addDel.add(deleteLogin);
deleteLogin.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
LoginDel delLogin = new LoginDel();
iFrame1 = delLogin.LoginDelFrame(desktopPane);
iFrame1.show();
}
});
UserOut.add(menuLogOut);
menuLogOut.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
setVisible(false);
Login againlogin = new Login();
}
});
menuBar.add(addNew);
menuBar.add(createNew);
menuBar.add(addSearch);
menuBar.add(addDel);
menuBar.add(UserOut,BorderLayout.WEST);
addNew.setMnemonic('A');
createNew.setMnemonic('C');
addSearch.setMnemonic('S');
addDel.setMnemonic('D');
UserOut.setMnemonic('U');
}
if(access.equals("Salesman"))
{
addNew.add(addCustomer);
addCustomer.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
Customer newCustomer = new Customer();
iFrame1 = newCustomer.CustomerFrame(desktopPane);
iFrame1.show();
}
});
createNew.add(createJobCard);
createJobCard.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
JobCard createJobCard = new JobCard();
iFrame1 = createJobCard.JobCardFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchCustomer);
searchCustomer.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
CustomerView viewCustomer = new CustomerView();
iFrame1 = viewCustomer.CustomerViewFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchJobCard);
searchJobCard.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
JobCardView viewJobCard = new JobCardView();
iFrame1 = viewJobCard.JobCardViewFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchInventory);
searchInventory.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
InventoryView viewInventory = new InventoryView();
iFrame1 = viewInventory.InventoryViewFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchBill);
searchBill.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
BillingView viewBill = new BillingView();
iFrame1 = viewBill.BillingViewFrame(desktopPane);
iFrame1.show();
}
});
UserOut.add(menuLogOut);
menuLogOut.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
desktopPane.setVisible(false);
Login againlogin = new Login();
}
});
menuBar.add(addNew);
menuBar.add(createNew);
menuBar.add(addSearch);
menuBar.add(UserOut,BorderLayout.WEST);
addNew.setMnemonic('A');
createNew.setMnemonic('C');
addSearch.setMnemonic('S');
UserOut.setMnemonic('U');
}
if(access.equals("Goldsmith"))
{
addSearch.add(searchJobCard);
searchJobCard.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
JobCardView viewJobCard = new JobCardView();
iFrame1 = viewJobCard.JobCardViewFrame(desktopPane);
iFrame1.show();
}
});
addSearch.add(searchInventory);
searchInventory.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
InventoryView viewInventory = new InventoryView();
iFrame1 = viewInventory.InventoryViewFrame(desktopPane);
iFrame1.show();
}
});
UserOut.add(menuLogOut,BorderLayout.WEST);
menuLogOut.addActionListener (new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
desktopPane.setVisible(false);
Login againlogin = new Login();
}
});
menuBar.add(addSearch);
menuBar.add(UserOut,BorderLayout.WEST);
addSearch.setMnemonic('S');
UserOut.setMnemonic('U');
}
addNew.setToolTipText("Click Here for add Operations.");
addSearch.setToolTipText("Click here to search any Data in the Table");
addDel.setToolTipText("Click Here to Delete any data in table with refrence to ID.");
menuLogOut.setToolTipText("Click here to logout from the system.");
c1.add(menuBar,BorderLayout.NORTH);
c1.add(desktopPane);
setSize(1100,700);
show();
}
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
}
}