Package Controller
Class InventoryController
java.lang.Object
Controller.InventoryController
Controller for the Inventory Screen
- Since:
- 2023-03-07
-
Field Summary
Modifier and TypeFieldDescriptionprivate javafx.scene.control.Button
Button
that will add an itemprivate javafx.scene.control.TextField
TextField
that allows user input to add an itemprivate javafx.scene.control.TextField
TextField
that allows user input to add an itemprivate DatabaseConnect
Connection to the databaseprivate javafx.scene.control.Button
Button
Button to navigate to the data trends sceneprivate javafx.scene.control.Button
Button
that will delete the itemprivate javafx.scene.control.TextField
TextField
that allows user input to delete an itemprivate javafx.scene.control.Button
Button
Button to navigate edit menu sceneprivate javafx.scene.control.Button
Button
Button to navigate employees sceneprivate javafx.scene.control.Button
Button
Button to navigate inventory sceneprivate javafx.scene.control.TableColumn<InventoryItem,
Long> TableColumn
displaying identificaiton numbers of all inventory itemsprivate javafx.scene.control.TableView<InventoryItem>
TableView
ofInventoryItem
that will display the entire inventoryprivate javafx.scene.control.TableColumn<InventoryItem,
String> TableColumn
displaying name of all inventory itemsprivate javafx.scene.control.Button
Button
Button to logoutprivate javafx.scene.control.Button
Button
Button to navigate order sceneprivate javafx.scene.control.Button
Button
Button to navigate order history sceneprivate javafx.scene.control.TableColumn<InventoryItem,
Long> TableColumn
displaying the quantity of all inventory itemsprivate SceneSwitch
Switches between scenes or tabsprivate SessionData
Current session dataprivate javafx.scene.control.Button
Button
update inventory button.private javafx.scene.control.TextField
TextField
to allow managers to update stock through the item's nameprivate javafx.scene.control.TextField
TextField
to allow managers to update stock -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addItem()
Adds an item to the inventory databaseprivate void
Reset all text fields that get user input for editing a menu item to nullvoid
Deletes an item from the databaseprivate javafx.collections.ObservableList<InventoryItem>
Helper method to retreive all items from the Inventory.void
Initialize Graphical User Interfacevoid
navButtonClicked
(javafx.event.ActionEvent event) Handles switching to a new sceneprivate void
InitializesinventoryTable
void
Updates the actual database through thedatabase
private void
Updates theinventoryTable
in the Graphical User Interface
-
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 -
inventoryTable
TableView
ofInventoryItem
that will display the entire inventory -
inventoryID
TableColumn
displaying identificaiton numbers of all inventory items -
itemName
TableColumn
displaying name of all inventory items -
quantityCol
TableColumn
displaying the quantity of all inventory items -
updateItemID
private javafx.scene.control.TextField updateItemIDTextField
to allow managers to update stock through the item's name -
updateItemQuant
private javafx.scene.control.TextField updateItemQuantTextField
to allow managers to update stock -
updateItem
private javafx.scene.control.Button updateItemButton
update inventory button. TriggersupdateInventory()
-
deleteItemID
private javafx.scene.control.TextField deleteItemIDTextField
that allows user input to delete an item -
deleteItem
private javafx.scene.control.Button deleteItemButton
that will delete the item -
addItemName
private javafx.scene.control.TextField addItemNameTextField
that allows user input to add an item -
addItemQuant
private javafx.scene.control.TextField addItemQuantTextField
that allows user input to add an item -
addItem
private javafx.scene.control.Button addItemButton
that will add an item
-
-
Constructor Details
-
InventoryController
Constructor- Parameters:
session
-SessionData
passed in fromSceneSwitch
-
-
Method Details
-
initialize
public void initialize()Initialize Graphical User Interface -
setUpTable
private void setUpTable()InitializesinventoryTable
-
addItem
public void addItem()Adds an item to the inventory database -
deleteItem
public void deleteItem()Deletes an item from the database -
updateInventory
public void updateInventory()Updates the actual database through thedatabase
-
clearTextFields
private void clearTextFields()Reset all text fields that get user input for editing a menu item to null -
updateTable
private void updateTable()Updates theinventoryTable
in the Graphical User Interface -
getInventory
Helper method to retreive all items from the Inventory.- Returns:
ObservableList
ofInventoryItem
holding every item in the inventory
-