@using Disco.Web.Models.Device; @using Disco.Models.Services.Devices; @model ExportModel @{ Authorization.RequireAny(Claims.Device.Actions.Export); ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Export Devices"); var optionsMetadata = ModelMetadata.FromLambdaExpression(m => m.Options, ViewData); var optionGroups = optionsMetadata.Properties.Where(p => p.ShortDisplayName != null && p.ModelType == typeof(bool)) .GroupBy(m => m.ShortDisplayName); }
@using (Html.BeginForm(MVC.API.Device.Export())) {

Export Type

Type: @Html.DropDownListFor(m => m.Options.ExportType, Enum.GetNames(typeof(Disco.Models.Services.Devices.Exporting.DeviceExportTypes)).Select(t => new SelectListItem() { Text = t, Value = t }))
@Html.DropDownListFor(m => m.Options.ExportTypeTargetId, Model.DeviceBatches.Select(i => new SelectListItem() { Value = i.Key.ToString(), Text = i.Value }))
@Html.DropDownListFor(m => m.Options.ExportTypeTargetId, Model.DeviceModels.Select(i => new SelectListItem() { Value = i.Key.ToString(), Text = i.Value }))
@Html.DropDownListFor(m => m.Options.ExportTypeTargetId, Model.DeviceProfiles.Select(i => new SelectListItem() { Value = i.Key.ToString(), Text = i.Value }))
@Html.LabelFor(m => m.Options.Format) @Html.DropDownListFor(m => m.Options.Format, Enum.GetNames(typeof(Disco.Models.Exporting.ExportFormat)).Select(v => new SelectListItem() { Value = v, Text = v }))

Export Fields (Defaults)

@foreach (var optionGroup in optionGroups) { var optionFields = optionGroup.ToList(); var itemsPerColumn = (int)Math.Ceiling((double)optionFields.Count / 2); }
@optionGroup.Key @if (optionFields.Count > 2) { ALL | NONE }
    @foreach (var optionItem in optionFields.Take(itemsPerColumn)) {
  • }
    @foreach (var optionItem in optionFields.Skip(itemsPerColumn)) {
  • }
}
@if (Model.ExportSessionId != null) {

@Model.ExportSessionResult.RecordCount record@(Model.ExportSessionResult.RecordCount != 1 ? "s" : null) were successfully exported.

Download Device Export
}

Exporting devices...

Export Devices