@model PowderCoating.Application.DTOs.Equipment.EquipmentDto @{ ViewData["Title"] = Model.EquipmentName; ViewData["PageIcon"] = "bi-tools"; ViewData["PageHelpTitle"] = "Equipment Details"; ViewData["PageHelpContent"] = "The status banner shows whether this equipment is currently available. Maintenance Schedule shows the interval and when service is next due. Use Add Maintenance or Schedule Maintenance to log upcoming or completed service. Upload a PDF user manual here so staff can access it without leaving the system."; var maintenanceHistory = ViewBag.MaintenanceHistory as List ?? new List(); var hasManual = !string.IsNullOrWhiteSpace(Model.ManualFilePath) || (!string.IsNullOrWhiteSpace(Model.Notes) && Model.Notes.StartsWith("uploads/")); }

@Model.EquipmentType @(!string.IsNullOrEmpty(Model.EquipmentNumber) ? $"• {Model.EquipmentNumber}" : "")

@{ var statusClass = Model.Status switch { "Operational" => "alert-success", "NeedsMaintenance" => "alert-warning", "UnderMaintenance" => "alert-info", "OutOfService" => "alert-danger", _ => "alert-secondary" }; var statusIcon = Model.Status switch { "Operational" => "bi-check-circle", "NeedsMaintenance" => "bi-exclamation-triangle", "UnderMaintenance" => "bi-wrench", "OutOfService" => "bi-x-circle", _ => "bi-info-circle" }; }
Status: @Model.StatusDisplay @if (Model.DaysUntilMaintenance.HasValue && Model.DaysUntilMaintenance < 7) { • Maintenance due in @Model.DaysUntilMaintenance days }
Equipment Information

@Model.EquipmentName

@(Model.EquipmentNumber ?? "Not assigned")

@Model.EquipmentType

@if (!string.IsNullOrEmpty(Model.Location)) { @Model.Location } else { Not specified }

@(Model.Manufacturer ?? "—")

@(Model.Model ?? "—")

@(Model.SerialNumber ?? "—")

Purchase & Warranty

@(Model.PurchaseDate.HasValue ? Model.PurchaseDate.Value.ToString("MMM dd, yyyy") : "Not recorded")

@Model.PurchasePrice.ToString("C")

@if (Model.WarrantyExpiration.HasValue) { var isExpired = Model.WarrantyExpiration.Value < DateTime.Now; @Model.WarrantyExpiration.Value.ToString("MMM dd, yyyy") @(isExpired ? "(Expired)" : "(Active)") } else { No warranty information }

Maintenance Schedule

@Model.RecommendedMaintenanceIntervalDays days

@(Model.LastMaintenanceDate.HasValue ? Model.LastMaintenanceDate.Value.ToString("MMM dd, yyyy") : "Never")

@if (Model.NextScheduledMaintenance.HasValue) { @Model.NextScheduledMaintenance.Value.ToString("MMM dd, yyyy") @if (Model.DaysUntilMaintenance.HasValue) {
(@Model.DaysUntilMaintenance days away) } } else { Not scheduled }

Maintenance History
Add Maintenance
@if (!maintenanceHistory.Any()) {

No maintenance records yet

} else {
@foreach (var maintenance in maintenanceHistory.Take(10)) { }
Date Type Status Priority Cost Actions
@maintenance.ScheduledDate.ToString("MMM dd, yyyy") @maintenance.MaintenanceType @{ var badgeClass = maintenance.Status switch { "Scheduled" => "bg-primary", "InProgress" => "bg-warning", "Completed" => "bg-success", "Overdue" => "bg-danger", "Cancelled" => "bg-secondary", _ => "bg-secondary" }; } @maintenance.StatusDisplay @{ var priorityClass = maintenance.Priority switch { "Critical" => "danger", "High" => "warning", "Normal" => "primary", "Low" => "secondary", _ => "secondary" }; } @maintenance.PriorityDisplay @maintenance.TotalCost.ToString("C")
}
User Manual
@if (hasManual) { // Get the filename from new storage or legacy storage var fileName = !string.IsNullOrWhiteSpace(Model.ManualFileName) ? Model.ManualFileName : (!string.IsNullOrWhiteSpace(Model.Notes) ? System.IO.Path.GetFileName(Model.Notes) : "User Manual"); // Remove GUID prefix from legacy filenames if (fileName.Length > 37 && fileName[36] == '-') { fileName = fileName.Substring(37); }
@fileName
Download
@Html.AntiForgeryToken()
} else {

No manual uploaded

}
@Html.AntiForgeryToken()
Allowed: PDF, DOC, DOCX, XLS, XLSX (Max 10 MB)
@section Scripts { }