-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatient_Registration.java
More file actions
501 lines (444 loc) · 26.3 KB
/
Patient_Registration.java
File metadata and controls
501 lines (444 loc) · 26.3 KB
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
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Reception;
import Reception.Reception_Welcome;
import Secure.DBConnect;
import Admin.Ward_Management;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.sql.Statement;
import javax.swing.JOptionPane;
/**
*
* @author User
*/
public class Patient_Registration extends javax.swing.JFrame {
/**
* Creates new form Patient_Registration
*/
public Patient_Registration() {
initComponents();
setLocationRelativeTo(null);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonGroup2 = new javax.swing.ButtonGroup();
jPanel2 = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jtitle = new javax.swing.JComboBox();
jfname = new javax.swing.JTextField();
jlastname = new javax.swing.JTextField();
jmartialstatus = new javax.swing.JComboBox();
jreligion = new javax.swing.JComboBox();
joccupation = new javax.swing.JComboBox();
jLabel3 = new javax.swing.JLabel();
jpatientid = new javax.swing.JTextField();
jdob = new javax.swing.JTextField();
female = new javax.swing.JRadioButton();
male = new javax.swing.JRadioButton();
jLabel16 = new javax.swing.JLabel();
jWardid = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jcontactno = new javax.swing.JTextField();
jhomeaddress = new javax.swing.JTextField();
jPanel3 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jLabel18 = new javax.swing.JLabel();
jLabel19 = new javax.swing.JLabel();
jfullname = new javax.swing.JTextField();
jphoneno = new javax.swing.JTextField();
jrelation = new javax.swing.JTextField();
jaddress = new javax.swing.JTextField();
jbtnAdd = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jBack = new javax.swing.JButton();
jLabel20 = new javax.swing.JLabel();
jDelete = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(990, 767));
jPanel2.setBackground(new java.awt.Color(255, 255, 255));
jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel7.setText("Patient Information");
jPanel2.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(14, 15, -1, -1));
jLabel4.setText("Title :");
jPanel2.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 100, -1, -1));
jLabel5.setText("First Name :");
jPanel2.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 150, -1, -1));
jLabel6.setText("Last Name :");
jPanel2.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 190, -1, -1));
jLabel8.setText("Gender :");
jPanel2.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 230, -1, -1));
jLabel9.setText("Martial Status :");
jPanel2.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 270, -1, -1));
jLabel10.setText("Date of Birth :");
jPanel2.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 310, -1, -1));
jLabel11.setText("Religion :");
jPanel2.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(41, 355, -1, -1));
jLabel12.setText("Occupation :");
jPanel2.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(41, 407, -1, -1));
jtitle.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Mr", "Mrs", "Miss", " " }));
jPanel2.add(jtitle, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 100, -1, -1));
jPanel2.add(jfname, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 140, 150, -1));
jPanel2.add(jlastname, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 190, 150, -1));
jmartialstatus.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Married", "UnMarried" }));
jPanel2.add(jmartialstatus, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 270, 147, -1));
jreligion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Budhism", "Christianity", "Hindu", "Islam" }));
jPanel2.add(jreligion, new org.netbeans.lib.awtextra.AbsoluteConstraints(191, 352, 147, -1));
joccupation.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Self Employed", "Non-Employed" }));
jPanel2.add(joccupation, new org.netbeans.lib.awtextra.AbsoluteConstraints(191, 404, 147, -1));
jLabel3.setText("Patient Id :");
jPanel2.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, -1, -1));
jPanel2.add(jpatientid, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 60, 150, -1));
jPanel2.add(jdob, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 310, 150, -1));
buttonGroup2.add(female);
female.setText("Female");
jPanel2.add(female, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 230, -1, -1));
buttonGroup2.add(male);
male.setText("Male");
jPanel2.add(male, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 230, -1, -1));
jLabel16.setText("Ward Id:");
jPanel2.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 460, -1, -1));
jPanel2.add(jWardid, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 460, 150, -1));
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel1.setText("Contact Information");
jLabel13.setText("Contact Number :");
jLabel14.setText("Home Address :");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel14)
.addComponent(jLabel13))
.addGap(54, 54, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jcontactno, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
.addComponent(jhomeaddress))
.addGap(60, 60, 60))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(52, 52, 52))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(32, 32, 32)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel13)
.addGap(56, 56, 56)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel14)
.addComponent(jhomeaddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jcontactno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3.setBackground(new java.awt.Color(255, 255, 255));
jPanel3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel2.setText("Next of Kin Information");
jLabel15.setText("Full Name :");
jLabel17.setText("Phone No :");
jLabel18.setText(" Address :");
jLabel19.setText("Relationship with Patient :");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel19)
.addComponent(jLabel15, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel17, javax.swing.GroupLayout.Alignment.LEADING))
.addComponent(jLabel18))
.addGap(46, 46, 46)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addComponent(jfullname, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(84, Short.MAX_VALUE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jphoneno, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jrelation, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jaddress, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))))
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2)
.addContainerGap(393, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2)
.addGap(21, 21, 21)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel15)
.addComponent(jfullname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(79, 79, 79)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jphoneno, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel17))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 100, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel18)
.addComponent(jaddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(83, 83, 83)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel19)
.addComponent(jrelation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(38, 38, 38))
);
jbtnAdd.setText("Add");
jbtnAdd.setActionCommand("");
jbtnAdd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbtnAddActionPerformed(evt);
}
});
jButton2.setText("Edit");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jBack.setText("Back");
jBack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBackActionPerformed(evt);
}
});
jLabel20.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jLabel20.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel20.setText("New Patient File");
jLabel20.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jDelete.setText("Delete");
jDelete.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jDeleteActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(139, 139, 139)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jbtnAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDelete))
.addGap(90, 90, 90)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jBack, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGap(0, 12, Short.MAX_VALUE))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(11, 11, 11)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 515, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jbtnAdd)
.addComponent(jButton2))
.addGap(46, 46, 46)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBack)
.addComponent(jDelete))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jbtnAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnAddActionPerformed
if(jpatientid.getText().equals(""))
{
JOptionPane.showMessageDialog(this,"Error! Empty PatientId field","Unuccess!",JOptionPane.INFORMATION_MESSAGE);
return;
}
if(jfname.getText().equals(""))
{
JOptionPane.showMessageDialog(this,"Error! Enter First Name","Unuccess!",JOptionPane.INFORMATION_MESSAGE);
return;
}
if(jWardid.getText().equals(""))
{
JOptionPane.showMessageDialog(this,"Error! Empty Ward Id","Unuccess!",JOptionPane.INFORMATION_MESSAGE);
return;
}
try {
Statement stat= DBConnect.getStatemennt();
String gender = "";
if (male.isSelected()) {
gender = "Male";
} else if (female.isSelected()) {
gender = "Female";
}
stat.executeUpdate("INSERT INTO patient_details(Patient_Id,Title,First_name,Last_name,Gender,Martial_Status,DOB,Religion,Occupation,Ward_id,Contact_No,Home_Address,Full_Name,Phone_No,Address,Relationship_with_Patient)VALUES('"+jpatientid.getText()+"','"+jtitle.getSelectedItem()+"','"+jfname.getText()+"','"+jlastname.getText()+"','"+ gender +"','"+jmartialstatus.getSelectedItem()+"','"+jdob.getText()+"','"+jreligion.getSelectedItem()+"','"+joccupation.getSelectedItem()+"','"+jWardid.getText()+"','"+jcontactno.getText()+"','"+jfullname.getText()+"','"+jphoneno.getText()+"','"+jaddress.getText()+"','"+jrelation.getText()+"')");
JOptionPane.showMessageDialog(this,"Error! Succesfully added to the database","Unuccess!",JOptionPane.INFORMATION_MESSAGE);
}
catch (Exception ex) {
ex.printStackTrace();
}
}//GEN-LAST:event_jbtnAddActionPerformed
private void jBackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBackActionPerformed
Reception_Welcome rw = new Reception_Welcome();
rw.setVisible(true);
this.setVisible(false);
}//GEN-LAST:event_jBackActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
try {
Statement stat= DBConnect.getStatemennt();
stat.executeUpdate("UPDATE patient_details set First_name='"+jfname.getText()+"',Last_name='"+jlastname.getText()+"',Contact_No='"+jcontactno.getText()+"',Home_Address='"+jhomeaddress.getText()+"' where Patient_Id='" + jpatientid.getText() + "'" );
} catch (SQLException ex) {
Logger.getLogger(Patient_Registration.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton2ActionPerformed
private void jDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDeleteActionPerformed
try {
Statement stat= DBConnect.getStatemennt();
stat.executeUpdate("DELETE FROM patient_details where Patient_Id='" + jpatientid.getText() + "'");
} catch (SQLException ex) {
Logger.getLogger(Ward_Management.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jDeleteActionPerformed
/**
*
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Patient_Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Patient_Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Patient_Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Patient_Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Patient_Registration().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup buttonGroup2;
private javax.swing.JRadioButton female;
private javax.swing.JButton jBack;
private javax.swing.JButton jButton2;
private javax.swing.JButton jDelete;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JTextField jWardid;
private javax.swing.JTextField jaddress;
private javax.swing.JButton jbtnAdd;
private javax.swing.JTextField jcontactno;
private javax.swing.JTextField jdob;
private javax.swing.JTextField jfname;
private javax.swing.JTextField jfullname;
private javax.swing.JTextField jhomeaddress;
private javax.swing.JTextField jlastname;
private javax.swing.JComboBox jmartialstatus;
private javax.swing.JComboBox joccupation;
private javax.swing.JTextField jpatientid;
private javax.swing.JTextField jphoneno;
private javax.swing.JTextField jrelation;
private javax.swing.JComboBox jreligion;
private javax.swing.JComboBox jtitle;
private javax.swing.JRadioButton male;
// End of variables declaration//GEN-END:variables
}