-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLostIdWindowController.java
More file actions
56 lines (45 loc) · 1.47 KB
/
Copy pathLostIdWindowController.java
File metadata and controls
56 lines (45 loc) · 1.47 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
package healthcareLook;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
public class LostIdWindowController implements Initializable{
@FXML
TextField fName;
@FXML
TextField lName;
@FXML
TextField ssn;
@FXML
Button confirm;
String patId;
Alert dataAlert= new Alert(AlertType.INFORMATION);
Alert warnAlert= new Alert(AlertType.WARNING);
@Override
public void initialize(URL location, ResourceBundle resources) {
confirm.setOnAction(e->{
if(fName.getText().trim().isEmpty() || lName.getText().trim().isEmpty() || ssn.getText().trim().isEmpty()){
warnAlert.setTitle("Warning!");
warnAlert.setHeaderText("Please fill in all fields.");
warnAlert.showAndWait();
}
else{
if(DatabaseWork.PersonExists(fName.getText().trim(), lName.getText().trim(), ssn.getText().trim())){
patId = DatabaseWork.RetrieveIDPatient(ssn.getText().trim());
dataAlert.setTitle("ID retrieved!");
dataAlert.setHeaderText("Please write the ID number down \nID#: " + patId);
dataAlert.showAndWait();
}
else{
warnAlert.setTitle("Warning!");
warnAlert.setHeaderText("A person with that information does not exist.");
warnAlert.showAndWait();
}
}
});
}
}