@model PagedResult @{ ViewData["Title"] = "Equipment"; ViewData["PageIcon"] = "bi-tools"; ViewData["PageHelpTitle"] = "Equipment"; ViewData["PageHelpContent"] = "Track all shop equipment — ovens, spray booths, compressors, and other machinery. Status shows whether each piece is Operational, Needs Maintenance, Under Maintenance, or Out of Service. Next Maintenance date is calculated from the last completed maintenance plus the equipment's maintenance interval. Click any row to view full details and maintenance history."; }
@await Html.PartialAsync("_Metric", (Label: "TOTAL", Value: Model.TotalCount.ToString(), Delta: (string?)null, DeltaDir: (string?)null))
@await Html.PartialAsync("_Metric", (Label: "OPERATIONAL", Value: Model.Items.Count(e => e.Status == "Operational").ToString(), Delta: (string?)null, DeltaDir: (string?)null))
@await Html.PartialAsync("_Metric", (Label: "NEEDS SERVICE", Value: Model.Items.Count(e => e.Status == "NeedsMaintenance").ToString(), Delta: (string?)null, DeltaDir: (string?)null))
@await Html.PartialAsync("_Metric", (Label: "IN MAINTENANCE", Value: Model.Items.Count(e => e.Status == "UnderMaintenance").ToString(), Delta: (string?)null, DeltaDir: (string?)null))
Add Equipment Add
@if (!Model.Items.Any()) { var isEquipmentListFiltered = !string.IsNullOrEmpty(ViewBag.SearchTerm as string) || ViewBag.StatusFilter != null;
No equipment found

@(isEquipmentListFiltered ? "No equipment matches your search." : "Get started by adding your first equipment.")

@(isEquipmentListFiltered ? "Add Equipment" : "Add Your First Equipment")
} else {
@foreach (var equipment in Model.Items.Where(e => e.IsActive)) { }
Equipment Code Type Status Location Next Maintenance Actions
@if (!string.IsNullOrEmpty(equipment.EquipmentType)) { @equipment.EquipmentType.Substring(0, 1).ToUpper() } else { @equipment.EquipmentName.Substring(0, 1).ToUpper() }
@equipment.EquipmentName
@if (!string.IsNullOrEmpty(equipment.EquipmentNumber)) { @equipment.EquipmentNumber }
@equipment.EquipmentType @await Html.PartialAsync("_StatusChip", (Kind: StatusChipHelper.EquipmentStatus(equipment.Status), Text: equipment.StatusDisplay)) @if (!string.IsNullOrEmpty(equipment.Location)) { @equipment.Location } else { } @if (equipment.NextScheduledMaintenance.HasValue) { @equipment.NextScheduledMaintenance.Value.ToString("MMM dd, yyyy") } else { Not scheduled }
@foreach (var equipment in Model.Items.Where(e => e.IsActive)) {
@equipment.EquipmentName
@equipment.EquipmentType
@if (!string.IsNullOrEmpty(equipment.EquipmentNumber)) {
Code @equipment.EquipmentNumber
}
Status @switch (equipment.Status) { case "Operational": @equipment.StatusDisplay break; case "NeedsMaintenance": @equipment.StatusDisplay break; case "UnderMaintenance": @equipment.StatusDisplay break; case "OutOfService": @equipment.StatusDisplay break; default: @equipment.StatusDisplay break; }
@if (!string.IsNullOrEmpty(equipment.Location)) {
Location @equipment.Location
} @if (equipment.NextScheduledMaintenance.HasValue) {
Next Maintenance @equipment.NextScheduledMaintenance.Value.ToString("MMM dd, yyyy")
}
}
}
@if (Model.TotalCount > 0) { @await Html.PartialAsync("_Pagination", Model) }
@section Scripts { }