From 583552ffdd23ccd5fd0eb7e147c519e935a3ce50 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Thu, 3 Jul 2025 19:13:52 +1000 Subject: [PATCH] feature: batch device decommissioning --- .../Devices/Importing/IDeviceImportContext.cs | 1 + .../DeviceBatch/ConfigDeviceBatchShowModel.cs | 1 + .../Devices/DeviceBatchExtensions.cs | 31 +- .../Importing/BaseDeviceImportContext.cs | 2 + .../DeviceDecommissionImportContext.cs | 111 ++ .../DeviceDecommissionImportRecord.cs | 32 + .../Devices/Importing/DeviceImport.cs | 9 +- .../Devices/Importing/DeviceImportRecord.cs | 20 +- .../Fields/AssignedUserIdImportField.cs | 19 + .../DeviceDecommissionedDateImportField.cs | 40 +- .../DeviceDecommissionedReasonImportField.cs | 23 +- .../Fields/DeviceSerialNumberImportField.cs | 10 + Disco.Services/Disco.Services.csproj | 2 + .../DetailsProvider/DetailsProviderService.cs | 2 - .../Areas/API/Controllers/DeviceController.cs | 15 + .../Controllers/DeviceBatchController.cs | 4 +- .../Config/Models/DeviceBatch/ShowModel.cs | 1 + .../Config/Views/DeviceBatch/Show.cshtml | 229 ++-- .../Views/DeviceBatch/Show.generated.cs | 1015 +++++++++++------ Disco.Web/Controllers/DeviceController.cs | 1 - .../T4MVC/API.DeviceController.generated.cs | 32 + Disco.Web/Views/Device/Import.cshtml | 2 +- Disco.Web/Views/Device/Import.generated.cs | 4 +- Disco.Web/Views/Device/ImportHeaders.cshtml | 7 +- .../Views/Device/ImportHeaders.generated.cs | 68 +- Disco.Web/Views/Device/ImportReview.cshtml | 203 ++-- .../Views/Device/ImportReview.generated.cs | 509 +++++---- 27 files changed, 1533 insertions(+), 860 deletions(-) create mode 100644 Disco.Services/Devices/Importing/DeviceDecommissionImportContext.cs create mode 100644 Disco.Services/Devices/Importing/DeviceDecommissionImportRecord.cs diff --git a/Disco.Models/Services/Devices/Importing/IDeviceImportContext.cs b/Disco.Models/Services/Devices/Importing/IDeviceImportContext.cs index cf93c1e1..8e1c2432 100644 --- a/Disco.Models/Services/Devices/Importing/IDeviceImportContext.cs +++ b/Disco.Models/Services/Devices/Importing/IDeviceImportContext.cs @@ -21,5 +21,6 @@ namespace Disco.Models.Services.Devices.Importing List Records { get; set; } int AffectedRecords { get; set; } + bool AllowBacktracking { get; } } } diff --git a/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModel.cs b/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModel.cs index c9b8bb41..fd02e570 100644 --- a/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModel.cs +++ b/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModel.cs @@ -16,5 +16,6 @@ namespace Disco.Models.UI.Config.DeviceBatch int DeviceCount { get; set; } int DeviceDecommissionedCount { get; set; } bool CanDelete { get; set; } + bool CanDecommission { get; set; } } } diff --git a/Disco.Services/Devices/DeviceBatchExtensions.cs b/Disco.Services/Devices/DeviceBatchExtensions.cs index a09c4c19..563cfcab 100644 --- a/Disco.Services/Devices/DeviceBatchExtensions.cs +++ b/Disco.Services/Devices/DeviceBatchExtensions.cs @@ -5,28 +5,28 @@ using Disco.Services.Devices.ManagedGroups; using Disco.Services.Interop.ActiveDirectory; using Disco.Services.Users; using System; +using System.Data.Entity; using System.Linq; namespace Disco.Services { public static class DeviceBatchExtensions { - public static bool CanDelete(this DeviceBatch db, DiscoDataContext Database) + public static bool CanDelete(this DeviceBatch db, DiscoDataContext database) { if (!UserService.CurrentAuthorization.Has(Claims.Config.DeviceBatch.Delete)) return false; // Can't Delete if Contains Devices - var deviceCount = Database.Devices.Count(d => d.DeviceBatchId == db.Id); - if (deviceCount > 0) + if (database.Devices.Any(d => d.DeviceBatchId == db.Id)) return false; return true; } - public static void Delete(this DeviceBatch db, DiscoDataContext Database) + public static void Delete(this DeviceBatch db, DiscoDataContext database) { - if (!db.CanDelete(Database)) + if (!db.CanDelete(database)) throw new InvalidOperationException("The state of this Device Batch doesn't allow it to be deleted"); // Remove Linked Group @@ -34,7 +34,26 @@ namespace Disco.Services ActiveDirectory.Context.ManagedGroups.Remove(DeviceBatchAssignedUsersManagedGroup.GetKey(db)); // Delete Batch - Database.DeviceBatches.Remove(db); + database.DeviceBatches.Remove(db); + } + + public static bool CanDecommission(this DeviceBatch db, DiscoDataContext database) + { + if (!UserService.CurrentAuthorization.Has(Claims.Device.Actions.Import)) + return false; + + if (!database.Devices.Any(d => d.DeviceBatchId == db.Id && d.DecommissionedDate == null)) + return false; + + return true; + } + + public static void Decommission(this DeviceBatch db, DiscoDataContext database, DecommissionReasons Reason, bool unassignUsers) + { + if (!db.CanDecommission(database)) + throw new InvalidOperationException("Decommission of Device Batch is Denied"); + + } } } diff --git a/Disco.Services/Devices/Importing/BaseDeviceImportContext.cs b/Disco.Services/Devices/Importing/BaseDeviceImportContext.cs index bccc5817..3a4d89e7 100644 --- a/Disco.Services/Devices/Importing/BaseDeviceImportContext.cs +++ b/Disco.Services/Devices/Importing/BaseDeviceImportContext.cs @@ -48,6 +48,8 @@ namespace Disco.Services.Devices.Importing public List Records { get; set; } public int AffectedRecords { get; set; } + public bool AllowBacktracking { get; } = true; + public int ColumnCount { get { return columns.Count; } } public IEnumerable Columns { diff --git a/Disco.Services/Devices/Importing/DeviceDecommissionImportContext.cs b/Disco.Services/Devices/Importing/DeviceDecommissionImportContext.cs new file mode 100644 index 00000000..7dff455d --- /dev/null +++ b/Disco.Services/Devices/Importing/DeviceDecommissionImportContext.cs @@ -0,0 +1,111 @@ +using Disco.Data.Repository; +using Disco.Models.Repository; +using Disco.Models.Services.Devices.Importing; +using Disco.Services.Devices.Importing.Fields; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.Entity; +using System.Linq; + +namespace Disco.Services.Devices.Importing +{ + public class DeviceDecommissionImportContext : IDeviceImportContext + { + private readonly List records; + + public string SessionId { get; } + public string Filename { get; } + public string DatasetName { get; } + public int ColumnCount { get; } + public IEnumerable Columns { get; } + + public int RecordCount => records.Count; + public List Records { get => records; set => throw new NotImplementedException(); } + public int AffectedRecords { get; set; } + public bool AllowBacktracking { get; } = false; + + private DeviceDecommissionImportContext(string sourceName, List devices, DecommissionReasons decommissionReason, bool unassignUsers) + { + SessionId = Guid.NewGuid().ToString("D"); + Filename = DatasetName = sourceName; + + var columns = new List(3) + { + new DeviceImportColumn() + { + Index = 0, + Type = DeviceImportFieldTypes.DeviceSerialNumber, + Handler = typeof(DeviceSerialNumberImportField), + Name = "Device Serial Number", + }, + new DeviceImportColumn() + { + Index = 1, + Type = DeviceImportFieldTypes.DeviceDecommissionedReason, + Handler = typeof(DeviceDecommissionedReasonImportField), + Name = "Device Decommissioned Reason", + } + }; + + if (unassignUsers && devices.Any(d => d.AssignedUserId != null)) + { + ColumnCount = 3; + columns.Add(new DeviceImportColumn() + { + Index = 2, + Type = DeviceImportFieldTypes.AssignedUserId, + Handler = typeof(AssignedUserIdImportField), + Name = "Assigned User Identifier", + }); + } + else + { + unassignUsers = false; + } + + Columns = columns; + ColumnCount = columns.Count; + + records = devices.Select((d, i) => + { + var fields = new List(ColumnCount) + { + DeviceSerialNumberImportField.Create(d), + DeviceDecommissionedReasonImportField.Create(d, decommissionReason, true, unassignUsers), + }; + if (unassignUsers) + { + fields.Add(AssignedUserIdImportField.CreateUnassigned(d)); + } + return new DeviceDecommissionImportRecord(d, i, fields); + }).ToList(); + + } + + public static DeviceDecommissionImportContext Create(DiscoDataContext database, DeviceBatch deviceBatch, DecommissionReasons decommissionReason, bool unassignUsers) + { + var devices = database.Devices + .Include(d => d.Jobs) + .Include(d => d.AssignedUser) + .Where(d => d.DeviceBatchId == deviceBatch.Id && d.DecommissionedDate == null) + .ToList(); + return new DeviceDecommissionImportContext($"Batch: {deviceBatch.Name} ({deviceBatch.Id})", devices, decommissionReason, unassignUsers); + } + + public IDeviceImportColumn GetColumn(int Index) + => throw new NotImplementedException(); + + public int? GetColumnByType(DeviceImportFieldTypes FieldType) + => throw new NotImplementedException(); + + public IDeviceImportDataReader GetDataReader() + => throw new NotImplementedException(); + + public IEnumerable> GetFieldHandlers() + => throw new NotImplementedException(); + + public void SetColumnType(int Index, DeviceImportFieldTypes Type) + => throw new NotImplementedException(); + } +} diff --git a/Disco.Services/Devices/Importing/DeviceDecommissionImportRecord.cs b/Disco.Services/Devices/Importing/DeviceDecommissionImportRecord.cs new file mode 100644 index 00000000..3bf5c69c --- /dev/null +++ b/Disco.Services/Devices/Importing/DeviceDecommissionImportRecord.cs @@ -0,0 +1,32 @@ +using Disco.Models.Repository; +using Disco.Models.Services.Devices.Importing; +using System.Collections.Generic; +using System.Data; +using System.Linq; + +namespace Disco.Services.Devices.Importing +{ + internal class DeviceDecommissionImportRecord : IDeviceImportRecord + { + public int Index { get; } + public string DeviceSerialNumber { get; } + public IEnumerable Fields { get; } + public EntityState RecordAction { get; } + public bool HasError { get; } + + public DeviceDecommissionImportRecord(Device device, int index, IEnumerable fields) + { + Index = index; + DeviceSerialNumber = device.SerialNumber; + + if (fields.Any(f => !f.FieldAction.HasValue)) + RecordAction = EntityState.Detached; + else if (fields.Any(f => f.FieldAction == EntityState.Modified)) + RecordAction = EntityState.Modified; + else + RecordAction = EntityState.Unchanged; + + Fields = fields; + } + } +} diff --git a/Disco.Services/Devices/Importing/DeviceImport.cs b/Disco.Services/Devices/Importing/DeviceImport.cs index af35bb94..a27e8b53 100644 --- a/Disco.Services/Devices/Importing/DeviceImport.cs +++ b/Disco.Services/Devices/Importing/DeviceImport.cs @@ -40,6 +40,9 @@ namespace Disco.Services.Devices.Importing return context; } + public static IDeviceImportContext BeginDecommissionImport(DiscoDataContext database, DeviceBatch deviceBatch, DecommissionReasons decommissionReason, bool unassignUsers) + => DeviceDecommissionImportContext.Create(database, deviceBatch, decommissionReason, unassignUsers); + private static void GuessHeaderTypes(this IDeviceImportContext Context, DiscoDataContext Database) { using (var dataReader = Context.GetDataReader()) @@ -151,11 +154,11 @@ namespace Disco.Services.Devices.Importing int affectedRecords = 0; - foreach (var record in Context.Records.Cast().Select((r, i) => Tuple.Create(r, i))) + foreach (var (record, index) in Context.Records.Select((r, i) => Tuple.Create(r, i))) { - Status.UpdateStatus(((double)record.Item2 / Context.Records.Count) * 100, string.Format("Applying: {0}", record.Item1.DeviceSerialNumber)); + Status.UpdateStatus(((double)index / Context.Records.Count) * 100, $"Applying: {record.DeviceSerialNumber}"); - if (record.Item1.Apply(Database)) + if (DeviceImportRecord.Apply(record, Database)) affectedRecords++; } diff --git a/Disco.Services/Devices/Importing/DeviceImportRecord.cs b/Disco.Services/Devices/Importing/DeviceImportRecord.cs index 1b006725..56ee9d81 100644 --- a/Disco.Services/Devices/Importing/DeviceImportRecord.cs +++ b/Disco.Services/Devices/Importing/DeviceImportRecord.cs @@ -30,22 +30,22 @@ namespace Disco.Services.Devices.Importing this.RecordAction = RecordAction; } - public bool Apply(DiscoDataContext Database) + public static bool Apply(IDeviceImportRecord record, DiscoDataContext Database) { - if (RecordAction == EntityState.Detached || !HasError) + if (record.RecordAction == EntityState.Detached || !record.HasError) { Device device; - if (RecordAction == EntityState.Unchanged) + if (record.RecordAction == EntityState.Unchanged) { // Unchanged - No Action Required return false; } - else if (RecordAction == EntityState.Modified) + else if (record.RecordAction == EntityState.Modified) { - device = Database.Devices.Find(DeviceSerialNumber); + device = Database.Devices.Find(record.DeviceSerialNumber); } - else if (RecordAction == EntityState.Added) + else if (record.RecordAction == EntityState.Added) { // Use 'Add Device Offline' default if available var deviceProfileId = Database.DiscoConfiguration.DeviceProfiles.DefaultAddDeviceOfflineDeviceProfileId; @@ -57,7 +57,7 @@ namespace Disco.Services.Devices.Importing // Create Device device = new Device() { - SerialNumber = DeviceSerialNumber.ToUpper(), + SerialNumber = record.DeviceSerialNumber.ToUpper(), CreatedDate = DateTime.Now, AllowUnauthenticatedEnrol = true, DeviceProfileId = deviceProfileId, @@ -71,9 +71,9 @@ namespace Disco.Services.Devices.Importing return false; } - bool changesMade = (RecordAction == EntityState.Added); + bool changesMade = (record.RecordAction == EntityState.Added); - foreach (var field in Fields.Cast()) + foreach (var field in record.Fields.Cast()) { changesMade = field.Apply(Database, device) || changesMade; } @@ -84,7 +84,7 @@ namespace Disco.Services.Devices.Importing bool adDescriptionSet = false; - foreach (var field in Fields.Cast()) + foreach (var field in record.Fields.Cast()) { field.Applied(Database, device, ref adDescriptionSet); } diff --git a/Disco.Services/Devices/Importing/Fields/AssignedUserIdImportField.cs b/Disco.Services/Devices/Importing/Fields/AssignedUserIdImportField.cs index 0d6743ef..a776277a 100644 --- a/Disco.Services/Devices/Importing/Fields/AssignedUserIdImportField.cs +++ b/Disco.Services/Devices/Importing/Fields/AssignedUserIdImportField.cs @@ -23,6 +23,25 @@ namespace Disco.Services.Devices.Importing.Fields public override string FriendlyValue { get { return friendlyValue; } } public override string FriendlyPreviousValue { get { return friendlyPreviousValue; } } + public static AssignedUserIdImportField CreateUnassigned(Device device) + { + var field = new AssignedUserIdImportField() + { + parsedValue = null, + friendlyValue = null, + }; + if (device.AssignedUser != null) + { + field.friendlyPreviousValue = $"{device.AssignedUser.DisplayName} [{device.AssignedUser.UserId}]"; + field.Success(EntityState.Modified); + } + else + { + field.Success(EntityState.Unchanged); + } + return field; + } + public override bool Parse(DiscoDataContext Database, IDeviceImportCache Cache, IDeviceImportContext Context, string DeviceSerialNumber, Device ExistingDevice, List PreviousRecords, IDeviceImportDataReader DataReader, int ColumnIndex) { var value = friendlyValue = DataReader.GetString(ColumnIndex); diff --git a/Disco.Services/Devices/Importing/Fields/DeviceDecommissionedDateImportField.cs b/Disco.Services/Devices/Importing/Fields/DeviceDecommissionedDateImportField.cs index e1a17df4..dbe5e0f7 100644 --- a/Disco.Services/Devices/Importing/Fields/DeviceDecommissionedDateImportField.cs +++ b/Disco.Services/Devices/Importing/Fields/DeviceDecommissionedDateImportField.cs @@ -158,36 +158,48 @@ namespace Disco.Services.Devices.Importing.Fields return possibleColumns.Select(h => (int?)h.Index).FirstOrDefault(); } - public static bool CanDecommissionDevice(Device Device, IDeviceImportContext Context, IDeviceImportDataReader DataReader, out string ErrorMessage) + public static bool CanDecommissionDevice(Device device, IDeviceImportContext context, IDeviceImportDataReader dataReader, out string errorMessage) { - if (Device == null) + var isAssigningUser = false; + var assigningUserId = default(string); + var assignedUserIndex = context.GetColumnByType(DeviceImportFieldTypes.AssignedUserId); + if (assignedUserIndex.HasValue) { - ErrorMessage = "Cannot decommission new devices"; + isAssigningUser = true; + assigningUserId = dataReader.GetString(assignedUserIndex.Value); + } + var hasOpenJobs = device.Jobs.Any(j => !j.ClosedDate.HasValue); + + return CanDecommissionDevice(device, isAssigningUser, assigningUserId, hasOpenJobs, out errorMessage); + } + + public static bool CanDecommissionDevice(Device device, bool isAssigningUser, string assigningUserId, bool hasOpenJobs, out string errorMessage) + { + if (device == null) + { + errorMessage = "Cannot decommission new devices"; return false; } // Check device is assigned (or being removed in this import) - - var assignedUserIndex = Context.GetColumnByType(DeviceImportFieldTypes.AssignedUserId); - if ((!assignedUserIndex.HasValue && Device.AssignedUserId != null) || - (assignedUserIndex.HasValue && !string.IsNullOrWhiteSpace(DataReader.GetString(assignedUserIndex.Value)))) + if (isAssigningUser && !string.IsNullOrEmpty(assigningUserId) || + (!isAssigningUser && device.AssignedUserId != null)) { - if (Device.AssignedUserId != null) - ErrorMessage = $"The device is assigned to a user ({Device.AssignedUser.DisplayName} [{Device.AssignedUser.UserId}]) and cannot be decommissioned"; + if (!isAssigningUser) + errorMessage = $"The device is assigned to a user ({device.AssignedUser.DisplayName} [{device.AssignedUser.UserId}]) and cannot be decommissioned"; else - ErrorMessage = $"The device is being assigned to a user ({DataReader.GetString(assignedUserIndex.Value)}) and cannot be decommissioned"; + errorMessage = $"The device is being assigned to a user ({assigningUserId}) and cannot be decommissioned"; return false; } // Check device doesn't have any open jobs - var openJobCount = Device.Jobs.Count(j => !j.ClosedDate.HasValue); - if (openJobCount > 0) + if (hasOpenJobs) { - ErrorMessage = $"The device is associated with {openJobCount} open job{(openJobCount == 1 ? null : "s")} and cannot be decommissioned"; + errorMessage = $"The device is associated with an open job and cannot be decommissioned"; return false; } - ErrorMessage = null; + errorMessage = null; return true; } } diff --git a/Disco.Services/Devices/Importing/Fields/DeviceDecommissionedReasonImportField.cs b/Disco.Services/Devices/Importing/Fields/DeviceDecommissionedReasonImportField.cs index 6cf7cca7..ec9451ab 100644 --- a/Disco.Services/Devices/Importing/Fields/DeviceDecommissionedReasonImportField.cs +++ b/Disco.Services/Devices/Importing/Fields/DeviceDecommissionedReasonImportField.cs @@ -24,6 +24,26 @@ namespace Disco.Services.Devices.Importing.Fields public override string FriendlyValue { get { return parsedValue.HasValue ? parsedValue.Value.ToString() : rawValue; } } public override string FriendlyPreviousValue { get { return previousValue.HasValue ? previousValue.Value.ToString() : null; } } + public static DeviceDecommissionedReasonImportField Create(Device device, DecommissionReasons? decommissionReason, bool setDate, bool isUnassigningUser) + { + var field = new DeviceDecommissionedReasonImportField() + { + rawValue = decommissionReason?.ToString(), + parsedValue = decommissionReason, + previousValue = device.DecommissionReason, + setDate = setDate + }; + var hasOpenJobs = device.Jobs.Any(j => !j.ClosedDate.HasValue); + if (!DeviceDecommissionedDateImportField.CanDecommissionDevice(device, isUnassigningUser, null, hasOpenJobs, out var errorMessage)) + field.Error(errorMessage); + else if (device.DecommissionReason == decommissionReason) + field.Success(EntityState.Unchanged); + else + field.Success(EntityState.Modified); + + return field; + } + public override bool Parse(DiscoDataContext Database, IDeviceImportCache Cache, IDeviceImportContext Context, string DeviceSerialNumber, Device ExistingDevice, List PreviousRecords, IDeviceImportDataReader DataReader, int ColumnIndex) { var value = DataReader.GetString(ColumnIndex); @@ -50,8 +70,7 @@ namespace Disco.Services.Devices.Importing.Fields var decommissionedDateIndex = Context.GetColumnByType(DeviceImportFieldTypes.DeviceDecommissionedDate); if (parsedValue.HasValue && !decommissionedDateIndex.HasValue) { - string errorMessage; - if (!DeviceDecommissionedDateImportField.CanDecommissionDevice(ExistingDevice, Context, DataReader, out errorMessage)) + if (!DeviceDecommissionedDateImportField.CanDecommissionDevice(ExistingDevice, Context, DataReader, out var errorMessage)) return Error(errorMessage); setDate = true; diff --git a/Disco.Services/Devices/Importing/Fields/DeviceSerialNumberImportField.cs b/Disco.Services/Devices/Importing/Fields/DeviceSerialNumberImportField.cs index 97cce89e..a9f5d88f 100644 --- a/Disco.Services/Devices/Importing/Fields/DeviceSerialNumberImportField.cs +++ b/Disco.Services/Devices/Importing/Fields/DeviceSerialNumberImportField.cs @@ -19,6 +19,16 @@ namespace Disco.Services.Devices.Importing.Fields public override string FriendlyValue { get { return parsedValue; } } public override string FriendlyPreviousValue { get { return parsedValue; } } + public static DeviceSerialNumberImportField Create(Device device) + { + var field = new DeviceSerialNumberImportField() + { + parsedValue = device.SerialNumber, + }; + field.Success(EntityState.Unchanged); + return field; + } + public override bool Parse(DiscoDataContext Database, IDeviceImportCache Cache, IDeviceImportContext Context, string DeviceSerialNumber, Device ExistingDevice, List PreviousRecords, IDeviceImportDataReader DataReader, int ColumnIndex) { var value = DataReader.GetString(ColumnIndex); diff --git a/Disco.Services/Disco.Services.csproj b/Disco.Services/Disco.Services.csproj index a61517d0..d050b135 100644 --- a/Disco.Services/Disco.Services.csproj +++ b/Disco.Services/Disco.Services.csproj @@ -366,6 +366,8 @@ + + diff --git a/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs b/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs index 4ab9c63d..028440c6 100644 --- a/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs +++ b/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs @@ -1,7 +1,5 @@ using Disco.Data.Repository; using Disco.Models.Repository; -using Disco.Services.Authorization; -using Disco.Services.Users; using System; using System.Collections.Generic; using System.Drawing; diff --git a/Disco.Web/Areas/API/Controllers/DeviceController.cs b/Disco.Web/Areas/API/Controllers/DeviceController.cs index a589985e..620c06dc 100644 --- a/Disco.Web/Areas/API/Controllers/DeviceController.cs +++ b/Disco.Web/Areas/API/Controllers/DeviceController.cs @@ -715,6 +715,21 @@ namespace Disco.Web.Areas.API.Controllers return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId)); } + [DiscoAuthorize(Claims.Device.Actions.Import)] + [HttpPost, ValidateAntiForgeryToken] + public virtual ActionResult DeviceBatchDecommission(int id, DecommissionReasons? decommissionReason = null, bool? unassignUsers = null) + { + var deviceBatch = Database.DeviceBatches.Find(id) + ?? throw new ArgumentException("Invalid Device Batch Id", nameof(id)); + if (decommissionReason == null) + throw new ArgumentNullException(nameof(decommissionReason), "Decommission Reason is required"); + + var context = DeviceImport.BeginDecommissionImport(Database, deviceBatch, decommissionReason.Value, unassignUsers.GetValueOrDefault()); + Import_StoreContext(context); + + return RedirectToAction(MVC.Device.ImportReview(context.SessionId)); + } + #endregion #region Exporting diff --git a/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs b/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs index 583b5511..e90ece24 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs @@ -48,8 +48,8 @@ namespace Disco.Web.Areas.Config.Controllers if (DeviceBatchDevicesManagedGroup.TryGetManagedGroup(m.DeviceBatch, out devicesManagedGroup)) m.DevicesLinkedGroup = devicesManagedGroup; - if (Authorization.Has(Claims.Config.DeviceBatch.Delete)) - m.CanDelete = m.DeviceBatch.CanDelete(Database); + m.CanDelete = m.DeviceBatch.CanDelete(Database); + m.CanDecommission = m.DeviceBatch.CanDecommission(Database); if (Authorization.Has(Claims.Config.DeviceBatch.Configure)) { diff --git a/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs b/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs index 9dc1ad04..263fd256 100644 --- a/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs +++ b/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs @@ -20,6 +20,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceBatch public int DeviceCount { get; set; } public int DeviceDecommissionedCount { get; set; } public bool CanDelete { get; set; } + public bool CanDecommission { get; set; } public override int DeviceGroupId => DeviceBatch.Id; } diff --git a/Disco.Web/Areas/Config/Views/DeviceBatch/Show.cshtml b/Disco.Web/Areas/Config/Views/DeviceBatch/Show.cshtml index 9d7b1bff..635c8c11 100644 --- a/Disco.Web/Areas/Config/Views/DeviceBatch/Show.cshtml +++ b/Disco.Web/Areas/Config/Views/DeviceBatch/Show.cshtml @@ -28,14 +28,16 @@
- - - - @@ -154,12 +160,14 @@ - - \r\n
Id: + + Id: @Html.DisplayFor(model => model.DeviceBatch.Id)
Name: + + Name: @if (canConfig) @@ -61,14 +63,16 @@
Default Device Model: + + Default Device Model: @if (canConfig) + + @if (canConfig) { - @Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels.ToSelectListItems(null, true)) - @AjaxHelpers.AjaxSave() - @AjaxHelpers.AjaxLoader() - + } else { @@ -85,11 +89,13 @@ {<None Specified>} else {@Model.DefaultDeviceModel.ToString(); - } } + }
- Devices added offline will default to this Device Model. - Once a device enrols the Device Model will be accurately represented. + + Devices added offline will default to this Device Model. + Once a device enrols the Device Model will be accurately represented. +
Purchase: + + Purchase: - - - - - - -
Purchase Date: + + Purchase Date: @if (canConfig) @@ -187,14 +195,16 @@
Supplier: + + Supplier: @if (canConfig) + + @if (canConfig) { - @Html.EditorFor(model => model.DeviceBatch.Supplier) - @AjaxHelpers.AjaxSave() - @AjaxHelpers.AjaxLoader() - + } else { @@ -211,18 +221,20 @@ {<None Specified>} else {@Model.DeviceBatch.Supplier} - } + }
Unit Cost: + + Unit Cost: @if (canConfig) + + @if (canConfig) { - @Html.EditorFor(model => model.DeviceBatch.UnitCost) - @AjaxHelpers.AjaxSave() - @AjaxHelpers.AjaxLoader() - + } else { @@ -239,18 +251,20 @@ {<None Specified>} else {@Model.DeviceBatch.UnitCost.Value.ToString("C")} - } + }
Quantity: + + Quantity: @if (canConfig) + + @if (canConfig) { - @Html.EditorFor(model => model.DeviceBatch.UnitQuantity) - @AjaxHelpers.AjaxSave() - @AjaxHelpers.AjaxLoader() - + } else { @@ -267,7 +281,7 @@ {<None Specified>} else {@Model.DeviceBatch.UnitQuantity.Value.ToString("n0")} - } + }
@@ -341,12 +355,14 @@
Warranty: + + Warranty: - - \r\n \r\n " + -"\r\n \r\n"); - - - #line 67 "..\..\Views\Device\ImportReview.cshtml" - - - #line default - #line hidden - - #line 67 "..\..\Views\Device\ImportReview.cshtml" - foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn)) - { - - - #line default - #line hidden -WriteLiteral(" \r\n"); - - - #line 70 "..\..\Views\Device\ImportReview.cshtml" - } - - - #line default - #line hidden -WriteLiteral(" \r\n \r\n \r" + -"\n \r\n"); +WriteLiteral(">\r\n \r\n \r\n \r\n " + +" \r\n"); #line 75 "..\..\Views\Device\ImportReview.cshtml" - + #line default #line hidden #line 75 "..\..\Views\Device\ImportReview.cshtml" - foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn)) - { + foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn)) + { #line default #line hidden -WriteLiteral(" \r\n"); #line 78 "..\..\Views\Device\ImportReview.cshtml" - } + } #line default #line hidden -WriteLiteral(" \r\n \r\n \r\n"); +WriteLiteral(" \r\n \r\n \r\n " + +" \r\n"); - #line 82 "..\..\Views\Device\ImportReview.cshtml" + #line 83 "..\..\Views\Device\ImportReview.cshtml" #line default #line hidden - #line 82 "..\..\Views\Device\ImportReview.cshtml" - foreach (var recordEntry in Model.Context.Records.Select((r, i) => Tuple.Create(r, i))) + #line 83 "..\..\Views\Device\ImportReview.cshtml" + foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn)) { - var record = recordEntry.Item1; #line default #line hidden -WriteLiteral(" "); -WriteAttribute("class", Tuple.Create(" class=\"", 4401), Tuple.Create("\"", 4437) -, Tuple.Create(Tuple.Create("", 4409), Tuple.Create("action", 4409), true) #line 85 "..\..\Views\Device\ImportReview.cshtml" -, Tuple.Create(Tuple.Create("", 4415), Tuple.Create(record.RecordAction + Write(header.Name); + #line default #line hidden -, 4415), false) +WriteLiteral("\r\n"); + + + #line 86 "..\..\Views\Device\ImportReview.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n \r\n \r\n"); + + + #line 90 "..\..\Views\Device\ImportReview.cshtml" + + + #line default + #line hidden + + #line 90 "..\..\Views\Device\ImportReview.cshtml" + foreach (var recordEntry in Model.Context.Records.Select((r, i) => Tuple.Create(r, i))) + { + var record = recordEntry.Item1; + + + #line default + #line hidden +WriteLiteral(" (record.RecordAction + + #line default + #line hidden +, 4031), false) ); -WriteLiteral(">\r\n \r\n \r\n \r\n \r\n \r\n"); - #line 88 "..\..\Views\Device\ImportReview.cshtml" - + #line 96 "..\..\Views\Device\ImportReview.cshtml" + #line default #line hidden - #line 88 "..\..\Views\Device\ImportReview.cshtml" - foreach (var field in record.Fields) - { - var friendlyValue = field.FriendlyValue; + #line 96 "..\..\Views\Device\ImportReview.cshtml" + foreach (var field in record.Fields) + { + var friendlyValue = field.FriendlyValue; #line default #line hidden -WriteLiteral(" (field.FieldType + #line 99 "..\..\Views\Device\ImportReview.cshtml" +, Tuple.Create(Tuple.Create("", 4371), Tuple.Create(field.FieldType #line default #line hidden -, 4779), false) -, Tuple.Create(Tuple.Create(" ", 4797), Tuple.Create("action", 4798), true) +, 4371), false) +, Tuple.Create(Tuple.Create(" ", 4389), Tuple.Create("action", 4390), true) - #line 91 "..\..\Views\Device\ImportReview.cshtml" -, Tuple.Create(Tuple.Create("", 4804), Tuple.Create(field.FieldAction.HasValue ? field.FieldAction.ToString() : "Error" + #line 99 "..\..\Views\Device\ImportReview.cshtml" +, Tuple.Create(Tuple.Create("", 4396), Tuple.Create(field.FieldAction.HasValue ? field.FieldAction.ToString() : "Error" #line default #line hidden -, 4804), false) +, 4396), false) ); WriteLiteral(" data-previousvalue=\""); - #line 91 "..\..\Views\Device\ImportReview.cshtml" - Write(field.FieldAction.HasValue && field.FieldAction.Value == System.Data.EntityState.Modified ? field.FriendlyPreviousValue : null); + #line 99 "..\..\Views\Device\ImportReview.cshtml" + Write(field.FieldAction.HasValue && field.FieldAction.Value == System.Data.EntityState.Modified ? field.FriendlyPreviousValue : null); #line default @@ -534,53 +538,53 @@ WriteLiteral("\""); WriteLiteral(">\r\n"); - #line 92 "..\..\Views\Device\ImportReview.cshtml" - + #line 100 "..\..\Views\Device\ImportReview.cshtml" + #line default #line hidden - #line 92 "..\..\Views\Device\ImportReview.cshtml" - if (!field.FieldAction.HasValue) - { + #line 100 "..\..\Views\Device\ImportReview.cshtml" + if (!field.FieldAction.HasValue) + { #line default #line hidden -WriteLiteral(" Error: "); - #line 94 "..\..\Views\Device\ImportReview.cshtml" - Write(field.ErrorMessage); + #line 102 "..\..\Views\Device\ImportReview.cshtml" + Write(field.ErrorMessage); #line default #line hidden WriteLiteral("\r\n"); -WriteLiteral(" \r\n"); - #line 96 "..\..\Views\Device\ImportReview.cshtml" - } + #line 104 "..\..\Views\Device\ImportReview.cshtml" + } #line default #line hidden -WriteLiteral(" "); +WriteLiteral(" "); - #line 97 "..\..\Views\Device\ImportReview.cshtml" - if (string.IsNullOrEmpty(friendlyValue)) - { + #line 105 "..\..\Views\Device\ImportReview.cshtml" + if (string.IsNullOrEmpty(friendlyValue)) + { #line default #line hidden @@ -591,93 +595,109 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None>"); - #line 98 "..\..\Views\Device\ImportReview.cshtml" - } - else if (field.FieldType == DeviceImportFieldTypes.DeviceSerialNumber && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Added) - { - + #line 106 "..\..\Views\Device\ImportReview.cshtml" + } + else if (field.FieldType == DeviceImportFieldTypes.DeviceSerialNumber && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Added) + { + #line default #line hidden - #line 101 "..\..\Views\Device\ImportReview.cshtml" - Write(Html.ActionLink(friendlyValue, MVC.Device.Show((string)field.RawParsedValue), new { target="_blank" })); + #line 109 "..\..\Views\Device\ImportReview.cshtml" + Write(Html.ActionLink(friendlyValue, MVC.Device.Show((string)field.RawParsedValue), new { target = "_blank" })); #line default #line hidden - #line 101 "..\..\Views\Device\ImportReview.cshtml" - } - else if (field.FieldType == DeviceImportFieldTypes.AssignedUserId && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Unchanged) - { - - - #line default - #line hidden - - #line 104 "..\..\Views\Device\ImportReview.cshtml" - Write(Html.ActionLink(friendlyValue, MVC.User.Show((string)field.RawParsedValue), new { target="_blank" })); - - - #line default - #line hidden - - #line 104 "..\..\Views\Device\ImportReview.cshtml" + #line 109 "..\..\Views\Device\ImportReview.cshtml" } - else - { + else if (field.FieldType == DeviceImportFieldTypes.AssignedUserId && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Unchanged) + { + #line default #line hidden - #line 106 "..\..\Views\Device\ImportReview.cshtml" - Write(friendlyValue); + #line 112 "..\..\Views\Device\ImportReview.cshtml" + Write(Html.ActionLink(friendlyValue, MVC.User.Show((string)field.RawParsedValue), new { target = "_blank" })); #line default #line hidden - #line 106 "..\..\Views\Device\ImportReview.cshtml" - } + #line 112 "..\..\Views\Device\ImportReview.cshtml" + } + else + { + + #line default + #line hidden + + #line 114 "..\..\Views\Device\ImportReview.cshtml" + Write(friendlyValue); #line default #line hidden -WriteLiteral(" \r\n"); - - #line 108 "..\..\Views\Device\ImportReview.cshtml" - } + #line 114 "..\..\Views\Device\ImportReview.cshtml" + } #line default #line hidden -WriteLiteral(" \r\n"); +WriteLiteral(" \r\n"); - #line 110 "..\..\Views\Device\ImportReview.cshtml" - } + #line 116 "..\..\Views\Device\ImportReview.cshtml" + } #line default #line hidden -WriteLiteral(" \r\n
Valid Until: + + Valid Until: @if (canConfig) @@ -444,19 +460,22 @@
Insurance: + + Insurance: - - - - - - @@ -600,13 +623,15 @@ - - } - \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Purchase Date:\r\n \r\n \r\n \r\n \r\n \r\n " + -" \r\n \r\n \r\n \r\n \r\n " + -" \r\n \r\n \r\n \r\n " + -" \r\n \r\n Warranty:\r\n \r\n Valid Until:\r\n \r\n \r\n \r\n \r\n " + -" \r\n \r\n Insurance:\r\n \r\n Supplier:\r\n \r\n \r\n \r\n WriteLiteral(" class=\"name\""); -WriteLiteral(">Insured Date:\r\n \r\n \r\n \r\n WriteLiteral(" class=\"name\""); -WriteLiteral(">Insured Until:\r\n \r\n \r\n \r\n \r\n " + -" \r\n \r\n \r\n \r\n WriteLiteral(" id=\"DeviceBatch_Attachments\""); -WriteAttribute("class", Tuple.Create(" class=\"", 34485), Tuple.Create("\"", 34552) +WriteAttribute("class", Tuple.Create(" class=\"", 35231), Tuple.Create("\"", 35298) - #line 671 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" -, Tuple.Create(Tuple.Create("", 34493), Tuple.Create(canConfig ? "canAddAttachments" : "cannotAddAttachments" + #line 696 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" +, Tuple.Create(Tuple.Create("", 35239), Tuple.Create(canConfig ? "canAddAttachments" : "cannotAddAttachments" #line default #line hidden -, 34493), false) +, 35239), false) ); WriteLiteral(" data-uploadurl=\""); - #line 671 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 696 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.AttachmentUpload(Model.DeviceBatch.Id, null))); @@ -2031,7 +2090,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 672 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 697 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.AntiForgeryToken()); @@ -2049,13 +2108,13 @@ WriteLiteral(" class=\"attachmentOutput\""); WriteLiteral(">\r\n"); - #line 677 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 702 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 677 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 702 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceBatch.DeviceBatchAttachments != null) { foreach (var attachment in Model.DeviceBatch.DeviceBatchAttachments) @@ -2066,20 +2125,20 @@ WriteLiteral(">\r\n"); #line hidden WriteLiteral(" (Url.Action(MVC.API.DeviceBatch.AttachmentDownload(attachment.Id)) + #line 706 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" +, Tuple.Create(Tuple.Create("", 35927), Tuple.Create(Url.Action(MVC.API.DeviceBatch.AttachmentDownload(attachment.Id)) #line default #line hidden -, 35181), false) +, 35927), false) ); WriteLiteral(" data-attachmentid=\""); - #line 681 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 706 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Id); @@ -2090,7 +2149,7 @@ WriteLiteral("\""); WriteLiteral(" data-mimetype=\""); - #line 681 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 706 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.MimeType); @@ -2102,28 +2161,28 @@ WriteLiteral(">\r\n (attachment.Filename + #line 707 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" +, Tuple.Create(Tuple.Create("", 36131), Tuple.Create(attachment.Filename #line default #line hidden -, 35385), false) +, 36131), false) ); WriteLiteral(">\r\n (Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail(attachment.Id)) + #line 708 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" +, Tuple.Create(Tuple.Create("", 36232), Tuple.Create(Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail(attachment.Id)) #line default #line hidden -, 35486), false) +, 36232), false) ); WriteLiteral(" />\r\n \r\n " + @@ -2131,14 +2190,14 @@ WriteLiteral(" />\r\n \r\n WriteLiteral(" class=\"comments\""); -WriteAttribute("title", Tuple.Create(" title=\"", 35664), Tuple.Create("\"", 35692) +WriteAttribute("title", Tuple.Create(" title=\"", 36410), Tuple.Create("\"", 36438) - #line 685 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" -, Tuple.Create(Tuple.Create("", 35672), Tuple.Create(attachment.Comments + #line 710 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" +, Tuple.Create(Tuple.Create("", 36418), Tuple.Create(attachment.Comments #line default #line hidden -, 35672), false) +, 36418), false) ); WriteLiteral(">\r\n"); @@ -2146,7 +2205,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 686 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 711 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Comments); @@ -2159,7 +2218,7 @@ WriteLiteral(" class=\"author\""); WriteLiteral(">"); - #line 687 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 712 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.TechUser.ToString()); @@ -2168,7 +2227,7 @@ WriteLiteral(">"); WriteLiteral(""); - #line 687 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 712 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -2181,7 +2240,7 @@ WriteLiteral(" class=\"remove fa fa-times-circle\""); WriteLiteral(">"); - #line 688 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default @@ -2190,20 +2249,20 @@ WriteLiteral("(attachment.Timestamp.ToFullDateTime() + #line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + , Tuple.Create(Tuple.Create("", 36752), Tuple.Create(attachment.Timestamp.ToFullDateTime() #line default #line hidden -, 36006), false) +, 36752), false) ); WriteLiteral(" data-livestamp=\""); - #line 688 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Timestamp.ToUnixEpoc()); @@ -2214,7 +2273,7 @@ WriteLiteral("\""); WriteLiteral(">"); - #line 688 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Timestamp.ToFullDateTime()); @@ -2223,7 +2282,7 @@ WriteLiteral(">"); WriteLiteral("\r\n \r\n"); - #line 690 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 715 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } @@ -2233,13 +2292,13 @@ WriteLiteral("\r\n \r\n"); WriteLiteral(" \r\n"); - #line 693 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 718 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 693 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 718 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -2286,7 +2345,7 @@ WriteLiteral("> Are you sure?\r\n

\r\n " \r\n"); - #line 704 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 729 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -2318,7 +2377,7 @@ WriteLiteral(@"> $.connection.hub.qs = { DeviceBatchId: '"); - #line 724 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 749 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Id); @@ -2362,7 +2421,7 @@ WriteLiteral("\' };\r\n $.connection.hub.error(onHubF " $.ajax({\r\n url: \'"); - #line 770 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 795 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.Attachment())); @@ -2377,13 +2436,13 @@ WriteLiteral(@"', "); - #line 776 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 801 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 776 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 801 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -2397,7 +2456,7 @@ WriteLiteral("buildAttachment(a, true, quick);"); WriteLiteral("\r\n"); - #line 779 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 804 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -2412,7 +2471,7 @@ WriteLiteral("buildAttachment(a, false, quick);"); WriteLiteral("\r\n"); - #line 783 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 808 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -2439,7 +2498,7 @@ WriteLiteral(@" } else { e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '"); - #line 802 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 827 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.AttachmentDownload())); @@ -2470,7 +2529,7 @@ WriteLiteral(@"/' + a.Id); img.attr('src', '"); - #line 824 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 849 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail())); @@ -2516,13 +2575,13 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n " }\r\n\r\n"); - #line 876 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 901 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 876 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 901 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -2569,7 +2628,7 @@ WriteLiteral("\r\n //#region Add Attachments\r\n " url: \'"); - #line 926 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 951 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.AttachmentRemove())); @@ -2597,7 +2656,7 @@ WriteLiteral("\',\r\n dataType: \'jso "endregion\r\n "); - #line 953 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 978 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -2620,13 +2679,13 @@ WriteLiteral(@" "); - #line 968 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 993 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 968 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 993 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (hideAdvanced) { @@ -2660,7 +2719,7 @@ WriteLiteral(@">Show Advanced Options "); - #line 984 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1009 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -2670,13 +2729,13 @@ WriteLiteral(" \r\n
\r\n \r\n " + +" \r\n \r\n
Supplier: + + Supplier: @if (canConfig) + + @if (canConfig) { - @Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier) - @AjaxHelpers.AjaxSave() - @AjaxHelpers.AjaxLoader() - + } else { @@ -473,18 +492,20 @@ {<None Specified>} else {@Model.DeviceBatch.InsuranceSupplier; - } } + }
Insured Date: + + Insured Date: @if (canConfig) + + @if (canConfig) { - @Html.EditorFor(model => model.DeviceBatch.InsuredDate) - @AjaxHelpers.AjaxLoader() - + } else { - @CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown") + @CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown") }
Insured Until: + + Insured Until: @if (canConfig) + + @if (canConfig) { - @Html.EditorFor(model => model.DeviceBatch.InsuredUntil) - @AjaxHelpers.AjaxLoader() - + } else { - @CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown") + @CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown") }
Comments:
+
+ Comments:
@AjaxHelpers.AjaxLoader("ajaxComments")
@if (canConfig) + + @if (canConfig) { - @Html.EditorFor(model => model.DeviceBatch.Comments) - + } else { @@ -983,7 +1008,8 @@
Linked Groups: + + Linked Groups:
@@ -1014,19 +1040,78 @@
@Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model)
+ @if (Model.CanDecommission) + { + +
+ @using (Html.BeginForm(MVC.API.Device.DeviceBatchDecommission(Model.DeviceBatch.Id), FormMethod.Post)) + { + @Html.AntiForgeryToken() +
+  Why are these devices to be decommissioned? +
+
+
    + @foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast().OrderBy(r => r.ToString())) + { +
  • + + +
  • + } +
+
+ +
+ } +
+ + } @if (Model.CanDelete) - { + { @Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete") } @if (Model.DeviceCount > 0) { if (Authorization.Has(Claims.Device.Actions.Export)) { - @Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Batch, Model.DeviceBatch.Id)) + @Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Batch, Model.DeviceBatch.Id)) } if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0) { - @Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch")) + @Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch")) } }
diff --git a/Disco.Web/Areas/Config/Views/DeviceBatch/Show.generated.cs b/Disco.Web/Areas/Config/Views/DeviceBatch/Show.generated.cs index 31e1d428..47d3e9ce 100644 --- a/Disco.Web/Areas/Config/Views/DeviceBatch/Show.generated.cs +++ b/Disco.Web/Areas/Config/Views/DeviceBatch/Show.generated.cs @@ -104,28 +104,28 @@ WriteLiteral(">\r\n \r\n \r\n Id:\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n #line default #line hidden - #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Name)); #line default #line hidden - #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 44 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 46 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden - #line 44 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 46 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 47 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 47 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" @@ -186,7 +186,7 @@ WriteLiteral(@"> '"); - #line 51 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 53 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateName(Model.DeviceBatch.Id))); @@ -196,7 +196,7 @@ WriteLiteral("\',\r\n \'BatchName\'\r\n " });\r\n \r\n"); - #line 56 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 58 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -205,74 +205,80 @@ WriteLiteral("\',\r\n \'BatchName\'\r\n #line default #line hidden - #line 59 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 61 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Name); #line default #line hidden - #line 59 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 61 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden -WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n " + -" + + + + \r\n \r\n #line default #line hidden - #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #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 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 121 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else @@ -417,14 +429,14 @@ WriteLiteral(" \r\n #line default #line hidden - #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 125 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceModel.ToString()); #line default #line hidden - #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 125 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -437,7 +449,7 @@ WriteLiteral(" \r\n WriteLiteral(" "); - #line 123 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 129 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceCount.ToString("n0")); @@ -449,7 +461,7 @@ WriteLiteral("\r\n \r\n WriteLiteral(" "); - #line 126 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 132 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceDecommissionedCount.ToString("n0")); @@ -459,7 +471,7 @@ WriteLiteral("\r\n \r\n ">\r\n"); - #line 129 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 135 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -469,7 +481,7 @@ WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n "
\r\n"); +WriteLiteral(">\r\n Id:\r\n \r\n \r\n"); WriteLiteral(" "); - #line 34 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 35 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.DisplayFor(model => model.DeviceBatch.Id)); #line default #line hidden -WriteLiteral("\r\n
Name:\r\n " + -" \r\n"); +WriteLiteral("\r\n
\r\n " + +" Name:\r\n \r\n"); - #line 41 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 41 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -133,42 +133,42 @@ WriteLiteral("\r\n
Default Device Mo" + -"del:\r\n "); +WriteLiteral("
\r\n " + +" Default Device Model:\r\n \r\n"); - #line 66 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #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 68 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels.ToSelectListItems(null, true))); + #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 68 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 72 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 69 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxSave()); + #line 73 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxSave()); #line default #line hidden - #line 69 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 73 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxLoader()); + #line 74 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 74 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line default #line hidden -WriteLiteral(" \r\n $(function () {\r\n " \'"); - #line 76 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #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 \r\n"); +";\r\n });\r\n \r\n"); - #line 81 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 85 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -308,7 +314,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None Specified>"); - #line 85 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 89 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -316,17 +322,17 @@ WriteLiteral("><None Specified>"); #line default #line hidden - #line 87 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 91 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DefaultDeviceModel.ToString()); #line default #line hidden - #line 87 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 91 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" ; - } } + } #line default @@ -335,19 +341,25 @@ WriteLiteral("
\r\n Devices added offline will default to this Device Model.\r\n On" + -"ce a device enrols the Device Model will be accurately represented.\r\n " + -"
Devices\r\n"); +WriteLiteral(@"> + Devices added offline will default to this Device Model. + Once a device enrols the Device Model will be accurately represented. + +
Devices +"); - #line 98 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 98 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceModelMembers.Count > 0) { @@ -370,13 +382,13 @@ WriteLiteral(@"> "); - #line 109 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 109 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" foreach (var membership in Model.DeviceModelMembers.OrderByDescending(dmm => dmm.DeviceCount)) { @@ -386,13 +398,13 @@ WriteLiteral(@"> WriteLiteral("
\r\n"); - #line 113 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 113 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canDeviceModelShow) { @@ -400,14 +412,14 @@ WriteLiteral("
Total Models: "); - #line 133 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 139 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceModelMembers.Count.ToString("n0")); @@ -478,7 +490,7 @@ WriteLiteral(" \r\n
"); - #line 134 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 140 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); @@ -487,7 +499,7 @@ WriteLiteral(""); WriteLiteral(""); - #line 135 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 141 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceDecommissionedCount.ToString("n0")); @@ -497,7 +509,7 @@ WriteLiteral("
\r\n"); - #line 139 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 145 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -512,7 +524,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral(">No device models are referenced in this batch.\r\n"); - #line 143 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 149 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -521,7 +533,7 @@ WriteLiteral(">No device models are referenced in this batch.\r\n"); WriteLiteral(" "); - #line 144 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #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; @@ -546,7 +558,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 150 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); @@ -555,7 +567,7 @@ WriteLiteral(" "); WriteLiteral(" of "); - #line 150 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0")); @@ -564,7 +576,7 @@ WriteLiteral(" of "); WriteLiteral(" purchased devices are managed by Disco. "); - #line 150 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(missingCount.ToString("n0")); @@ -573,7 +585,7 @@ WriteLiteral(" purchased devices are managed by Disco. "); WriteLiteral(" "); - #line 150 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(missingCount == 1 ? "is" : "are"); @@ -583,14 +595,14 @@ WriteLiteral(" not managed.\r\n

\r\n "\n"); - #line 153 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 159 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden -WriteLiteral("
Purchase:\r\n " + -"
\r\n " + +" Purchase:\r\n \r\n"); +WriteLiteral(">\r\n Purchase Date:\r\n \r\n " + +" \r\n"); - #line 165 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 173 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 165 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 173 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -621,28 +634,28 @@ WriteLiteral(">Purchase Date:\r\n \r\n #line default #line hidden - #line 167 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 175 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDate)); #line default #line hidden - #line 167 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 175 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 168 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 176 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 168 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 176 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" @@ -657,7 +670,7 @@ WriteLiteral(@" \r\n"); +" \r\n"); - #line 207 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 217 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -789,7 +808,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None Specified>"); - #line 211 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 221 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -797,75 +816,81 @@ WriteLiteral("><None Specified>"); #line default #line hidden - #line 213 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Supplier); #line default #line hidden - #line 213 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } - } + } #line default #line hidden WriteLiteral("
Unit Cost:\r\n "); +">\r\n \r\n Unit Cost:\r\n " + +" \r\n"); - #line 220 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #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 222 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(Html.EditorFor(model => model.DeviceBatch.UnitCost)); + #line 234 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(Html.EditorFor(model => model.DeviceBatch.UnitCost)); #line default #line hidden - #line 222 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 234 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxSave()); + #line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxSave()); #line default #line hidden - #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 224 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxLoader()); + #line 236 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 224 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 236 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line default #line hidden -WriteLiteral(" '"); - #line 230 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 242 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateUnitCost(Model.DeviceBatch.Id))); @@ -885,10 +910,10 @@ WriteLiteral(@"> #line hidden WriteLiteral("\',\r\n \'UnitCost\'\r\n " + " );\r\n });\r\n " + -"\r\n"); +" \r\n"); - #line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 247 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -904,7 +929,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None Specified>"); - #line 239 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 251 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -912,75 +937,81 @@ WriteLiteral("><None Specified>"); #line default #line hidden - #line 241 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 253 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitCost.Value.ToString("C")); #line default #line hidden - #line 241 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 253 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } - } + } #line default #line hidden WriteLiteral("
Quantity:\r\n "); +">\r\n \r\n Quantity:\r\n " + +" \r\n"); - #line 248 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #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 250 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(Html.EditorFor(model => model.DeviceBatch.UnitQuantity)); + #line 264 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(Html.EditorFor(model => model.DeviceBatch.UnitQuantity)); #line default #line hidden - #line 250 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 264 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 251 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxSave()); + #line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxSave()); #line default #line hidden - #line 251 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 252 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxLoader()); + #line 266 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 252 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 266 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line default #line hidden -WriteLiteral(" '"); - #line 258 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 272 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateUnitQuantity(Model.DeviceBatch.Id))); @@ -1000,10 +1031,10 @@ WriteLiteral(@"> #line hidden WriteLiteral("\',\r\n \'UnitQuantity\'\r\n " + " );\r\n });\r\n " + -" \r\n"); +" \r\n"); - #line 263 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 277 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1019,7 +1050,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None Specified>"); - #line 267 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 281 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1027,16 +1058,16 @@ WriteLiteral("><None Specified>"); #line default #line hidden - #line 269 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 283 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0")); #line default #line hidden - #line 269 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 283 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } - } + } #line default @@ -1049,7 +1080,7 @@ WriteLiteral(" id=\"DeviceBatch_PurchaseDetails_Container\""); WriteLiteral(">\r\n
\r\n Details "); - #line 276 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 290 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxPurchaseDetails")); @@ -1058,13 +1089,13 @@ WriteLiteral(">\r\n
\r\n Details WriteLiteral("\r\n
\r\n"); - #line 278 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 292 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 278 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 292 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -1072,14 +1103,14 @@ WriteLiteral("\r\n
\r\n"); #line default #line hidden - #line 280 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 294 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDetails)); #line default #line hidden - #line 280 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 294 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" @@ -1108,7 +1139,7 @@ WriteLiteral(@"> url: '"); - #line 297 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 311 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDetails(Model.DeviceBatch.Id))); @@ -1142,7 +1173,7 @@ WriteLiteral("\',\r\n dataType: \'jso " });\r\n \r\n"); - #line 332 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 346 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1158,7 +1189,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None Specified>"); - #line 336 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 350 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1166,14 +1197,14 @@ WriteLiteral("><None Specified>"); #line default #line hidden - #line 338 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.PurchaseDetails)); #line default #line hidden - #line 338 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } @@ -1181,7 +1212,7 @@ WriteLiteral("><None Specified>"); #line default #line hidden WriteLiteral(" \r\n
Warranty:\r\n \r\n"); +WriteLiteral(">\r\n Valid Until:\r\n \r\n " + +" \r\n"); - #line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 368 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 368 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -1212,28 +1244,28 @@ WriteLiteral(">Valid Until:\r\n \r\n #line default #line hidden - #line 354 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 370 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.WarrantyValidUntil)); #line default #line hidden - #line 354 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 370 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 355 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 371 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 355 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 371 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" @@ -1248,7 +1280,7 @@ WriteLiteral(@" \r\n"); - #line 435 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 451 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1404,7 +1436,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None Specified>"); - #line 439 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 455 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1412,14 +1444,14 @@ WriteLiteral("><None Specified>"); #line default #line hidden - #line 441 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.WarrantyDetails)); #line default #line hidden - #line 441 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } @@ -1427,7 +1459,7 @@ WriteLiteral("><None Specified>"); #line default #line hidden WriteLiteral(" \r\n
Insurance:\r\n "); +WriteLiteral(">\r\n Supplier:\r\n \r\n " + +" \r\n"); - #line 454 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + + #line default + #line hidden + + #line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { - + #line default #line hidden - #line 456 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier)); + #line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier)); #line default #line hidden - #line 456 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxSave()); + #line 476 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxSave()); #line default #line hidden - #line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 476 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 458 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxLoader()); + #line 477 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 458 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 477 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line default #line hidden -WriteLiteral(" '"); - #line 464 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 483 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceSupplier(Model.DeviceBatch.Id))); @@ -1513,10 +1552,10 @@ WriteLiteral(@"> #line hidden WriteLiteral("\',\r\n \'InsuranceSupplier\'\r\n " + " );\r\n });\r\n " + -" \r\n"); +" \r\n"); - #line 469 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 488 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1532,7 +1571,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None Specified>"); - #line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 492 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1540,17 +1579,17 @@ WriteLiteral("><None Specified>"); #line default #line hidden - #line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 494 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.InsuranceSupplier); #line default #line hidden - #line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 494 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" ; - } } + } #line default @@ -1560,45 +1599,52 @@ WriteLiteral("
"); +WriteLiteral(">\r\n Insured Date:\r\n \r\n " + +" \r\n"); - #line 483 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 504 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + + #line default + #line hidden + + #line 504 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { - + #line default #line hidden - #line 485 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(Html.EditorFor(model => model.DeviceBatch.InsuredDate)); + #line 506 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(Html.EditorFor(model => model.DeviceBatch.InsuredDate)); #line default #line hidden - #line 485 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 506 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 486 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxLoader()); + #line 507 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 486 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 507 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line default #line hidden -WriteLiteral(@" + "); - #line 500 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 521 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { - + #line default #line hidden - #line 503 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown")); + #line 524 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown")); #line default #line hidden - #line 503 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 524 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + } @@ -1651,45 +1697,52 @@ WriteLiteral("
"); +WriteLiteral(">\r\n Insured Until:\r\n \r\n " + +" \r\n"); - #line 510 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 533 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + + #line default + #line hidden + + #line 533 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { - + #line default #line hidden - #line 512 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(Html.EditorFor(model => model.DeviceBatch.InsuredUntil)); + #line 535 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(Html.EditorFor(model => model.DeviceBatch.InsuredUntil)); #line default #line hidden - #line 512 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - - + #line 535 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + #line default #line hidden - #line 513 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(AjaxHelpers.AjaxLoader()); + #line 536 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 513 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 536 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line default #line hidden -WriteLiteral(@" + "); - #line 527 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 550 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { - + #line default #line hidden - #line 530 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown")); + #line 553 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown")); #line default #line hidden - #line 530 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 553 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + } @@ -1745,7 +1798,7 @@ WriteLiteral(" id=\"DeviceBatch_InsuranceDetails_Container\""); WriteLiteral(">\r\n
\r\n Details "); - #line 537 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 560 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxInsuranceDetails")); @@ -1754,13 +1807,13 @@ WriteLiteral(">\r\n
\r\n Details WriteLiteral("\r\n
\r\n"); - #line 539 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 562 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 539 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 562 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -1768,14 +1821,14 @@ WriteLiteral("\r\n
\r\n"); #line default #line hidden - #line 541 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 564 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuranceDetails)); #line default #line hidden - #line 541 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 564 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" @@ -1802,7 +1855,7 @@ WriteLiteral(@"> url: '"); - #line 556 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 579 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceDetails(Model.DeviceBatch.Id))); @@ -1836,7 +1889,7 @@ WriteLiteral("\',\r\n dataType: \'jso " });\r\n \r\n"); - #line 591 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 614 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1852,7 +1905,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None Specified>"); - #line 595 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 618 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1860,14 +1913,14 @@ WriteLiteral("><None Specified>"); #line default #line hidden - #line 597 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 620 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.InsuranceDetails)); #line default #line hidden - #line 597 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 620 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } @@ -1875,42 +1928,48 @@ WriteLiteral("><None Specified>"); #line default #line hidden WriteLiteral(" \r\n
Comments:
\r\n"); +"
\r\n Comments:
\r\n"); WriteLiteral(" "); - #line 604 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 628 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxComments")); #line default #line hidden -WriteLiteral("\r\n
"); +WriteLiteral("\r\n \r\n \r\n"); - #line 606 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - if (canConfig) - { + #line 631 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 608 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - Write(Html.EditorFor(model => model.DeviceBatch.Comments)); + #line 631 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + if (canConfig) + { + + + #line default + #line hidden + + #line 633 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(Html.EditorFor(model => model.DeviceBatch.Comments)); #line default #line hidden - #line 608 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 633 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line default #line hidden -WriteLiteral(" url: '"); - #line 623 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 648 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateComments(Model.DeviceBatch.Id))); @@ -1958,11 +2017,11 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n " setup: function (ed) {\r\n ed.on(\'ini" + "t\', function () {\r\n $(ed.getWin()).blur(model" + ".updated);\r\n });\r\n }\r\n" + -" });\r\n });\r\n \r" + -"\n"); +" });\r\n });\r\n \r\n"); - #line 658 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 683 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1978,7 +2037,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None Specified>"); - #line 662 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 687 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { @@ -1986,14 +2045,14 @@ WriteLiteral("><None Specified>"); #line default #line hidden - #line 664 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 689 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.Comments)); #line default #line hidden - #line 664 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 689 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } @@ -2005,20 +2064,20 @@ WriteLiteral("
Linked Groups:\r\n \r\n " + -"
\r\n"); +WriteLiteral(">\r\n
\r\n Linked Groups:\r\n \r\n
\r\n"); WriteLiteral(" "); - #line 990 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1016 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel() { CanConfigure = canConfig, @@ -2694,7 +2753,7 @@ WriteLiteral("\r\n"); WriteLiteral(" "); - #line 998 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1024 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel() { CanConfigure = canConfig, @@ -2710,13 +2769,13 @@ WriteLiteral(" "); WriteLiteral("\r\n"); - #line 1006 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1032 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 1006 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1032 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { @@ -2724,14 +2783,14 @@ WriteLiteral("\r\n"); #line default #line hidden - #line 1008 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1034 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared)); #line default #line hidden - #line 1008 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1034 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -2741,7 +2800,7 @@ WriteLiteral("\r\n"); WriteLiteral("
\r\n
\r\n\r\n"); - #line 1015 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1041 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model)); @@ -2754,28 +2813,246 @@ WriteLiteral(" class=\"actionBar\""); WriteLiteral(">\r\n"); - #line 1017 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1043 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 1017 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1043 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + if (Model.CanDecommission) + { + + + #line default + #line hidden +WriteLiteral(" Decommission All Devices\r\n"); + +WriteLiteral(" \r\n"); + + + #line 1047 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + + #line default + #line hidden + + #line 1047 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + using (Html.BeginForm(MVC.API.Device.DeviceBatchDecommission(Model.DeviceBatch.Id), FormMethod.Post)) + { + + + #line default + #line hidden + + #line 1049 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(Html.AntiForgeryToken()); + + + #line default + #line hidden + + #line 1049 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + + + #line default + #line hidden +WriteLiteral(" \r\n  Why are these devices to be decommissioned?\r\n \r\n"); + +WriteLiteral("
\r\n \r\n"); + + + #line 1055 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + + + #line default + #line hidden + + #line 1055 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast().OrderBy(r => r.ToString())) + { + + + #line default + #line hidden +WriteLiteral("
  • \r\n ((int)decommissionReason + + #line default + #line hidden +, 56868), false) +); + +WriteLiteral("\r\n name=\"decommissionReason\""); + +WriteAttribute("value", Tuple.Create(" value=\"", 56961), Tuple.Create("\"", 56995) + + #line 1059 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" +, Tuple.Create(Tuple.Create("", 56969), Tuple.Create((int)decommissionReason + + #line default + #line hidden +, 56969), false) +); + +WriteLiteral(" "); + + + #line 1059 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty); + + + #line default + #line hidden +WriteLiteral(" />\r\n ((int)decommissionReason + + #line default + #line hidden +, 57180), false) +); + +WriteLiteral(">"); + + + #line 1060 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(decommissionReason.ReasonMessage()); + + + #line default + #line hidden +WriteLiteral("\r\n
  • \r\n"); + + + #line 1062 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n
    \r\n \r\n \r\n Unassign devices users\r\n " + +"\r\n
    \r\n"); + + + #line 1070 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n"); + +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; + }); + + }); + +"); + + + #line 1101 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" "); + + + #line 1102 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.CanDelete) - { + { #line default #line hidden - #line 1019 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete")); #line default #line hidden - #line 1019 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -2785,42 +3062,42 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 1021 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1106 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceCount > 0) { if (Authorization.Has(Claims.Device.Actions.Export)) { - + #line default #line hidden - #line 1025 "..\..\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 1110 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Batch, Model.DeviceBatch.Id))); #line default #line hidden - #line 1025 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 1110 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + } if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0) { - + #line default #line hidden - #line 1029 "..\..\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 1114 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch"))); #line default #line hidden - #line 1029 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" - + #line 1114 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + } } diff --git a/Disco.Web/Controllers/DeviceController.cs b/Disco.Web/Controllers/DeviceController.cs index 7eb98460..a50bb4f5 100644 --- a/Disco.Web/Controllers/DeviceController.cs +++ b/Disco.Web/Controllers/DeviceController.cs @@ -1,6 +1,5 @@ using Disco.Models.Repository; using Disco.Models.Services.Devices; -using Disco.Models.Services.Documents; using Disco.Models.Services.Jobs.JobLists; using Disco.Models.UI.Device; using Disco.Services; diff --git a/Disco.Web/Extensions/T4MVC/API.DeviceController.generated.cs b/Disco.Web/Extensions/T4MVC/API.DeviceController.generated.cs index 8187ba7c..0cc05bd3 100644 --- a/Disco.Web/Extensions/T4MVC/API.DeviceController.generated.cs +++ b/Disco.Web/Extensions/T4MVC/API.DeviceController.generated.cs @@ -218,6 +218,12 @@ namespace Disco.Web.Areas.API.Controllers } [NonAction] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] + public virtual System.Web.Mvc.ActionResult DeviceBatchDecommission() + { + return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.DeviceBatchDecommission); + } + [NonAction] + [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public virtual System.Web.Mvc.ActionResult Export() { return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Export); @@ -276,6 +282,7 @@ namespace Disco.Web.Areas.API.Controllers public readonly string ImportBegin = "ImportBegin"; public readonly string ImportParse = "ImportParse"; public readonly string ImportApply = "ImportApply"; + public readonly string DeviceBatchDecommission = "DeviceBatchDecommission"; public readonly string Export = "Export"; public readonly string ExportRetrieve = "ExportRetrieve"; public readonly string SaveExport = "SaveExport"; @@ -311,6 +318,7 @@ namespace Disco.Web.Areas.API.Controllers public const string ImportBegin = "ImportBegin"; public const string ImportParse = "ImportParse"; public const string ImportApply = "ImportApply"; + public const string DeviceBatchDecommission = "DeviceBatchDecommission"; public const string Export = "Export"; public const string ExportRetrieve = "ExportRetrieve"; public const string SaveExport = "SaveExport"; @@ -557,6 +565,16 @@ namespace Disco.Web.Areas.API.Controllers { public readonly string Id = "Id"; } + static readonly ActionParamsClass_DeviceBatchDecommission s_params_DeviceBatchDecommission = new ActionParamsClass_DeviceBatchDecommission(); + [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] + public ActionParamsClass_DeviceBatchDecommission DeviceBatchDecommissionParams { get { return s_params_DeviceBatchDecommission; } } + [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] + public class ActionParamsClass_DeviceBatchDecommission + { + public readonly string id = "id"; + public readonly string decommissionReason = "decommissionReason"; + public readonly string unassignUsers = "unassignUsers"; + } static readonly ActionParamsClass_Export s_params_Export = new ActionParamsClass_Export(); [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public ActionParamsClass_Export ExportParams { get { return s_params_Export; } } @@ -943,6 +961,20 @@ namespace Disco.Web.Areas.API.Controllers return callInfo; } + [NonAction] + partial void DeviceBatchDecommissionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, Disco.Models.Repository.DecommissionReasons? decommissionReason, bool? unassignUsers); + + [NonAction] + public override System.Web.Mvc.ActionResult DeviceBatchDecommission(int id, Disco.Models.Repository.DecommissionReasons? decommissionReason, bool? unassignUsers) + { + var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.DeviceBatchDecommission); + ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id); + ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "decommissionReason", decommissionReason); + ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "unassignUsers", unassignUsers); + DeviceBatchDecommissionOverride(callInfo, id, decommissionReason, unassignUsers); + return callInfo; + } + [NonAction] partial void ExportOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Web.Models.Device.ExportModel model); diff --git a/Disco.Web/Views/Device/Import.cshtml b/Disco.Web/Views/Device/Import.cshtml index 7a05d693..ab774c18 100644 --- a/Disco.Web/Views/Device/Import.cshtml +++ b/Disco.Web/Views/Device/Import.cshtml @@ -217,7 +217,7 @@ {

    Successfully imported/updated @Model.CompletedImportSessionContext.AffectedRecords device@(Model.CompletedImportSessionContext.AffectedRecords != 1 ? "s" : null).

    -
    File: @Model.CompletedImportSessionContext.Filename
    +
    @Model.CompletedImportSessionContext.Filename
    - -
    - - - - - - @foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn)) - { - - } - - - - - @foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn)) - { - - } - - - - @foreach (var recordEntry in Model.Context.Records.Select((r, i) => Tuple.Create(r, i))) - { - var record = recordEntry.Item1; - - - - @foreach (var field in record.Fields) - { - var friendlyValue = field.FriendlyValue; - - } - + $navigationContainer.find('input').each(function () { + var $this = $(this); + var action = $this.closest('li').attr('class'); + var records = $tableBody.find('tr.' + action); + if ($this.is(':checked')) { + records.show(); + } else { + records.hide(); } - -
    ActionRow@(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2)
      @header.Name
    @(recordEntry.Item2 + 1) - @if (!field.FieldAction.HasValue) - { - Error: @field.ErrorMessage - - } - @if (string.IsNullOrEmpty(friendlyValue)) - {<None>} - else if (field.FieldType == DeviceImportFieldTypes.DeviceSerialNumber && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Added) - { - @Html.ActionLink(friendlyValue, MVC.Device.Show((string)field.RawParsedValue), new { target="_blank" })} - else if (field.FieldType == DeviceImportFieldTypes.AssignedUserId && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Unchanged) - { - @Html.ActionLink(friendlyValue, MVC.User.Show((string)field.RawParsedValue), new { target="_blank" })} - else - {@friendlyValue} -
    -
    -
    + }); + }); + }); + +
    +
    + + + + + + @foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn)) + { + + } + + + + + @foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn)) + { + + } + + + + @foreach (var recordEntry in Model.Context.Records.Select((r, i) => Tuple.Create(r, i))) + { + var record = recordEntry.Item1; + + + + @foreach (var field in record.Fields) + { + var friendlyValue = field.FriendlyValue; + + } + + } + +
    ActionRow@(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2)
      @header.Name
    @(recordEntry.Item2 + 1) + @if (!field.FieldAction.HasValue) + { + Error: @field.ErrorMessage + + } + @if (string.IsNullOrEmpty(friendlyValue)) + {<None>} + else if (field.FieldType == DeviceImportFieldTypes.DeviceSerialNumber && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Added) + { + @Html.ActionLink(friendlyValue, MVC.Device.Show((string)field.RawParsedValue), new { target = "_blank" })} + else if (field.FieldType == DeviceImportFieldTypes.AssignedUserId && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Unchanged) + { + @Html.ActionLink(friendlyValue, MVC.User.Show((string)field.RawParsedValue), new { target = "_blank" })} + else + {@friendlyValue} +
    +
    +
    + @if (Model.Context.AllowBacktracking) + { Change Import Columns - @if (Model.StatisticImportRecords == 0) - { - Apply Device Import - } - else - { - Apply Device Import - } -
    + } + @if (Model.StatisticImportRecords == 0) + { + Apply Device Import + } + else + { + Apply Device Import + } + - - + +\r\n \r\n \r\n
    ActionRow"); - - - #line 69 "..\..\Views\Device\ImportReview.cshtml" - Write(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2); - - - #line default - #line hidden -WriteLiteral("
      
    ActionRow"); +WriteLiteral(" "); #line 77 "..\..\Views\Device\ImportReview.cshtml" - Write(header.Name); + Write(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2); #line default @@ -430,42 +399,77 @@ WriteLiteral("
      
    "); +WriteLiteral(">"); - #line 87 "..\..\Views\Device\ImportReview.cshtml" - Write(recordEntry.Item2 + 1); + #line 95 "..\..\Views\Device\ImportReview.cshtml" + Write(recordEntry.Item2 + 1); #line default @@ -485,46 +489,46 @@ WriteLiteral(">"); WriteLiteral("
    \r\n \r\n \r\n"); + + + #line 118 "..\..\Views\Device\ImportReview.cshtml" + } + + + #line default + #line hidden +WriteLiteral("
    \r\n
    \r\n\r\n \r\n"); -WriteLiteral(" id=\"Devices_Import_Review_ChangeHeaders\""); - -WriteAttribute("href", Tuple.Create(" href=\"", 6568), Tuple.Create("\"", 6637) - #line 115 "..\..\Views\Device\ImportReview.cshtml" -, Tuple.Create(Tuple.Create("", 6575), Tuple.Create(Url.Action(MVC.Device.ImportHeaders(Model.Context.SessionId)) + #line 123 "..\..\Views\Device\ImportReview.cshtml" + #line default #line hidden -, 6575), false) + + #line 123 "..\..\Views\Device\ImportReview.cshtml" + if (Model.Context.AllowBacktracking) + { + + + #line default + #line hidden +WriteLiteral(" (Url.Action(MVC.Device.ImportHeaders(Model.Context.SessionId)) + + #line default + #line hidden +, 6129), false) ); WriteLiteral(" class=\"button\""); @@ -689,20 +709,23 @@ WriteLiteral(" class=\"fa fa-caret-left\""); WriteLiteral(">Change Import Columns\r\n"); - #line 116 "..\..\Views\Device\ImportReview.cshtml" - - - #line default - #line hidden - - #line 116 "..\..\Views\Device\ImportReview.cshtml" - if (Model.StatisticImportRecords == 0) - { + #line 126 "..\..\Views\Device\ImportReview.cshtml" + } #line default #line hidden -WriteLiteral("