@model Disco.Web.Areas.Config.Models.DeviceBatch.IndexModel @{ Authorization.Require(Claims.Config.DeviceBatch.Show); ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches"); var hasDecommissionedBatches = Model.DeviceBatches.Any(db => db.DeviceCount > 0 && db.DeviceDecommissionedCount >= db.DeviceCount); var showTags = hasDecommissionedBatches || Model.DeviceBatches.Any(i => i.IsLinked); }
| Name | Default Model | Purchase Date | Warranty Expires | Insurance Expires | Device Count | @if (showTags) {} |
|---|---|---|---|---|---|---|
| @Html.ActionLink(item.Name, MVC.Config.DeviceBatch.Index(item.Id)) | @item.DefaultDeviceModel | @CommonHelpers.FriendlyDate(item.PurchaseDate) | @CommonHelpers.FriendlyDate(item.WarrantyExpires, "Unknown") | @CommonHelpers.FriendlyDate(item.InsuredUntil, item.InsuranceSupplier == null ? "N/A" : "Unknown") @(item.InsuranceSupplier == null ? string.Empty : string.Format("[{0}]", item.InsuranceSupplier)) | @if (item.PurchaseUnitQuantity.HasValue) { @item.DeviceCount.ToString("n0")/@(item.PurchaseUnitQuantity.Value.ToString("n0")) } else { @item.DeviceCount.ToString("n0") } @if (item.DeviceDecommissionedCount > 0) { (@(item.DeviceDecommissionedCount.ToString("n0"))) } | @if (showTags) {@if (item.IsLinked) { } @if (isDecommissioned) { } | }