Export devices without a batch assigned #60

This commit is contained in:
Gary Sharp committed 2014-07-14 13:30:25 +10:00
1 parent 5c5e5a23a2
commit 09b1c93bf0
2 files changed
+5 -2

No files matched your search

@@ -120,7 +120,10 @@ namespace Disco.Services.Devices.Exporting
case DeviceExportTypes.All:
return GenerateExport(Database, Database.Devices, Options, TaskStatus);
case DeviceExportTypes.Batch:
return GenerateExport(Database, Database.Devices.Where(d => d.DeviceBatchId == Options.ExportTypeTargetId), Options, TaskStatus);
if (Options.ExportTypeTargetId.HasValue && Options.ExportTypeTargetId.Value > 0)
return GenerateExport(Database, Database.Devices.Where(d => d.DeviceBatchId == Options.ExportTypeTargetId), Options, TaskStatus);
else
return GenerateExport(Database, Database.Devices.Where(d => d.DeviceBatchId == null), Options, TaskStatus);
case DeviceExportTypes.Model:
return GenerateExport(Database, Database.Devices.Where(d => d.DeviceModelId == Options.ExportTypeTargetId), Options, TaskStatus);
case DeviceExportTypes.Profile: