-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathFrmSearchOPDAdmission.java
More file actions
72 lines (64 loc) · 1.76 KB
/
FrmSearchOPDAdmission.java
File metadata and controls
72 lines (64 loc) · 1.76 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
package hms;
import javax.swing.*;
import java.awt.*;
import java.sql.*;
import java.awt.event.*;
public class FrmSearchOPDAdmission extends JInternalFrame
{
/**
*
*/
private static final long serialVersionUID = 1L;
JLabel lblSearch,lblSelect;
JTextField jtfSearch;
JComboBox<String> jcbSelect;
JButton btnSearch,btnCancel;
DConnection dc;
ResultSet rst;
FrmOPDAdmission fpp;
FrmSearchOPDAdmission(FrmOPDAdmission fpp)
{
super("Search",false,true,false,false);
this.fpp=fpp;
setLayout(new GridLayout(3,2));
lblSearch=new JLabel("Search");
add(lblSearch);
jtfSearch=new JTextField();
add(jtfSearch);
lblSelect=new JLabel("Select");
add(lblSelect);
jcbSelect=new JComboBox<String>();
jcbSelect.addItem("reg_no");
jcbSelect.addItem("pat_id");
jcbSelect.addItem("dr_id");
add(jcbSelect);
btnSearch=new JButton("Search");
btnSearch.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
dc=new DConnection();
String select=(String)jcbSelect.getSelectedItem();
String value=jtfSearch.getText();
FrmOPDAdmission.query="from opd where "+select+" = "+value+"";
dispose();
fpp.reload();
}
});
add(btnSearch);
btnCancel=new JButton("Cancel");
btnCancel.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
dispose();
}
});
add(btnCancel);
setSize(300,200);
setLocation(CommonMethods.getCenterPoint(getSize()));
setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setVisible(true);
}
}