Package Controller
Class OrderHistoryController
java.lang.Object
Controller.OrderHistoryController
Controller for the Order History Screen
- Since:
- 2023-03-07
-
Field Summary
FieldsModifier and TypeFieldDescriptionTableColumnto display customer nameprivate DatabaseConnectConnection to the databaseprivate javafx.scene.control.ButtonButtonButton to navigate to the data trends sceneprivate javafx.scene.control.ButtonButtonButton to navigate edit menu sceneTableColumnto display employee nameprivate javafx.scene.control.ButtonButtonButton to navigate employees sceneprivate javafx.scene.control.ButtonButtonButton to navigate inventory sceneprivate javafx.scene.control.ButtonButtonButton to logoutprivate javafx.scene.control.ButtonButtonButton to navigate order sceneTableColumnto display order dateprivate javafx.scene.control.ButtonButtonButton to navigate order history sceneprivate javafx.scene.control.TableView<OrderRow>TableViewofOrderRowto display order historyprivate javafx.scene.control.TextAreaTextAreato display order detailsTableColumnto display order IDTableColumnto display order totalprivate SceneSwitchSwitches between scenes or tabsprivate SessionDataCurrent session data -
Constructor Summary
ConstructorsConstructorDescriptionOrderHistoryController(SessionData session) Constructor for OrderHistoryController -
Method Summary
Modifier and TypeMethodDescriptionprivate voidAdds a click event to eachOrderRowin table to display order detailsprivate javafx.collections.ObservableList<OrderRow>Gets the last 20 orders from the databasevoidInitializes the Order History scenevoidnavButtonClicked(javafx.event.ActionEvent event) Navigates to the scene specified by the button clickedprivate voidSets up the table to display order historyprivate voidUpdate 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 orderButtonButtonButton to navigate order scene -
orderHistoryButton
private javafx.scene.control.Button orderHistoryButtonButtonButton to navigate order history scene -
inventoryButton
private javafx.scene.control.Button inventoryButtonButtonButton to navigate inventory scene -
employeesButton
private javafx.scene.control.Button employeesButtonButtonButton to navigate employees scene -
editMenuButton
private javafx.scene.control.Button editMenuButtonButtonButton to navigate edit menu scene -
dataTrendsButton
private javafx.scene.control.Button dataTrendsButtonButtonButton to navigate to the data trends scene -
logoutButton
private javafx.scene.control.Button logoutButtonButtonButton to logout -
orderHistoryTable
TableViewofOrderRowto display order history -
orderID
TableColumnto display order ID -
customerName
TableColumnto display customer name -
orderDate
TableColumnto display order date -
orderTotal
TableColumnto display order total -
employeeName
TableColumnto display employee name -
orderHistoryTextBox
private javafx.scene.control.TextArea orderHistoryTextBoxTextAreato display order details
-
-
Constructor Details
-
OrderHistoryController
Constructor for OrderHistoryController- Parameters:
session-SessionDatapassed 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:
ObservableListofOrderRowof the last 20 orders
-
addRowOnClick
private void addRowOnClick()Adds a click event to eachOrderRowin table to display order details
-