From 1a8ec32f0fa0b5f7f1bf861a9de331e44c3c5e0f Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Fri, 28 Apr 2023 15:39:44 +1000 Subject: [PATCH] view batch devices from index requested by @RB --- .../Config/Views/DeviceBatch/Index.cshtml | 12 +- .../Views/DeviceBatch/Index.generated.cs | 114 +++++++++++------- 2 files changed, 76 insertions(+), 50 deletions(-) diff --git a/Disco.Web/Areas/Config/Views/DeviceBatch/Index.cshtml b/Disco.Web/Areas/Config/Views/DeviceBatch/Index.cshtml index 09f21321..83dcf0a2 100644 --- a/Disco.Web/Areas/Config/Views/DeviceBatch/Index.cshtml +++ b/Disco.Web/Areas/Config/Views/DeviceBatch/Index.cshtml @@ -63,13 +63,17 @@ @(item.InsuranceSupplier == null ? string.Empty : string.Format("[{0}]", item.InsuranceSupplier)) - @if (item.PurchaseUnitQuantity.HasValue) + @if (item.DeviceCount > 0 && Authorization.Has(Claims.Device.Search)) { - @item.DeviceCount.ToString("n0")/@(item.PurchaseUnitQuantity.Value.ToString("n0")) + @Html.ActionLink(string.Format("View {0}", item.DeviceCount), MVC.Search.Query(item.Id.ToString(), "DeviceBatch")) } else { - @item.DeviceCount.ToString("n0") + @item.DeviceCount.ToString("n0") + } + @if (item.PurchaseUnitQuantity.HasValue) + { + / @(item.PurchaseUnitQuantity.Value.ToString("n0")) } @if (item.DeviceDecommissionedCount > 0) { @@ -80,7 +84,7 @@ { @if (item.IsLinked) - { + { } @if (isDecommissioned) diff --git a/Disco.Web/Areas/Config/Views/DeviceBatch/Index.generated.cs b/Disco.Web/Areas/Config/Views/DeviceBatch/Index.generated.cs index 5e7b66cc..ebd00698 100644 --- a/Disco.Web/Areas/Config/Views/DeviceBatch/Index.generated.cs +++ b/Disco.Web/Areas/Config/Views/DeviceBatch/Index.generated.cs @@ -276,7 +276,7 @@ WriteLiteral("\r\n \r\n \r\n"); #line hidden #line 66 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" - if (item.PurchaseUnitQuantity.HasValue) + if (item.DeviceCount > 0 && Authorization.Has(Claims.Device.Search)) { @@ -286,16 +286,7 @@ WriteLiteral(" "); #line 68 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" - Write(item.DeviceCount.ToString("n0")); - - - #line default - #line hidden -WriteLiteral("/"); - - - #line 68 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" - Write(item.PurchaseUnitQuantity.Value.ToString("n0")); + Write(Html.ActionLink(string.Format("View {0}", item.DeviceCount), MVC.Search.Query(item.Id.ToString(), "DeviceBatch"))); #line default @@ -307,20 +298,23 @@ WriteLiteral("\r\n"); } else { - - - #line default - #line hidden - - #line 72 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" - Write(item.DeviceCount.ToString("n0")); #line default #line hidden +WriteLiteral(" "); + #line 72 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" - + Write(item.DeviceCount.ToString("n0")); + + + #line default + #line hidden +WriteLiteral("\r\n"); + + + #line 73 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } @@ -330,6 +324,34 @@ WriteLiteral(" "); #line 74 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + if (item.PurchaseUnitQuantity.HasValue) + { + + + #line default + #line hidden +WriteLiteral(" / "); + + + #line 76 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + Write(item.PurchaseUnitQuantity.Value.ToString("n0")); + + + #line default + #line hidden +WriteLiteral("\r\n"); + + + #line 77 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" "); + + + #line 78 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" if (item.DeviceDecommissionedCount > 0) { @@ -340,21 +362,21 @@ WriteLiteral(" (item.DeviceDecommissionedCount.ToString("n0") + #line 80 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" +, Tuple.Create(Tuple.Create("", 3890), Tuple.Create(item.DeviceDecommissionedCount.ToString("n0") #line default #line hidden -, 3602), false) -, Tuple.Create(Tuple.Create(" ", 3650), Tuple.Create("Decommissioned", 3651), true) +, 3890), false) +, Tuple.Create(Tuple.Create(" ", 3938), Tuple.Create("Decommissioned", 3939), true) ); WriteLiteral(">("); - #line 76 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 80 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" Write(item.DeviceDecommissionedCount.ToString("n0")); @@ -363,7 +385,7 @@ WriteLiteral(">("); WriteLiteral(")\r\n"); - #line 77 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 81 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } @@ -372,13 +394,13 @@ WriteLiteral(")\r\n"); WriteLiteral(" \r\n"); - #line 79 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 83 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" #line default #line hidden - #line 79 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 83 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" if (showTags) { @@ -388,15 +410,15 @@ WriteLiteral(" \r\n"); WriteLiteral(" \r\n"); - #line 82 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 86 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" #line default #line hidden - #line 82 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 86 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" if (item.IsLinked) - { + { #line default @@ -410,7 +432,7 @@ WriteLiteral(" title=\"Is Linked\""); WriteLiteral(">\r\n"); - #line 85 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 89 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } @@ -419,7 +441,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 86 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 90 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" if (isDecommissioned) { @@ -435,7 +457,7 @@ WriteLiteral(" title=\"Decommissioned\""); WriteLiteral(">\r\n"); - #line 89 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 93 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } @@ -444,7 +466,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" \r\n"); - #line 91 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 95 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } @@ -453,7 +475,7 @@ WriteLiteral(" \r\n"); WriteLiteral(" \r\n"); - #line 93 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 97 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } @@ -462,7 +484,7 @@ WriteLiteral(" \r\n"); WriteLiteral(" \r\n"); - #line 95 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 99 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } @@ -471,7 +493,7 @@ WriteLiteral(" \r\n"); WriteLiteral("\r\n"); - #line 97 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 101 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" if (Authorization.HasAny(Claims.Config.DeviceBatch.Create, Claims.Config.DeviceBatch.ShowTimeline)) { @@ -485,13 +507,13 @@ WriteLiteral(" class=\"actionBar\""); WriteLiteral(">\r\n"); - #line 100 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 104 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" #line default #line hidden - #line 100 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 104 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" if (Authorization.Has(Claims.Config.DeviceBatch.ShowTimeline) && Model.DeviceBatches.Count > 0) { @@ -499,14 +521,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 102 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 106 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" Write(Html.ActionLinkButton("Timeline", MVC.Config.DeviceBatch.Timeline())); #line default #line hidden - #line 102 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 106 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } @@ -516,7 +538,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 104 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 108 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" if (Authorization.HasAll(Claims.Config.DeviceBatch.Create, Claims.Config.DeviceBatch.Configure)) { @@ -524,14 +546,14 @@ WriteLiteral(" "); #line default #line hidden - #line 106 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 110 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" Write(Html.ActionLinkButton("Create Device Batch", MVC.Config.DeviceBatch.Create())); #line default #line hidden - #line 106 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 110 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } @@ -541,7 +563,7 @@ WriteLiteral(" "); WriteLiteral(" \r\n"); - #line 109 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" + #line 113 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml" } #line default