Feature: MS Excel (xlsx) Import/Export

Microsoft Excel files can be used to import/export devices. Several
import bugs were also fixed in the process.
This commit is contained in:
Gary Sharp
2017-03-25 15:37:28 +11:00
parent ed66f4f285
commit 5ce9e51ae7
51 changed files with 1959 additions and 1083 deletions
@@ -1,4 +1,5 @@
using Disco.Data.Repository;
using Disco.Models.Services.Devices.Importing;
using Disco.Services.Tasks;
using Quartz;
using System;
@@ -13,7 +14,7 @@ namespace Disco.Services.Devices.Importing
public override bool SingleInstanceTask { get { return false; } }
public override bool CancelInitiallySupported { get { return false; } }
public static ScheduledTaskStatus ScheduleNow(DeviceImportContext Context)
public static ScheduledTaskStatus ScheduleNow(IDeviceImportContext Context)
{
if (Context == null)
throw new ArgumentNullException("Context");
@@ -28,11 +29,11 @@ namespace Disco.Services.Devices.Importing
protected override void ExecuteTask()
{
var context = (DeviceImportContext)this.ExecutionContext.JobDetail.JobDataMap[JobDataMapContext];
var context = (IDeviceImportContext)ExecutionContext.JobDetail.JobDataMap[JobDataMapContext];
using (DiscoDataContext Database = new DiscoDataContext())
{
context.ParseRecords(Database, this.Status);
context.ParseRecords(Database, Status);
}
}
}