Update: New Device UI

This commit is contained in:
Gary Sharp
2013-06-18 17:18:19 +10:00
parent d6be58b5c7
commit b7dc05dd65
63 changed files with 5068 additions and 2626 deletions
@@ -10,10 +10,38 @@ namespace Disco.BI.Extensions
{
public static class DeviceActionExtensions
{
public static bool IsDecommissioned(this Device d)
{
return d.DecommissionedDate.HasValue;
}
public static bool CanCreateJob(this Device d)
{
return !d.DecommissionedDate.HasValue;
return !d.IsDecommissioned();
}
public static bool CanUpdateAssignment(this Device d)
{
return !d.IsDecommissioned();
}
public static bool CanUpdateDeviceProfile(this Device d)
{
return !d.IsDecommissioned();
}
public static bool CanUpdateDeviceBatch(this Device d)
{
return !d.IsDecommissioned();
}
public static bool CanUpdateTrustEnrol(this Device d)
{
return !d.IsDecommissioned() && !d.AllowUnauthenticatedEnrol;
}
public static bool CanUpdateUntrustEnrol(this Device d)
{
return !d.IsDecommissioned() && d.AllowUnauthenticatedEnrol;
}
#region Decommission
@@ -178,5 +178,15 @@ namespace Disco.BI.Extensions
return null;
}
public static string Status(this Device Device)
{
if (Device.DecommissionedDate.HasValue)
return "Decommissioned";
if (!Device.EnrolledDate.HasValue)
return "Not Enrolled";
return "Active";
}
}
}
@@ -5,6 +5,7 @@ using System.Text;
using Disco.Models.Repository;
using Disco.Data.Repository;
using Disco.Data.Configuration.Modules;
using Disco.Models.BI.Config;
namespace Disco.BI.Extensions
{
@@ -17,6 +18,18 @@ namespace Disco.BI.Extensions
Expressions.ExpressionCache.InvalidateKey(ComputerNameExpressionCacheModule, deviceProfile.Id.ToString());
}
public static OrganisationAddress DefaultOrganisationAddressDetails(this DeviceProfile deviceProfile, DiscoDataContext dbContext)
{
if (deviceProfile.DefaultOrganisationAddress.HasValue)
{
return dbContext.DiscoConfiguration.OrganisationAddresses.GetAddress(deviceProfile.DefaultOrganisationAddress.Value);
}
else
{
return null;
}
}
public static bool CanDelete(this DeviceProfile dp, DiscoDataContext dbContext)
{
// Can't Delete Default Profile (Id: 1)
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0606.1909")]
[assembly: AssemblyFileVersion("1.2.0606.1909")]
[assembly: AssemblyVersion("1.2.0618.1707")]
[assembly: AssemblyFileVersion("1.2.0618.1707")]