Package Controller
Class InventoryController
java.lang.Object
Controller.InventoryController
Controller for the Inventory Screen
- Since:
- 2023-03-07
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javafx.scene.control.ButtonButtonthat will add an itemprivate javafx.scene.control.TextFieldTextFieldthat allows user input to add an itemprivate javafx.scene.control.TextFieldTextFieldthat allows user input to add an itemprivate DatabaseConnectConnection to the databaseprivate javafx.scene.control.ButtonButtonButton to navigate to the data trends sceneprivate javafx.scene.control.ButtonButtonthat will delete the itemprivate javafx.scene.control.TextFieldTextFieldthat allows user input to delete an itemprivate javafx.scene.control.ButtonButtonButton to navigate edit menu sceneprivate javafx.scene.control.ButtonButtonButton to navigate employees sceneprivate javafx.scene.control.ButtonButtonButton to navigate inventory sceneprivate javafx.scene.control.TableColumn<InventoryItem,Long> TableColumndisplaying identificaiton numbers of all inventory itemsprivate javafx.scene.control.TableView<InventoryItem>TableViewofInventoryItemthat will display the entire inventoryprivate javafx.scene.control.TableColumn<InventoryItem,String> TableColumndisplaying name of all inventory itemsprivate javafx.scene.control.ButtonButtonButton to logoutprivate javafx.scene.control.ButtonButtonButton to navigate order sceneprivate javafx.scene.control.ButtonButtonButton to navigate order history sceneprivate javafx.scene.control.TableColumn<InventoryItem,Long> TableColumndisplaying the quantity of all inventory itemsprivate SceneSwitchSwitches between scenes or tabsprivate SessionDataCurrent session dataprivate javafx.scene.control.ButtonButtonupdate inventory button.private javafx.scene.control.TextFieldTextFieldto allow managers to update stock through the item's nameprivate javafx.scene.control.TextFieldTextFieldto allow managers to update stock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddItem()Adds an item to the inventory databaseprivate voidReset all text fields that get user input for editing a menu item to nullvoidDeletes an item from the databaseprivate javafx.collections.ObservableList<InventoryItem>Helper method to retreive all items from the Inventory.voidInitialize Graphical User InterfacevoidnavButtonClicked(javafx.event.ActionEvent event) Handles switching to a new sceneprivate voidInitializesinventoryTablevoidUpdates the actual database through thedatabaseprivate voidUpdates theinventoryTablein 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 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 -
inventoryTable
TableViewofInventoryItemthat will display the entire inventory -
inventoryID
TableColumndisplaying identificaiton numbers of all inventory items -
itemName
TableColumndisplaying name of all inventory items -
quantityCol
TableColumndisplaying the quantity of all inventory items -
updateItemID
private javafx.scene.control.TextField updateItemIDTextFieldto allow managers to update stock through the item's name -
updateItemQuant
private javafx.scene.control.TextField updateItemQuantTextFieldto allow managers to update stock -
updateItem
private javafx.scene.control.Button updateItemButtonupdate inventory button. TriggersupdateInventory() -
deleteItemID
private javafx.scene.control.TextField deleteItemIDTextFieldthat allows user input to delete an item -
deleteItem
private javafx.scene.control.Button deleteItemButtonthat will delete the item -
addItemName
private javafx.scene.control.TextField addItemNameTextFieldthat allows user input to add an item -
addItemQuant
private javafx.scene.control.TextField addItemQuantTextFieldthat allows user input to add an item -
addItem
private javafx.scene.control.Button addItemButtonthat will add an item
-
-
Constructor Details
-
InventoryController
Constructor- Parameters:
session-SessionDatapassed 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 theinventoryTablein the Graphical User Interface -
getInventory
Helper method to retreive all items from the Inventory.- Returns:
ObservableListofInventoryItemholding every item in the inventory
-