@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.DeviceCount > 0 && Authorization.Has(Claims.Device.Search)) { @Html.ActionLink(string.Format("View {0}", item.DeviceCount), MVC.Search.Query(item.Id.ToString(), "DeviceBatch")) } else { @item.DeviceCount.ToString("n0") } @if (item.PurchaseUnitQuantity.HasValue) { / @(item.PurchaseUnitQuantity.Value.ToString("n0")) } @if (item.DeviceDecommissionedCount > 0) { (@(item.DeviceDecommissionedCount.ToString("n0"))) } | @if (showTags) {@if (item.IsLinked) { } @if (isDecommissioned) { } | }