-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeptview.java
More file actions
66 lines (53 loc) · 1.73 KB
/
Copy pathDeptview.java
File metadata and controls
66 lines (53 loc) · 1.73 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
package PDBMS;
//Should be loaded when admin clicks department code on the form
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import java.sql.ResultSet;
import java.sql.SQLException;
public class Deptview {
@FXML private TextField deptcode;
@FXML private TextField deptname;
@FXML private TextArea deptdescrp;
@FXML private Button back;
Stage s;
public void initStatus(final Stage l){
s=l;
ResultSet r=LoginManager.sql("select * from deptview where dept_code="+Integer.parseInt(deptcode.getText())+"");
try {
if (r.next()) {
// deptcode.setText("" + r.getInt("dept_code"));
deptname.setText(r.getString("dept_name"));
deptdescrp.setText(r.getString("dept_descrp"));
}
} catch (SQLException e) {
e.printStackTrace();
}
}
public void getparam(String param)
{
deptcode.setText(param);
deptcode.setEditable(false);
}
/* @FXML
private void ret()
{
ResultSet r=LoginManager.sql("Select * from department where dept_code="+Integer.parseInt(deptcode.getText())+"");
try {
if (r.next()) {
deptcode.setText("" + r.getInt("dept_code"));
deptname.setText(r.getString("dept_name"));
deptdescrp.setText(r.getString("dept_descrp"));
}
} catch (SQLException e) {
e.printStackTrace();
}
}*/
@FXML
private void GoBackButton(){
// get a handle to the stage
s.close();
}
}