-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReceptionistMainMenuController.java
95 lines (81 loc) · 2.52 KB
/
ReceptionistMainMenuController.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
package healthcareLook;
import java.net.URL;
import java.util.Optional;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Label;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
public class ReceptionistMainMenuController implements Initializable {
@FXML
Button checkin;
@FXML
Button newpatient;
@FXML
Button cancelappoint;
@FXML
Button setappoint;
@FXML
Button paybill;
@FXML
Button signout;
@FXML
Label welcome;
String patID;
Alert confirmAlert = new Alert(AlertType.CONFIRMATION);
Optional<ButtonType> result;
@Override
public void initialize(URL location, ResourceBundle resources) {
checkin.setOnAction(e->{
//retrieve id number first.
patID = PatientFinderMain.startPatient();
// System.out.println("new window to check patients in");
CheckinWindow.startCheckinScreen(patID);
});
newpatient.setOnAction(f->{
HealthMainClass.startPatient();
});
cancelappoint.setOnAction(g->{
//retrieve id number first.
//add new window for canceling/no shows.
patID = PatientFinderMain.startPatient();
// System.out.println("Did it get the id " + patID);
CancelWindow.startCancelScreen(patID);
});
setappoint.setOnAction(h->{
//Retrieve id number first then interact
//Alert the user should the person have a pending bill
patID = PatientFinderMain.startPatient();
if(DatabaseWork.HasPendingBill(patID)){
confirmAlert.setTitle("Pending Bill");
confirmAlert.setHeaderText(patID + " has a pending bill");
confirmAlert.setContentText("Do you wish to pay this bill?");
ButtonType yes = new ButtonType("Yes");
ButtonType no = new ButtonType("No");
confirmAlert.getButtonTypes().setAll(yes, no);
result = confirmAlert.showAndWait();
if(result.get() == yes){
PatientPaymentWindow.startCreatePaymentWindow(patID);
}
else{
PatientInteractionWindow.startPInteraction(patID);
}
}
else{
PatientInteractionWindow.startPInteraction(patID);
}
});
paybill.setOnAction(i->{
//retrieve id number first. patient finder class will change to find id
patID = PatientFinderMain.startPatient();
PatientPaymentWindow.startCreatePaymentWindow(patID);
});
signout.setOnAction(j->{
//close this window
ReceptionistMainMenuWindow.stageClose();
});
}
}