Remove: 'Active' Device property

No longer needed.
This commit is contained in:
Gary Sharp committed 2013-02-21 18:25:46 +11:00
1 parent 20a12c1c99
commit 9e2f9a646f
10 files changed
+437 -261

No files matched your search

-2
View File
@@ -256,7 +256,6 @@ namespace Disco.BI.DeviceBI
DeviceProfile = deviceProfile, DeviceProfile = deviceProfile,
DeviceModel = deviceModel, DeviceModel = deviceModel,
AllowUnauthenticatedEnrol = false, AllowUnauthenticatedEnrol = false,
Active = true,
CreatedDate = DateTime.Now, CreatedDate = DateTime.Now,
EnrolledDate = DateTime.Now EnrolledDate = DateTime.Now
}; };
@@ -393,7 +392,6 @@ namespace Disco.BI.DeviceBI
DeviceProfile = deviceProfile, DeviceProfile = deviceProfile,
DeviceModel = deviceModel, DeviceModel = deviceModel,
AllowUnauthenticatedEnrol = false, AllowUnauthenticatedEnrol = false,
Active = true,
CreatedDate = DateTime.Now, CreatedDate = DateTime.Now,
EnrolledDate = DateTime.Now, EnrolledDate = DateTime.Now,
LastEnrolDate = DateTime.Now LastEnrolDate = DateTime.Now
+185 -186
View File
@@ -1,186 +1,185 @@
using System.Linq; using System.Linq;
using Disco.BI.Interop.ActiveDirectory; using Disco.BI.Interop.ActiveDirectory;
using Disco.Data.Configuration; using Disco.Data.Configuration;
using Disco.Data.Repository; using Disco.Data.Repository;
using Disco.Models.BI.DocumentTemplates; using Disco.Models.BI.DocumentTemplates;
using Disco.Models.Repository; using Disco.Models.Repository;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
using System.IO; using System.IO;
using Disco.Models.Interop.ActiveDirectory; using Disco.Models.Interop.ActiveDirectory;
namespace Disco.BI.Extensions namespace Disco.BI.Extensions
{ {
public static class DeviceExtensions public static class DeviceExtensions
{ {
public static string ComputerNameRender(this Device device, DiscoDataContext context) public static string ComputerNameRender(this Device device, DiscoDataContext context)
{ {
DeviceProfile deviceProfile = device.DeviceProfile; DeviceProfile deviceProfile = device.DeviceProfile;
Expressions.Expression computerNameTemplateExpression = null; Expressions.Expression computerNameTemplateExpression = null;
computerNameTemplateExpression = Expressions.ExpressionCache.GetValue(DeviceProfileExtensions.ComputerNameExpressionCacheModule, deviceProfile.Id.ToString(), () => computerNameTemplateExpression = Expressions.ExpressionCache.GetValue(DeviceProfileExtensions.ComputerNameExpressionCacheModule, deviceProfile.Id.ToString(), () =>
{ {
// Removed 2012-06-14 G# - Properties moved to DeviceProfile model & DB Migrated in DBv3. // Removed 2012-06-14 G# - Properties moved to DeviceProfile model & DB Migrated in DBv3.
//return Expressions.Expression.TokenizeSingleDynamic(null, deviceProfile.Configuration(context).ComputerNameTemplate, 0); //return Expressions.Expression.TokenizeSingleDynamic(null, deviceProfile.Configuration(context).ComputerNameTemplate, 0);
return Expressions.Expression.TokenizeSingleDynamic(null, deviceProfile.ComputerNameTemplate, 0); return Expressions.Expression.TokenizeSingleDynamic(null, deviceProfile.ComputerNameTemplate, 0);
}); });
System.Collections.IDictionary evaluatorVariables = Expressions.Expression.StandardVariables(null, context, UserBI.UserCache.CurrentUser, System.DateTime.Now, null); System.Collections.IDictionary evaluatorVariables = Expressions.Expression.StandardVariables(null, context, UserBI.UserCache.CurrentUser, System.DateTime.Now, null);
string rendered; string rendered;
try try
{ {
rendered = computerNameTemplateExpression.EvaluateFirst<string>(device, evaluatorVariables); rendered = computerNameTemplateExpression.EvaluateFirst<string>(device, evaluatorVariables);
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new InvalidOperationException(string.Format("An error occurred rendering the computer name: [{0}] {1}", ex.GetType().Name, ex.Message), ex.InnerException); throw new InvalidOperationException(string.Format("An error occurred rendering the computer name: [{0}] {1}", ex.GetType().Name, ex.Message), ex.InnerException);
} }
if (rendered == null || rendered.Length > 24) if (rendered == null || rendered.Length > 24)
{ {
throw new System.InvalidOperationException("The rendered computer name would be invalid or longer than 24 characters"); throw new System.InvalidOperationException("The rendered computer name would be invalid or longer than 24 characters");
} }
return rendered.ToString(); return rendered.ToString();
} }
public static System.Collections.Generic.List<DocumentTemplate> AvailableDocumentTemplates(this Device d, DiscoDataContext Context, User User, System.DateTime TimeStamp) public static System.Collections.Generic.List<DocumentTemplate> AvailableDocumentTemplates(this Device d, DiscoDataContext Context, User User, System.DateTime TimeStamp)
{ {
List<DocumentTemplate> ats = Context.DocumentTemplates List<DocumentTemplate> ats = Context.DocumentTemplates
.Where(at => at.Scope == Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Device).ToList(); .Where(at => at.Scope == Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Device).ToList();
return ats.Where(at => at.FilterExpressionMatches(d, Context, User, TimeStamp, DocumentState.DefaultState())).ToList(); return ats.Where(at => at.FilterExpressionMatches(d, Context, User, TimeStamp, DocumentState.DefaultState())).ToList();
} }
public static bool UpdateLastNetworkLogonDate(this Device Device) public static bool UpdateLastNetworkLogonDate(this Device Device)
{ {
return ActiveDirectoryUpdateLastNetworkLogonDateJob.UpdateLastNetworkLogonDate(Device); return ActiveDirectoryUpdateLastNetworkLogonDateJob.UpdateLastNetworkLogonDate(Device);
} }
public static DeviceAttachment CreateAttachment(this Device Device, DiscoDataContext dbContext, User CreatorUser, string Filename, string MimeType, string Comments, Stream Content, DocumentTemplate DocumentTemplate = null, byte[] PdfThumbnail = null) public static DeviceAttachment CreateAttachment(this Device Device, DiscoDataContext dbContext, User CreatorUser, string Filename, string MimeType, string Comments, Stream Content, DocumentTemplate DocumentTemplate = null, byte[] PdfThumbnail = null)
{ {
if (string.IsNullOrEmpty(MimeType) || MimeType.Equals("unknown/unknown", StringComparison.InvariantCultureIgnoreCase)) if (string.IsNullOrEmpty(MimeType) || MimeType.Equals("unknown/unknown", StringComparison.InvariantCultureIgnoreCase))
MimeType = Interop.MimeTypes.ResolveMimeType(Filename); MimeType = Interop.MimeTypes.ResolveMimeType(Filename);
DeviceAttachment da = new DeviceAttachment() DeviceAttachment da = new DeviceAttachment()
{ {
DeviceSerialNumber = Device.SerialNumber, DeviceSerialNumber = Device.SerialNumber,
TechUserId = CreatorUser.Id, TechUserId = CreatorUser.Id,
Filename = Filename, Filename = Filename,
MimeType = MimeType, MimeType = MimeType,
Timestamp = DateTime.Now, Timestamp = DateTime.Now,
Comments = Comments Comments = Comments
}; };
if (DocumentTemplate != null) if (DocumentTemplate != null)
da.DocumentTemplateId = DocumentTemplate.Id; da.DocumentTemplateId = DocumentTemplate.Id;
dbContext.DeviceAttachments.Add(da); dbContext.DeviceAttachments.Add(da);
dbContext.SaveChanges(); dbContext.SaveChanges();
da.SaveAttachment(dbContext, Content); da.SaveAttachment(dbContext, Content);
Content.Position = 0; Content.Position = 0;
if (PdfThumbnail == null) if (PdfThumbnail == null)
da.GenerateThumbnail(dbContext, Content); da.GenerateThumbnail(dbContext, Content);
else else
da.SaveThumbnailAttachment(dbContext, PdfThumbnail); da.SaveThumbnailAttachment(dbContext, PdfThumbnail);
return da; return da;
} }
public static Device AddOffline(this Device d, DiscoDataContext dbContext) public static Device AddOffline(this Device d, DiscoDataContext dbContext)
{ {
// Just Include: // Just Include:
// - Serial Number // - Serial Number
// - Asset Number // - Asset Number
// - Profile Id // - Profile Id
// - Assigned User Id // - Assigned User Id
// - Batch // - Batch
// Batch // Batch
DeviceBatch db = default(DeviceBatch); DeviceBatch db = default(DeviceBatch);
if (d.DeviceBatchId.HasValue) if (d.DeviceBatchId.HasValue)
db = dbContext.DeviceBatches.Find(d.DeviceBatchId.Value); db = dbContext.DeviceBatches.Find(d.DeviceBatchId.Value);
// Default Device Model // Default Device Model
DeviceModel dm = default(DeviceModel); DeviceModel dm = default(DeviceModel);
if (db != null && db.DefaultDeviceModelId.HasValue) if (db != null && db.DefaultDeviceModelId.HasValue)
dm = dbContext.DeviceModels.Find(db.DefaultDeviceModelId); // From Batch dm = dbContext.DeviceModels.Find(db.DefaultDeviceModelId); // From Batch
else else
dm = dbContext.DeviceModels.Find(1); // Default dm = dbContext.DeviceModels.Find(1); // Default
Device d2 = new Device() Device d2 = new Device()
{ {
SerialNumber = d.SerialNumber.ToUpper(), SerialNumber = d.SerialNumber.ToUpper(),
AssetNumber = d.AssetNumber, AssetNumber = d.AssetNumber,
Location = d.Location, Location = d.Location,
CreatedDate = DateTime.Now, CreatedDate = DateTime.Now,
DeviceProfileId = d.DeviceProfileId, DeviceProfileId = d.DeviceProfileId,
DeviceProfile = dbContext.DeviceProfiles.Find(d.DeviceProfileId), DeviceProfile = dbContext.DeviceProfiles.Find(d.DeviceProfileId),
AllowUnauthenticatedEnrol = true, AllowUnauthenticatedEnrol = true,
Active = true, DeviceModelId = dm.Id,
DeviceModelId = dm.Id, DeviceModel = dm,
DeviceModel = dm, DeviceBatchId = d.DeviceBatchId,
DeviceBatchId = d.DeviceBatchId, DeviceBatch = db
DeviceBatch = db };
};
dbContext.Devices.Add(d2);
dbContext.Devices.Add(d2); if (!string.IsNullOrEmpty(d.AssignedUserId))
if (!string.IsNullOrEmpty(d.AssignedUserId)) {
{ User u = UserBI.UserCache.GetUser(d.AssignedUserId, dbContext);
User u = UserBI.UserCache.GetUser(d.AssignedUserId, dbContext); d2.AssignDevice(dbContext, u);
d2.AssignDevice(dbContext, u); }
}
return d2;
return d2; }
}
public static DeviceUserAssignment AssignDevice(this Device d, DiscoDataContext dbContext, User u)
public static DeviceUserAssignment AssignDevice(this Device d, DiscoDataContext dbContext, User u) {
{ DeviceUserAssignment newDua = default(DeviceUserAssignment);
DeviceUserAssignment newDua = default(DeviceUserAssignment);
// Mark existing assignments as Unassigned
// Mark existing assignments as Unassigned foreach (var dua in dbContext.DeviceUserAssignments.Where(m => m.DeviceSerialNumber == d.SerialNumber && !m.UnassignedDate.HasValue))
foreach (var dua in dbContext.DeviceUserAssignments.Where(m => m.DeviceSerialNumber == d.SerialNumber && !m.UnassignedDate.HasValue)) dua.UnassignedDate = DateTime.Now;
dua.UnassignedDate = DateTime.Now;
if (u != null)
if (u != null) {
{ // Add new Assignment
// Add new Assignment newDua = new DeviceUserAssignment()
newDua = new DeviceUserAssignment() {
{ DeviceSerialNumber = d.SerialNumber,
DeviceSerialNumber = d.SerialNumber, AssignedUserId = u.Id,
AssignedUserId = u.Id, AssignedDate = DateTime.Now
AssignedDate = DateTime.Now };
}; dbContext.DeviceUserAssignments.Add(newDua);
dbContext.DeviceUserAssignments.Add(newDua);
d.AssignedUserId = u.Id;
d.AssignedUserId = u.Id; d.AssignedUser = u;
d.AssignedUser = u; }
} else
else {
{ d.AssignedUserId = null;
d.AssignedUserId = null; }
}
// Update AD Account
// Update AD Account if (!string.IsNullOrEmpty(d.ComputerName) && d.ComputerName.Length <= 24)
if (!string.IsNullOrEmpty(d.ComputerName) && d.ComputerName.Length <= 24) {
{ var adMachineAccount = Interop.ActiveDirectory.ActiveDirectory.GetMachineAccount(d.ComputerName);
var adMachineAccount = Interop.ActiveDirectory.ActiveDirectory.GetMachineAccount(d.ComputerName); if (adMachineAccount != null)
if (adMachineAccount != null) {
{ if (newDua == null)
if (newDua == null) adMachineAccount.SetDescription(string.Empty);
adMachineAccount.SetDescription(string.Empty); else
else adMachineAccount.SetDescription(d);
adMachineAccount.SetDescription(d); }
} }
}
return newDua;
return newDua; }
}
public static ActiveDirectoryMachineAccount ActiveDirectoryAccount(this Device Device, params string[] AdditionalProperties)
public static ActiveDirectoryMachineAccount ActiveDirectoryAccount(this Device Device, params string[] AdditionalProperties) {
{ if (!string.IsNullOrEmpty(Device.ComputerName))
if (!string.IsNullOrEmpty(Device.ComputerName)) return Interop.ActiveDirectory.ActiveDirectory.GetMachineAccount(Device.ComputerName, AdditionalProperties: AdditionalProperties);
return Interop.ActiveDirectory.ActiveDirectory.GetMachineAccount(Device.ComputerName, AdditionalProperties: AdditionalProperties); else
else return null;
return null; }
}
}
} }
}
+8 -1
View File
@@ -93,6 +93,10 @@
<Compile Include="Migrations\201301150107063_DBv6.Designer.cs"> <Compile Include="Migrations\201301150107063_DBv6.Designer.cs">
<DependentUpon>201301150107063_DBv6.cs</DependentUpon> <DependentUpon>201301150107063_DBv6.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Migrations\201302210057463_DBv7.cs" />
<Compile Include="Migrations\201302210057463_DBv7.Designer.cs">
<DependentUpon>201302210057463_DBv7.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" /> <Compile Include="Migrations\Configuration.cs" />
<Compile Include="Migrations\DiscoDataMigrator.cs" /> <Compile Include="Migrations\DiscoDataMigrator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
@@ -124,6 +128,9 @@
<EmbeddedResource Include="Migrations\201301150107063_DBv6.resx"> <EmbeddedResource Include="Migrations\201301150107063_DBv6.resx">
<DependentUpon>201301150107063_DBv6.cs</DependentUpon> <DependentUpon>201301150107063_DBv6.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Migrations\201302210057463_DBv7.resx">
<DependentUpon>201302210057463_DBv7.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -137,7 +144,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>
<UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" BuildVersion_BuildAction="ReBuild" /> <UserProperties BuildVersion_BuildAction="ReBuild" BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2001/1/1" />
</VisualStudio> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+27
View File
@@ -0,0 +1,27 @@
// <auto-generated />
namespace Disco.Data.Migrations
{
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
public sealed partial class DBv7 : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv7));
string IMigrationMetadata.Id
{
get { return "201302210057463_DBv7"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,18 @@
namespace Disco.Data.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DBv7 : DbMigration
{
public override void Up()
{
DropColumn("dbo.Devices", "Active");
}
public override void Down()
{
AddColumn("dbo.Devices", "Active", c => c.Boolean(nullable: false));
}
}
}
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO1dW3PcuHJ+T1X+g0pPSapi2d5LbU7JSXkleWMd21Ise/fRRc9AEutwyAnJ8ZF/Wx7yk/IXAl4Hl26gAYKX0erJ1gBsdDcajcbt6//7n/89/Y+HTXL0jeVFnKWvjl88e358xNJVto7Tu1fHu/L2X385/o9//8d/OL1Ybx6Ofu/q/VDV41+mxavj+7Lc/uXkpFjds01UPNvEqzwrstvy2SrbnETr7OTl8+f/dvLixQnjJI45raOj04+7tIw3rP6D/3mWpSu2LXdR8j5bs6Rof+clNzXVow/RhhXbaMVeHZ/HxSp7dh6V0bOPbJsVcZnl34+PXidxxJm5Ycnt8dH2x798LthNmWfp3c02KuMo+fR9y3j5bZQUrGX9L9sfqdw/f1lxfxKlaVZyclnqJf1xLxeX7IJroPxesVVL9+qYK+E2vtvlNf23JZOq8w/+yr5LP/CfrvNsy/Ly+0d22xK5WfFfjo9O7DU5ObXe6YnaRv+dTL7imv9R5txKjo/exA9s/Y6ld+V9r+D30UP3yy/cVD6nMbcp/k2Z73jph12SRF8T1lc/MbZaszpxm79Hyc5VUv5fQ7PN32Krpyd7IzCaxnm22m1YWn5im20SlczHMt6u3bu7+s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FZoi+tqI2Po2NqAo8INuguBiCLine truncated
</data>
</root>
+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 // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0219.1854")] [assembly: AssemblyVersion("1.2.0221.1820")]
[assembly: AssemblyFileVersion("1.2.0219.1854")] [assembly: AssemblyFileVersion("1.2.0221.1820")]
+3 -1
View File
@@ -96,6 +96,8 @@
<Compile Include="Repository\User\User.cs" /> <Compile Include="Repository\User\User.cs" />
<Compile Include="Repository\User\UserAttachment.cs" /> <Compile Include="Repository\User\UserAttachment.cs" />
<Compile Include="Repository\User\UserDetail.cs" /> <Compile Include="Repository\User\UserDetail.cs" />
<Compile Include="UI\BaseUIModel.cs" />
<Compile Include="UI\Job\JobShowModel.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
@@ -103,7 +105,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>
<UserProperties BuildVersion_BuildAction="ReBuild" BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2001/1/1" /> <UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" BuildVersion_BuildAction="ReBuild" />
</VisualStudio> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
<PropertyGroup> <PropertyGroup>
+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 // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0219.1854")] [assembly: AssemblyVersion("1.2.0221.1820")]
[assembly: AssemblyFileVersion("1.2.0219.1854")] [assembly: AssemblyFileVersion("1.2.0221.1820")]
+69 -67
View File
@@ -1,67 +1,69 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Disco.Models.Repository namespace Disco.Models.Repository
{ {
public class Device public class Device
{ {
[Required(ErrorMessage="The Serial Number is Required"), Key, StringLength(60)] [Required(ErrorMessage="The Serial Number is Required"), Key, StringLength(60)]
public string SerialNumber { get; set; } public string SerialNumber { get; set; }
[StringLength(40)] [StringLength(40)]
public string AssetNumber { get; set; } public string AssetNumber { get; set; }
[StringLength(250)] [StringLength(250)]
public string Location { get; set; } public string Location { get; set; }
public int? DeviceModelId { get; set; } public int? DeviceModelId { get; set; }
[Range(1, int.MaxValue, ErrorMessage="A valid Device Profile is Required")] [Range(1, int.MaxValue, ErrorMessage="A valid Device Profile is Required")]
public int DeviceProfileId { get; set; } public int DeviceProfileId { get; set; }
public int? DeviceBatchId { get; set; } public int? DeviceBatchId { get; set; }
[StringLength(24)] [StringLength(24)]
public string ComputerName { get; set; } public string ComputerName { get; set; }
public string AssignedUserId { get; set; } public string AssignedUserId { get; set; }
public DateTime? LastNetworkLogonDate { get; set; } public DateTime? LastNetworkLogonDate { get; set; }
// 2012-06-21 - Removed // 2012-06-21 - Removed
//[StringLength(24)] //[StringLength(24)]
//public string CertificateStoreReference { get; set; } //public string CertificateStoreReference { get; set; }
public bool AllowUnauthenticatedEnrol { get; set; } public bool AllowUnauthenticatedEnrol { get; set; }
public bool Active { get; set; } // Removed 2013-02-21 G#: Redundant - See DecommissionedDate
//public bool Active { get; set; }
public DateTime CreatedDate { get; set; } // End Removed 2013-02-21
public DateTime? EnrolledDate { get; set; }
public DateTime? LastEnrolDate { get; set; } public DateTime CreatedDate { get; set; }
public DateTime? DecommissionedDate { get; set; } public DateTime? EnrolledDate { get; set; }
public DateTime? LastEnrolDate { get; set; }
[ForeignKey("DeviceModelId")] public DateTime? DecommissionedDate { get; set; }
public virtual DeviceModel DeviceModel { get; set; }
[ForeignKey("DeviceProfileId")] [ForeignKey("DeviceModelId")]
public virtual DeviceProfile DeviceProfile { get; set; } public virtual DeviceModel DeviceModel { get; set; }
[ForeignKey("DeviceBatchId")] [ForeignKey("DeviceProfileId")]
public virtual DeviceBatch DeviceBatch { get; set; } public virtual DeviceProfile DeviceProfile { get; set; }
[ForeignKey("AssignedUserId")] [ForeignKey("DeviceBatchId")]
public virtual User AssignedUser { get; set; } public virtual DeviceBatch DeviceBatch { get; set; }
[ForeignKey("AssignedUserId")]
public virtual IList<DeviceUserAssignment> DeviceUserAssignments { get; set; } public virtual User AssignedUser { get; set; }
public virtual IList<DeviceDetail> DeviceDetails { get; set; }
public virtual IList<DeviceAttachment> DeviceAttachments { get; set; } public virtual IList<DeviceUserAssignment> DeviceUserAssignments { get; set; }
public virtual IList<DeviceDetail> DeviceDetails { get; set; }
[InverseProperty("DeviceSerialNumber")] public virtual IList<DeviceAttachment> DeviceAttachments { get; set; }
public virtual IList<Job> Jobs { get; set; }
[InverseProperty("DeviceSerialNumber")]
public override string ToString() public virtual IList<Job> Jobs { get; set; }
{
if (DeviceModel != null) public override string ToString()
return string.Format("{0} - {1}", this.DeviceModel, this.SerialNumber); {
else if (DeviceModel != null)
return this.SerialNumber; return string.Format("{0} - {1}", this.DeviceModel, this.SerialNumber);
} else
} return this.SerialNumber;
} }
}
}