Card-Based Locker View
The dashboard uses a grid layout to display individual locker cards. Each card shows essential locker information at a glance.Locker Card Components
Each locker card displays:- Locker Number: The unique identifier for the locker
- Location: Physical location of the locker
- Employee ID: The employee number assigned to the locker (if occupied)
- Delete Action: Quick access to remove the locker
Color-Coded Availability Indicators
The dashboard uses color coding based on theIsEmpty field to indicate locker availability status:
Empty Locker
Green background indicates the locker is available
Occupied Locker
Blue background indicates the locker is currently assigned to an employee
Status Indicator Logic
The color is dynamically applied using Angular’sngStyle directive:
app.component.html:33
The legend is displayed below the form:
- Green
[ ]= Empty locker - Blue
[ ]= Occupied locker
Real-Time Status Updates
The dashboard automatically refreshes locker data after any CRUD operation to maintain real-time accuracy.Update Triggers
ThegetAllLockers() method is called after:
- Initial Load: When the component initializes
- Adding a Locker: After successfully creating a new locker
- Deleting a Locker: After removing a locker
- Updating a Locker: After modifying locker information
Locker Display and Sorting
Lockers are retrieved from the API and displayed in a specific order to ensure consistent visualization.Sorting Order
The backend API sorts lockers byLockerNo in ascending order:
LockersController.cs:18-25
Data Model
The locker data structure includes all necessary fields for display:Interactive Features
Click-to-Edit
Clicking on a locker number populates the form with the locker’s current data for editing:app.component.ts:73-75
app.component.html:34
Quick Delete
Each locker card includes a delete action that removes the locker and refreshes the view:app.component.ts:64-71