Pdf Import Rewrite

Pdf Import rewritten to greatly improve QR Code detection, reduce
reliance on iTextSharp and improve thumbnails. Fixes #50
This commit is contained in:
Gary Sharp
2016-08-26 09:46:35 +10:00
parent 44f6d325db
commit 5ea9a814d6
98 changed files with 3168 additions and 3202 deletions
+11 -5
View File
@@ -7,9 +7,9 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Disco.Models.Repository
{
public class Device
public class Device : IAttachmentTarget
{
[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; }
[StringLength(40)]
@@ -18,7 +18,7 @@ namespace Disco.Models.Repository
public string Location { 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? DeviceBatchId { get; set; }
@@ -26,7 +26,7 @@ namespace Disco.Models.Repository
public string DeviceDomainId { get; set; }
public string AssignedUserId { get; set; }
public DateTime? LastNetworkLogonDate { get; set; }
public bool AllowUnauthenticatedEnrol { get; set; }
public DateTime CreatedDate { get; set; }
@@ -48,7 +48,7 @@ namespace Disco.Models.Repository
public virtual IList<DeviceDetail> DeviceDetails { get; set; }
public virtual IList<DeviceAttachment> DeviceAttachments { get; set; }
public virtual IList<DeviceCertificate> DeviceCertificates { get; set; }
[InverseProperty("DeviceSerialNumber")]
public virtual IList<Job> Jobs { get; set; }
@@ -85,5 +85,11 @@ namespace Disco.Models.Repository
return index < 0 ? null : DeviceDomainId.Substring(0, index);
}
}
[NotMapped]
public string AttachmentReferenceId { get { return SerialNumber; } }
[NotMapped]
public AttachmentTypes HasAttachmentType { get { return AttachmentTypes.Device; } }
}
}
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Disco.Models.Repository
{
public class DeviceAttachment
public class DeviceAttachment : IAttachment
{
[Key]
public int Id { get; set; }
@@ -24,6 +21,12 @@ namespace Disco.Models.Repository
public string DocumentTemplateId { get; set; }
[NotMapped]
public object Reference { get { return DeviceSerialNumber; } }
[NotMapped]
public AttachmentTypes AttachmentType { get { return AttachmentTypes.Device; } }
[InverseProperty("DeviceAttachments"), ForeignKey("DeviceSerialNumber")]
public virtual Device Device { get; set; }
@@ -32,6 +35,5 @@ namespace Disco.Models.Repository
[ForeignKey("DocumentTemplateId")]
public virtual DocumentTemplate DocumentTemplate { get; set; }
}
}