@@ -58,12 +58,13 @@ namespace Disco.BI.Extensions
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public static void OnDecommission(this Device d)
|
public static void OnDecommission(this Device d, Disco.Models.Repository.Device.DecommissionReasons Reason)
|
||||||
{
|
{
|
||||||
if (!d.CanDecommission())
|
if (!d.CanDecommission())
|
||||||
throw new InvalidOperationException("Decommission of Device is Denied");
|
throw new InvalidOperationException("Decommission of Device is Denied");
|
||||||
|
|
||||||
d.DecommissionedDate = DateTime.Now;
|
d.DecommissionedDate = DateTime.Now;
|
||||||
|
d.DecommissionReason = Reason;
|
||||||
|
|
||||||
// Disable AD Account
|
// Disable AD Account
|
||||||
if (d.ComputerName != null)
|
if (d.ComputerName != null)
|
||||||
@@ -87,6 +88,7 @@ namespace Disco.BI.Extensions
|
|||||||
throw new InvalidOperationException("Recommission of Device is Denied");
|
throw new InvalidOperationException("Recommission of Device is Denied");
|
||||||
|
|
||||||
d.DecommissionedDate = null;
|
d.DecommissionedDate = null;
|
||||||
|
d.DecommissionReason = null;
|
||||||
|
|
||||||
// Enable AD Account
|
// Enable AD Account
|
||||||
if (d.ComputerName != null)
|
if (d.ComputerName != null)
|
||||||
|
|||||||
@@ -178,10 +178,39 @@ namespace Disco.BI.Extensions
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string ReasonMessage(this Disco.Models.Repository.Device.DecommissionReasons r)
|
||||||
|
{
|
||||||
|
switch (r)
|
||||||
|
{
|
||||||
|
case Device.DecommissionReasons.EndOfLife:
|
||||||
|
return "End of Life";
|
||||||
|
case Device.DecommissionReasons.Sold:
|
||||||
|
return "Sold";
|
||||||
|
case Device.DecommissionReasons.Stolen:
|
||||||
|
return "Stolen";
|
||||||
|
case Device.DecommissionReasons.Lost:
|
||||||
|
return "Lost";
|
||||||
|
case Device.DecommissionReasons.Damaged:
|
||||||
|
return "Damaged";
|
||||||
|
case Device.DecommissionReasons.Donated:
|
||||||
|
return "Donated";
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ReasonMessage(this Disco.Models.Repository.Device.DecommissionReasons? r)
|
||||||
|
{
|
||||||
|
if (!r.HasValue)
|
||||||
|
return "Not Decommissioned";
|
||||||
|
|
||||||
|
return r.Value.ReasonMessage();
|
||||||
|
}
|
||||||
|
|
||||||
public static string Status(this Device Device)
|
public static string Status(this Device Device)
|
||||||
{
|
{
|
||||||
if (Device.DecommissionedDate.HasValue)
|
if (Device.DecommissionedDate.HasValue)
|
||||||
return "Decommissioned";
|
return string.Format("Decommissioned ({0})", Device.DecommissionReason.ReasonMessage());
|
||||||
|
|
||||||
if (!Device.EnrolledDate.HasValue)
|
if (!Device.EnrolledDate.HasValue)
|
||||||
return "Not Enrolled";
|
return "Not Enrolled";
|
||||||
|
|||||||
@@ -109,6 +109,10 @@
|
|||||||
<Compile Include="Migrations\201302210057463_DBv7.Designer.cs">
|
<Compile Include="Migrations\201302210057463_DBv7.Designer.cs">
|
||||||
<DependentUpon>201302210057463_DBv7.cs</DependentUpon>
|
<DependentUpon>201302210057463_DBv7.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Migrations\201309050648129_DBv8.cs" />
|
||||||
|
<Compile Include="Migrations\201309050648129_DBv8.Designer.cs">
|
||||||
|
<DependentUpon>201309050648129_DBv8.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Migrations\Configuration.cs" />
|
<Compile Include="Migrations\Configuration.cs" />
|
||||||
<Compile Include="Migrations\DiscoDataMigrator.cs" />
|
<Compile Include="Migrations\DiscoDataMigrator.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
@@ -146,6 +150,9 @@
|
|||||||
<EmbeddedResource Include="Migrations\201302210057463_DBv7.resx">
|
<EmbeddedResource Include="Migrations\201302210057463_DBv7.resx">
|
||||||
<DependentUpon>201302210057463_DBv7.cs</DependentUpon>
|
<DependentUpon>201302210057463_DBv7.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\201309050648129_DBv8.resx">
|
||||||
|
<DependentUpon>201309050648129_DBv8.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
@@ -159,7 +166,7 @@
|
|||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace Disco.Data.Migrations
|
||||||
|
{
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
public sealed partial class DBv8 : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv8));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "201309050648129_DBv8"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
namespace Disco.Data.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class DBv8 : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.Devices", "DecommissionReason", c => c.Int());
|
||||||
|
|
||||||
|
// Set DecommissionedReason to default ('End Of Life') for any previously decommissioned devices.
|
||||||
|
Sql("UPDATE dbo.Devices SET DecommissionReason=0 WHERE NOT DecommissionedDate IS NULL");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.Devices", "DecommissionReason");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -41,6 +41,7 @@ namespace Disco.Models.Repository
|
|||||||
public DateTime? EnrolledDate { get; set; }
|
public DateTime? EnrolledDate { get; set; }
|
||||||
public DateTime? LastEnrolDate { get; set; }
|
public DateTime? LastEnrolDate { get; set; }
|
||||||
public DateTime? DecommissionedDate { get; set; }
|
public DateTime? DecommissionedDate { get; set; }
|
||||||
|
public DecommissionReasons? DecommissionReason { get; set; }
|
||||||
|
|
||||||
[ForeignKey("DeviceModelId")]
|
[ForeignKey("DeviceModelId")]
|
||||||
public virtual DeviceModel DeviceModel { get; set; }
|
public virtual DeviceModel DeviceModel { get; set; }
|
||||||
@@ -65,5 +66,15 @@ namespace Disco.Models.Repository
|
|||||||
else
|
else
|
||||||
return this.SerialNumber;
|
return this.SerialNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum DecommissionReasons
|
||||||
|
{
|
||||||
|
EndOfLife = 0,
|
||||||
|
Sold = 10,
|
||||||
|
Stolen = 20,
|
||||||
|
Lost = 30,
|
||||||
|
Damaged = 40,
|
||||||
|
Donated = 50
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Device Actions
|
#region Device Actions
|
||||||
public virtual ActionResult Decommission(string id, bool redirect)
|
public virtual ActionResult Decommission(string id, int Reason, bool redirect)
|
||||||
{
|
{
|
||||||
var d = dbContext.Devices.Find(id);
|
var d = dbContext.Devices.Find(id);
|
||||||
dbContext.Configuration.LazyLoadingEnabled = true;
|
dbContext.Configuration.LazyLoadingEnabled = true;
|
||||||
@@ -221,7 +221,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
{
|
{
|
||||||
if (d.CanDecommission())
|
if (d.CanDecommission())
|
||||||
{
|
{
|
||||||
d.OnDecommission();
|
d.OnDecommission((Disco.Models.Repository.Device.DecommissionReasons)Reason);
|
||||||
|
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
if (redirect)
|
if (redirect)
|
||||||
|
|||||||
+7
-3
@@ -143,6 +143,8 @@ namespace Links
|
|||||||
public static string Url(string fileName) { return T4MVCHelpers.ProcessVirtualPath(URLPATH + "/" + fileName); }
|
public static string Url(string fileName) { return T4MVCHelpers.ProcessVirtualPath(URLPATH + "/" + fileName); }
|
||||||
public static readonly string disco_dataTables_extensions_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/disco.dataTables.extensions.min.js") ? Url("disco.dataTables.extensions.min.js") : Url("disco.dataTables.extensions.js");
|
public static readonly string disco_dataTables_extensions_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/disco.dataTables.extensions.min.js") ? Url("disco.dataTables.extensions.min.js") : Url("disco.dataTables.extensions.js");
|
||||||
|
|
||||||
|
public static readonly string disco_uicore_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/disco.uicore.min.js") ? Url("disco.uicore.min.js") : Url("disco.uicore.js");
|
||||||
|
|
||||||
public static readonly string disco_unobtrusiveValidation_extensions_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/disco.unobtrusiveValidation.extensions.min.js") ? Url("disco.unobtrusiveValidation.extensions.min.js") : Url("disco.unobtrusiveValidation.extensions.js");
|
public static readonly string disco_unobtrusiveValidation_extensions_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/disco.unobtrusiveValidation.extensions.min.js") ? Url("disco.unobtrusiveValidation.extensions.min.js") : Url("disco.unobtrusiveValidation.extensions.js");
|
||||||
|
|
||||||
public static readonly string jquery_2_0_2_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/jquery-2.0.2.min.js") ? Url("jquery-2.0.2.min.js") : Url("jquery-2.0.2.js");
|
public static readonly string jquery_2_0_2_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/jquery-2.0.2.min.js") ? Url("jquery-2.0.2.min.js") : Url("jquery-2.0.2.js");
|
||||||
@@ -3491,6 +3493,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public class ActionParamsClass_Decommission
|
public class ActionParamsClass_Decommission
|
||||||
{
|
{
|
||||||
public readonly string id = "id";
|
public readonly string id = "id";
|
||||||
|
public readonly string Reason = "Reason";
|
||||||
public readonly string redirect = "redirect";
|
public readonly string redirect = "redirect";
|
||||||
}
|
}
|
||||||
static readonly ActionParamsClass_Recommission s_params_Recommission = new ActionParamsClass_Recommission();
|
static readonly ActionParamsClass_Recommission s_params_Recommission = new ActionParamsClass_Recommission();
|
||||||
@@ -3697,14 +3700,15 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
partial void DecommissionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, bool redirect);
|
partial void DecommissionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, int Reason, bool redirect);
|
||||||
|
|
||||||
public override System.Web.Mvc.ActionResult Decommission(string id, bool redirect)
|
public override System.Web.Mvc.ActionResult Decommission(string id, int Reason, bool redirect)
|
||||||
{
|
{
|
||||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Decommission);
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Decommission);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Reason", Reason);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
DecommissionOverride(callInfo, id, redirect);
|
DecommissionOverride(callInfo, id, Reason, redirect);
|
||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -590,17 +590,30 @@
|
|||||||
}
|
}
|
||||||
@if (Model.Device.CanDecommission())
|
@if (Model.Device.CanDecommission())
|
||||||
{
|
{
|
||||||
@Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Decommission_Button")
|
@Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(), "Device_Show_Device_Actions_Decommission_Button")
|
||||||
<div id="Device_Show_Device_Actions_Decommission_Dialog" class="dialog" title="Decommission this Device?">
|
<div id="Device_Show_Device_Actions_Decommission_Dialog" class="dialog" title="Device Decommissioning">
|
||||||
<p>
|
<div class="clearfix" style="margin-bottom: 10px;">
|
||||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
<span class="ui-icon ui-icon-info" style="float: left; margin: 0 7px 0 0;"></span>
|
||||||
Are you sure?
|
Why was this Device Decommissioned?
|
||||||
</p>
|
</div>
|
||||||
|
<div>
|
||||||
|
<ul class="none">
|
||||||
|
@foreach (Device.DecommissionReasons decommissionReason in Enum.GetValues(typeof(Device.DecommissionReasons)))
|
||||||
|
{
|
||||||
|
<li>
|
||||||
|
<input type="radio" id="Device_Show_Device_Actions_Decommission_Reason_@((int)decommissionReason)"
|
||||||
|
name="Device_Show_Device_Actions_Decommission_Reason" value="@((int)decommissionReason)" @((decommissionReason== Device.DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty)/>
|
||||||
|
<label for="Device_Show_Device_Actions_Decommission_Reason_@((int)decommissionReason)">@(decommissionReason.ReasonMessage())</label>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
var button = $('#Device_Show_Device_Actions_Decommission_Button');
|
var button = $('#Device_Show_Device_Actions_Decommission_Button');
|
||||||
var buttonDialog = null;
|
var buttonDialog = null;
|
||||||
|
var deviceSerialNumber = '@(Model.Device.SerialNumber)';
|
||||||
|
|
||||||
button.click(function () {
|
button.click(function () {
|
||||||
|
|
||||||
@@ -608,15 +621,20 @@
|
|||||||
buttonDialog = $('#Device_Show_Device_Actions_Decommission_Dialog')
|
buttonDialog = $('#Device_Show_Device_Actions_Decommission_Dialog')
|
||||||
.dialog({
|
.dialog({
|
||||||
resizable: false,
|
resizable: false,
|
||||||
height: 140,
|
|
||||||
modal: true,
|
modal: true,
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
buttons: {
|
buttons: {
|
||||||
"Decommission": function () {
|
"Decommission": function () {
|
||||||
|
|
||||||
|
var reasonId = buttonDialog.find('input:checked').val();
|
||||||
|
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
$this.dialog("disable");
|
$this.dialog("disable");
|
||||||
$this.dialog("option", "buttons", null);
|
$this.dialog("option", "buttons", null);
|
||||||
window.location.href = button.attr('href');
|
|
||||||
|
var url = button.attr('href') + '/' + deviceSerialNumber + '?Reason=' + reasonId + '&redirect=True';
|
||||||
|
|
||||||
|
window.location.href = url;
|
||||||
},
|
},
|
||||||
Cancel: function () {
|
Cancel: function () {
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.18033
|
// Runtime Version:4.0.30319.18051
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
@@ -1886,7 +1886,7 @@ WriteLiteral(" ");
|
|||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 593 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 593 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
Write(Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Decommission_Button"));
|
Write(Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(), "Device_Show_Device_Actions_Decommission_Button"));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -1904,16 +1904,111 @@ WriteLiteral(" id=\"Device_Show_Device_Actions_Decommission_Dialog\"");
|
|||||||
|
|
||||||
WriteLiteral(" class=\"dialog\"");
|
WriteLiteral(" class=\"dialog\"");
|
||||||
|
|
||||||
WriteLiteral(" title=\"Decommission this Device?\"");
|
WriteLiteral(" title=\"Device Decommissioning\"");
|
||||||
|
|
||||||
WriteLiteral(">\r\n <p>\r\n <span");
|
WriteLiteral(">\r\n <div");
|
||||||
|
|
||||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
WriteLiteral(" class=\"clearfix\"");
|
||||||
|
|
||||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
WriteLiteral(" style=\"margin-bottom: 10px;\"");
|
||||||
|
|
||||||
WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n " +
|
WriteLiteral(">\r\n <span");
|
||||||
" </div>\r\n");
|
|
||||||
|
WriteLiteral(" class=\"ui-icon ui-icon-info\"");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"float: left; margin: 0 7px 0 0;\"");
|
||||||
|
|
||||||
|
WriteLiteral("></span>\r\n Why was this Device Decommissioned?\r\n " +
|
||||||
|
" </div>\r\n <div>\r\n <ul");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"none\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 601 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
|
||||||
|
#line 601 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
foreach (Device.DecommissionReasons decommissionReason in Enum.GetValues(typeof(Device.DecommissionReasons)))
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" <li>\r\n <input");
|
||||||
|
|
||||||
|
WriteLiteral(" type=\"radio\"");
|
||||||
|
|
||||||
|
WriteAttribute("id", Tuple.Create(" id=\"", 37225), Tuple.Create("\"", 37303)
|
||||||
|
, Tuple.Create(Tuple.Create("", 37230), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 37230), true)
|
||||||
|
|
||||||
|
#line 604 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
, Tuple.Create(Tuple.Create("", 37277), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
, 37277), false)
|
||||||
|
);
|
||||||
|
|
||||||
|
WriteLiteral("\r\n name=\"Device_Show_Device_Actions_Decomm" +
|
||||||
|
"ission_Reason\"");
|
||||||
|
|
||||||
|
WriteAttribute("value", Tuple.Create(" value=\"", 37399), Tuple.Create("\"", 37433)
|
||||||
|
|
||||||
|
#line 605 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
, Tuple.Create(Tuple.Create("", 37407), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
, 37407), false)
|
||||||
|
);
|
||||||
|
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 605 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
Write((decommissionReason== Device.DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("/>\r\n <label");
|
||||||
|
|
||||||
|
WriteAttribute("for", Tuple.Create(" for=\"", 37582), Tuple.Create("\"", 37661)
|
||||||
|
, Tuple.Create(Tuple.Create("", 37588), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 37588), true)
|
||||||
|
|
||||||
|
#line 606 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
, Tuple.Create(Tuple.Create("", 37635), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
, 37635), false)
|
||||||
|
);
|
||||||
|
|
||||||
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
|
#line 606 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
Write(decommissionReason.ReasonMessage());
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("</label>\r\n </li>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 608 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" </ul>\r\n </div>\r\n </div>" +
|
||||||
|
"\r\n");
|
||||||
|
|
||||||
WriteLiteral(" <script");
|
WriteLiteral(" <script");
|
||||||
|
|
||||||
@@ -1921,32 +2016,44 @@ WriteLiteral(" type=\"text/javascript\"");
|
|||||||
|
|
||||||
WriteLiteral(">\r\n $(function () {\r\n var button = $(\'#" +
|
WriteLiteral(">\r\n $(function () {\r\n var button = $(\'#" +
|
||||||
"Device_Show_Device_Actions_Decommission_Button\');\r\n var b" +
|
"Device_Show_Device_Actions_Decommission_Button\');\r\n var b" +
|
||||||
"uttonDialog = null;\r\n\r\n button.click(function () {\r\n\r\n " +
|
"uttonDialog = null;\r\n var deviceSerialNumber = \'");
|
||||||
" if (!buttonDialog) {\r\n b" +
|
|
||||||
"uttonDialog = $(\'#Device_Show_Device_Actions_Decommission_Dialog\')\r\n " +
|
|
||||||
" .dialog({\r\n " +
|
|
||||||
" resizable: false,\r\n " +
|
|
||||||
" height: 140,\r\n " +
|
|
||||||
" modal: true,\r\n " +
|
|
||||||
" autoOpen: false,\r\n butt" +
|
|
||||||
"ons: {\r\n \"Decommissio" +
|
|
||||||
"n\": function () {\r\n " +
|
|
||||||
" var $this = $(this);\r\n " +
|
|
||||||
" $this.dialog(\"disable\");\r\n " +
|
|
||||||
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
|
||||||
" window.location.href = button.attr(" +
|
|
||||||
"\'href\');\r\n },\r\n " +
|
|
||||||
" Cancel: function () {\r\n " +
|
|
||||||
" $(this).dialog(\"clo" +
|
|
||||||
"se\");\r\n }\r\n " +
|
|
||||||
" }\r\n " +
|
|
||||||
" });\r\n }\r\n\r\n " +
|
|
||||||
" buttonDialog.dialog(\'open\');\r\n return false;\r\n" +
|
|
||||||
" });\r\n\r\n });\r\n </script" +
|
|
||||||
">\r\n");
|
|
||||||
|
|
||||||
|
|
||||||
#line 634 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 616 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
Write(Model.Device.SerialNumber);
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\r\n " +
|
||||||
|
" if (!buttonDialog) {\r\n buttonDialog = $(\'#" +
|
||||||
|
"Device_Show_Device_Actions_Decommission_Dialog\')\r\n " +
|
||||||
|
" .dialog({\r\n " +
|
||||||
|
" resizable: false,\r\n " +
|
||||||
|
" modal: true,\r\n autoOp" +
|
||||||
|
"en: false,\r\n buttons: {\r\n" +
|
||||||
|
" \"Decommission\": func" +
|
||||||
|
"tion () {\r\n\r\n var" +
|
||||||
|
" reasonId = buttonDialog.find(\'input:checked\').val();\r\n " +
|
||||||
|
" \r\n " +
|
||||||
|
" var $this = $(this);\r\n " +
|
||||||
|
" $this.dialog(\"disable\");\r\n " +
|
||||||
|
" $this.dialog(\"option\", \"buttons\", null)" +
|
||||||
|
";\r\n\r\n var url = b" +
|
||||||
|
"utton.attr(\'href\') + \'/\' + deviceSerialNumber + \'?Reason=\' + reasonId + \'&redire" +
|
||||||
|
"ct=True\';\r\n\r\n win" +
|
||||||
|
"dow.location.href = url;\r\n " +
|
||||||
|
" },\r\n Cancel: fu" +
|
||||||
|
"nction () {\r\n $(t" +
|
||||||
|
"his).dialog(\"close\");\r\n " +
|
||||||
|
" }\r\n }\r\n " +
|
||||||
|
" });\r\n }\r\n\r\n " +
|
||||||
|
" buttonDialog.dialog(\'open\');\r\n " +
|
||||||
|
" return false;\r\n });\r\n\r\n });\r\n " +
|
||||||
|
" </script>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 652 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1955,7 +2062,7 @@ WriteLiteral(">\r\n $(function () {\r\n
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 635 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 653 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
if (Model.Device.CanRecommission())
|
if (Model.Device.CanRecommission())
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1963,14 +2070,14 @@ WriteLiteral(" ");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 637 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 655 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
Write(Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button"));
|
Write(Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button"));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 637 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 655 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2027,7 +2134,7 @@ WriteLiteral(@">
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 673 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 691 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2036,7 +2143,7 @@ WriteLiteral(@">
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 674 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 692 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
if (Model.Device.CanDelete())
|
if (Model.Device.CanDelete())
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2044,14 +2151,14 @@ WriteLiteral(" ");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 676 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 694 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
Write(Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button"));
|
Write(Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button"));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 676 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 694 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2113,7 +2220,7 @@ WriteLiteral(@">
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 714 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
#line 732 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user