feature: support importing device computer name
This commit is contained in:
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Disco.Models.Services.Devices.Importing
|
namespace Disco.Models.Services.Devices.Importing
|
||||||
{
|
{
|
||||||
@@ -11,6 +6,8 @@ namespace Disco.Models.Services.Devices.Importing
|
|||||||
{
|
{
|
||||||
[Required, Display(Name = "Device Serial Number", Description = "The device serial number")]
|
[Required, Display(Name = "Device Serial Number", Description = "The device serial number")]
|
||||||
DeviceSerialNumber,
|
DeviceSerialNumber,
|
||||||
|
[Display(Name = "Device Computer Name", Description = "The device computer name")]
|
||||||
|
DeviceComputerName,
|
||||||
[Display(Name = "Device Asset Number", Description = "The device asset number")]
|
[Display(Name = "Device Asset Number", Description = "The device asset number")]
|
||||||
DeviceAssetNumber,
|
DeviceAssetNumber,
|
||||||
[Display(Name = "Device Location", Description = "The device location")]
|
[Display(Name = "Device Location", Description = "The device location")]
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ namespace Disco.Services
|
|||||||
{
|
{
|
||||||
// Just Include:
|
// Just Include:
|
||||||
// - Serial Number
|
// - Serial Number
|
||||||
|
// - Device Domain Id
|
||||||
// - Asset Number
|
// - Asset Number
|
||||||
// - Profile Id
|
// - Profile Id
|
||||||
// - Assigned User Id
|
// - Assigned User Id
|
||||||
@@ -102,6 +103,7 @@ namespace Disco.Services
|
|||||||
Device d2 = new Device()
|
Device d2 = new Device()
|
||||||
{
|
{
|
||||||
SerialNumber = d.SerialNumber.ToUpper(),
|
SerialNumber = d.SerialNumber.ToUpper(),
|
||||||
|
DeviceDomainId = d.DeviceDomainId,
|
||||||
AssetNumber = d.AssetNumber,
|
AssetNumber = d.AssetNumber,
|
||||||
Location = d.Location,
|
Location = d.Location,
|
||||||
CreatedDate = DateTime.Now,
|
CreatedDate = DateTime.Now,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace Disco.Services.Devices.Importing
|
|||||||
return new Dictionary<DeviceImportFieldTypes, Type>()
|
return new Dictionary<DeviceImportFieldTypes, Type>()
|
||||||
{
|
{
|
||||||
{ DeviceImportFieldTypes.DeviceSerialNumber, typeof(DeviceSerialNumberImportField) },
|
{ DeviceImportFieldTypes.DeviceSerialNumber, typeof(DeviceSerialNumberImportField) },
|
||||||
|
{ DeviceImportFieldTypes.DeviceComputerName, typeof(DeviceComputerNameImportField) },
|
||||||
{ DeviceImportFieldTypes.DeviceAssetNumber, typeof(DeviceAssetNumberImportField) },
|
{ DeviceImportFieldTypes.DeviceAssetNumber, typeof(DeviceAssetNumberImportField) },
|
||||||
{ DeviceImportFieldTypes.DeviceLocation, typeof(DeviceLocationImportField) },
|
{ DeviceImportFieldTypes.DeviceLocation, typeof(DeviceLocationImportField) },
|
||||||
{ DeviceImportFieldTypes.DeviceAllowUnauthenticatedEnrol, typeof(DeviceAllowUnauthenticatedEnrolImportField) },
|
{ DeviceImportFieldTypes.DeviceAllowUnauthenticatedEnrol, typeof(DeviceAllowUnauthenticatedEnrolImportField) },
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
using Disco.Data.Repository;
|
||||||
|
using Disco.Models.Repository;
|
||||||
|
using Disco.Models.Services.Devices.Importing;
|
||||||
|
using Disco.Services.Interop.ActiveDirectory;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Disco.Services.Devices.Importing.Fields
|
||||||
|
{
|
||||||
|
internal class DeviceComputerNameImportField : DeviceImportFieldBase
|
||||||
|
{
|
||||||
|
private const int maxLength = 60;
|
||||||
|
private string parsedValue;
|
||||||
|
private string previousValue;
|
||||||
|
|
||||||
|
public override DeviceImportFieldTypes FieldType { get { return DeviceImportFieldTypes.DeviceComputerName; } }
|
||||||
|
|
||||||
|
public override object RawParsedValue { get { return parsedValue; } }
|
||||||
|
public override string FriendlyValue { get { return parsedValue; } }
|
||||||
|
public override string FriendlyPreviousValue { get { return previousValue; } }
|
||||||
|
|
||||||
|
public override bool Parse(DiscoDataContext Database, IDeviceImportCache Cache, IDeviceImportContext Context, string DeviceSerialNumber, Device ExistingDevice, List<IDeviceImportRecord> PreviousRecords, IDeviceImportDataReader DataReader, int ColumnIndex)
|
||||||
|
{
|
||||||
|
var value = DataReader.GetString(ColumnIndex);
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(value))
|
||||||
|
parsedValue = null;
|
||||||
|
else
|
||||||
|
parsedValue = value.Trim();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(parsedValue))
|
||||||
|
return Error("The Device Computer Name is required");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
parsedValue = ActiveDirectory.ParseDomainAccountId(parsedValue);
|
||||||
|
}
|
||||||
|
catch (ArgumentException ex) when (ex.ParamName == "NetBiosName")
|
||||||
|
{
|
||||||
|
return Error(ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parsedValue.Length > maxLength)
|
||||||
|
return Error($"Cannot be more than {maxLength} characters");
|
||||||
|
|
||||||
|
if (ExistingDevice != null)
|
||||||
|
{
|
||||||
|
if (string.Equals(parsedValue, ExistingDevice.DeviceDomainId, StringComparison.OrdinalIgnoreCase))
|
||||||
|
return Success(EntityState.Unchanged);
|
||||||
|
if (ExistingDevice.EnrolledDate.HasValue)
|
||||||
|
return Error("The Device Computer Name cannot be changed after a device has enrolled");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
previousValue = ExistingDevice.DeviceDomainId;
|
||||||
|
return Success(EntityState.Modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success(EntityState.Added);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Apply(DiscoDataContext Database, Device Device)
|
||||||
|
{
|
||||||
|
if (FieldAction == EntityState.Added ||
|
||||||
|
FieldAction == EntityState.Modified)
|
||||||
|
{
|
||||||
|
Device.DeviceDomainId = parsedValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int? GuessColumn(DiscoDataContext Database, IDeviceImportContext Context, IDeviceImportDataReader DataReader)
|
||||||
|
{
|
||||||
|
// column name
|
||||||
|
var possibleColumns = Context.Columns
|
||||||
|
.Where(h => h.Type == DeviceImportFieldTypes.IgnoreColumn &&
|
||||||
|
h.Name.IndexOf("name", StringComparison.OrdinalIgnoreCase) >= 0);
|
||||||
|
|
||||||
|
return possibleColumns.Select(h => (int?)h.Index).FirstOrDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -265,6 +265,7 @@
|
|||||||
<Compile Include="Devices\Importing\Fields\DetailBatteryImportField.cs" />
|
<Compile Include="Devices\Importing\Fields\DetailBatteryImportField.cs" />
|
||||||
<Compile Include="Devices\Importing\Fields\DeviceDecommissionedReasonImportField.cs" />
|
<Compile Include="Devices\Importing\Fields\DeviceDecommissionedReasonImportField.cs" />
|
||||||
<Compile Include="Devices\Importing\Fields\DeviceDecommissionedDateImportField.cs" />
|
<Compile Include="Devices\Importing\Fields\DeviceDecommissionedDateImportField.cs" />
|
||||||
|
<Compile Include="Devices\Importing\Fields\DeviceComputerNameImportField.cs" />
|
||||||
<Compile Include="Devices\Importing\Fields\ProfileIdImportField.cs" />
|
<Compile Include="Devices\Importing\Fields\ProfileIdImportField.cs" />
|
||||||
<Compile Include="Devices\Importing\Fields\DetailACAdapterImportField.cs" />
|
<Compile Include="Devices\Importing\Fields\DetailACAdapterImportField.cs" />
|
||||||
<Compile Include="Devices\Importing\Fields\DetailWLanMacAddressImportField.cs" />
|
<Compile Include="Devices\Importing\Fields\DetailWLanMacAddressImportField.cs" />
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Disco.Models.UI.Device;
|
|||||||
using Disco.Services;
|
using Disco.Services;
|
||||||
using Disco.Services.Authorization;
|
using Disco.Services.Authorization;
|
||||||
using Disco.Services.Devices.Exporting;
|
using Disco.Services.Devices.Exporting;
|
||||||
|
using Disco.Services.Interop.ActiveDirectory;
|
||||||
using Disco.Services.Plugins.Features.DetailsProvider;
|
using Disco.Services.Plugins.Features.DetailsProvider;
|
||||||
using Disco.Services.Plugins.Features.UIExtension;
|
using Disco.Services.Plugins.Features.UIExtension;
|
||||||
using Disco.Services.Users;
|
using Disco.Services.Users;
|
||||||
@@ -77,6 +78,16 @@ namespace Disco.Web.Controllers
|
|||||||
if (!string.IsNullOrEmpty(m.Device.SerialNumber) && Database.Devices.Count(d => d.SerialNumber == m.Device.SerialNumber) > 0)
|
if (!string.IsNullOrEmpty(m.Device.SerialNumber) && Database.Devices.Count(d => d.SerialNumber == m.Device.SerialNumber) > 0)
|
||||||
ModelState.AddModelError("Device.SerialNumber", "A Device what this Serial Number already exists");
|
ModelState.AddModelError("Device.SerialNumber", "A Device what this Serial Number already exists");
|
||||||
}
|
}
|
||||||
|
if (string.IsNullOrWhiteSpace(m.Device.DeviceDomainId))
|
||||||
|
m.Device.DeviceDomainId = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
m.Device.DeviceDomainId = ActiveDirectory.ParseDomainAccountId(m.Device.DeviceDomainId);
|
||||||
|
}
|
||||||
|
catch (ArgumentException ex)
|
||||||
|
{
|
||||||
|
ModelState.AddModelError("Device.DeviceDomainId", ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
if (ModelState.IsValid)
|
if (ModelState.IsValid)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,19 +17,31 @@
|
|||||||
<div class="form" style="width: 450px">
|
<div class="form" style="width: 450px">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Serial Number:
|
<th>
|
||||||
|
Serial Number (required):
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
@Html.TextBoxFor(model => model.Device.SerialNumber)<br />
|
@Html.TextBoxFor(model => model.Device.SerialNumber)<br />
|
||||||
@Html.ValidationMessageFor(model => model.Device.SerialNumber)
|
@Html.ValidationMessageFor(model => model.Device.SerialNumber)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Computer Name:
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
@Html.TextBoxFor(model => model.Device.DeviceDomainId)<br />
|
||||||
|
@Html.ValidationMessageFor(model => model.Device.DeviceDomainId)
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
@if (hasAssetNumber)
|
@if (hasAssetNumber)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<th>Asset Number:
|
<th>
|
||||||
|
Asset Number:
|
||||||
</th>
|
</th>
|
||||||
<td>@Html.TextBoxFor(model => model.Device.AssetNumber)<br />
|
<td>
|
||||||
|
@Html.TextBoxFor(model => model.Device.AssetNumber)<br />
|
||||||
@Html.ValidationMessageFor(model => model.Device.AssetNumber)
|
@Html.ValidationMessageFor(model => model.Device.AssetNumber)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -37,9 +49,11 @@
|
|||||||
@if (hasLocation)
|
@if (hasLocation)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<th>Location:
|
<th>
|
||||||
|
Location:
|
||||||
</th>
|
</th>
|
||||||
<td>@Html.TextBoxFor(model => model.Device.Location)<br />
|
<td>
|
||||||
|
@Html.TextBoxFor(model => model.Device.Location)<br />
|
||||||
@Html.ValidationMessageFor(model => model.Device.Location)
|
@Html.ValidationMessageFor(model => model.Device.Location)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -47,7 +61,8 @@
|
|||||||
@if (hasDeviceBatch)
|
@if (hasDeviceBatch)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<th>Device Batch:
|
<th>
|
||||||
|
Device Batch:
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
@Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems())
|
@Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems())
|
||||||
@@ -59,7 +74,8 @@
|
|||||||
@if (hasDeviceProfile)
|
@if (hasDeviceProfile)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<th>Device Profile:
|
<th>
|
||||||
|
Device Profile:
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
@Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId))<br />
|
@Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId))<br />
|
||||||
@@ -70,7 +86,8 @@
|
|||||||
@if (hasAssignUser)
|
@if (hasAssignUser)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<th>Assigned User:
|
<th>
|
||||||
|
Assigned User:
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
@Html.TextBoxFor(model => model.Device.AssignedUserId)<br />
|
@Html.TextBoxFor(model => model.Device.AssignedUserId)<br />
|
||||||
@@ -87,13 +104,20 @@
|
|||||||
|
|
||||||
<input type="submit" class="button" value="Add" />
|
<input type="submit" class="button" value="Add" />
|
||||||
</p>
|
</p>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
var $SerialNumber = $('#Device_SerialNumber').focus();
|
var $SerialNumber = $('#Device_SerialNumber').focus();
|
||||||
|
|
||||||
|
$SerialNumber.keydown(function (e) {
|
||||||
|
if (e.which == 13) {
|
||||||
|
$('#Device_DeviceDomainId').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
@if (hasAssignUser)
|
@if (hasAssignUser)
|
||||||
{<text>
|
{<text>
|
||||||
$SerialNumber.keydown(function (e) {
|
$('#Device_DeviceDomainId').keydown(function (e) {
|
||||||
if (e.which == 13) {
|
if (e.which == 13) {
|
||||||
$('#Device_AssignedUserId').focus();
|
$('#Device_AssignedUserId').focus();
|
||||||
return false;
|
return false;
|
||||||
@@ -144,6 +168,6 @@
|
|||||||
};
|
};
|
||||||
</text>}
|
</text>}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.34014
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// 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.
|
||||||
@@ -27,7 +27,6 @@ namespace Disco.Web.Views.Device
|
|||||||
using System.Web.UI;
|
using System.Web.UI;
|
||||||
using System.Web.WebPages;
|
using System.Web.WebPages;
|
||||||
using Disco;
|
using Disco;
|
||||||
using Disco.BI.Extensions;
|
|
||||||
using Disco.Models.Repository;
|
using Disco.Models.Repository;
|
||||||
using Disco.Services;
|
using Disco.Services;
|
||||||
using Disco.Services.Authorization;
|
using Disco.Services.Authorization;
|
||||||
@@ -91,13 +90,13 @@ WriteLiteral(" class=\"form\"");
|
|||||||
|
|
||||||
WriteLiteral(" style=\"width: 450px\"");
|
WriteLiteral(" style=\"width: 450px\"");
|
||||||
|
|
||||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Serial Number:\r\n " +
|
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n S" +
|
||||||
" </th>\r\n <td>\r\n");
|
"erial Number (required):\r\n </th>\r\n <td>\r\n");
|
||||||
|
|
||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 23 "..\..\Views\Device\AddOffline.cshtml"
|
#line 24 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.TextBoxFor(model => model.Device.SerialNumber));
|
Write(Html.TextBoxFor(model => model.Device.SerialNumber));
|
||||||
|
|
||||||
|
|
||||||
@@ -108,33 +107,59 @@ WriteLiteral("<br />\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 24 "..\..\Views\Device\AddOffline.cshtml"
|
#line 25 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.ValidationMessageFor(model => model.Device.SerialNumber));
|
Write(Html.ValidationMessageFor(model => model.Device.SerialNumber));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||||
|
">\r\n Computer Name:\r\n </th>\r\n <t" +
|
||||||
|
"d>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 33 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
|
Write(Html.TextBoxFor(model => model.Device.DeviceDomainId));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("<br />\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 34 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
|
Write(Html.ValidationMessageFor(model => model.Device.DeviceDomainId));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 27 "..\..\Views\Device\AddOffline.cshtml"
|
#line 37 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 27 "..\..\Views\Device\AddOffline.cshtml"
|
#line 37 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasAssetNumber)
|
if (hasAssetNumber)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <tr>\r\n <th>Asset Number:\r\n " +
|
WriteLiteral(" <tr>\r\n <th>\r\n Asset Num" +
|
||||||
"</th>\r\n <td>");
|
"ber:\r\n </th>\r\n <td>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 32 "..\..\Views\Device\AddOffline.cshtml"
|
#line 44 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.TextBoxFor(model => model.Device.AssetNumber));
|
Write(Html.TextBoxFor(model => model.Device.AssetNumber));
|
||||||
|
|
||||||
|
|
||||||
@@ -145,7 +170,7 @@ WriteLiteral("<br />\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 33 "..\..\Views\Device\AddOffline.cshtml"
|
#line 45 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.ValidationMessageFor(model => model.Device.AssetNumber));
|
Write(Html.ValidationMessageFor(model => model.Device.AssetNumber));
|
||||||
|
|
||||||
|
|
||||||
@@ -154,7 +179,7 @@ WriteLiteral(" ");
|
|||||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 36 "..\..\Views\Device\AddOffline.cshtml"
|
#line 48 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -163,18 +188,20 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 37 "..\..\Views\Device\AddOffline.cshtml"
|
#line 49 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasLocation)
|
if (hasLocation)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <tr>\r\n <th>Location:\r\n </th" +
|
WriteLiteral(" <tr>\r\n <th>\r\n Location:" +
|
||||||
">\r\n <td>");
|
"\r\n </th>\r\n <td>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 42 "..\..\Views\Device\AddOffline.cshtml"
|
#line 56 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.TextBoxFor(model => model.Device.Location));
|
Write(Html.TextBoxFor(model => model.Device.Location));
|
||||||
|
|
||||||
|
|
||||||
@@ -185,7 +212,7 @@ WriteLiteral("<br />\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 43 "..\..\Views\Device\AddOffline.cshtml"
|
#line 57 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.ValidationMessageFor(model => model.Device.Location));
|
Write(Html.ValidationMessageFor(model => model.Device.Location));
|
||||||
|
|
||||||
|
|
||||||
@@ -194,7 +221,7 @@ WriteLiteral(" ");
|
|||||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 46 "..\..\Views\Device\AddOffline.cshtml"
|
#line 60 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -203,20 +230,20 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 47 "..\..\Views\Device\AddOffline.cshtml"
|
#line 61 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasDeviceBatch)
|
if (hasDeviceBatch)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <tr>\r\n <th>Device Batch:\r\n " +
|
WriteLiteral(" <tr>\r\n <th>\r\n Device Ba" +
|
||||||
"</th>\r\n <td>\r\n");
|
"tch:\r\n </th>\r\n <td>\r\n");
|
||||||
|
|
||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 53 "..\..\Views\Device\AddOffline.cshtml"
|
#line 68 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems()));
|
Write(Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems()));
|
||||||
|
|
||||||
|
|
||||||
@@ -227,7 +254,7 @@ WriteLiteral("\r\n <br />\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 55 "..\..\Views\Device\AddOffline.cshtml"
|
#line 70 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.ValidationMessageFor(model => model.Device.DeviceBatchId));
|
Write(Html.ValidationMessageFor(model => model.Device.DeviceBatchId));
|
||||||
|
|
||||||
|
|
||||||
@@ -236,7 +263,7 @@ WriteLiteral(" ");
|
|||||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 58 "..\..\Views\Device\AddOffline.cshtml"
|
#line 73 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -245,20 +272,20 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 59 "..\..\Views\Device\AddOffline.cshtml"
|
#line 74 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasDeviceProfile)
|
if (hasDeviceProfile)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <tr>\r\n <th>Device Profile:\r\n " +
|
WriteLiteral(" <tr>\r\n <th>\r\n Device Pr" +
|
||||||
" </th>\r\n <td>\r\n");
|
"ofile:\r\n </th>\r\n <td>\r\n");
|
||||||
|
|
||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 65 "..\..\Views\Device\AddOffline.cshtml"
|
#line 81 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId)));
|
Write(Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId)));
|
||||||
|
|
||||||
|
|
||||||
@@ -269,7 +296,7 @@ WriteLiteral("<br />\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 66 "..\..\Views\Device\AddOffline.cshtml"
|
#line 82 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.ValidationMessageFor(model => model.Device.DeviceProfileId));
|
Write(Html.ValidationMessageFor(model => model.Device.DeviceProfileId));
|
||||||
|
|
||||||
|
|
||||||
@@ -278,7 +305,7 @@ WriteLiteral(" ");
|
|||||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 69 "..\..\Views\Device\AddOffline.cshtml"
|
#line 85 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -287,20 +314,20 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 70 "..\..\Views\Device\AddOffline.cshtml"
|
#line 86 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasAssignUser)
|
if (hasAssignUser)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <tr>\r\n <th>Assigned User:\r\n " +
|
WriteLiteral(" <tr>\r\n <th>\r\n Assigned " +
|
||||||
" </th>\r\n <td>\r\n");
|
"User:\r\n </th>\r\n <td>\r\n");
|
||||||
|
|
||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 76 "..\..\Views\Device\AddOffline.cshtml"
|
#line 93 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.TextBoxFor(model => model.Device.AssignedUserId));
|
Write(Html.TextBoxFor(model => model.Device.AssignedUserId));
|
||||||
|
|
||||||
|
|
||||||
@@ -311,7 +338,7 @@ WriteLiteral("<br />\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 77 "..\..\Views\Device\AddOffline.cshtml"
|
#line 94 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.ValidationMessageFor(model => model.Device.AssignedUserId));
|
Write(Html.ValidationMessageFor(model => model.Device.AssignedUserId));
|
||||||
|
|
||||||
|
|
||||||
@@ -320,7 +347,7 @@ WriteLiteral(" ");
|
|||||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 80 "..\..\Views\Device\AddOffline.cshtml"
|
#line 97 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -333,13 +360,13 @@ WriteLiteral(" class=\"actions\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 83 "..\..\Views\Device\AddOffline.cshtml"
|
#line 100 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 83 "..\..\Views\Device\AddOffline.cshtml"
|
#line 100 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (!hasDeviceProfile)
|
if (!hasDeviceProfile)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -347,14 +374,14 @@ WriteLiteral(">\r\n");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 85 "..\..\Views\Device\AddOffline.cshtml"
|
#line 102 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Html.Hidden("Device.DeviceProfileId", Model.DefaultDeviceProfileId));
|
Write(Html.Hidden("Device.DeviceProfileId", Model.DefaultDeviceProfileId));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 85 "..\..\Views\Device\AddOffline.cshtml"
|
#line 102 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,40 +396,53 @@ WriteLiteral(" class=\"button\"");
|
|||||||
|
|
||||||
WriteLiteral(" value=\"Add\"");
|
WriteLiteral(" value=\"Add\"");
|
||||||
|
|
||||||
WriteLiteral(" />\r\n </p>\r\n <script");
|
WriteLiteral(" />\r\n </p>\r\n <script");
|
||||||
|
|
||||||
WriteLiteral(" type=\"text/javascript\"");
|
WriteLiteral(" type=\"text/javascript\"");
|
||||||
|
|
||||||
WriteLiteral(">\r\n $(function () {\r\n var $SerialNumber = $(\'#D" +
|
WriteLiteral(@">
|
||||||
"evice_SerialNumber\').focus();\r\n\r\n");
|
$(function () {
|
||||||
|
var $SerialNumber = $('#Device_SerialNumber').focus();
|
||||||
|
|
||||||
|
$SerialNumber.keydown(function (e) {
|
||||||
|
if (e.which == 13) {
|
||||||
|
$('#Device_DeviceDomainId').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 94 "..\..\Views\Device\AddOffline.cshtml"
|
#line 118 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 94 "..\..\Views\Device\AddOffline.cshtml"
|
#line 118 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasAssignUser)
|
if (hasAssignUser)
|
||||||
{
|
{
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("\r\n $SerialNumber.keydown(function (e) {\r\n if (e" +
|
WriteLiteral(@"
|
||||||
".which == 13) {\r\n $(\'#Device_AssignedUserId\').focus();\r\n " +
|
$('#Device_DeviceDomainId').keydown(function (e) {
|
||||||
" return false;\r\n }\r\n });" +
|
if (e.which == 13) {
|
||||||
"");
|
$('#Device_AssignedUserId').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});");
|
||||||
|
|
||||||
|
|
||||||
#line 101 "..\..\Views\Device\AddOffline.cshtml"
|
#line 125 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 102 "..\..\Views\Device\AddOffline.cshtml"
|
#line 126 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasAssetNumber)
|
if (hasAssetNumber)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -412,13 +452,13 @@ WriteLiteral("\r\n $(\'#Device_AssetNumber\').keydown(functio
|
|||||||
" if (e.which == 13) {\r\n");
|
" if (e.which == 13) {\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 106 "..\..\Views\Device\AddOffline.cshtml"
|
#line 130 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 106 "..\..\Views\Device\AddOffline.cshtml"
|
#line 130 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasLocation)
|
if (hasLocation)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -427,7 +467,7 @@ WriteLiteral("\r\n $(\'#Device_AssetNumber\').keydown(functio
|
|||||||
WriteLiteral("$(\'#Device_Location\').focus(); return false;");
|
WriteLiteral("$(\'#Device_Location\').focus(); return false;");
|
||||||
|
|
||||||
|
|
||||||
#line 107 "..\..\Views\Device\AddOffline.cshtml"
|
#line 131 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
else if (hasAssignUser)
|
else if (hasAssignUser)
|
||||||
{
|
{
|
||||||
@@ -437,7 +477,7 @@ WriteLiteral("$(\'#Device_Location\').focus(); return false;");
|
|||||||
WriteLiteral("$(\'#Device_AssignedUserId\').focus(); return false;");
|
WriteLiteral("$(\'#Device_AssignedUserId\').focus(); return false;");
|
||||||
|
|
||||||
|
|
||||||
#line 109 "..\..\Views\Device\AddOffline.cshtml"
|
#line 133 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -446,14 +486,14 @@ WriteLiteral("$(\'#Device_AssignedUserId\').focus(); return false;");
|
|||||||
WriteLiteral(" }\r\n });\r\n ");
|
WriteLiteral(" }\r\n });\r\n ");
|
||||||
|
|
||||||
|
|
||||||
#line 112 "..\..\Views\Device\AddOffline.cshtml"
|
#line 136 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 113 "..\..\Views\Device\AddOffline.cshtml"
|
#line 137 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasLocation && hasAssignUser)
|
if (hasLocation && hasAssignUser)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -469,7 +509,7 @@ WriteLiteral(@"
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 121 "..\..\Views\Device\AddOffline.cshtml"
|
#line 145 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -478,7 +518,7 @@ WriteLiteral(@"
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 122 "..\..\Views\Device\AddOffline.cshtml"
|
#line 146 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
if (hasAssignUser)
|
if (hasAssignUser)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -493,7 +533,7 @@ WriteLiteral(@"
|
|||||||
source: '");
|
source: '");
|
||||||
|
|
||||||
|
|
||||||
#line 129 "..\..\Views\Device\AddOffline.cshtml"
|
#line 153 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
Write(Url.Action(MVC.API.Search.UsersUpstream()));
|
Write(Url.Action(MVC.API.Search.UsersUpstream()));
|
||||||
|
|
||||||
|
|
||||||
@@ -518,16 +558,16 @@ WriteLiteral(@"',
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 145 "..\..\Views\Device\AddOffline.cshtml"
|
#line 169 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" });\r\n </script>\r\n </div>\r\n");
|
WriteLiteral(" });\r\n </script>\r\n </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 149 "..\..\Views\Device\AddOffline.cshtml"
|
#line 173 "..\..\Views\Device\AddOffline.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user