Package Controller
Class OrderHistoryController
java.lang.Object
Controller.OrderHistoryController
Controller for the Order History Screen
- Since:
- 2023-03-07
-
Field Summary
Modifier and TypeFieldDescriptionTableColumn
to display customer nameprivate DatabaseConnect
Connection to the databaseprivate javafx.scene.control.Button
Button
Button to navigate to the data trends sceneprivate javafx.scene.control.Button
Button
Button to navigate edit menu sceneTableColumn
to display employee nameprivate javafx.scene.control.Button
Button
Button to navigate employees sceneprivate javafx.scene.control.Button
Button
Button to navigate inventory sceneprivate javafx.scene.control.Button
Button
Button to logoutprivate javafx.scene.control.Button
Button
Button to navigate order sceneTableColumn
to display order dateprivate javafx.scene.control.Button
Button
Button to navigate order history sceneprivate javafx.scene.control.TableView<OrderRow>
TableView
ofOrderRow
to display order historyprivate javafx.scene.control.TextArea
TextArea
to display order detailsTableColumn
to display order IDTableColumn
to display order totalprivate SceneSwitch
Switches between scenes or tabsprivate SessionData
Current session data -
Constructor Summary
ConstructorDescriptionOrderHistoryController
(SessionData session) Constructor for OrderHistoryController -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Adds a click event to eachOrderRow
in table to display order detailsprivate javafx.collections.ObservableList<OrderRow>
Gets the last 20 orders from the databasevoid
Initializes the Order History scenevoid
navButtonClicked
(javafx.event.ActionEvent event) Navigates to the scene specified by the button clickedprivate void
Sets up the table to display order historyprivate void
Update theorderHistoryTable
-
Field Details
-
session
Current session data- See Also:
-
database
Connection to the database- See Also:
-
sceneSwitch
Switches between scenes or tabs- See Also:
-
orderButton
private javafx.scene.control.Button orderButtonButton
Button to navigate order scene -
orderHistoryButton
private javafx.scene.control.Button orderHistoryButtonButton
Button to navigate order history scene -
inventoryButton
private javafx.scene.control.Button inventoryButtonButton
Button to navigate inventory scene -
employeesButton
private javafx.scene.control.Button employeesButtonButton
Button to navigate employees scene -
editMenuButton
private javafx.scene.control.Button editMenuButtonButton
Button to navigate edit menu scene -
dataTrendsButton
private javafx.scene.control.Button dataTrendsButtonButton
Button to navigate to the data trends scene -
logoutButton
private javafx.scene.control.Button logoutButtonButton
Button to logout -
orderHistoryTable
TableView
ofOrderRow
to display order history -
orderID
TableColumn
to display order ID -
customerName
TableColumn
to display customer name -
orderDate
TableColumn
to display order date -
orderTotal
TableColumn
to display order total -
employeeName
TableColumn
to display employee name -
orderHistoryTextBox
private javafx.scene.control.TextArea orderHistoryTextBoxTextArea
to display order details
-
-
Constructor Details
-
OrderHistoryController
Constructor for OrderHistoryController- Parameters:
session
-SessionData
passed in fromSceneSwitch
-
-
Method Details
-
initialize
public void initialize()Initializes the Order History scene -
setUpTable
private void setUpTable()Sets up the table to display order history -
updateTable
private void updateTable()Update theorderHistoryTable
-
getOrders
Gets the last 20 orders from the database- Returns:
ObservableList
ofOrderRow
of the last 20 orders
-
addRowOnClick
private void addRowOnClick()Adds a click event to eachOrderRow
in table to display order details
-