3146 lines
116 KiB
C#
3146 lines
116 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("><None Specified></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("><None Specified></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("><None Specified></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("><None Specified></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(" data-updateurl=\"");
|
|
|
|
|
|
#line 288 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDetails(Model.DeviceBatch.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
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(">\r\n $(function () {\r\n c" +
|
|
"onst $field = $(\'#DeviceBatch_PurchaseDetails\');\r\n\r\n " +
|
|
" async function updated() {\r\n $(\'#ajaxPurc" +
|
|
"haseDetails_loading\').show();\r\n try {\r\n " +
|
|
" const body = new FormData();\r\n " +
|
|
" body.append(\'__RequestVerificationToken\', document.body." +
|
|
"dataset.antiforgery);\r\n body.append(\'purc" +
|
|
"haseDetails\', $field.tinymce().getContent())\r\n\r\n " +
|
|
" const response = await fetch($(\'#DeviceBatch_PurchaseDetails_Container\')" +
|
|
".attr(\'data-updateurl\'), {\r\n method: " +
|
|
"\'POST\',\r\n body: body\r\n " +
|
|
" });\r\n\r\n if (resp" +
|
|
"onse.ok) {\r\n $(\'#ajaxPurchaseDetails_" +
|
|
"ok\').show().delay(\'fast\').fadeOut(\'slow\');\r\n " +
|
|
" } else {\r\n alert(\'Unable to updat" +
|
|
"e purchase details: \' + response.statusText);\r\n " +
|
|
" }\r\n } catch (e) {\r\n " +
|
|
" alert(\'Unable to update purchase details: \' + e);\r\n " +
|
|
" }\r\n $(\'#ajaxPurch" +
|
|
"aseDetails_loading\').hide();\r\n }\r\n\r\n " +
|
|
" $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(\'init\', function () {\r\n " +
|
|
" $(ed.getWin()).blur(function () { updated()" +
|
|
"; });\r\n });\r\n " +
|
|
" }\r\n });\r\n });\r" +
|
|
"\n </script>\r\n");
|
|
|
|
|
|
#line 335 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
if (string.IsNullOrEmpty(Model.DeviceBatch.PurchaseDetails))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>");
|
|
|
|
|
|
#line 339 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 341 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(new HtmlString(Model.DeviceBatch.PurchaseDetails));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 341 "..\..\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 357 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 357 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 359 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceBatch.WarrantyValidUntil));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 359 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 360 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 360 "..\..\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 367 "..\..\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 374 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 377 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.WarrantyValidUntil, "Unknown"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 377 "..\..\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(" data-updateurl=\"");
|
|
|
|
|
|
#line 382 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyDetails(Model.DeviceBatch.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n Details ");
|
|
|
|
|
|
#line 384 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader("ajaxWarrantyDetails"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </div>\r\n");
|
|
|
|
|
|
#line 386 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 386 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 388 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceBatch.WarrantyDetails));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 388 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n c" +
|
|
"onst $field = $(\'#DeviceBatch_WarrantyDetails\');\r\n\r\n " +
|
|
" async function updated() {\r\n $(\'#ajaxWarr" +
|
|
"antyDetails_loading\').show();\r\n try {\r\n " +
|
|
" const body = new FormData();\r\n " +
|
|
" body.append(\'__RequestVerificationToken\', document.body." +
|
|
"dataset.antiforgery);\r\n body.append(\'warr" +
|
|
"antyDetails\', $field.tinymce().getContent())\r\n\r\n " +
|
|
" const response = await fetch($(\'#DeviceBatch_WarrantyDetails_Container\')" +
|
|
".attr(\'data-updateurl\'), {\r\n method: " +
|
|
"\'POST\',\r\n body: body\r\n " +
|
|
" });\r\n\r\n if (resp" +
|
|
"onse.ok) {\r\n $(\'#ajaxWarrantyDetails_" +
|
|
"ok\').show().delay(\'fast\').fadeOut(\'slow\');\r\n " +
|
|
" } else {\r\n alert(\'Unable to updat" +
|
|
"e warranty details: \' + response.statusText);\r\n " +
|
|
" }\r\n } catch (e) {\r\n " +
|
|
" alert(\'Unable to update warranty details: \' + e);\r\n " +
|
|
" }\r\n $(\'#ajaxWarra" +
|
|
"ntyDetails_loading\').hide();\r\n }\r\n\r\n " +
|
|
" $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(\'init\', function () {\r\n " +
|
|
" $(ed.getWin()).blur(function () { updated()" +
|
|
"; });\r\n });\r\n " +
|
|
" }\r\n });\r\n });\r" +
|
|
"\n </script>\r\n");
|
|
|
|
|
|
#line 429 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
if (string.IsNullOrEmpty(Model.DeviceBatch.WarrantyDetails))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>");
|
|
|
|
|
|
#line 433 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 435 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(new HtmlString(Model.DeviceBatch.WarrantyDetails));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 435 "..\..\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 451 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 451 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 453 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 453 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 454 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 454 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 455 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 455 "..\..\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 461 "..\..\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 466 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceSupplier))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>");
|
|
|
|
|
|
#line 470 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 472 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Model.DeviceBatch.InsuranceSupplier);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 472 "..\..\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 482 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 482 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 484 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceBatch.InsuredDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 484 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 485 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 485 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <script>
|
|
$(function () {
|
|
var dateField = $('#DeviceBatch_InsuredDate');
|
|
document.DiscoFunctions.DateChangeHelper(
|
|
dateField,
|
|
'Insured Date',
|
|
'");
|
|
|
|
|
|
#line 492 "..\..\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 499 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 502 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 502 "..\..\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 511 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 511 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 513 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceBatch.InsuredUntil));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 513 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 514 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 514 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <script>
|
|
$(function () {
|
|
var dateField = $('#DeviceBatch_InsuredUntil');
|
|
document.DiscoFunctions.DateChangeHelper(
|
|
dateField,
|
|
'Insured Until',
|
|
'");
|
|
|
|
|
|
#line 521 "..\..\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 528 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 531 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 531 "..\..\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(" data-updateurl=\"");
|
|
|
|
|
|
#line 536 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceDetails(Model.DeviceBatch.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n Details ");
|
|
|
|
|
|
#line 538 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader("ajaxInsuranceDetails"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </div>\r\n");
|
|
|
|
|
|
#line 540 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 540 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 542 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceBatch.InsuranceDetails));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 542 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n c" +
|
|
"onst $field = $(\'#DeviceBatch_InsuranceDetails\');\r\n " +
|
|
" async function updated() {\r\n $(\'#ajaxInsur" +
|
|
"anceDetails_loading\').show();\r\n try {\r\n " +
|
|
" const body = new FormData();\r\n " +
|
|
" body.append(\'__RequestVerificationToken\', document.body." +
|
|
"dataset.antiforgery);\r\n body.append(\'insu" +
|
|
"ranceDetails\', $field.tinymce().getContent())\r\n\r\n " +
|
|
" const response = await fetch($(\'#DeviceBatch_InsuranceDetails_Container" +
|
|
"\').attr(\'data-updateurl\'), {\r\n method" +
|
|
": \'POST\',\r\n body: body\r\n " +
|
|
" });\r\n\r\n if (re" +
|
|
"sponse.ok) {\r\n $(\'#ajaxInsuranceDetai" +
|
|
"ls_ok\').show().delay(\'fast\').fadeOut(\'slow\');\r\n " +
|
|
" } else {\r\n alert(\'Unable to up" +
|
|
"date insurance details: \' + response.statusText);\r\n " +
|
|
" }\r\n } catch (e) {\r\n " +
|
|
" alert(\'Unable to update insurance details: \' + e);\r\n " +
|
|
" }\r\n $(\'#ajax" +
|
|
"InsuranceDetails_loading\').hide();\r\n }\r\n\r\n " +
|
|
" $field.tinymce({\r\n t" +
|
|
"heme: \'simple\',\r\n add_unload_trigger: false,\r" +
|
|
"\n schema: \"html5\",\r\n " +
|
|
" statusbar: false,\r\n setup: functio" +
|
|
"n (ed) {\r\n ed.on(\'init\', function () {\r\n " +
|
|
" $(ed.getWin()).blur(function () { upd" +
|
|
"ated(); });\r\n });\r\n " +
|
|
" }\r\n });\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 582 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceDetails))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>");
|
|
|
|
|
|
#line 586 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 588 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(new HtmlString(Model.DeviceBatch.InsuranceDetails));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 588 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r\n <tr");
|
|
|
|
WriteLiteral(" id=\"DeviceBatch_Comments_Container\"");
|
|
|
|
WriteLiteral(" data-updateurl=\"");
|
|
|
|
|
|
#line 593 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceBatch.UpdateComments(Model.DeviceBatch.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(">\r\n <th>\r\n Comments:<br />\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 596 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader("ajaxComments"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </th>\r\n <td>\r\n");
|
|
|
|
|
|
#line 599 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 599 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 601 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceBatch.Comments));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 601 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n const $fi" +
|
|
"eld = $(\'#DeviceBatch_Comments\');\r\n async function up" +
|
|
"dated() {\r\n $(\'#ajaxComments_loading\').show();\r\n " +
|
|
" try {\r\n const " +
|
|
"body = new FormData();\r\n body.append(\'__Reque" +
|
|
"stVerificationToken\', document.body.dataset.antiforgery);\r\n " +
|
|
" body.append(\'comments\', $field.tinymce().getContent())\r\n\r\n " +
|
|
" const response = await fetch($(\'#DeviceBatch_Commen" +
|
|
"ts_Container\').attr(\'data-updateurl\'), {\r\n " +
|
|
" method: \'POST\',\r\n body: body\r\n " +
|
|
" });\r\n\r\n if (respon" +
|
|
"se.ok) {\r\n $(\'#ajaxComments_ok\').show().d" +
|
|
"elay(\'fast\').fadeOut(\'slow\');\r\n } else {\r\n " +
|
|
" alert(\'Unable to update comments: \' + respo" +
|
|
"nse.statusText);\r\n }\r\n " +
|
|
" } catch (e) {\r\n alert(\'Unable to upd" +
|
|
"ate comments: \' + e);\r\n }\r\n " +
|
|
" $(\'#ajaxComments_loading\').hide();\r\n }\r\n\r\n " +
|
|
" $field.tinymce({\r\n the" +
|
|
"me: \'simple\',\r\n add_unload_trigger: false,\r\n " +
|
|
" schema: \"html5\",\r\n sta" +
|
|
"tusbar: false,\r\n setup: function (ed) {\r\n " +
|
|
" ed.on(\'init\', function () {\r\n " +
|
|
" $(ed.getWin()).blur(function () { updated(); });\r\n " +
|
|
" });\r\n }\r\n " +
|
|
" });\r\n });\r\n </script>\r\n");
|
|
|
|
|
|
#line 641 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
if (string.IsNullOrEmpty(Model.DeviceBatch.Comments))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>");
|
|
|
|
|
|
#line 645 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 647 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(new HtmlString(Model.DeviceBatch.Comments));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 647 "..\..\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=\"", 32441), Tuple.Create("\"", 32508)
|
|
|
|
#line 654 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 32449), Tuple.Create<System.Object, System.Int32>(canConfig ? "canAddAttachments" : "cannotAddAttachments"
|
|
|
|
#line default
|
|
#line hidden
|
|
, 32449), false)
|
|
);
|
|
|
|
WriteLiteral(" data-uploadurl=\"");
|
|
|
|
|
|
#line 654 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceBatch.AttachmentUpload(Model.DeviceBatch.Id, null)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(" data-removeurl=\"");
|
|
|
|
|
|
#line 654 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceBatch.AttachmentRemove()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
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 659 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 659 "..\..\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=\"", 33153), Tuple.Create("\"", 33226)
|
|
|
|
#line 663 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 33160), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceBatch.AttachmentDownload(attachment.Id))
|
|
|
|
#line default
|
|
#line hidden
|
|
, 33160), false)
|
|
);
|
|
|
|
WriteLiteral(" data-attachmentid=\"");
|
|
|
|
|
|
#line 663 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(attachment.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(" data-mimetype=\"");
|
|
|
|
|
|
#line 663 "..\..\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=\"", 33356), Tuple.Create("\"", 33384)
|
|
|
|
#line 664 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 33364), Tuple.Create<System.Object, System.Int32>(attachment.Filename
|
|
|
|
#line default
|
|
#line hidden
|
|
, 33364), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n <img");
|
|
|
|
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
|
|
|
WriteAttribute("src", Tuple.Create(" src=\"", 33459), Tuple.Create("\"", 33534)
|
|
|
|
#line 665 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 33465), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail(attachment.Id))
|
|
|
|
#line default
|
|
#line hidden
|
|
, 33465), false)
|
|
);
|
|
|
|
WriteLiteral(" />\r\n </span>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" class=\"comments\"");
|
|
|
|
WriteAttribute("title", Tuple.Create(" title=\"", 33643), Tuple.Create("\"", 33671)
|
|
|
|
#line 667 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 33651), Tuple.Create<System.Object, System.Int32>(attachment.Comments
|
|
|
|
#line default
|
|
#line hidden
|
|
, 33651), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 668 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(attachment.Comments ?? attachment.Filename);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </span><span");
|
|
|
|
WriteLiteral(" class=\"author\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 669 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(attachment.TechUser.ToString());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>");
|
|
|
|
|
|
#line 669 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"remove fa fa-times-circle\"");
|
|
|
|
WriteLiteral("></span>");
|
|
|
|
|
|
#line 670 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"timestamp\"");
|
|
|
|
WriteAttribute("title", Tuple.Create(" title=\"", 34002), Tuple.Create("\"", 34048)
|
|
|
|
#line 670 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 34010), Tuple.Create<System.Object, System.Int32>(attachment.Timestamp.ToFullDateTime()
|
|
|
|
#line default
|
|
#line hidden
|
|
, 34010), false)
|
|
);
|
|
|
|
WriteLiteral(" data-livestamp=\"");
|
|
|
|
|
|
#line 670 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(attachment.Timestamp.ToUnixEpoc());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 670 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(attachment.Timestamp.ToFullDateTime());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n </a>\r\n");
|
|
|
|
|
|
#line 672 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n");
|
|
|
|
|
|
#line 675 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 675 "..\..\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> Are you sure?\r\n </p>\r\n " +
|
|
" </div>\r\n");
|
|
|
|
|
|
#line 686 "..\..\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 706 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Model.DeviceBatch.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\' };\r\n\r\n $.connection.hub.reconnecting(function () {\r\n" +
|
|
" $Attachments.find(\'span.action.enabled\').addClas" +
|
|
"s(\'disabled\');\r\n });\r\n $.c" +
|
|
"onnection.hub.reconnected(function () {\r\n $Attach" +
|
|
"ments.find(\'span.action.enabled\').removeClass(\'disabled\');\r\n " +
|
|
" });\r\n $.connection.hub.error(function (error)" +
|
|
" {\r\n console.log(\'Server connection error: \' + er" +
|
|
"ror);\r\n });\r\n $.connection" +
|
|
".hub.disconnected(function () {\r\n // Disable UI\r\n" +
|
|
" $Attachments.find(\'span.action.enabled\').addClas" +
|
|
"s(\'disabled\');\r\n\r\n // Show Dialog Message\r\n " +
|
|
" if ($(\'.disconnected-dialog\').length == 0) {\r\n " +
|
|
" $(\'<div>\')\r\n " +
|
|
".addClass(\'dialog disconnected-dialog\')\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 error\"></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 refresh 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 \'R" +
|
|
"efresh Now\': function () {\r\n " +
|
|
"$(this).dialog(\'option\', \'buttons\', null);\r\n " +
|
|
" window.location.reload(true);\r\n " +
|
|
" },\r\n \'Close\': func" +
|
|
"tion () {\r\n $(this).dialog(\'d" +
|
|
"estroy\');\r\n }\r\n " +
|
|
" }\r\n });\r\n " +
|
|
" }\r\n });\r\n\r\n " +
|
|
" // Start Connection\r\n $.connection.hub.st" +
|
|
"art(function () {\r\n $Attachments.find(\'span.actio" +
|
|
"n.enabled\').removeClass(\'disabled\');\r\n });\r\n\r\n " +
|
|
" function onAddAttachment(id, quick) {\r\n " +
|
|
" var data = { id: id };\r\n $.ajax({\r\n " +
|
|
" url: \'");
|
|
|
|
|
|
#line 752 "..\..\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 758 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 758 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
WriteLiteral("buildAttachment(a, true, quick);");
|
|
|
|
WriteLiteral("\r\n");
|
|
|
|
|
|
#line 761 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
WriteLiteral("buildAttachment(a, false, quick);");
|
|
|
|
WriteLiteral("\r\n");
|
|
|
|
|
|
#line 765 "..\..\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 784 "..\..\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 806 "..\..\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 858 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 858 "..\..\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\').on(\'click\', removeAttachment);\r\n\r\n fu" +
|
|
"nction removeAttachment() {\r\n const attachmentId " +
|
|
"= $(this).closest(\'a\').attr(\'data-attachmentid\');\r\n\r\n " +
|
|
" if (!$dialogRemoveAttachment) {\r\n $dialo" +
|
|
"gRemoveAttachment = $(\'#dialogRemoveAttachment\').dialog({\r\n " +
|
|
" resizable: false,\r\n he" +
|
|
"ight: 140,\r\n modal: true,\r\n " +
|
|
" autoOpen: false\r\n }" +
|
|
");\r\n }\r\n\r\n $dialog" +
|
|
"RemoveAttachment.dialog(\'option\', \'buttons\', {\r\n " +
|
|
" \"Remove\": function () {\r\n $dialogRemo" +
|
|
"veAttachment.dialog(\"option\", \"buttons\", null);\r\n\r\n " +
|
|
" const body = new FormData();\r\n " +
|
|
" body.append(\'__RequestVerificationToken\', document.body.dataset.antiforgery);\r\n" +
|
|
" body.append(\'id\', attachmentId);\r\n " +
|
|
" fetch($Attachments.attr(\'data-removeurl\'), {\r\n" +
|
|
" method: \'POST\',\r\n " +
|
|
" body: body\r\n })." +
|
|
"then(r => {\r\n if (!r.ok) {\r\n " +
|
|
" alert(\'Unable to remove attachment: \' + r" +
|
|
".statusText);\r\n }\r\n " +
|
|
" $dialogRemoveAttachment.dialog(\'close\');\r\n " +
|
|
" }).catch(e => {\r\n " +
|
|
" alert(\'Unable to remove attachment: \' + e);\r\n " +
|
|
" $dialogRemoveAttachment.dialog(\'close\');\r\n " +
|
|
" });\r\n },\r\n " +
|
|
" Cancel: function () {\r\n " +
|
|
" $(this).dialog(\"close\");\r\n }\r\n " +
|
|
" });\r\n\r\n $dialogRemoveAttachm" +
|
|
"ent.dialog(\'open\');\r\n\r\n return false;\r\n " +
|
|
" }\r\n //#endregion\r\n " +
|
|
" ");
|
|
|
|
|
|
#line 930 "..\..\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 945 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 945 "..\..\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 961 "..\..\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 968 "..\..\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 976 "..\..\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 984 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 984 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 986 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 986 "..\..\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 993 "..\..\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 995 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 995 "..\..\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 999 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 999 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
using (Html.BeginForm(MVC.API.Device.DeviceBatchDecommission(Model.DeviceBatch.Id)))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 1001 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.AntiForgeryToken());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 1001 "..\..\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> Why are these devices to be decommissioned?\r\n </div>\r\n");
|
|
|
|
WriteLiteral(" <div>\r\n <ul");
|
|
|
|
WriteLiteral(" class=\"none\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 1007 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 1007 "..\..\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=\"", 53759), Tuple.Create("\"", 53829)
|
|
, Tuple.Create(Tuple.Create("", 53764), Tuple.Create("DeviceBatch_Decommission_Dialog_Reason_", 53764), true)
|
|
|
|
#line 1010 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 53803), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 53803), false)
|
|
);
|
|
|
|
WriteLiteral("\r\n name=\"decommissionReason\"");
|
|
|
|
WriteAttribute("value", Tuple.Create(" value=\"", 53896), Tuple.Create("\"", 53930)
|
|
|
|
#line 1011 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 53904), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 53904), false)
|
|
);
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 1011 "..\..\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=\"", 54070), Tuple.Create("\"", 54141)
|
|
, Tuple.Create(Tuple.Create("", 54076), Tuple.Create("DeviceBatch_Decommission_Dialog_Reason_", 54076), true)
|
|
|
|
#line 1012 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 54115), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 54115), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 1012 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(decommissionReason.ReasonMessage());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</label>\r\n </li>\r\n");
|
|
|
|
|
|
#line 1014 "..\..\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 1022 "..\..\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 1053 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 1054 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (Model.CanDelete)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <button");
|
|
|
|
WriteLiteral(" id=\"buttonDelete\"");
|
|
|
|
WriteLiteral(" type=\"button\"");
|
|
|
|
WriteLiteral(" class=\"button\"");
|
|
|
|
WriteLiteral(">Delete</button>\r\n");
|
|
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"dialogConfirmDelete\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Delete this Device Batch?\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 1058 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 1058 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
using (Html.BeginForm(MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true)))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 1060 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
Write(Html.AntiForgeryToken());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 1060 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <p>\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg warning\"");
|
|
|
|
WriteLiteral("></i>\r\n This item will be permanently deleted and cannot be recove" +
|
|
"red. Are you sure?\r\n </p>\r\n </div>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
let dialog = null;
|
|
$('#buttonDelete').on('click', function () {
|
|
if (!dialog) {
|
|
dialog = $(""#dialogConfirmDelete"").dialog({
|
|
resizable: false,
|
|
width: 300,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Delete"": function () {
|
|
$(this)
|
|
.dialog(""option"", ""buttons"", null)
|
|
.find('form').trigger('submit');
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
dialog.dialog('open');
|
|
});
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 1094 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 1095 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
if (Model.DeviceCount > 0)
|
|
{
|
|
if (Authorization.Has(Claims.Device.Actions.Export))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 1099 "..\..\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 1099 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
}
|
|
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 1103 "..\..\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 1103 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
|
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|