@model Disco.Web.Models.Device.ImportModel
@using Disco.Models.Services.Devices.Importing;
@{
Authorization.Require(Claims.Device.Actions.Import);
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices");
}
@using (Html.BeginForm(MVC.API.Device.ImportBegin(), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
Loading device import...
}
XLSX/CSV Import Specification
Format
-
The import file must be in either:
- CSV (comma-separated values) format (CSV Reference), or
- XLSX (Microsoft Excel) format
- Be conscious of editors removing leading zeros from serial numbers (ie: Microsoft Excel).
Fields
The following fields/columns are available for to the import file. The Device Serial Number is the only required field, all other fields are optional. Fields can appear in any order.
| Field Name |
Description |
@foreach (var field in Model.HeaderTypes)
{
| @field.Item2 |
@field.Item3
@if (field.Item1 == DeviceImportFieldTypes.DeviceSerialNumber.ToString())
{
Required
}
else if (field.Item1 == DeviceImportFieldTypes.ModelId.ToString())
{
(Show IDs)
}
else if (field.Item1 == DeviceImportFieldTypes.ProfileId.ToString())
{
(Show IDs)
}
else if (field.Item1 == DeviceImportFieldTypes.BatchId.ToString())
{
(Show IDs)
}
|
}
| ID |
Description |
Manufacturer |
Model |
@foreach (var dm in Model.DeviceModels)
{
| @Html.ActionLink(dm.Id.ToString(), MVC.Config.DeviceModel.Index(dm.Id)) |
@dm.ToString() |
@dm.Manufacturer |
@dm.Model |
}
| ID |
Name |
Short Name |
Description |
@foreach (var dp in Model.DeviceProfiles)
{
| @Html.ActionLink(dp.Id.ToString(), MVC.Config.DeviceProfile.Index(dp.Id)) |
@dp.Name |
@dp.ShortName |
@dp.Description |
}
| ID |
Name |
Purchase Date |
@foreach (var db in Model.DeviceBatches)
{
| @Html.ActionLink(db.Id.ToString(), MVC.Config.DeviceBatch.Index(db.Id)) |
@db.Name |
@CommonHelpers.FriendlyDate(db.PurchaseDate) |
}
@if (Model.CompletedImportSessionContext != null)
{
Successfully imported/updated @Model.CompletedImportSessionContext.AffectedRecords device@(Model.CompletedImportSessionContext.AffectedRecords != 1 ? "s" : null).
File: @Model.CompletedImportSessionContext.Filename
}