Tidy: Sort/remove usings, simplify names
This commit is contained in:
@@ -73,7 +73,7 @@ namespace Disco.Services.Documents.AttachmentImport
|
||||
|
||||
public void ScheduleCurrentFiles(int ImportDelay)
|
||||
{
|
||||
foreach (var filename in Directory.GetFiles(this.MonitorLocation, "*.pdf"))
|
||||
foreach (var filename in Directory.GetFiles(MonitorLocation, "*.pdf"))
|
||||
{
|
||||
ScheduleImport(filename, ImportDelay);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Services.Logging;
|
||||
using Disco.Services.Tasks;
|
||||
using Quartz;
|
||||
using System;
|
||||
@@ -20,7 +19,7 @@ namespace Disco.Services.Documents.AttachmentImport
|
||||
// Trigger Daily @ 12:30am
|
||||
TriggerBuilder triggerBuilder = TriggerBuilder.Create().WithSchedule(CronScheduleBuilder.DailyAtHourAndMinute(0, 30));
|
||||
|
||||
this.ScheduleTask(triggerBuilder);
|
||||
ScheduleTask(triggerBuilder);
|
||||
}
|
||||
|
||||
protected override void ExecuteTask()
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Disco.Services.Documents.AttachmentImport
|
||||
var trigger = TriggerBuilder.Create()
|
||||
.StartAt(DateTimeOffset.Now.AddMinutes(5));
|
||||
|
||||
this.ScheduleTask(trigger);
|
||||
ScheduleTask(trigger);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -137,11 +137,11 @@ namespace Disco.Services.Documents
|
||||
|
||||
private DocumentUniqueIdentifier(DiscoDataContext Database, int Version, short DeploymentChecksum, string DocumentTemplateId, string TargetId, string CreatorId, DateTime TimeStamp, int PageIndex, AttachmentTypes? AttachmentType)
|
||||
{
|
||||
this.database = Database;
|
||||
database = Database;
|
||||
this.Version = Version;
|
||||
this.DeploymentChecksum = DeploymentChecksum;
|
||||
this.DocumentTemplateId = DocumentTemplateId;
|
||||
this.attachmentType = AttachmentType;
|
||||
attachmentType = AttachmentType;
|
||||
this.TargetId = TargetId;
|
||||
this.CreatorId = ActiveDirectory.ParseDomainAccountId(CreatorId);
|
||||
this.TimeStamp = TimeStamp;
|
||||
@@ -440,7 +440,7 @@ namespace Disco.Services.Documents
|
||||
|
||||
public static bool IsDocumentUniqueIdentifier(string Identifier)
|
||||
{
|
||||
return Identifier != null && Identifier.StartsWith("Disco|", System.StringComparison.OrdinalIgnoreCase);
|
||||
return Identifier != null && Identifier.StartsWith("Disco|", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public static bool IsDocumentUniqueIdentifier(byte[] Identifier)
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Documents;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services
|
||||
{
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
private DocumentTemplateDevicesManagedGroup(string Key, ADManagedGroupConfiguration Configuration, DocumentTemplate DocumentTemplate)
|
||||
: base(Key, Configuration)
|
||||
{
|
||||
this.DocumentTemplateId = DocumentTemplate.Id;
|
||||
this.DocumentTemplateDescription = DocumentTemplate.Description;
|
||||
this.DocumentTemplateScope = DocumentTemplate.Scope;
|
||||
DocumentTemplateId = DocumentTemplate.Id;
|
||||
DocumentTemplateDescription = DocumentTemplate.Description;
|
||||
DocumentTemplateScope = DocumentTemplate.Scope;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
@@ -160,7 +160,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
if (Configuration.FilterBeginDate.HasValue)
|
||||
{
|
||||
return Database.Devices
|
||||
.Where(d => d.DeviceDomainId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Where(d => d.DeviceDomainId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Select(d => d.DeviceDomainId)
|
||||
.ToList()
|
||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
||||
@@ -169,7 +169,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
else
|
||||
{
|
||||
return Database.Devices
|
||||
.Where(d => d.DeviceDomainId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId))
|
||||
.Where(d => d.DeviceDomainId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
||||
.Select(d => d.DeviceDomainId)
|
||||
.ToList()
|
||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
||||
@@ -179,7 +179,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
if (Configuration.FilterBeginDate.HasValue)
|
||||
{
|
||||
return Database.Jobs
|
||||
.Where(j => j.Device.DeviceDomainId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Where(j => j.Device.DeviceDomainId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Select(j => j.Device.DeviceDomainId)
|
||||
.Distinct()
|
||||
.ToList()
|
||||
@@ -189,7 +189,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
else
|
||||
{
|
||||
return Database.Jobs
|
||||
.Where(j => j.Device.DeviceDomainId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId))
|
||||
.Where(j => j.Device.DeviceDomainId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
||||
.Select(j => j.Device.DeviceDomainId)
|
||||
.Distinct()
|
||||
.ToList()
|
||||
@@ -200,7 +200,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
if (Configuration.FilterBeginDate.HasValue)
|
||||
{
|
||||
return Database.Users
|
||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.SelectMany(u => u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue && dua.Device.DeviceDomainId != null), (u, dua) => dua.Device.DeviceDomainId)
|
||||
.ToList()
|
||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
||||
@@ -209,7 +209,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
else
|
||||
{
|
||||
return Database.Users
|
||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId))
|
||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
||||
.SelectMany(u => u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue && dua.Device.DeviceDomainId != null), (u, dua) => dua.Device.DeviceDomainId)
|
||||
.ToList()
|
||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
||||
@@ -229,14 +229,14 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
{
|
||||
result = Database.Devices
|
||||
.Where(d => d.SerialNumber == DeviceSerialNumber && d.DeviceDomainId != null)
|
||||
.Select(d => Tuple.Create(d.DeviceDomainId, d.DeviceAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate)))
|
||||
.Select(d => Tuple.Create(d.DeviceDomainId, d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate)))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Database.Devices
|
||||
.Where(d => d.SerialNumber == DeviceSerialNumber && d.DeviceDomainId != null)
|
||||
.Select(d => Tuple.Create(d.DeviceDomainId, d.DeviceAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId)))
|
||||
.Select(d => Tuple.Create(d.DeviceDomainId, d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId)))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
.Select(j => new Tuple<string, string, bool>(
|
||||
j.Device.DeviceDomainId,
|
||||
j.Device.SerialNumber,
|
||||
j.Device.Jobs.Any(dj => dj.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))))
|
||||
j.Device.Jobs.Any(dj => dj.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
@@ -305,7 +305,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
.Select(j => new Tuple<string, string, bool>(
|
||||
j.Device.DeviceDomainId,
|
||||
j.Device.SerialNumber,
|
||||
j.Device.Jobs.Any(dj => dj.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId))))
|
||||
j.Device.Jobs.Any(dj => dj.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
result = Database.Users
|
||||
.Where(u => u.UserId == UserId)
|
||||
.Select(u => Tuple.Create(
|
||||
u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate),
|
||||
u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate),
|
||||
u.DeviceUserAssignments
|
||||
.Where(dua => !dua.UnassignedDate.HasValue && dua.Device.DeviceDomainId != null)
|
||||
.Select(dua => new Tuple<string, string>(dua.Device.DeviceDomainId, dua.Device.SerialNumber))))
|
||||
@@ -383,7 +383,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
result = Database.Users
|
||||
.Where(u => u.UserId == UserId)
|
||||
.Select(u => Tuple.Create(
|
||||
u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId),
|
||||
u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId),
|
||||
u.DeviceUserAssignments
|
||||
.Where(dua => !dua.UnassignedDate.HasValue && dua.Device.DeviceDomainId != null)
|
||||
.Select(dua => new Tuple<string, string>(dua.Device.DeviceDomainId, dua.Device.SerialNumber))))
|
||||
@@ -458,13 +458,13 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
{
|
||||
jobsHaveTemplate = e.Database.Jobs
|
||||
.Where(j => j.DeviceSerialNumber == deviceSerialNumber)
|
||||
.Any(j => j.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate));
|
||||
.Any(j => j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate));
|
||||
}
|
||||
else
|
||||
{
|
||||
jobsHaveTemplate = e.Database.Jobs
|
||||
.Where(j => j.DeviceSerialNumber == deviceSerialNumber)
|
||||
.Any(j => j.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId));
|
||||
.Any(j => j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId));
|
||||
}
|
||||
|
||||
if (jobsHaveTemplate)
|
||||
@@ -482,14 +482,14 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
userHasTemplate = e.Database.Devices
|
||||
.Where(d => d.SerialNumber == deviceSerialNumber)
|
||||
.Select(d => d.AssignedUser)
|
||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate));
|
||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate));
|
||||
}
|
||||
else
|
||||
{
|
||||
userHasTemplate = e.Database.Devices
|
||||
.Where(d => d.SerialNumber == deviceSerialNumber)
|
||||
.Select(d => d.AssignedUser)
|
||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId));
|
||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId));
|
||||
}
|
||||
|
||||
if (userHasTemplate)
|
||||
@@ -526,13 +526,13 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
if (Configuration.FilterBeginDate.HasValue)
|
||||
{
|
||||
previousUserHasTemplate = e.Database.Users
|
||||
.Where(u => u.UserId == devicePreviousAssignedUserId && u.UserAttachments.Any(ua => ua.DocumentTemplateId == this.DocumentTemplateId && ua.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Where(u => u.UserId == devicePreviousAssignedUserId && u.UserAttachments.Any(ua => ua.DocumentTemplateId == DocumentTemplateId && ua.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Any();
|
||||
}
|
||||
else
|
||||
{
|
||||
previousUserHasTemplate = e.Database.Users
|
||||
.Where(u => u.UserId == devicePreviousAssignedUserId && u.UserAttachments.Any(ua => ua.DocumentTemplateId == this.DocumentTemplateId))
|
||||
.Where(u => u.UserId == devicePreviousAssignedUserId && u.UserAttachments.Any(ua => ua.DocumentTemplateId == DocumentTemplateId))
|
||||
.Any();
|
||||
}
|
||||
}
|
||||
@@ -542,13 +542,13 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
if (Configuration.FilterBeginDate.HasValue)
|
||||
{
|
||||
currentUserHasTemplate = e.Database.Users
|
||||
.Where(u => u.UserId == deviceCurrentAssignedUserId && u.UserAttachments.Any(ua => ua.DocumentTemplateId == this.DocumentTemplateId && ua.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Where(u => u.UserId == deviceCurrentAssignedUserId && u.UserAttachments.Any(ua => ua.DocumentTemplateId == DocumentTemplateId && ua.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Any();
|
||||
}
|
||||
else
|
||||
{
|
||||
currentUserHasTemplate = e.Database.Users
|
||||
.Where(u => u.UserId == deviceCurrentAssignedUserId && u.UserAttachments.Any(ua => ua.DocumentTemplateId == this.DocumentTemplateId))
|
||||
.Where(u => u.UserId == deviceCurrentAssignedUserId && u.UserAttachments.Any(ua => ua.DocumentTemplateId == DocumentTemplateId))
|
||||
.Any();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
private DocumentTemplateUsersManagedGroup(string Key, ADManagedGroupConfiguration Configuration, DocumentTemplate DocumentTemplate)
|
||||
: base(Key, Configuration)
|
||||
{
|
||||
this.DocumentTemplateId = DocumentTemplate.Id;
|
||||
this.DocumentTemplateDescription = DocumentTemplate.Description;
|
||||
this.DocumentTemplateScope = DocumentTemplate.Scope;
|
||||
DocumentTemplateId = DocumentTemplate.Id;
|
||||
DocumentTemplateDescription = DocumentTemplate.Description;
|
||||
DocumentTemplateScope = DocumentTemplate.Scope;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
@@ -155,27 +155,27 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
if (Configuration.FilterBeginDate.HasValue)
|
||||
{
|
||||
return Database.Devices
|
||||
.Where(d => d.AssignedUserId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Where(d => d.AssignedUserId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Select(d => d.AssignedUserId);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Database.Devices
|
||||
.Where(d => d.AssignedUserId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId))
|
||||
.Where(d => d.AssignedUserId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
||||
.Select(d => d.AssignedUserId);
|
||||
}
|
||||
case DocumentTemplate.DocumentTemplateScopes.Job:
|
||||
if (Configuration.FilterBeginDate.HasValue)
|
||||
{
|
||||
return Database.Jobs
|
||||
.Where(j => j.UserId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Where(j => j.UserId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Select(j => j.UserId)
|
||||
.Distinct();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Database.Jobs
|
||||
.Where(j => j.UserId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId))
|
||||
.Where(j => j.UserId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
||||
.Select(j => j.UserId)
|
||||
.Distinct();
|
||||
}
|
||||
@@ -183,13 +183,13 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
if (Configuration.FilterBeginDate.HasValue)
|
||||
{
|
||||
return Database.Users
|
||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Select(u => u.UserId);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Database.Users
|
||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId))
|
||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
||||
.Select(u => u.UserId);
|
||||
}
|
||||
default:
|
||||
@@ -208,7 +208,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
.Where(d => d.SerialNumber == DeviceSerialNumber && d.AssignedUser != null)
|
||||
.Select(d => Tuple.Create(
|
||||
d.AssignedUserId,
|
||||
d.DeviceAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate)))
|
||||
d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate)))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
@@ -217,7 +217,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
.Where(d => d.SerialNumber == DeviceSerialNumber && d.AssignedUser != null)
|
||||
.Select(d => Tuple.Create(
|
||||
d.AssignedUserId,
|
||||
d.DeviceAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId)))
|
||||
d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId)))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
.Where(j => j.Id == JobId && j.UserId != null)
|
||||
.Select(j => Tuple.Create(
|
||||
j.UserId,
|
||||
j.User.Jobs.Any(uj => uj.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))))
|
||||
j.User.Jobs.Any(uj => uj.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
@@ -279,7 +279,7 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
.Where(j => j.Id == JobId && j.UserId != null)
|
||||
.Select(j => Tuple.Create(
|
||||
j.UserId,
|
||||
j.User.Jobs.Any(uj => uj.JobAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId))))
|
||||
j.User.Jobs.Any(uj => uj.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
@@ -328,13 +328,13 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
{
|
||||
return Database.Users
|
||||
.Where(u => u.UserId == UserId)
|
||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate));
|
||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate));
|
||||
}
|
||||
else
|
||||
{
|
||||
return Database.Users
|
||||
.Where(u => u.UserId == UserId)
|
||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == this.DocumentTemplateId));
|
||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,13 +369,13 @@ namespace Disco.Services.Documents.ManagedGroups
|
||||
if (Configuration.FilterBeginDate.HasValue)
|
||||
{
|
||||
relevantDevice = Event.Database.Devices
|
||||
.Where(d => d.SerialNumber == deviceSerialNumber && d.DeviceAttachments.Any(ja => ja.DocumentTemplateId == this.DocumentTemplateId && ja.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Where(d => d.SerialNumber == deviceSerialNumber && d.DeviceAttachments.Any(ja => ja.DocumentTemplateId == DocumentTemplateId && ja.Timestamp >= Configuration.FilterBeginDate))
|
||||
.Any();
|
||||
}
|
||||
else
|
||||
{
|
||||
relevantDevice = Event.Database.Devices
|
||||
.Where(d => d.SerialNumber == deviceSerialNumber && d.DeviceAttachments.Any(ja => ja.DocumentTemplateId == this.DocumentTemplateId))
|
||||
.Where(d => d.SerialNumber == deviceSerialNumber && d.DeviceAttachments.Any(ja => ja.DocumentTemplateId == DocumentTemplateId))
|
||||
.Any();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user