#34 Feature: Detailed Device Exporting

Many additional device properties are available to export. The previous
export configuration is remembered.
This commit is contained in:
Gary Sharp
2014-05-22 01:22:57 +10:00
parent 53ca13c7f4
commit 3fdb4f1053
54 changed files with 1750 additions and 397 deletions
@@ -461,23 +461,5 @@ namespace Disco.Web.Areas.API.Controllers
#endregion
#region Exporting
[DiscoAuthorizeAll(Claims.Config.DeviceProfile.Show, Claims.Device.Actions.Export)]
public virtual ActionResult ExportDevices(int id)
{
DeviceProfile dp = Database.DeviceProfiles.Find(id);
if (dp == null)
throw new ArgumentNullException("id", "Invalid Device Profile Id");
var devices = Database.Devices.Where(d => !d.DecommissionedDate.HasValue && d.DeviceProfileId == dp.Id);
var export = BI.DeviceBI.Importing.Export.GenerateExport(devices);
var filename = string.Format("DiscoDeviceExport-Profile_{0}-{1:yyyyMMdd-HHmmss}.csv", dp.Id, DateTime.Now);
return File(export, "text/csv", filename);
}
#endregion
}
}