Files
Disco/Disco.Web/Areas/Config/Views/DeviceBatch/Show.generated.cs
T
2025-07-03 19:13:52 +10:00

3113 lines
117 KiB
C#

#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.DeviceBatch
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
#line 2 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
using Disco.Services.Devices.ManagedGroups;
#line default
#line hidden
using Disco.Services.Web;
using Disco.Web;
#line 3 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
using Disco.Web.Areas.Config.Models.Shared;
#line default
#line hidden
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Show.cshtml")]
public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceBatch.ShowModel>
{
public Show()
{
}
public override void Execute()
{
#line 4 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Authorization.Require(Claims.Config.DeviceBatch.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), Model.DeviceBatch.ToString());
var canConfig = Authorization.Has(Claims.Config.DeviceBatch.Configure);
var canDeviceModelShow = Authorization.Has(Claims.Config.DeviceModel.Show);
var hideAdvanced =
Model.DeviceBatch.AssignedUsersLinkedGroup == null &&
Model.DeviceBatch.DevicesLinkedGroup == null;
Html.BundleDeferred("~/Style/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
if (canConfig)
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
Html.BundleDeferred("~/ClientScripts/Modules/tinymce");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AttachmentUploader");
}
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteAttribute("class", Tuple.Create(" class=\"", 1224), Tuple.Create("\"", 1297)
, Tuple.Create(Tuple.Create("", 1232), Tuple.Create("form", 1232), true)
, Tuple.Create(Tuple.Create(" ", 1236), Tuple.Create("deviceBatches", 1237), true)
#line 28 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 1250), Tuple.Create<System.Object, System.Int32>(hideAdvanced ? " Config_HideAdvanced" : null
#line default
#line hidden
, 1250), false)
);
WriteLiteral(" style=\"width: 730px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">\r\n Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 35 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceBatch.Id));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Name:\r\n </th>\r\n <td>\r\n");
#line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.Name));
#line default
#line hidden
#line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 46 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 46 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 47 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 47 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceBatch_Name'),
'Invalid Name',
'");
#line 53 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateName(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'BatchName\'\r\n );\r\n " +
" });\r\n </script>\r\n");
#line 58 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 61 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceBatch.Name);
#line default
#line hidden
#line 61 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Default Device Model:\r\n </th>\r\n <td>\r\n");
#line 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 72 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels.ToSelectListItems(null, true)));
#line default
#line hidden
#line 72 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 73 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 73 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 74 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 74 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFun" +
"ctions.PropertyChangeHelper(\r\n $(\'#DeviceBatch_Defaul" +
"tDeviceModelId\'),\r\n null,\r\n " +
" \'");
#line 80 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateDefaultDeviceModelId(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'DefaultDeviceModelId\'\r\n )" +
";\r\n });\r\n </script>\r\n");
#line 85 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
if (Model.DefaultDeviceModel == null)
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>");
#line 89 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 91 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DefaultDeviceModel.ToString());
#line default
#line hidden
#line 91 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
;
}
}
#line default
#line hidden
WriteLiteral(" <br />\r\n <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(@">
Devices added offline will default to this Device Model.
Once a device enrols the Device Model will be accurately represented.
</span>
</td>
</tr>
<tr>
<th>Devices</th>
<td>
");
#line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (Model.DeviceModelMembers.Count > 0)
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" class=\"tableData smallTable\"");
WriteLiteral(@">
<thead>
<tr>
<th>Model</th>
<th>Device Count</th>
<th>Decommissioned</th>
</tr>
</thead>
<tbody>
");
#line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
foreach (var membership in Model.DeviceModelMembers.OrderByDescending(dmm => dmm.DeviceCount))
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n");
#line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canDeviceModelShow)
{
#line default
#line hidden
#line 121 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.ActionLink(membership.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(membership.DeviceModel.Id)));
#line default
#line hidden
#line 121 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 125 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(membership.DeviceModel.ToString());
#line default
#line hidden
#line 125 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n <t" +
"d>\r\n");
WriteLiteral(" ");
#line 129 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(membership.DeviceCount.ToString("n0"));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n " +
"<td>\r\n");
WriteLiteral(" ");
#line 132 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(membership.DeviceDecommissionedCount.ToString("n0"));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr" +
">\r\n");
#line 135 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </tbody>\r\n <tfoot>\r\n " +
" <tr>\r\n <th>Total Models: ");
#line 139 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceModelMembers.Count.ToString("n0"));
#line default
#line hidden
WriteLiteral("</th>\r\n <th>");
#line 140 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceCount.ToString("n0"));
#line default
#line hidden
WriteLiteral("</th>\r\n <th>");
#line 141 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceDecommissionedCount.ToString("n0"));
#line default
#line hidden
WriteLiteral("</th>\r\n </tr>\r\n </tfoot>\r\n " +
" </table>\r\n");
#line 145 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No device models are referenced in this batch.</div>\r\n");
#line 149 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 150 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (Model.DeviceBatch.UnitQuantity.HasValue && Model.DeviceBatch.UnitQuantity.Value > Model.DeviceCount)
{
var missingCount = Model.DeviceBatch.UnitQuantity.Value - Model.DeviceCount;
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"info-box\"");
WriteLiteral(">\r\n <p");
WriteLiteral(" class=\"fa-p\"");
WriteLiteral(">\r\n <i");
WriteLiteral(" class=\"fa fa-info-circle information\"");
WriteLiteral("></i>\r\n");
WriteLiteral(" ");
#line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceCount.ToString("n0"));
#line default
#line hidden
WriteLiteral(" of ");
#line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0"));
#line default
#line hidden
WriteLiteral(" purchased devices are managed by Disco. <strong>");
#line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(missingCount.ToString("n0"));
#line default
#line hidden
WriteLiteral(" ");
#line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(missingCount == 1 ? "is" : "are");
#line default
#line hidden
WriteLiteral(" not managed</strong>.\r\n </p>\r\n </div>\r" +
"\n");
#line 159 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Purchase:\r\n </th>\r\n <td");
WriteLiteral(" class=\"details\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" class=\"sub\"");
WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral(" style=\"width: 100px\"");
WriteLiteral(">\r\n Purchase Date:\r\n </th>\r\n " +
" <td>\r\n");
#line 173 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 173 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 175 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDate));
#line default
#line hidden
#line 175 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 176 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 176 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(@" <script>
$(function () {
var dateField = $('#DeviceBatch_PurchaseDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Invalid Date',
'");
#line 183 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDate(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral(@"',
'PurchaseDate',
null,
true
);
});
</script>
");
#line 190 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 193 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.PurchaseDate));
#line default
#line hidden
#line 193 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr" +
">\r\n <th>\r\n Supplier:\r\n " +
" </th>\r\n <td>\r\n");
#line 202 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 202 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 204 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.Supplier));
#line default
#line hidden
#line 204 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 205 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 205 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 206 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 206 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceBatch_Supplier'),
'Batch Supplier',
'");
#line 212 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateSupplier(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'Supplier\'\r\n " +
" );\r\n });\r\n " +
" </script>\r\n");
#line 217 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.Supplier))
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>");
#line 221 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceBatch.Supplier);
#line default
#line hidden
#line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr" +
">\r\n <th>\r\n Unit Cost:\r\n " +
" </th>\r\n <td>\r\n");
#line 232 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 232 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 234 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.UnitCost));
#line default
#line hidden
#line 234 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 236 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 236 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceBatch_UnitCost'),
'Unit Cost',
'");
#line 242 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateUnitCost(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'UnitCost\'\r\n " +
" );\r\n });\r\n " +
" </script>\r\n");
#line 247 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
if (!Model.DeviceBatch.UnitCost.HasValue)
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>");
#line 251 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 253 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceBatch.UnitCost.Value.ToString("C"));
#line default
#line hidden
#line 253 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr" +
">\r\n <th>\r\n Quantity:\r\n " +
" </th>\r\n <td>\r\n");
#line 262 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 262 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 264 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.UnitQuantity));
#line default
#line hidden
#line 264 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 266 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 266 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceBatch_UnitQuantity'),
'Quantity',
'");
#line 272 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateUnitQuantity(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'UnitQuantity\'\r\n " +
" );\r\n });\r\n " +
" </script>\r\n");
#line 277 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
if (!Model.DeviceBatch.UnitQuantity.HasValue)
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>");
#line 281 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 283 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0"));
#line default
#line hidden
#line 283 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n </table" +
">\r\n <div");
WriteLiteral(" id=\"DeviceBatch_PurchaseDetails_Container\"");
WriteLiteral(">\r\n <div>\r\n Details ");
#line 290 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader("ajaxPurchaseDetails"));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 292 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 292 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 294 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDetails));
#line default
#line hidden
#line 294 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var model = {
$field: $('#DeviceBatch_PurchaseDetails'),
fieldName: 'PurchaseDetails',
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajax' + model.fieldName + '_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajax' + model.fieldName + '_ok');
model.$ajax_loading.show();
var data = {};
data[model.fieldName] = model.$field.tinymce().getContent();
$.ajax({
url: '");
#line 311 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDetails(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n " +
" traditional: true,\r\n type: \'PO" +
"ST\',\r\n success: function (d) {\r\n " +
" if (d == \'OK\') {\r\n " +
" model.$ajax_loading.hide();\r\n " +
" model.$ajax_ok.show().delay(\'fast\').fadeOut(\'s" +
"low\');\r\n } else {\r\n " +
" model.$ajax_loading.hide();\r\n " +
" alert(\'Unable to update purchase details:" +
" \' + d);\r\n }\r\n " +
" },\r\n error: " +
"function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to update purchase details: \' + errorThrown);\r\n " +
" model.$ajax_loading.hide();\r\n " +
" }\r\n })" +
"\r\n }\r\n };\r\n\r\n " +
" model.$field.tinymce({\r\n " +
" theme: \'simple\',\r\n add_unload_trig" +
"ger: false,\r\n schema: \"html5\",\r\n " +
" statusbar: false,\r\n se" +
"tup: function (ed) {\r\n ed.on(\'init\', func" +
"tion () {\r\n $(ed.getWin()).blur(model" +
".updated);\r\n });\r\n " +
" }\r\n });\r\n " +
" });\r\n </script>\r\n");
#line 346 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.PurchaseDetails))
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>");
#line 350 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(new HtmlString(Model.DeviceBatch.PurchaseDetails));
#line default
#line hidden
#line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n Warranty:\r\n </th>\r\n <td");
WriteLiteral(" class=\"details\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" class=\"sub\"");
WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral(" style=\"width: 100px\"");
WriteLiteral(">\r\n Valid Until:\r\n </th>\r\n " +
" <td>\r\n");
#line 368 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 368 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 370 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.WarrantyValidUntil));
#line default
#line hidden
#line 370 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 371 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 371 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(@" <script>
$(function () {
var dateField = $('#DeviceBatch_WarrantyValidUntil');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Warranty Valid Until',
'");
#line 378 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyValidUntil(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral(@"',
'WarrantyValidUntil',
null,
true
);
});
</script>
");
#line 385 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 388 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.WarrantyValidUntil, "Unknown"));
#line default
#line hidden
#line 388 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n </table" +
">\r\n <div");
WriteLiteral(" id=\"DeviceBatch_WarrantyDetails_Container\"");
WriteLiteral(">\r\n <div>\r\n Details ");
#line 395 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader("ajaxWarrantyDetails"));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 397 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 397 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 399 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.WarrantyDetails));
#line default
#line hidden
#line 399 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var model = {
$field: $('#DeviceBatch_WarrantyDetails'),
fieldName: 'WarrantyDetails',
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajax' + model.fieldName + '_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajax' + model.fieldName + '_ok');
model.$ajax_loading.show();
var data = {};
data[model.fieldName] = model.$field.tinymce().getContent();
$.ajax({
url: '");
#line 416 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyDetails(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n " +
" traditional: true,\r\n type: \'PO" +
"ST\',\r\n success: function (d) {\r\n " +
" if (d == \'OK\') {\r\n " +
" model.$ajax_loading.hide();\r\n " +
" model.$ajax_ok.show().delay(\'fast\').fadeOut(\'s" +
"low\');\r\n } else {\r\n " +
" model.$ajax_loading.hide();\r\n " +
" alert(\'Unable to update warranty details:" +
" \' + d);\r\n }\r\n " +
" },\r\n error: " +
"function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to update warranty details: \' + errorThrown);\r\n " +
" model.$ajax_loading.hide();\r\n " +
" }\r\n })" +
"\r\n }\r\n };\r\n\r\n " +
" model.$field.tinymce({\r\n " +
" theme: \'simple\',\r\n add_unload_trig" +
"ger: false,\r\n schema: \"html5\",\r\n " +
" statusbar: false,\r\n se" +
"tup: function (ed) {\r\n ed.on(\'init\', func" +
"tion () {\r\n $(ed.getWin()).blur(model" +
".updated);\r\n });\r\n " +
" }\r\n });\r\n " +
" });\r\n </script>\r\n");
#line 451 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.WarrantyDetails))
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>");
#line 455 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(new HtmlString(Model.DeviceBatch.WarrantyDetails));
#line default
#line hidden
#line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n Insurance:\r\n </th>\r\n <td");
WriteLiteral(" class=\"details\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" class=\"sub\"");
WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral(" style=\"width: 100px\"");
WriteLiteral(">\r\n Supplier:\r\n </th>\r\n " +
" <td>\r\n");
#line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier));
#line default
#line hidden
#line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 476 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 476 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 477 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 477 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceBatch_InsuranceSupplier'),
'Insurance Supplier',
'");
#line 483 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceSupplier(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'InsuranceSupplier\'\r\n " +
" );\r\n });\r\n " +
" </script>\r\n");
#line 488 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceSupplier))
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>");
#line 492 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 494 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceBatch.InsuranceSupplier);
#line default
#line hidden
#line 494 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
;
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr" +
">\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral(">\r\n Insured Date:\r\n </th>\r\n " +
" <td>\r\n");
#line 504 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 504 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 506 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.InsuredDate));
#line default
#line hidden
#line 506 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 507 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 507 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(@" <script>
$(function () {
var dateField = $('#DeviceBatch_InsuredDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Insured Date',
'");
#line 514 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuredDate(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral(@"',
'InsuredDate',
null,
true
);
});
</script>
");
#line 521 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 524 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown"));
#line default
#line hidden
#line 524 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr" +
">\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral(">\r\n Insured Until:\r\n </th>\r\n " +
" <td>\r\n");
#line 533 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 533 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 535 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.InsuredUntil));
#line default
#line hidden
#line 535 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 536 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 536 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(@" <script>
$(function () {
var dateField = $('#DeviceBatch_InsuredUntil');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Insured Until',
'");
#line 543 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuredUntil(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral(@"',
'InsuredUntil',
null,
true
);
});
</script>
");
#line 550 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 553 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown"));
#line default
#line hidden
#line 553 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n </table" +
">\r\n <div");
WriteLiteral(" id=\"DeviceBatch_InsuranceDetails_Container\"");
WriteLiteral(">\r\n <div>\r\n Details ");
#line 560 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader("ajaxInsuranceDetails"));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 562 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 562 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 564 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.InsuranceDetails));
#line default
#line hidden
#line 564 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var model = {
$field: $('#DeviceBatch_InsuranceDetails'),
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajaxInsuranceDetails_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajaxInsuranceDetails_ok');
model.$ajax_loading.show();
var data = { InsuranceDetails: model.$field.tinymce().getContent() };
$.ajax({
url: '");
#line 579 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceDetails(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n " +
" traditional: true,\r\n type: \'PO" +
"ST\',\r\n success: function (d) {\r\n " +
" if (d == \'OK\') {\r\n " +
" model.$ajax_loading.hide();\r\n " +
" model.$ajax_ok.show().delay(\'fast\').fadeOut(\'s" +
"low\');\r\n } else {\r\n " +
" model.$ajax_loading.hide();\r\n " +
" alert(\'Unable to update insurance details" +
": \' + d);\r\n }\r\n " +
" },\r\n error:" +
" function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to update insurance details: \' + errorThrown);\r\n " +
" model.$ajax_loading.hide();\r\n " +
" }\r\n " +
"})\r\n }\r\n };\r\n\r" +
"\n model.$field.tinymce({\r\n " +
" theme: \'simple\',\r\n add_unload_tr" +
"igger: false,\r\n schema: \"html5\",\r\n " +
" statusbar: false,\r\n " +
"setup: function (ed) {\r\n ed.on(\'init\', fu" +
"nction () {\r\n $(ed.getWin()).blur(mod" +
"el.updated);\r\n });\r\n " +
" }\r\n });\r\n " +
" });\r\n </script>\r\n");
#line 614 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceDetails))
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>");
#line 618 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 620 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(new HtmlString(Model.DeviceBatch.InsuranceDetails));
#line default
#line hidden
#line 620 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n Comments:<br />\r\n");
WriteLiteral(" ");
#line 628 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(AjaxHelpers.AjaxLoader("ajaxComments"));
#line default
#line hidden
WriteLiteral("\r\n </th>\r\n <td>\r\n");
#line 631 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 631 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 633 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.Comments));
#line default
#line hidden
#line 633 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var model = {
$field: $('#DeviceBatch_Comments'),
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajaxComments_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajaxComments_ok');
model.$ajax_loading.show();
var data = { Comments: model.$field.tinymce().getContent() };
$.ajax({
url: '");
#line 648 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.UpdateComments(Model.DeviceBatch.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n traditional: true" +
",\r\n type: \'POST\',\r\n " +
" success: function (d) {\r\n if (d" +
" == \'OK\') {\r\n model.$ajax_loading.hid" +
"e();\r\n model.$ajax_ok.show().delay(\'f" +
"ast\').fadeOut(\'slow\');\r\n } else {\r\n " +
" model.$ajax_loading.hide();\r\n " +
" alert(\'Unable to update comments: \' + d);\r\n " +
" }\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown" +
") {\r\n alert(\'Unable to update comments: \'" +
" + errorThrown);\r\n model.$ajax_loading.hi" +
"de();\r\n }\r\n })" +
"\r\n }\r\n };\r\n\r\n " +
" model.$field.tinymce({\r\n theme: \'simple\',\r\n " +
" add_unload_trigger: false,\r\n " +
" schema: \"html5\",\r\n statusbar: false,\r\n " +
" setup: function (ed) {\r\n ed.on(\'ini" +
"t\', function () {\r\n $(ed.getWin()).blur(model" +
".updated);\r\n });\r\n }\r\n" +
" });\r\n });\r\n </scri" +
"pt>\r\n");
#line 683 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.Comments))
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>");
#line 687 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
#line 689 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(new HtmlString(Model.DeviceBatch.Comments));
#line default
#line hidden
#line 689 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Attachments:</th>" +
"\r\n <td>\r\n <div");
WriteLiteral(" id=\"DeviceBatch_Attachments\"");
WriteAttribute("class", Tuple.Create(" class=\"", 35231), Tuple.Create("\"", 35298)
#line 696 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 35239), Tuple.Create<System.Object, System.Int32>(canConfig ? "canAddAttachments" : "cannotAddAttachments"
#line default
#line hidden
, 35239), false)
);
WriteLiteral(" data-uploadurl=\"");
#line 696 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.AttachmentUpload(Model.DeviceBatch.Id, null)));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 697 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.AntiForgeryToken());
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"Disco-AttachmentUpload-DropTarget\"");
WriteLiteral(">\r\n <h2>Drop Attachments Here</h2>\r\n </" +
"div>\r\n <div");
WriteLiteral(" class=\"attachmentOutput\"");
WriteLiteral(">\r\n");
#line 702 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 702 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (Model.DeviceBatch.DeviceBatchAttachments != null)
{
foreach (var attachment in Model.DeviceBatch.DeviceBatchAttachments)
{
#line default
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 35920), Tuple.Create("\"", 35993)
#line 706 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 35927), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceBatch.AttachmentDownload(attachment.Id))
#line default
#line hidden
, 35927), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 706 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(attachment.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 706 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(attachment.MimeType);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 36123), Tuple.Create("\"", 36151)
#line 707 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 36131), Tuple.Create<System.Object, System.Int32>(attachment.Filename
#line default
#line hidden
, 36131), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 36226), Tuple.Create("\"", 36301)
#line 708 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 36232), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail(attachment.Id))
#line default
#line hidden
, 36232), false)
);
WriteLiteral(" />\r\n </span>\r\n " +
" <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 36410), Tuple.Create("\"", 36438)
#line 710 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 36418), Tuple.Create<System.Object, System.Int32>(attachment.Comments
#line default
#line hidden
, 36418), false)
);
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 711 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(attachment.Comments);
#line default
#line hidden
WriteLiteral("\r\n </span><span");
WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 712 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(attachment.TechUser.ToString());
#line default
#line hidden
WriteLiteral("</span>");
#line 712 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"remove fa fa-times-circle\"");
WriteLiteral("></span>");
#line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"timestamp\"");
WriteAttribute("title", Tuple.Create(" title=\"", 36744), Tuple.Create("\"", 36790)
#line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 36752), Tuple.Create<System.Object, System.Int32>(attachment.Timestamp.ToFullDateTime()
#line default
#line hidden
, 36752), false)
);
WriteLiteral(" data-livestamp=\"");
#line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(attachment.Timestamp.ToUnixEpoc());
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">");
#line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(attachment.Timestamp.ToFullDateTime());
#line default
#line hidden
WriteLiteral("</span>\r\n </a>\r\n");
#line 715 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 718 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 718 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"Disco-AttachmentUpload-Progress\"");
WriteLiteral("></div>\r\n");
WriteLiteral(" <div");
WriteLiteral(" class=\"attachmentInput clearfix\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"action enabled upload fa fa-upload disabled\"");
WriteLiteral(" title=\"Attach File\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"action enabled photo fa fa-camera disabled\"");
WriteLiteral(" title=\"Capture Image\"");
WriteLiteral("></span>\r\n </div>\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogRemoveAttachment\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Remove this Attachment?\"");
WriteLiteral(">\r\n <p>\r\n <i");
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
WriteLiteral("></i>&nbsp;Are you sure?\r\n </p>\r\n " +
" </div>\r\n");
#line 729 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
Shadowbox.init({
skipSetup: true,
modal: true
});
$(function () {
var $Attachments = $('#DeviceBatch_Attachments');
var $attachmentOutput = $Attachments.find('.attachmentOutput');
var $attachmentDownloadHost;
var $dialogRemoveAttachment = null;
// Connect to Hub
var hub = $.connection.deviceBatchUpdates;
// Map Functions
hub.client.addAttachment = onAddAttachment;
hub.client.removeAttachment = onRemoveAttachment;
$.connection.hub.qs = { DeviceBatchId: '");
#line 749 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Model.DeviceBatch.Id);
#line default
#line hidden
WriteLiteral("\' };\r\n $.connection.hub.error(onHubFailed);\r\n " +
" $.connection.hub.disconnected(onHubFailed);\r\n\r\n " +
" $.connection.hub.reconnecting(function () {\r\n " +
" $Attachments.find(\'span.action.enabled\').addClass(\'disabled\');\r\n " +
" });\r\n $.connection.hub.reconne" +
"cted(function () {\r\n $Attachments.find(\'span.acti" +
"on.enabled\').removeClass(\'disabled\');\r\n });\r\n\r\n " +
" // Start Connection\r\n $.connect" +
"ion.hub.start(function () {\r\n $Attachments.find(\'" +
"span.action.enabled\').removeClass(\'disabled\');\r\n }).f" +
"ail(onHubFailed);\r\n\r\n function onHubFailed(error) {\r\n" +
" // Disable UI\r\n $" +
"Attachments.find(\'span.action.enabled\').addClass(\'disabled\');\r\n\r\n " +
" // Show Dialog Message\r\n if ($(\'" +
".disconnected-dialog\').length == 0) {\r\n $(\'<d" +
"iv>\')\r\n .addClass(\'dialog disconnected-di" +
"alog\')\r\n .html(\'<h3><span class=\"fa-stack" +
" fa-lg\"><i class=\"fa fa-wifi fa-stack-1x\"></i><i class=\"fa fa-ban fa-stack-2x er" +
"ror\"></i></span>Disconnected from the Disco ICT Server</h3><div>This page is not" +
" receiving live updates. Please ensure you are connected to the server, then ref" +
"resh this page to enable features.</div>\')\r\n " +
" .dialog({\r\n resizable: false,\r\n " +
" title: \'Disconnected\',\r\n " +
" width: 400,\r\n " +
" modal: true,\r\n buttons: {\r\n " +
" \'Refresh Now\': function () {\r\n " +
" $(this).dialog(\'option\', \'buttons" +
"\', null);\r\n window.location.r" +
"eload(true);\r\n },\r\n " +
" \'Close\': function () {\r\n " +
" $(this).dialog(\'destroy\');\r\n " +
" }\r\n }\r\n " +
" });\r\n }\r\n " +
" }\r\n\r\n function onAddAttachmen" +
"t(id, quick) {\r\n var data = { id: id };\r\n " +
" $.ajax({\r\n url: \'");
#line 795 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.Attachment()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
");
#line 801 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 801 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" ");
WriteLiteral("buildAttachment(a, true, quick);");
WriteLiteral("\r\n");
#line 804 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" ");
WriteLiteral("buildAttachment(a, false, quick);");
WriteLiteral("\r\n");
#line 808 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(@" } else {
alert('Unable to add attachment: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add attachment: ' + textStatus);
}
});
}
function buildAttachment(a, canRemove, quick) {
var t = '<a><span class=""icon""><img alt=""Attachment Thumbnail"" /></span><span class=""comments""></span><span class=""author""></span>';
if (canRemove)
t += '<span class=""remove fa fa-times-circle""></span>';
t += '<span class=""timestamp""></span></a>';
var e = $(t);
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
#line 827 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.AttachmentDownload()));
#line default
#line hidden
WriteLiteral(@"/' + a.Id);
e.find('.comments').text(a.Description);
e.find('.author').text(a.Author);
e.find('.timestamp').text(a.TimestampFull).attr('title', a.TimestampFull).livestamp(a.TimestampUnixEpoc);
if (canRemove)
e.find('.remove').click(removeAttachment);
if (!quick)
e.hide();
$attachmentOutput.append(e);
if (!quick)
e.show('slow');
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Description });
else
e.click(onDownload);
// Add Thumbnail
var buildThumbnail = function () {
var retryCount = 0;
var img = e.find('.icon img');
var setThumbnailUrl = function () {
img.attr('src', '");
#line 849 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail()));
#line default
#line hidden
WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n };\r\n " +
" img.on(\'error\', function () {\r\n " +
" img.addClass(\'loading\');\r\n " +
" retryCount++;\r\n if (retryCount < 6)" +
"\r\n window.setTimeout(setThumbnailUrl," +
" retryCount * 250);\r\n });\r\n " +
" img.on(\'load\', function () {\r\n " +
" img.removeClass(\'loading\');\r\n });\r\n " +
" window.setTimeout(setThumbnailUrl, 100);\r\n " +
" };\r\n buildThumbnail()" +
";\r\n }\r\n\r\n function onRemov" +
"eAttachment(id) {\r\n var a = $attachmentOutput.fin" +
"d(\'a[data-attachmentid=\' + id + \']\');\r\n\r\n a.hide(" +
"300).delay(300).queue(function () {\r\n var $th" +
"is = $(this);\r\n if ($this.attr(\'data-mimetype" +
"\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" Shadowbox.removeCache(this);\r\n $this.find(\'" +
".timestamp\').livestamp(\'destroy\');\r\n $this.re" +
"move();\r\n });\r\n }\r\n\r\n " +
" function onDownload() {\r\n " +
" var $this = $(this);\r\n var url = $this.attr(\'" +
"href\');\r\n\r\n if ($.connection && $.connection.hub " +
"&& $.connection.hub.transport &&\r\n " +
" $.connection.hub.transport.name == \'foreverFrame\') {\r\n " +
" // SignalR active with foreverFrame transport - use popup window" +
"\r\n window.open(url, \'_blank\', \'height=150,wid" +
"th=250,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no\');" +
"\r\n } else {\r\n " +
"// use iFrame\r\n if (!$attachmentDownloadHost)" +
" {\r\n $attachmentDownloadHost = $(\'<iframe" +
">\')\r\n .attr({ \'src\': url, \'title\': \'A" +
"ttachment Download Host\' })\r\n .addCla" +
"ss(\'hidden\')\r\n .appendTo(\'body\')\r\n " +
" .contents();\r\n " +
" } else {\r\n $attachmentDownload" +
"Host[0].location.href = url;\r\n }\r\n " +
" }\r\n\r\n return false;\r\n " +
" }\r\n\r\n");
#line 901 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 901 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral("\r\n //#region Add Attachments\r\n " +
" var attachmentUploader = new document.Disco.AttachmentUploader($Attachments)" +
";\r\n\r\n var $attachmentInput = $Attachments.find(\'.atta" +
"chmentInput\');\r\n if (window.location.protocol != \'htt" +
"ps:\') {\r\n $attachmentInput.find(\'.photo\')\r\n " +
" .removeClass(\'enabled\')\r\n " +
" .addClass(\'disabled\')\r\n .attr(\'tit" +
"le\', \'Capture Image: this functionality is only available over a HTTPS connectio" +
"n\');\r\n }\r\n $attachmentInpu" +
"t.find(\'.photo\').click(function () {\r\n if (!$(thi" +
"s).hasClass(\'enabled\'))\r\n alert(\'This functio" +
"nality is only available over a HTTPS connection\');\r\n " +
" else if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh this page and try" +
" again\');\r\n else\r\n " +
" attachmentUploader.uploadImage();\r\n });\r\n " +
" $attachmentInput.find(\'.upload\').click(function () {\r\n " +
" if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh " +
"this page and try again\');\r\n else\r\n " +
" attachmentUploader.uploadFiles();\r\n " +
" });\r\n //#endregion\r\n " +
"//#region Remove Attachments\r\n $attachmentOutput.find" +
"(\'span.remove\').click(removeAttachment);\r\n\r\n function" +
" removeAttachment() {\r\n $this = $(this).closest(\'" +
"a\');\r\n\r\n var data = { id: $this.attr(\'data-attach" +
"mentid\') };\r\n\r\n if (!$dialogRemoveAttachment) {\r\n" +
" $dialogRemoveAttachment = $(\'#dialogRemoveAt" +
"tachment\').dialog({\r\n resizable: false,\r\n" +
" height: 140,\r\n " +
" modal: true,\r\n autoOpen: fa" +
"lse\r\n });\r\n }\r" +
"\n\r\n $dialogRemoveAttachment.dialog(\"enable\");\r\n " +
" $dialogRemoveAttachment.dialog(\'option\', \'buttons\'" +
", {\r\n \"Remove\": function () {\r\n " +
" $dialogRemoveAttachment.dialog(\"disable\");\r\n " +
" $dialogRemoveAttachment.dialog(\"option\", \"buttons\"" +
", null);\r\n $.ajax({\r\n " +
" url: \'");
#line 951 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.AttachmentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n " +
" success: function (d) {\r\n " +
"if (d == \'OK\') {\r\n // Do noth" +
"ing, await SignalR notification\r\n " +
" } else {\r\n alert(\'Unable to " +
"remove attachment: \' + d);\r\n }\r\n " +
" $dialogRemoveAttachment.dialog(\"c" +
"lose\");\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to remove attachment: \' +" +
" textStatus);\r\n $dialogRemoveAtta" +
"chment.dialog(\"close\");\r\n }\r\n " +
" });\r\n },\r\n " +
" Cancel: function () {\r\n " +
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
" }\r\n });\r\n\r\n " +
" $dialogRemoveAttachment.dialog(\'open\');\r\n\r\n " +
" return false;\r\n }\r\n //#" +
"endregion\r\n ");
#line 978 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(@"
$attachmentOutput.children('a').each(function () {
$this = $(this);
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
else
$this.click(onDownload);
});
});
</script>
</div>
</td>
</tr>
");
#line 993 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 993 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (hideAdvanced)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td");
WriteLiteral(" colspan=\"2\"");
WriteLiteral(" style=\"text-align: right;\"");
WriteLiteral(">\r\n <button");
WriteLiteral(" id=\"Config_HideAdvanced_Show\"");
WriteLiteral(" class=\"button small\"");
WriteLiteral(@">Show Advanced Options</button>
<script>
$(function () {
$('#Config_HideAdvanced_Show').click(function () {
var $this = $(this);
$this.closest('.Config_HideAdvanced').removeClass('Config_HideAdvanced');
$this.closest('tr').remove();
});
});
</script>
</td>
</tr>
");
#line 1009 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" class=\"Config_HideAdvanced_Item\"");
WriteLiteral(">\r\n <th>\r\n Linked Groups:\r\n </th>\r\n " +
" <td>\r\n <div>\r\n");
WriteLiteral(" ");
#line 1016 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
{
CanConfigure = canConfig,
CategoryDescription = DeviceBatchDevicesManagedGroup.GetCategoryDescription(Model.DeviceBatch),
Description = DeviceBatchDevicesManagedGroup.GetDescription(Model.DeviceBatch),
ManagedGroup = Model.DevicesLinkedGroup,
UpdateUrl = Url.Action(MVC.API.DeviceBatch.UpdateDevicesLinkedGroup(Model.DeviceBatch.Id, redirect: true))
}));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 1024 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
{
CanConfigure = canConfig,
CategoryDescription = DeviceBatchAssignedUsersManagedGroup.GetCategoryDescription(Model.DeviceBatch),
Description = DeviceBatchAssignedUsersManagedGroup.GetDescription(Model.DeviceBatch),
ManagedGroup = Model.AssignedUsersLinkedGroup,
UpdateUrl = Url.Action(MVC.API.DeviceBatch.UpdateAssignedUsersLinkedGroup(Model.DeviceBatch.Id, redirect: true))
}));
#line default
#line hidden
WriteLiteral("\r\n");
#line 1032 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 1032 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 1034 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared));
#line default
#line hidden
#line 1034 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n");
#line 1041 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model));
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 1043 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 1043 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (Model.CanDecommission)
{
#line default
#line hidden
WriteLiteral(" <button");
WriteLiteral(" id=\"DeviceBatch_Decommission\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(">Decommission All Devices</button>\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"DeviceBatch_Decommission_Dialog\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Batch Device Decommission\"");
WriteLiteral(">\r\n");
#line 1047 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 1047 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
using (Html.BeginForm(MVC.API.Device.DeviceBatchDecommission(Model.DeviceBatch.Id), FormMethod.Post))
{
#line default
#line hidden
#line 1049 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.AntiForgeryToken());
#line default
#line hidden
#line 1049 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"clearfix\"");
WriteLiteral(" style=\"margin-bottom: 10px;\"");
WriteLiteral(">\r\n <i");
WriteLiteral(" class=\"fa fa-question-circle fa-lg information\"");
WriteLiteral("></i>&nbsp;Why are these devices to be decommissioned?\r\n </div>\r\n");
WriteLiteral(" <div>\r\n <ul");
WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
#line 1055 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
#line default
#line hidden
#line 1055 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast<DecommissionReasons>().OrderBy(r => r.ToString()))
{
#line default
#line hidden
WriteLiteral(" <li>\r\n <input");
WriteLiteral(" type=\"radio\"");
WriteAttribute("id", Tuple.Create(" id=\"", 56824), Tuple.Create("\"", 56894)
, Tuple.Create(Tuple.Create("", 56829), Tuple.Create("DeviceBatch_Decommission_Dialog_Reason_", 56829), true)
#line 1058 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 56868), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
#line default
#line hidden
, 56868), false)
);
WriteLiteral("\r\n name=\"decommissionReason\"");
WriteAttribute("value", Tuple.Create(" value=\"", 56961), Tuple.Create("\"", 56995)
#line 1059 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 56969), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
#line default
#line hidden
, 56969), false)
);
WriteLiteral(" ");
#line 1059 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);
#line default
#line hidden
WriteLiteral(" />\r\n <label");
WriteAttribute("for", Tuple.Create(" for=\"", 57135), Tuple.Create("\"", 57206)
, Tuple.Create(Tuple.Create("", 57141), Tuple.Create("DeviceBatch_Decommission_Dialog_Reason_", 57141), true)
#line 1060 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
, Tuple.Create(Tuple.Create("", 57180), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
#line default
#line hidden
, 57180), false)
);
WriteLiteral(">");
#line 1060 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(decommissionReason.ReasonMessage());
#line default
#line hidden
WriteLiteral("</label>\r\n </li>\r\n");
#line 1062 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n <br />\r\n <label" +
">\r\n <input");
WriteLiteral(" type=\"checkbox\"");
WriteLiteral(" value=\"true\"");
WriteLiteral(" name=\"unassignUsers\"");
WriteLiteral(" />\r\n Unassign devices users\r\n </label>" +
"\r\n </div>\r\n");
#line 1070 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
let buttonDialog = null;
$('#DeviceBatch_Decommission').click(function () {
if (!buttonDialog) {
buttonDialog = $('#DeviceBatch_Decommission_Dialog')
.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
""Decommission"": function () {
const $this = $(this);
$this.find('form').trigger('submit');
$this.dialog(""disable"");
$this.dialog(""option"", ""buttons"", null);
},
Cancel: function () {
$(this).dialog(""close"");
}
}
});
}
buttonDialog.dialog('open');
return false;
});
});
</script>
");
#line 1101 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 1102 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (Model.CanDelete)
{
#line default
#line hidden
#line 1104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete"));
#line default
#line hidden
#line 1104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 1106 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
if (Model.DeviceCount > 0)
{
if (Authorization.Has(Claims.Device.Actions.Export))
{
#line default
#line hidden
#line 1110 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Batch, Model.DeviceBatch.Id)));
#line default
#line hidden
#line 1110 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
{
#line default
#line hidden
#line 1114 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch")));
#line default
#line hidden
#line 1114 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
}
#pragma warning restore 1591