From 5792771ea16c19391ee236bf928051b6c5dbdf3e Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Sun, 20 Jul 2025 13:47:56 +1000 Subject: [PATCH] qol: formatting --- Disco.Client/ErrorReporting.cs | 6 +- .../Extensions/ClientServicesExtensions.cs | 10 +- Disco.Client/Extensions/WhoAmIExtensions.cs | 4 +- .../Interop/Native/WLAN_PROFILE_INFO_LIST.cs | 2 +- Disco.Client/Interop/Network.cs | 2 +- Disco.Client/Presentation.cs | 6 +- Disco.Client/Program.cs | 6 +- Disco.ClientBootstrapper/BootstrapperLoop.cs | 20 +- .../Interop/CertificateInterop.cs | 2 +- .../Interop/InstallInterop.cs | 6 +- .../Interop/NetworkAdapter.cs | 8 +- .../Interop/NetworkInterop.cs | 2 +- .../Interop/RegistryInterop.cs | 2 +- .../Interop/WIMInterop.cs | 5 +- Disco.ClientBootstrapper/Program.cs | 21 +- .../Modules/ActiveDirectoryConfiguration.cs | 3 +- .../Configuration/SystemConfiguration.cs | 2 +- .../DiscoDatabaseConnectionFactory.cs | 6 +- .../Repository/Monitor/RepositoryMonitor.cs | 10 +- .../Monitor/RepositoryMonitorEvent.cs | 3 +- .../EnrolmentInformation/ComputerSystem.cs | 2 +- .../EnrolmentInformation/NetworkAdapter.cs | 2 +- Disco.Models/ClientServices/MacEnrol.cs | 2 +- .../ClientServices/MacEnrolResponse.cs | 2 +- .../ClientServices/MacSecureEnrolResponse.cs | 2 +- Disco.Models/Repository/Device/Device.cs | 4 +- .../Repository/Device/DeviceComment.cs | 4 +- .../Repository/Device/DeviceComponent.cs | 4 +- .../Repository/Device/DeviceDetail.cs | 6 +- .../Repository/Device/DeviceProfile.cs | 2 +- Disco.Models/Repository/Job/Job.cs | 2 +- Disco.Models/Repository/Job/JobAttachment.cs | 2 +- Disco.Models/Repository/Job/JobComponent.cs | 4 +- Disco.Models/Repository/Job/JobLog.cs | 4 +- .../Job/JobMeta/JobMetaInsurance.cs | 2 +- .../Repository/Job/JobMeta/JobMetaWarranty.cs | 2 +- Disco.Models/Repository/Job/JobType.cs | 2 +- .../Repository/Job/Queue/JobQueueJob.cs | 4 +- Disco.Models/Repository/User/User.cs | 2 +- Disco.Models/Repository/User/UserComment.cs | 4 +- Disco.Models/Repository/User/UserDetail.cs | 4 +- .../Devices/Importing/IDeviceImportField.cs | 2 +- .../Documents/DocumentExportRecord.cs | 2 +- .../DiscoServices/PluginIncompatibility.cs | 2 +- .../Services/Users/Contact/UserContact.cs | 2 +- Disco.Models/UI/User/UserShowModel.cs | 2 +- .../App_Start/RazorGeneratorMvcStart.cs | 14 +- .../Authorization/AuthorizationLog.cs | 2 +- .../Authorization/AuthorizationToken.cs | 4 +- .../Authorization/ClaimNavigatorItem.cs | 20 +- .../Authorization/DiscoAuthorizeAttribute.cs | 7 +- .../DocumentTemplateClaims.cs | 2 +- .../Configuration/System/SystemClaims.cs | 2 +- .../Roles/ClaimGroups/Job/JobListsClaims.cs | 4 +- .../Roles/ClaimGroups/Job/JobTypesClaims.cs | 2 +- .../Authorization/Roles/RoleCache.cs | 8 +- .../Authorization/Roles/RoleToken.cs | 6 +- .../DeviceFlagDevicesManagedGroup.cs | 2 +- .../Devices/DeviceFlags/DeviceFlagService.cs | 2 +- .../DeviceFlags/DeviceFlagsDeleteTask.cs | 2 +- .../Devices/Enrolment/EnrolmentLog.cs | 2 +- .../Fields/DetailACAdapterImportField.cs | 2 +- .../Fields/DetailWLanMacAddressImportField.cs | 2 +- .../DeviceBatchAssignedUsersManagedGroup.cs | 2 +- .../DeviceProfileAssignedUsersManagedGroup.cs | 2 +- .../DeviceProfileDevicesManagedGroup.cs | 2 +- .../Documents/AttachmentImport/Importer.cs | 2 +- Disco.Services/Documents/DocumentExport.cs | 2 +- .../Expressions/EvaluateExpressionPart.cs | 5 +- .../BitmapImageExpressionResult.cs | 4 +- .../FileMontageImageExpressionResult.cs | 3 +- Disco.Services/Expressions/IExpressionPart.cs | 12 +- .../Extensions/EnumerableExtensions.cs | 2 +- .../Extensions/ImagingExtensions.cs | 2 +- .../ADNetworkLogonDatesUpdateTask.cs | 2 +- .../ActiveDirectoryGroupCache.cs | 2 +- .../ActiveDirectoryManagedGroups.cs | 6 +- .../Interop/ActiveDirectory/IADObject.cs | 2 +- .../Interop/DiscoServices/UpdateQuery.cs | 2 +- Disco.Services/Jobs/JobExtensions.cs | 2 +- .../Jobs/JobLists/JobTableExtensions.cs | 2 +- .../Jobs/JobQueues/JobQueueDeleteTask.cs | 2 +- Disco.Services/Jobs/JobUpdatesHub.cs | 2 +- .../Jobs/Noticeboards/HeldDevices.cs | 2 +- Disco.Services/Logging/LogContext.cs | 16 +- Disco.Services/Logging/LogReInitalizeJob.cs | 4 +- Disco.Services/Logging/Models/LogEvent.cs | 2 +- Disco.Services/Logging/Models/LogEventType.cs | 8 +- Disco.Services/Logging/Models/LogLiveEvent.cs | 4 +- Disco.Services/Logging/Utilities.cs | 8 +- .../DetailsProvider/DetailsProviderService.cs | 3 +- .../RepairProvider/RepairProviderFeature.cs | 4 +- .../UIExtension/UIExtensionFeature.cs | 9 +- .../Features/UIExtension/UIExtensionResult.cs | 2 +- .../Features/UIExtension/UIExtensions.cs | 4 +- .../WarrantyProviderFeature.cs | 8 +- Disco.Services/Plugins/InstallPluginTask.cs | 2 +- Disco.Services/Plugins/Plugin.cs | 6 +- .../Plugins/PluginConfigurationHandler.cs | 4 +- Disco.Services/Plugins/PluginExtensions.cs | 16 +- Disco.Services/Plugins/PluginFeature.cs | 6 +- .../Plugins/PluginFeatureManifest.cs | 6 +- Disco.Services/Plugins/PluginManifest.cs | 12 +- Disco.Services/Plugins/PluginWebViewPage.cs | 5 +- Disco.Services/Plugins/PluginsLog.cs | 486 +++++++++--------- Disco.Services/Plugins/UpdatePluginTask.cs | 3 +- Disco.Services/Tasks/IScheduledTaskStatus.cs | 4 +- .../Tasks/ScheduledTaskNotificationsHub.cs | 2 +- Disco.Services/Tasks/ScheduledTasks.cs | 8 +- Disco.Services/Tasks/ScheduledTasksLog.cs | 204 ++++---- .../Users/UserFlags/UserFlagService.cs | 2 +- .../Users/UserFlags/UserFlagsDeleteTask.cs | 2 +- .../Web/AuthorizedDatabaseController.cs | 4 +- .../Web/Bundles/BundleExtensions.cs | 2 +- Disco.Services/Web/Bundles/UrlBundle.cs | 2 +- Disco.Services/Web/HelperExtensions.cs | 2 +- .../BIModelExtensions/PluginExtensions.cs | 4 +- .../DeviceBatchExtensions.cs | 4 +- .../DeviceModelExtensions.cs | 4 +- .../DeviceProfileExtensions.cs | 4 +- .../JobSubTypeExtensions.cs | 4 +- .../DataModelExtension/JobTypeExtensions.cs | 4 +- .../MvcExtensions/JsonNet/JsonNetResult.cs | 4 +- .../PartialCompiledHtmlExtensions.cs | 8 +- .../RazorExtensions/DropDownListExtensions.cs | 2 +- Disco.Web/App_Start/RazorGeneratorMvcStart.cs | 2 +- .../API/Controllers/DeviceBatchController.cs | 8 +- .../Controllers/DocumentTemplateController.cs | 5 +- .../API/Controllers/JobQueueJobController.cs | 6 +- .../Areas/API/Controllers/PluginController.cs | 2 +- .../Areas/API/Controllers/UserController.cs | 2 +- .../DocumentTemplate/DocumentHandlersModel.cs | 2 +- .../Areas/API/Models/Logs/LogModuleModel.cs | 4 +- .../Areas/Config/ConfigAreaRegistration.cs | 2 +- .../Config/Controllers/PluginsController.cs | 8 +- .../Models/AuthorizationRole/IndexModel.cs | 4 +- .../Config/Models/DeviceBatch/IndexModel.cs | 6 +- .../Config/Models/DeviceBatch/ShowModel.cs | 2 +- .../Models/DeviceBatch/_IndexModelItem.cs | 4 +- .../Config/Models/DeviceModel/IndexModel.cs | 6 +- .../Models/DocumentTemplate/CreateModel.cs | 8 +- .../DocumentTemplate/CreatePackageModel.cs | 2 +- .../DocumentTemplate/UndetectedPagesModel.cs | 2 +- .../Areas/Config/Models/Logging/IndexModel.cs | 4 +- .../Config/Models/Organisation/IndexModel.cs | 8 +- .../Config/Models/Plugins/IndexViewModel.cs | 2 +- .../Config/Models/Shared/LinkedGroupModel.cs | 2 +- .../Config/Models/SystemConfig/IndexModel.cs | 2 +- .../UserHeldDevices/HeldJobDeviceModel.cs | 16 +- .../Controllers/InitialConfigController.cs | 3 +- .../Controllers/PluginWebHandlerController.cs | 10 +- Disco.Web/Models/Device/AddOfflineModel.cs | 4 +- .../Models/InitialConfig/DatabaseModel.cs | 2 +- Disco.Web/Models/Job/IndexModel.cs | 2 +- Disco.Web/Models/Job/LogInsuranceModel.cs | 2 +- Disco.Web/Models/Job/LogWarrantyModel.cs | 3 +- Disco.Web/Models/Search/QueryModel.cs | 4 +- Disco.Web/Models/Shared/ExportFieldsModel.cs | 2 +- 158 files changed, 693 insertions(+), 679 deletions(-) diff --git a/Disco.Client/ErrorReporting.cs b/Disco.Client/ErrorReporting.cs index c18eb604..813f267d 100644 --- a/Disco.Client/ErrorReporting.cs +++ b/Disco.Client/ErrorReporting.cs @@ -1,10 +1,10 @@ -using System; +using Disco.Client.Extensions; +using Newtonsoft.Json; +using System; using System.Diagnostics; using System.IO; using System.Net; using System.Reflection; -using Disco.Client.Extensions; -using Newtonsoft.Json; namespace Disco.Client { diff --git a/Disco.Client/Extensions/ClientServicesExtensions.cs b/Disco.Client/Extensions/ClientServicesExtensions.cs index 3649e3b5..bd4e8ffc 100644 --- a/Disco.Client/Extensions/ClientServicesExtensions.cs +++ b/Disco.Client/Extensions/ClientServicesExtensions.cs @@ -8,13 +8,13 @@ namespace Disco.Client.Extensions { public static class ClientServicesExtensions { -//#if DEBUG -// public const string ServicePathAuthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Authenticated/{0}"; -// public const string ServicePathUnauthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Unauthenticated/{0}"; -//#else + //#if DEBUG + // public const string ServicePathAuthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Authenticated/{0}"; + // public const string ServicePathUnauthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Unauthenticated/{0}"; + //#else public const string ServicePathAuthenticatedTemplate = "http://DISCO:9292/Services/Client/Authenticated/{0}"; public const string ServicePathUnauthenticatedTemplate = "http://DISCO:9292/Services/Client/Unauthenticated/{0}"; -//#endif + //#endif public static ResponseType Post(this ServiceBase Service, bool Authenticated) { diff --git a/Disco.Client/Extensions/WhoAmIExtensions.cs b/Disco.Client/Extensions/WhoAmIExtensions.cs index 9e2d2aa6..fe9a3017 100644 --- a/Disco.Client/Extensions/WhoAmIExtensions.cs +++ b/Disco.Client/Extensions/WhoAmIExtensions.cs @@ -1,5 +1,5 @@ -using System.Text; -using Disco.Models.ClientServices; +using Disco.Models.ClientServices; +using System.Text; namespace Disco.Client.Extensions { diff --git a/Disco.Client/Interop/Native/WLAN_PROFILE_INFO_LIST.cs b/Disco.Client/Interop/Native/WLAN_PROFILE_INFO_LIST.cs index f843de70..8f4d3f0f 100644 --- a/Disco.Client/Interop/Native/WLAN_PROFILE_INFO_LIST.cs +++ b/Disco.Client/Interop/Native/WLAN_PROFILE_INFO_LIST.cs @@ -10,7 +10,7 @@ namespace Disco.Client.Interop.Native /// The number of wireless profile entries in the ProfileInfo member. /// public uint dwNumberOfItems; - + /// /// The index of the current item. The index of the first item is 0. The dwIndex member must be less than the dwNumberOfItems member. /// This member is not used by the wireless service. Applications can use this member when processing individual profiles in the diff --git a/Disco.Client/Interop/Network.cs b/Disco.Client/Interop/Network.cs index e3a15da5..c9807bc1 100644 --- a/Disco.Client/Interop/Network.cs +++ b/Disco.Client/Interop/Network.cs @@ -21,7 +21,7 @@ namespace Disco.Client.Interop return adapters; } - + private static List GetWmiNetworkAdapters() { try diff --git a/Disco.Client/Presentation.cs b/Disco.Client/Presentation.cs index 3440e17a..7b121492 100644 --- a/Disco.Client/Presentation.cs +++ b/Disco.Client/Presentation.cs @@ -1,9 +1,9 @@ -using System; +using Disco.Client.Extensions; +using Disco.Client.Interop; +using System; using System.Reflection; using System.Text; using System.Threading; -using Disco.Client.Extensions; -using Disco.Client.Interop; namespace Disco.Client { diff --git a/Disco.Client/Program.cs b/Disco.Client/Program.cs index ae7b4707..807d3efb 100644 --- a/Disco.Client/Program.cs +++ b/Disco.Client/Program.cs @@ -1,8 +1,8 @@ -using System; +using Disco.Client.Extensions; +using Disco.Models.ClientServices; +using System; using System.Linq; using System.Net; -using Disco.Models.ClientServices; -using Disco.Client.Extensions; namespace Disco.Client { diff --git a/Disco.ClientBootstrapper/BootstrapperLoop.cs b/Disco.ClientBootstrapper/BootstrapperLoop.cs index e3777408..79a4ab7d 100644 --- a/Disco.ClientBootstrapper/BootstrapperLoop.cs +++ b/Disco.ClientBootstrapper/BootstrapperLoop.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; +using System.Diagnostics; +using System.IO; using System.Linq; +using System.Net; using System.Text; using System.Threading; -using System.Net; -using System.IO; -using System.Diagnostics; namespace Disco.ClientBootstrapper { @@ -20,13 +20,13 @@ namespace Disco.ClientBootstrapper private StringBuilder errorMessage; private Process clientProcess; -//#if DEBUG -// public const string DiscoServerName = "WS-GSHARP"; -// public const int DiscoServerPort = 57252; -//#else + //#if DEBUG + // public const string DiscoServerName = "WS-GSHARP"; + // public const int DiscoServerPort = 57252; + //#else public const string DiscoServerName = "DISCO"; public const int DiscoServerPort = 9292; -//#endif + //#endif public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback) { @@ -128,8 +128,8 @@ namespace Disco.ClientBootstrapper break; } } - } - + } + if (!Interop.NetworkInterop.PingDiscoIct(DiscoServerName)) { // Client Failed diff --git a/Disco.ClientBootstrapper/Interop/CertificateInterop.cs b/Disco.ClientBootstrapper/Interop/CertificateInterop.cs index 822b91cb..2466ad9e 100644 --- a/Disco.ClientBootstrapper/Interop/CertificateInterop.cs +++ b/Disco.ClientBootstrapper/Interop/CertificateInterop.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Text.RegularExpressions; -using System.IO; namespace Disco.ClientBootstrapper.Interop { diff --git a/Disco.ClientBootstrapper/Interop/InstallInterop.cs b/Disco.ClientBootstrapper/Interop/InstallInterop.cs index db328475..3f180022 100644 --- a/Disco.ClientBootstrapper/Interop/InstallInterop.cs +++ b/Disco.ClientBootstrapper/Interop/InstallInterop.cs @@ -66,7 +66,7 @@ namespace Disco.ClientBootstrapper.Interop foreach (var file in Directory.EnumerateFiles(SourceLocation)) { var fileName = Path.GetFileName(file); - + // Only Copy Certain Files // Copy Wireless Certificates @@ -79,7 +79,7 @@ namespace Disco.ClientBootstrapper.Interop if (fileName.StartsWith("WLAN_Profile_", StringComparison.OrdinalIgnoreCase) && fileName.EndsWith(".xml", StringComparison.OrdinalIgnoreCase)) File.Copy(file, Path.Combine(InstallLocation, fileName)); - + } #endregion @@ -340,7 +340,7 @@ namespace Disco.ClientBootstrapper.Interop var progress = eventArgs.WideParameter.ToInt32(); Program.Status.UpdateStatus(null, null, $"Time remaining: {timeRemainingMessage}", true, progress); - + break; default: break; diff --git a/Disco.ClientBootstrapper/Interop/NetworkAdapter.cs b/Disco.ClientBootstrapper/Interop/NetworkAdapter.cs index 8c446b2e..d9b18f7f 100644 --- a/Disco.ClientBootstrapper/Interop/NetworkAdapter.cs +++ b/Disco.ClientBootstrapper/Interop/NetworkAdapter.cs @@ -40,14 +40,16 @@ namespace Disco.ClientBootstrapper.Interop { var wirelessConnectionStatus = WirelessConnectionStatus; } - catch (Exception) { + catch (Exception) + { IsWireless = false; - }; + } } public int WirelessConnectionStatus { - get { + get + { if (IsWireless) { IntPtr handle = IntPtr.Zero; diff --git a/Disco.ClientBootstrapper/Interop/NetworkInterop.cs b/Disco.ClientBootstrapper/Interop/NetworkInterop.cs index 92251fce..a3275eed 100644 --- a/Disco.ClientBootstrapper/Interop/NetworkInterop.cs +++ b/Disco.ClientBootstrapper/Interop/NetworkInterop.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Net.NetworkInformation; using System.Management; +using System.Net.NetworkInformation; using System.Runtime.InteropServices; using System.Xml; diff --git a/Disco.ClientBootstrapper/Interop/RegistryInterop.cs b/Disco.ClientBootstrapper/Interop/RegistryInterop.cs index e8111704..14f1297f 100644 --- a/Disco.ClientBootstrapper/Interop/RegistryInterop.cs +++ b/Disco.ClientBootstrapper/Interop/RegistryInterop.cs @@ -30,7 +30,7 @@ namespace Disco.ClientBootstrapper.Interop private static extern int LookupPrivilegeValue(string lpsystemname, string lpname, [MarshalAs(UnmanagedType.Struct)] ref LUID lpLuid); [DllImport("advapi32.dll", CharSet = CharSet.Auto)] - private static extern int AdjustTokenPrivileges(int tokenhandle, int disableprivs, [MarshalAs(UnmanagedType.Struct)]ref TOKEN_PRIVILEGES Newstate, int bufferlength, int PreivousState, int Returnlength); + private static extern int AdjustTokenPrivileges(int tokenhandle, int disableprivs, [MarshalAs(UnmanagedType.Struct)] ref TOKEN_PRIVILEGES Newstate, int bufferlength, int PreivousState, int Returnlength); [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern int RegLoadKey(uint hKey, string lpSubKey, string lpFile); diff --git a/Disco.ClientBootstrapper/Interop/WIMInterop.cs b/Disco.ClientBootstrapper/Interop/WIMInterop.cs index 81a3a9db..bb8bbe6e 100644 --- a/Disco.ClientBootstrapper/Interop/WIMInterop.cs +++ b/Disco.ClientBootstrapper/Interop/WIMInterop.cs @@ -649,7 +649,8 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop ///Private null constructor /// private - NativeMethods() { } + NativeMethods() + { } [DllImport("Wimgapi.dll", ExactSpelling = true, EntryPoint = "WIMCreateFile", @@ -1435,7 +1436,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop ///Abort. /// Abort = NativeMethods.WIMMessage.WIM_MSG_ABORT_IMAGE, - + MountCleanupProgress = NativeMethods.WIMMessage.WIM_MSG_MOUNT_CLEANUP_PROGRESS } diff --git a/Disco.ClientBootstrapper/Program.cs b/Disco.ClientBootstrapper/Program.cs index ca75c1d5..4ab0def5 100644 --- a/Disco.ClientBootstrapper/Program.cs +++ b/Disco.ClientBootstrapper/Program.cs @@ -118,18 +118,17 @@ namespace Disco.ClientBootstrapper SleepThread(4000, true); Interop.ShutdownInterop.Shutdown(); } + else if (PostBootstrapperActions.Contains("Reboot")) + { + Status.UpdateStatus("System Preparation (Bootstrapper)", "Rebooting; Finished...", string.Empty, false, 0); + SleepThread(4000, true); + Interop.ShutdownInterop.Reboot(); + } else - if (PostBootstrapperActions.Contains("Reboot")) - { - Status.UpdateStatus("System Preparation (Bootstrapper)", "Rebooting; Finished...", string.Empty, false, 0); - SleepThread(4000, true); - Interop.ShutdownInterop.Reboot(); - } - else - { - Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0); - SleepThread(2000, true); - } + { + Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0); + SleepThread(2000, true); + } } else { diff --git a/Disco.Data/Configuration/Modules/ActiveDirectoryConfiguration.cs b/Disco.Data/Configuration/Modules/ActiveDirectoryConfiguration.cs index 6736c8f6..2d7a8d93 100644 --- a/Disco.Data/Configuration/Modules/ActiveDirectoryConfiguration.cs +++ b/Disco.Data/Configuration/Modules/ActiveDirectoryConfiguration.cs @@ -35,7 +35,8 @@ namespace Disco.Data.Configuration.Modules public bool? SearchAllServers { - get { + get + { var value = Get(null); /// migrate diff --git a/Disco.Data/Configuration/SystemConfiguration.cs b/Disco.Data/Configuration/SystemConfiguration.cs index 71536be6..fdff44b1 100644 --- a/Disco.Data/Configuration/SystemConfiguration.cs +++ b/Disco.Data/Configuration/SystemConfiguration.cs @@ -58,7 +58,7 @@ namespace Disco.Data.Configuration if (result == null) { var appDataPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data"); - + if (!appDataPath.EndsWith(@"\")) appDataPath += @"\"; diff --git a/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs b/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs index e3f3a764..50ba0446 100644 --- a/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs +++ b/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs @@ -1,7 +1,7 @@ -using System; -using System.Data.Entity.Infrastructure; -using Microsoft.Win32; +using Microsoft.Win32; +using System; using System.Data.Common; +using System.Data.Entity.Infrastructure; using System.Security; namespace Disco.Data.Repository diff --git a/Disco.Data/Repository/Monitor/RepositoryMonitor.cs b/Disco.Data/Repository/Monitor/RepositoryMonitor.cs index 85c0d1d5..5cd54be5 100644 --- a/Disco.Data/Repository/Monitor/RepositoryMonitor.cs +++ b/Disco.Data/Repository/Monitor/RepositoryMonitor.cs @@ -1,11 +1,11 @@ -using System; +using Disco.Models.Repository; +using System; +using System.Collections.Concurrent; using System.Collections.Generic; +using System.Data.Entity.Infrastructure; +using System.Data.Objects; using System.Linq; using System.Reactive.Subjects; -using System.Data.Entity.Infrastructure; -using System.Collections.Concurrent; -using System.Data.Objects; -using Disco.Models.Repository; namespace Disco.Data.Repository.Monitor { diff --git a/Disco.Data/Repository/Monitor/RepositoryMonitorEvent.cs b/Disco.Data/Repository/Monitor/RepositoryMonitorEvent.cs index 1be8d49b..e55a2bd0 100644 --- a/Disco.Data/Repository/Monitor/RepositoryMonitorEvent.cs +++ b/Disco.Data/Repository/Monitor/RepositoryMonitorEvent.cs @@ -52,7 +52,8 @@ namespace Disco.Data.Repository.Monitor return (T)dbEntityState.CurrentValues[PropertyName]; } - public void ExecuteAfterCommit(Action action){ + public void ExecuteAfterCommit(Action action) + { if (afterCommit) { // Execute Immediately diff --git a/Disco.Models/ClientServices/EnrolmentInformation/ComputerSystem.cs b/Disco.Models/ClientServices/EnrolmentInformation/ComputerSystem.cs index b70c9a43..acd610a6 100644 --- a/Disco.Models/ClientServices/EnrolmentInformation/ComputerSystem.cs +++ b/Disco.Models/ClientServices/EnrolmentInformation/ComputerSystem.cs @@ -3,7 +3,7 @@ public class ComputerSystem { public string ChassisSKUNumber { get; set; } - public short? CurrentTimeZone { get; set;} + public short? CurrentTimeZone { get; set; } public string Description { get; set; } public string[] OEMStringArray { get; set; } public string PCSystemType { get; set; } diff --git a/Disco.Models/ClientServices/EnrolmentInformation/NetworkAdapter.cs b/Disco.Models/ClientServices/EnrolmentInformation/NetworkAdapter.cs index ace2e025..8dc57265 100644 --- a/Disco.Models/ClientServices/EnrolmentInformation/NetworkAdapter.cs +++ b/Disco.Models/ClientServices/EnrolmentInformation/NetworkAdapter.cs @@ -19,7 +19,7 @@ namespace Disco.Models.ClientServices.EnrolmentInformation public string WlanStatus { get; set; } public bool NetEnabled { get; set; } public bool IPEnabled { get; set; } - + public List IPAddresses { get; set; } } } diff --git a/Disco.Models/ClientServices/MacEnrol.cs b/Disco.Models/ClientServices/MacEnrol.cs index b6a3281d..e3d41eeb 100644 --- a/Disco.Models/ClientServices/MacEnrol.cs +++ b/Disco.Models/ClientServices/MacEnrol.cs @@ -11,7 +11,7 @@ public string DeviceUUID { get; set; } public string DeviceComputerName { get; set; } - + public string DeviceManufacturer { get; set; } public string DeviceModel { get; set; } public string DeviceModelType { get; set; } diff --git a/Disco.Models/ClientServices/MacEnrolResponse.cs b/Disco.Models/ClientServices/MacEnrolResponse.cs index d6bff405..3ccdd05a 100644 --- a/Disco.Models/ClientServices/MacEnrolResponse.cs +++ b/Disco.Models/ClientServices/MacEnrolResponse.cs @@ -3,7 +3,7 @@ public class MacEnrolResponse { public string DeviceComputerName { get; set; } - + public string DeviceAssignedUserDomain { get; set; } public string DeviceAssignedUserName { get; set; } public string DeviceAssignedUserSID { get; set; } diff --git a/Disco.Models/ClientServices/MacSecureEnrolResponse.cs b/Disco.Models/ClientServices/MacSecureEnrolResponse.cs index a48cf714..f590b20b 100644 --- a/Disco.Models/ClientServices/MacSecureEnrolResponse.cs +++ b/Disco.Models/ClientServices/MacSecureEnrolResponse.cs @@ -3,7 +3,7 @@ public class MacSecureEnrolResponse { public string DeviceComputerName { get; set; } - + public string DeviceAssignedUserDomain { get; set; } public string DeviceAssignedUserName { get; set; } public string DeviceAssignedUserSID { get; set; } diff --git a/Disco.Models/Repository/Device/Device.cs b/Disco.Models/Repository/Device/Device.cs index 0319be17..aee48001 100644 --- a/Disco.Models/Repository/Device/Device.cs +++ b/Disco.Models/Repository/Device/Device.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; namespace Disco.Models.Repository { @@ -51,7 +51,7 @@ namespace Disco.Models.Repository [InverseProperty(nameof(Job.Device))] public virtual IList Jobs { get; set; } public virtual IList DeviceFlagAssignments { get; set; } - + [InverseProperty(nameof(DeviceComment.Device))] public virtual IList DeviceComments { get; set; } diff --git a/Disco.Models/Repository/Device/DeviceComment.cs b/Disco.Models/Repository/Device/DeviceComment.cs index 35ec6d43..c757f3e8 100644 --- a/Disco.Models/Repository/Device/DeviceComment.cs +++ b/Disco.Models/Repository/Device/DeviceComment.cs @@ -15,10 +15,10 @@ namespace Disco.Models.Repository public DateTime Timestamp { get; set; } [Required] public string Comments { get; set; } - + [ForeignKey(nameof(DeviceSerialNumber))] public Device Device { get; set; } - + [ForeignKey(nameof(TechUserId))] public User TechUser { get; set; } } diff --git a/Disco.Models/Repository/Device/DeviceComponent.cs b/Disco.Models/Repository/Device/DeviceComponent.cs index 4022f551..0adecd11 100644 --- a/Disco.Models/Repository/Device/DeviceComponent.cs +++ b/Disco.Models/Repository/Device/DeviceComponent.cs @@ -12,10 +12,10 @@ namespace Disco.Models.Repository [StringLength(100)] public string Description { get; set; } public decimal Cost { get; set; } - + [ForeignKey("DeviceModelId")] public virtual DeviceModel DeviceModel { get; set; } - + public virtual IList JobSubTypes { get; set; } } } diff --git a/Disco.Models/Repository/Device/DeviceDetail.cs b/Disco.Models/Repository/Device/DeviceDetail.cs index 09e825f8..348ed125 100644 --- a/Disco.Models/Repository/Device/DeviceDetail.cs +++ b/Disco.Models/Repository/Device/DeviceDetail.cs @@ -24,13 +24,13 @@ namespace Disco.Models.Repository [Column(Order = 0), Key] public string DeviceSerialNumber { get; set; } - + [Key, StringLength(100), Column(Order = 2)] public string Key { get; set; } - + [Column(Order = 1), StringLength(100), Key] public string Scope { get; set; } - + public string Value { get; set; } [ForeignKey("DeviceSerialNumber")] diff --git a/Disco.Models/Repository/Device/DeviceProfile.cs b/Disco.Models/Repository/Device/DeviceProfile.cs index dc870cca..1e4c09e3 100644 --- a/Disco.Models/Repository/Device/DeviceProfile.cs +++ b/Disco.Models/Repository/Device/DeviceProfile.cs @@ -23,7 +23,7 @@ namespace Disco.Models.Repository // 2012-06-14 G# [Required, DataType(DataType.MultilineText)] public string ComputerNameTemplate { get; set; } - + [Required] public DistributionTypes? DistributionType { get; set; } diff --git a/Disco.Models/Repository/Job/Job.cs b/Disco.Models/Repository/Job/Job.cs index 92860329..01465654 100644 --- a/Disco.Models/Repository/Job/Job.cs +++ b/Disco.Models/Repository/Job/Job.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; namespace Disco.Models.Repository { diff --git a/Disco.Models/Repository/Job/JobAttachment.cs b/Disco.Models/Repository/Job/JobAttachment.cs index 690154be..b37ac07c 100644 --- a/Disco.Models/Repository/Job/JobAttachment.cs +++ b/Disco.Models/Repository/Job/JobAttachment.cs @@ -41,6 +41,6 @@ namespace Disco.Models.Repository public virtual User TechUser { get; set; } [ForeignKey("DocumentTemplateId")] - public virtual DocumentTemplate DocumentTemplate { get; set; } + public virtual DocumentTemplate DocumentTemplate { get; set; } } } diff --git a/Disco.Models/Repository/Job/JobComponent.cs b/Disco.Models/Repository/Job/JobComponent.cs index aa614f38..3b78a4b9 100644 --- a/Disco.Models/Repository/Job/JobComponent.cs +++ b/Disco.Models/Repository/Job/JobComponent.cs @@ -14,10 +14,10 @@ namespace Disco.Models.Repository [StringLength(500)] public string Description { get; set; } public decimal Cost { get; set; } - + [ForeignKey("JobId")] public virtual Job Job { get; set; } - + [ForeignKey("TechUserId")] public virtual User TechUser { get; set; } } diff --git a/Disco.Models/Repository/Job/JobLog.cs b/Disco.Models/Repository/Job/JobLog.cs index c677aa51..4eb081de 100644 --- a/Disco.Models/Repository/Job/JobLog.cs +++ b/Disco.Models/Repository/Job/JobLog.cs @@ -15,10 +15,10 @@ namespace Disco.Models.Repository public DateTime Timestamp { get; set; } [Required] public string Comments { get; set; } - + [ForeignKey("JobId")] public Job Job { get; set; } - + [ForeignKey("TechUserId")] public User TechUser { get; set; } } diff --git a/Disco.Models/Repository/Job/JobMeta/JobMetaInsurance.cs b/Disco.Models/Repository/Job/JobMeta/JobMetaInsurance.cs index 0793891b..dd3a3688 100644 --- a/Disco.Models/Repository/Job/JobMeta/JobMetaInsurance.cs +++ b/Disco.Models/Repository/Job/JobMeta/JobMetaInsurance.cs @@ -59,7 +59,7 @@ namespace Disco.Models.Repository public string Insurer { get; set; } [StringLength(200)] public string InsurerReference { get; set; } - + [Required, ForeignKey("JobId")] public virtual Job Job { get; set; } diff --git a/Disco.Models/Repository/Job/JobMeta/JobMetaWarranty.cs b/Disco.Models/Repository/Job/JobMeta/JobMetaWarranty.cs index 1393da1e..46cfa0a4 100644 --- a/Disco.Models/Repository/Job/JobMeta/JobMetaWarranty.cs +++ b/Disco.Models/Repository/Job/JobMeta/JobMetaWarranty.cs @@ -17,7 +17,7 @@ namespace Disco.Models.Repository public string ExternalReference { get; set; } [DisplayFormat(ApplyFormatInEditMode = true, ConvertEmptyStringToNull = true, DataFormatString = "{0:yyyy/MM/dd hh:mm tt}", HtmlEncode = false)] public DateTime? ExternalCompletedDate { get; set; } - + [ForeignKey("JobId"), Required] public virtual Job Job { get; set; } } diff --git a/Disco.Models/Repository/Job/JobType.cs b/Disco.Models/Repository/Job/JobType.cs index 1f7504f6..7f9279b4 100644 --- a/Disco.Models/Repository/Job/JobType.cs +++ b/Disco.Models/Repository/Job/JobType.cs @@ -9,7 +9,7 @@ namespace Disco.Models.Repository public string Id { get; set; } [StringLength(100)] public string Description { get; set; } - + public virtual IList JobSubTypes { get; set; } public override string ToString() diff --git a/Disco.Models/Repository/Job/Queue/JobQueueJob.cs b/Disco.Models/Repository/Job/Queue/JobQueueJob.cs index 05269388..a395f230 100644 --- a/Disco.Models/Repository/Job/Queue/JobQueueJob.cs +++ b/Disco.Models/Repository/Job/Queue/JobQueueJob.cs @@ -12,13 +12,13 @@ namespace Disco.Models.Repository public int JobQueueId { get; set; } [Required] public int JobId { get; set; } - + [Required] public DateTime AddedDate { get; set; } [Required] public string AddedUserId { get; set; } public string AddedComment { get; set; } - + public DateTime? RemovedDate { get; set; } public string RemovedUserId { get; set; } public string RemovedComment { get; set; } diff --git a/Disco.Models/Repository/User/User.cs b/Disco.Models/Repository/User/User.cs index e7e4ad22..93868fe6 100644 --- a/Disco.Models/Repository/User/User.cs +++ b/Disco.Models/Repository/User/User.cs @@ -39,7 +39,7 @@ namespace Disco.Models.Repository return DomainUsername; } } - + [NotMapped] public string DomainUsername { diff --git a/Disco.Models/Repository/User/UserComment.cs b/Disco.Models/Repository/User/UserComment.cs index 30716e02..4cbeaaf6 100644 --- a/Disco.Models/Repository/User/UserComment.cs +++ b/Disco.Models/Repository/User/UserComment.cs @@ -15,10 +15,10 @@ namespace Disco.Models.Repository public DateTime Timestamp { get; set; } [Required] public string Comments { get; set; } - + [ForeignKey(nameof(UserId))] public User User { get; set; } - + [ForeignKey(nameof(TechUserId))] public User TechUser { get; set; } } diff --git a/Disco.Models/Repository/User/UserDetail.cs b/Disco.Models/Repository/User/UserDetail.cs index 66384d4c..62f629da 100644 --- a/Disco.Models/Repository/User/UserDetail.cs +++ b/Disco.Models/Repository/User/UserDetail.cs @@ -7,10 +7,10 @@ namespace Disco.Models.Repository { [Key, Column(Order = 0)] public string UserId { get; set; } - + [Column(Order = 1), Key, StringLength(100)] public string Scope { get; set; } - + [Key, Column(Order = 2), StringLength(100)] public string Key { get; set; } diff --git a/Disco.Models/Services/Devices/Importing/IDeviceImportField.cs b/Disco.Models/Services/Devices/Importing/IDeviceImportField.cs index 1274a820..6e0654f4 100644 --- a/Disco.Models/Services/Devices/Importing/IDeviceImportField.cs +++ b/Disco.Models/Services/Devices/Importing/IDeviceImportField.cs @@ -6,7 +6,7 @@ namespace Disco.Models.Services.Devices.Importing { DeviceImportFieldTypes FieldType { get; } EntityState? FieldAction { get; } - + string ErrorMessage { get; } object RawParsedValue { get; } diff --git a/Disco.Models/Services/Documents/DocumentExportRecord.cs b/Disco.Models/Services/Documents/DocumentExportRecord.cs index 439d0f68..3f98e789 100644 --- a/Disco.Models/Services/Documents/DocumentExportRecord.cs +++ b/Disco.Models/Services/Documents/DocumentExportRecord.cs @@ -11,7 +11,7 @@ namespace Disco.Models.Services.Documents public IAttachmentTarget AttachmentTarget { get; set; } public Device Device { get; set; } - + public Job Job { get; set; } public string JobStatus { get; set; } public string JobTypeDescription { get; set; } diff --git a/Disco.Models/Services/Interop/DiscoServices/PluginIncompatibility.cs b/Disco.Models/Services/Interop/DiscoServices/PluginIncompatibility.cs index 22615c68..02dad65e 100644 --- a/Disco.Models/Services/Interop/DiscoServices/PluginIncompatibility.cs +++ b/Disco.Models/Services/Interop/DiscoServices/PluginIncompatibility.cs @@ -6,7 +6,7 @@ namespace Disco.Models.Services.Interop.DiscoServices { public string PluginId { get; set; } public Version Version { get; set; } - + public string Reason { get; set; } } } diff --git a/Disco.Models/Services/Users/Contact/UserContact.cs b/Disco.Models/Services/Users/Contact/UserContact.cs index a43d7fef..eaf15871 100644 --- a/Disco.Models/Services/Users/Contact/UserContact.cs +++ b/Disco.Models/Services/Users/Contact/UserContact.cs @@ -42,7 +42,7 @@ namespace Disco.Models.Services.Users.Contact return false; } - var result = match.Value; + var result = match.Value; var name = default(string); if (match.Index > 0) { diff --git a/Disco.Models/UI/User/UserShowModel.cs b/Disco.Models/UI/User/UserShowModel.cs index 5f55b181..b27dc014 100644 --- a/Disco.Models/UI/User/UserShowModel.cs +++ b/Disco.Models/UI/User/UserShowModel.cs @@ -14,7 +14,7 @@ namespace Disco.Models.UI.User List DocumentTemplatePackages { get; set; } List AvailableUserFlags { get; set; } - + IAuthorizationToken AuthorizationToken { get; set; } IClaimNavigatorItem ClaimNavigator { get; set; } Dictionary UserDetails { get; set; } diff --git a/Disco.Services/App_Start/RazorGeneratorMvcStart.cs b/Disco.Services/App_Start/RazorGeneratorMvcStart.cs index 44c24e47..dabcd7bb 100644 --- a/Disco.Services/App_Start/RazorGeneratorMvcStart.cs +++ b/Disco.Services/App_Start/RazorGeneratorMvcStart.cs @@ -1,14 +1,18 @@ +using RazorGenerator.Mvc; using System.Web; using System.Web.Mvc; using System.Web.WebPages; -using RazorGenerator.Mvc; [assembly: WebActivatorEx.PostApplicationStartMethod(typeof(Disco.Services.App_Start.RazorGeneratorMvcStart), "Start")] -namespace Disco.Services.App_Start { - public static class RazorGeneratorMvcStart { - public static void Start() { - var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly) { +namespace Disco.Services.App_Start +{ + public static class RazorGeneratorMvcStart + { + public static void Start() + { + var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly) + { UsePhysicalViewsIfNewer = HttpContext.Current.Request.IsLocal }; diff --git a/Disco.Services/Authorization/AuthorizationLog.cs b/Disco.Services/Authorization/AuthorizationLog.cs index 12f51a63..9b3b7754 100644 --- a/Disco.Services/Authorization/AuthorizationLog.cs +++ b/Disco.Services/Authorization/AuthorizationLog.cs @@ -43,7 +43,7 @@ namespace Disco.Services.Authorization Name = "Access Denied", Format = "User: {0}; Resource: {1}; Reason: {2}", Severity = (int)LogEventType.Severities.Warning, - UseLive = true, UsePersist = true, UseDisplay = true + UseLive = true, UsePersist = true, UseDisplay = true }, new LogEventType() { Id = (int)EventTypeIds.RoleCreated, diff --git a/Disco.Services/Authorization/AuthorizationToken.cs b/Disco.Services/Authorization/AuthorizationToken.cs index 4f96db29..66c686c7 100644 --- a/Disco.Services/Authorization/AuthorizationToken.cs +++ b/Disco.Services/Authorization/AuthorizationToken.cs @@ -1,5 +1,5 @@ -using Disco.Models.Services.Authorization; -using Disco.Models.Repository; +using Disco.Models.Repository; +using Disco.Models.Services.Authorization; using Disco.Services.Authorization.Roles; using System; using System.Collections.Generic; diff --git a/Disco.Services/Authorization/ClaimNavigatorItem.cs b/Disco.Services/Authorization/ClaimNavigatorItem.cs index cbdd823a..ff4293fd 100644 --- a/Disco.Services/Authorization/ClaimNavigatorItem.cs +++ b/Disco.Services/Authorization/ClaimNavigatorItem.cs @@ -9,7 +9,7 @@ namespace Disco.Services.Authorization public class ClaimNavigatorItem : IClaimNavigatorItem { private Func accessor { get; set; } - + public string Key { get; private set; } public string Name { get; private set; } public string Description { get; private set; } @@ -49,15 +49,15 @@ namespace Disco.Services.Authorization public IClaimNavigatorItem BuildClaimTree(RoleClaims RoleClaims) { return new ClaimNavigatorItem() - { - Key = Key, - Name = Name, - Description = Description, - Hidden = Hidden, - accessor = accessor, - Value = accessor == null ? (bool?)null : accessor(RoleClaims), - Children = Children == null ? null : Children.Cast().Select(c => c.BuildClaimTree(RoleClaims)).ToList() - }; + { + Key = Key, + Name = Name, + Description = Description, + Hidden = Hidden, + accessor = accessor, + Value = accessor == null ? (bool?)null : accessor(RoleClaims), + Children = Children == null ? null : Children.Cast().Select(c => c.BuildClaimTree(RoleClaims)).ToList() + }; } public IClaimNavigatorItem BuildClaimTree(IEnumerable RoleClaims) diff --git a/Disco.Services/Authorization/DiscoAuthorizeAttribute.cs b/Disco.Services/Authorization/DiscoAuthorizeAttribute.cs index cc6032c2..b34bdd6e 100644 --- a/Disco.Services/Authorization/DiscoAuthorizeAttribute.cs +++ b/Disco.Services/Authorization/DiscoAuthorizeAttribute.cs @@ -30,11 +30,10 @@ namespace Disco.Services.Authorization if (UserService.CurrentAuthorization == null) resultMessage = AuthorizationToken.RequireAuthenticationMessage; + else if (string.IsNullOrEmpty(authorizedClaim)) + resultMessage = AuthorizationToken.RequireDiscoAuthorizationMessage; else - if (string.IsNullOrEmpty(authorizedClaim)) - resultMessage = AuthorizationToken.RequireDiscoAuthorizationMessage; - else - resultMessage = AuthorizationToken.BuildRequireMessage(authorizedClaim); + resultMessage = AuthorizationToken.BuildRequireMessage(authorizedClaim); return resultMessage; } diff --git a/Disco.Services/Authorization/Roles/ClaimGroups/Configuration/DocumentTemplate/DocumentTemplateClaims.cs b/Disco.Services/Authorization/Roles/ClaimGroups/Configuration/DocumentTemplate/DocumentTemplateClaims.cs index 0226d52f..6d75dfc9 100644 --- a/Disco.Services/Authorization/Roles/ClaimGroups/Configuration/DocumentTemplate/DocumentTemplateClaims.cs +++ b/Disco.Services/Authorization/Roles/ClaimGroups/Configuration/DocumentTemplate/DocumentTemplateClaims.cs @@ -26,7 +26,7 @@ [ClaimDetails("Bulk Generate Document Templates", "Can bulk generate document templates")] public bool BulkGenerate { get; set; } - + [ClaimDetails("Export Attachment Instances", "Can export document attachment instances")] public bool Export { get; set; } diff --git a/Disco.Services/Authorization/Roles/ClaimGroups/Configuration/System/SystemClaims.cs b/Disco.Services/Authorization/Roles/ClaimGroups/Configuration/System/SystemClaims.cs index da25e002..c853caee 100644 --- a/Disco.Services/Authorization/Roles/ClaimGroups/Configuration/System/SystemClaims.cs +++ b/Disco.Services/Authorization/Roles/ClaimGroups/Configuration/System/SystemClaims.cs @@ -8,7 +8,7 @@ [ClaimDetails("Configure Proxy Settings", "Can configure the proxy settings")] public bool ConfigureProxy { get; set; } - + [ClaimDetails("Configure Email Settings", "Can configure the email settings")] public bool ConfigureEmail { get; set; } diff --git a/Disco.Services/Authorization/Roles/ClaimGroups/Job/JobListsClaims.cs b/Disco.Services/Authorization/Roles/ClaimGroups/Job/JobListsClaims.cs index c66bd424..276da0ab 100644 --- a/Disco.Services/Authorization/Roles/ClaimGroups/Job/JobListsClaims.cs +++ b/Disco.Services/Authorization/Roles/ClaimGroups/Job/JobListsClaims.cs @@ -24,7 +24,7 @@ public bool DevicesReadyForReturn { get; set; } [ClaimDetails("Devices Awaiting Repair List", "Can show list")] public bool DevicesAwaitingRepair { get; set; } - + [ClaimDetails("Awaiting Finance List", "Can show list")] public bool AwaitingFinance { get; set; } @@ -36,7 +36,7 @@ public bool AwaitingFinanceInsuranceProcessing { get; set; } [ClaimDetails("Awaiting Finance Agreement Breach List", "Can show list (NOTE: Requires Awaiting Finance List)")] public bool AwaitingFinanceAgreementBreach { get; set; } - + [ClaimDetails("Awaiting User Action List", "Can show list")] public bool AwaitingUserAction { get; set; } [ClaimDetails("Recently Closed List", "Can show list")] diff --git a/Disco.Services/Authorization/Roles/ClaimGroups/Job/JobTypesClaims.cs b/Disco.Services/Authorization/Roles/ClaimGroups/Job/JobTypesClaims.cs index e4206827..6d6bd272 100644 --- a/Disco.Services/Authorization/Roles/ClaimGroups/Job/JobTypesClaims.cs +++ b/Disco.Services/Authorization/Roles/ClaimGroups/Job/JobTypesClaims.cs @@ -17,7 +17,7 @@ public bool ShowSImg { get; set; } [ClaimDetails("Show Software - Operating System Jobs", "Can show jobs of this type")] public bool ShowSOS { get; set; } - + [ClaimDetails("Show User Management Jobs", "Can show jobs of this type")] public bool ShowUMgmt { get; set; } diff --git a/Disco.Services/Authorization/Roles/RoleCache.cs b/Disco.Services/Authorization/Roles/RoleCache.cs index a08f9414..f8777fa3 100644 --- a/Disco.Services/Authorization/Roles/RoleCache.cs +++ b/Disco.Services/Authorization/Roles/RoleCache.cs @@ -1,11 +1,11 @@ using Disco.Data.Repository; -using Disco.Models.Services.Authorization; using Disco.Models.Repository; +using Disco.Models.Services.Authorization; +using Disco.Services.Interop.ActiveDirectory; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; -using Disco.Services.Interop.ActiveDirectory; -using Newtonsoft.Json; namespace Disco.Services.Authorization.Roles { @@ -156,7 +156,7 @@ namespace Disco.Services.Authorization.Roles { // Determine roles which need migration from DBv11 -> DBv14 var affectedRoles_DBv14 = Database.AuthorizationRoles.Where(r => !r.ClaimsJson.Contains("MyJobs")).ToList(); - + // Determine roles which need migration from DBv14 -> DBv15 var affectedRoles_DBv15 = Database.AuthorizationRoles.Where(r => !r.ClaimsJson.Contains("RepairProviderDetails")).ToList(); diff --git a/Disco.Services/Authorization/Roles/RoleToken.cs b/Disco.Services/Authorization/Roles/RoleToken.cs index 1b697409..9ee52b9f 100644 --- a/Disco.Services/Authorization/Roles/RoleToken.cs +++ b/Disco.Services/Authorization/Roles/RoleToken.cs @@ -1,5 +1,5 @@ -using Disco.Models.Services.Authorization; -using Disco.Models.Repository; +using Disco.Models.Repository; +using Disco.Models.Services.Authorization; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -20,7 +20,7 @@ namespace Disco.Services.Authorization.Roles return FromAuthorizationRole(Role, claims); } - + internal static RoleToken FromAuthorizationRole(AuthorizationRole Role, RoleClaims Claims) { string[] sg = (Role.SubjectIds == null ? new string[0] : Role.SubjectIds.Split(',').ToArray()); diff --git a/Disco.Services/Devices/DeviceFlags/DeviceFlagDevicesManagedGroup.cs b/Disco.Services/Devices/DeviceFlags/DeviceFlagDevicesManagedGroup.cs index e728d229..1978b242 100644 --- a/Disco.Services/Devices/DeviceFlags/DeviceFlagDevicesManagedGroup.cs +++ b/Disco.Services/Devices/DeviceFlags/DeviceFlagDevicesManagedGroup.cs @@ -111,7 +111,7 @@ namespace Disco.Services.Devices.DeviceFlags var assignment = (DeviceFlagAssignment)Event.Entity; var domainId = assignment.Device?.DeviceDomainId; - + if (!ActiveDirectory.IsValidDomainAccountId(domainId)) return; domainId += "$"; diff --git a/Disco.Services/Devices/DeviceFlags/DeviceFlagService.cs b/Disco.Services/Devices/DeviceFlags/DeviceFlagService.cs index adb35f1c..dcfe1c51 100644 --- a/Disco.Services/Devices/DeviceFlags/DeviceFlagService.cs +++ b/Disco.Services/Devices/DeviceFlags/DeviceFlagService.cs @@ -189,7 +189,7 @@ namespace Disco.Services.Devices.DeviceFlags status.UpdateStatus((chunkIndexOffset + index) * progressInterval, $"Removing Flag: {flagAssignment.Device}"); flagAssignment.OnRemoveUnsafe(database, technician); - + return flagAssignment; }).ToList(); diff --git a/Disco.Services/Devices/DeviceFlags/DeviceFlagsDeleteTask.cs b/Disco.Services/Devices/DeviceFlags/DeviceFlagsDeleteTask.cs index 72029483..a1c7824e 100644 --- a/Disco.Services/Devices/DeviceFlags/DeviceFlagsDeleteTask.cs +++ b/Disco.Services/Devices/DeviceFlags/DeviceFlagsDeleteTask.cs @@ -8,7 +8,7 @@ namespace Disco.Services.Devices.DeviceFlags { public override string TaskName { get { return "Device Flags - Delete Flag"; } } - public override bool SingleInstanceTask { get { return false; }} + public override bool SingleInstanceTask { get { return false; } } public override bool CancelInitiallySupported { get { return false; } } public override bool LogExceptionsOnly { get { return true; } } diff --git a/Disco.Services/Devices/Enrolment/EnrolmentLog.cs b/Disco.Services/Devices/Enrolment/EnrolmentLog.cs index 4fc44b3a..72aa80d6 100644 --- a/Disco.Services/Devices/Enrolment/EnrolmentLog.cs +++ b/Disco.Services/Devices/Enrolment/EnrolmentLog.cs @@ -168,7 +168,7 @@ namespace Disco.Services.Devices.Enrolment Request.Hardware.Model, Request.Hardware.ModelType); } - + public static void LogSessionProgress(string SessionId, int Progress, string Status) { Log(EventTypeIds.SessionProgress, new object[] diff --git a/Disco.Services/Devices/Importing/Fields/DetailACAdapterImportField.cs b/Disco.Services/Devices/Importing/Fields/DetailACAdapterImportField.cs index 22c2275e..838bf27b 100644 --- a/Disco.Services/Devices/Importing/Fields/DetailACAdapterImportField.cs +++ b/Disco.Services/Devices/Importing/Fields/DetailACAdapterImportField.cs @@ -35,7 +35,7 @@ namespace Disco.Services.Devices.Importing.Fields else if (ExistingDevice != null) { var detail = ExistingDevice.DeviceDetails.FirstOrDefault(dd => dd.Scope == DeviceDetail.ScopeHardware && dd.Key == DeviceDetail.HardwareKeyACAdapter); - + if (detail == null && parsedValue == null) return Success(EntityState.Unchanged); else if (detail == null && parsedValue != null) diff --git a/Disco.Services/Devices/Importing/Fields/DetailWLanMacAddressImportField.cs b/Disco.Services/Devices/Importing/Fields/DetailWLanMacAddressImportField.cs index 0da7adc3..fd7bfb6c 100644 --- a/Disco.Services/Devices/Importing/Fields/DetailWLanMacAddressImportField.cs +++ b/Disco.Services/Devices/Importing/Fields/DetailWLanMacAddressImportField.cs @@ -35,7 +35,7 @@ namespace Disco.Services.Devices.Importing.Fields else if (ExistingDevice != null) { var detail = ExistingDevice.DeviceDetails.FirstOrDefault(dd => dd.Scope == DeviceDetail.ScopeHardware && dd.Key == DeviceDetail.HardwareKeyWLanMacAddress); - + if (detail == null && parsedValue == null) return Success(EntityState.Unchanged); else if (detail == null && parsedValue != null) diff --git a/Disco.Services/Devices/ManagedGroups/DeviceBatchAssignedUsersManagedGroup.cs b/Disco.Services/Devices/ManagedGroups/DeviceBatchAssignedUsersManagedGroup.cs index 0141b035..895c56be 100644 --- a/Disco.Services/Devices/ManagedGroups/DeviceBatchAssignedUsersManagedGroup.cs +++ b/Disco.Services/Devices/ManagedGroups/DeviceBatchAssignedUsersManagedGroup.cs @@ -16,7 +16,7 @@ namespace Disco.Services.Devices.ManagedGroups private const string DescriptionFormat = "Devices within the {0} Batch will have their assigned users added to this Active Directory group."; private const string CategoryDescriptionFormat = "Assigned Users Linked Group"; private const string GroupDescriptionFormat = "{0} [Device Batch Assigned Users]"; - + private static Lazy> RepositoryEvents; private IDisposable repositorySubscription; diff --git a/Disco.Services/Devices/ManagedGroups/DeviceProfileAssignedUsersManagedGroup.cs b/Disco.Services/Devices/ManagedGroups/DeviceProfileAssignedUsersManagedGroup.cs index ed3403b4..21963a12 100644 --- a/Disco.Services/Devices/ManagedGroups/DeviceProfileAssignedUsersManagedGroup.cs +++ b/Disco.Services/Devices/ManagedGroups/DeviceProfileAssignedUsersManagedGroup.cs @@ -16,7 +16,7 @@ namespace Disco.Services.Devices.ManagedGroups private const string DescriptionFormat = "Devices within the {0} Profile will have their assigned users added to this Active Directory group."; private const string CategoryDescriptionFormat = "Assigned Users Linked Group"; private const string GroupDescriptionFormat = "{0} [Device Profile Assigned Users]"; - + private static Lazy> RepositoryEvents; private IDisposable repositorySubscription; diff --git a/Disco.Services/Devices/ManagedGroups/DeviceProfileDevicesManagedGroup.cs b/Disco.Services/Devices/ManagedGroups/DeviceProfileDevicesManagedGroup.cs index ec5b2502..559c84e6 100644 --- a/Disco.Services/Devices/ManagedGroups/DeviceProfileDevicesManagedGroup.cs +++ b/Disco.Services/Devices/ManagedGroups/DeviceProfileDevicesManagedGroup.cs @@ -16,7 +16,7 @@ namespace Disco.Services.Devices.ManagedGroups private const string DescriptionFormat = "Devices within the {0} Profile will be added to this Active Directory group."; private const string CategoryDescriptionFormat = "Devices Linked Group"; private const string GroupDescriptionFormat = "{0} [Device Profile Devices]"; - + private static Lazy> RepositoryEvents; private IDisposable repositorySubscription; diff --git a/Disco.Services/Documents/AttachmentImport/Importer.cs b/Disco.Services/Documents/AttachmentImport/Importer.cs index 4d7bc3cc..517e4bd0 100644 --- a/Disco.Services/Documents/AttachmentImport/Importer.cs +++ b/Disco.Services/Documents/AttachmentImport/Importer.cs @@ -270,7 +270,7 @@ namespace Disco.Services.Documents.AttachmentImport { var rules = Identifier.DocumentTemplate.GetOnImportUserFlagRules(); - foreach ( var rule in rules) + foreach (var rule in rules) { rule.Apply(Database, Identifier.Target, creatorUser); } diff --git a/Disco.Services/Documents/DocumentExport.cs b/Disco.Services/Documents/DocumentExport.cs index 8c582fbe..c2fdbe77 100644 --- a/Disco.Services/Documents/DocumentExport.cs +++ b/Disco.Services/Documents/DocumentExport.cs @@ -249,7 +249,7 @@ namespace Disco.Services.Documents { var query = database.UserAttachments .Include(a => a.User); - + if (Options.HasDeviceOptions()) query = query.Include(a => a.User.DeviceUserAssignments.Select(u => u.Device)); if (Options.HasDeviceBatchOptions()) diff --git a/Disco.Services/Expressions/EvaluateExpressionPart.cs b/Disco.Services/Expressions/EvaluateExpressionPart.cs index 6666aeb0..8b9def56 100644 --- a/Disco.Services/Expressions/EvaluateExpressionPart.cs +++ b/Disco.Services/Expressions/EvaluateExpressionPart.cs @@ -20,9 +20,8 @@ namespace Disco.Services.Expressions { if (expressionParseException == null) return null; - else - if (evaluateParseException == null) - evaluateParseException = EvaluateExpressionParseException.FromRecognitionException(expressionParseException, Source); + else if (evaluateParseException == null) + evaluateParseException = EvaluateExpressionParseException.FromRecognitionException(expressionParseException, Source); return evaluateParseException; } } diff --git a/Disco.Services/Expressions/Extensions/ImageResultImplementations/BitmapImageExpressionResult.cs b/Disco.Services/Expressions/Extensions/ImageResultImplementations/BitmapImageExpressionResult.cs index e75a5d8a..16d0ea53 100644 --- a/Disco.Services/Expressions/Extensions/ImageResultImplementations/BitmapImageExpressionResult.cs +++ b/Disco.Services/Expressions/Extensions/ImageResultImplementations/BitmapImageExpressionResult.cs @@ -24,10 +24,10 @@ namespace Disco.Services.Expressions.Extensions.ImageResultImplementations public override MemoryStream GetImage(out int width, out int height) { var image = Image; - + width = image.Width; height = image.Height; - + return OutputBitmapImage(image); } } diff --git a/Disco.Services/Expressions/Extensions/ImageResultImplementations/FileMontageImageExpressionResult.cs b/Disco.Services/Expressions/Extensions/ImageResultImplementations/FileMontageImageExpressionResult.cs index c9235b87..a6172e07 100644 --- a/Disco.Services/Expressions/Extensions/ImageResultImplementations/FileMontageImageExpressionResult.cs +++ b/Disco.Services/Expressions/Extensions/ImageResultImplementations/FileMontageImageExpressionResult.cs @@ -53,7 +53,8 @@ namespace Disco.Services.Expressions.Extensions.ImageResultImplementations { maxWidth = images.Sum(i => i.Width); maxHeight = images.Max(i => i.Height); - }else if (MontageVerticalLayout) + } + else if (MontageVerticalLayout) { maxWidth = images.Max(i => i.Width); maxHeight = images.Sum(i => i.Height); diff --git a/Disco.Services/Expressions/IExpressionPart.cs b/Disco.Services/Expressions/IExpressionPart.cs index 745a4c0a..c385c475 100644 --- a/Disco.Services/Expressions/IExpressionPart.cs +++ b/Disco.Services/Expressions/IExpressionPart.cs @@ -2,14 +2,14 @@ using System.Collections; namespace Disco.Services.Expressions { - public interface IExpressionPart - { + public interface IExpressionPart + { string RawSource { get; set; } - string Source { get; set; } + string Source { get; set; } bool ErrorsAllowed { get; set; } bool ParseError { get; } string ParseErrorMessage { get; } - bool IsDynamic { get; set; } - object Evaluate(object ExpressionContext, IDictionary Variables); - } + bool IsDynamic { get; set; } + object Evaluate(object ExpressionContext, IDictionary Variables); + } } diff --git a/Disco.Services/Extensions/EnumerableExtensions.cs b/Disco.Services/Extensions/EnumerableExtensions.cs index b817c865..4dc0c78b 100644 --- a/Disco.Services/Extensions/EnumerableExtensions.cs +++ b/Disco.Services/Extensions/EnumerableExtensions.cs @@ -50,7 +50,7 @@ namespace Disco IEnumerator IEnumerable.GetEnumerator() => new OneOfEnumerator(instance); - + private struct OneOfEnumerator : IEnumerator { private readonly T instance; diff --git a/Disco.Services/Extensions/ImagingExtensions.cs b/Disco.Services/Extensions/ImagingExtensions.cs index 244400d5..ae3183a2 100644 --- a/Disco.Services/Extensions/ImagingExtensions.cs +++ b/Disco.Services/Extensions/ImagingExtensions.cs @@ -178,7 +178,7 @@ namespace Disco.Services public static void DrawImageResized(this Graphics graphics, Image SourceImage, float Scale, float LocationX, float LocationY) { RectangleF clipBounds = graphics.VisibleClipBounds; - + float width = SourceImage.Width * Scale, height = SourceImage.Height * Scale, x = LocationX, diff --git a/Disco.Services/Interop/ActiveDirectory/ADNetworkLogonDatesUpdateTask.cs b/Disco.Services/Interop/ActiveDirectory/ADNetworkLogonDatesUpdateTask.cs index e5d1f9fe..1e79f0fc 100644 --- a/Disco.Services/Interop/ActiveDirectory/ADNetworkLogonDatesUpdateTask.cs +++ b/Disco.Services/Interop/ActiveDirectory/ADNetworkLogonDatesUpdateTask.cs @@ -63,7 +63,7 @@ namespace Disco.Services.Interop.ActiveDirectory ADDomain deviceDomain; ActiveDirectory.ParseDomainAccountId(Device.DeviceDomainId + "$", out deviceSamAccountName, out deviceDomain); - + var ldapFilter = string.Format(ldapFilterTemplate, ADHelpers.EscapeLdapQuery(deviceSamAccountName)); IEnumerable domainControllers; diff --git a/Disco.Services/Interop/ActiveDirectory/ActiveDirectoryGroupCache.cs b/Disco.Services/Interop/ActiveDirectory/ActiveDirectoryGroupCache.cs index 05267f65..9f3cc8cd 100644 --- a/Disco.Services/Interop/ActiveDirectory/ActiveDirectoryGroupCache.cs +++ b/Disco.Services/Interop/ActiveDirectory/ActiveDirectoryGroupCache.cs @@ -12,7 +12,7 @@ namespace Disco.Services.Interop.ActiveDirectory private ConcurrentDictionary> securityIdentifierCache; private ConcurrentDictionary> distinguishedNameCache; private const long CacheTimeoutTicks = 6000000000; // 10 Minutes - + private const int CacheCleanIntervalMinutes = 15; private DateTime cacheCleanNext; private object cacheCleanLock = new object(); diff --git a/Disco.Services/Interop/ActiveDirectory/ActiveDirectoryManagedGroups.cs b/Disco.Services/Interop/ActiveDirectory/ActiveDirectoryManagedGroups.cs index f2d12de7..13e3946c 100644 --- a/Disco.Services/Interop/ActiveDirectory/ActiveDirectoryManagedGroups.cs +++ b/Disco.Services/Interop/ActiveDirectory/ActiveDirectoryManagedGroups.cs @@ -1,9 +1,9 @@ -using System; +using Disco.Data.Repository; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Reactive.Subjects; -using Disco.Data.Repository; namespace Disco.Services.Interop.ActiveDirectory { @@ -468,7 +468,7 @@ namespace Disco.Services.Interop.ActiveDirectory { return new ADManagedGroupScheduledActionItem[] { - new ADManagedGroupScheduledActionItem(ManagedGroup, ActionType, InvokingIdentifier) + new ADManagedGroupScheduledActionItem(ManagedGroup, ActionType, InvokingIdentifier) }; } } diff --git a/Disco.Services/Interop/ActiveDirectory/IADObject.cs b/Disco.Services/Interop/ActiveDirectory/IADObject.cs index b74e7f2b..55ff001a 100644 --- a/Disco.Services/Interop/ActiveDirectory/IADObject.cs +++ b/Disco.Services/Interop/ActiveDirectory/IADObject.cs @@ -8,7 +8,7 @@ namespace Disco.Services.Interop.ActiveDirectory string DistinguishedName { get; } SecurityIdentifier SecurityIdentifier { get; } - + string Id { get; } string SamAccountName { get; } diff --git a/Disco.Services/Interop/DiscoServices/UpdateQuery.cs b/Disco.Services/Interop/DiscoServices/UpdateQuery.cs index b8d2e6b0..e3222ca5 100644 --- a/Disco.Services/Interop/DiscoServices/UpdateQuery.cs +++ b/Disco.Services/Interop/DiscoServices/UpdateQuery.cs @@ -15,9 +15,9 @@ using System.Text; namespace Disco.Services.Interop.DiscoServices { using StatisticInt = UpdateRequestV2.StatisticInt; + using StatisticIntPair = UpdateRequestV2.StatisticIntPair; using StatisticJob = UpdateRequestV2.StatisticJob; using StatisticString = UpdateRequestV2.StatisticString; - using StatisticIntPair = UpdateRequestV2.StatisticIntPair; public static class UpdateQuery { diff --git a/Disco.Services/Jobs/JobExtensions.cs b/Disco.Services/Jobs/JobExtensions.cs index 141a7ecb..df18d168 100644 --- a/Disco.Services/Jobs/JobExtensions.cs +++ b/Disco.Services/Jobs/JobExtensions.cs @@ -83,7 +83,7 @@ namespace Disco.Services public static string JobStatusDescription(string StatusId, Job j) => JobStatusDescription(StatusId, j?.DeviceHeld, j?.JobMetaWarranty?.ExternalName, j?.JobMetaNonWarranty?.RepairerName); - + public static string JobStatusDescription(string StatusId, JobTableStatusItemModel j) => JobStatusDescription(StatusId, j?.DeviceHeld, j?.JobMetaWarranty_ExternalName, j?.JobMetaNonWarranty_RepairerName); diff --git a/Disco.Services/Jobs/JobLists/JobTableExtensions.cs b/Disco.Services/Jobs/JobLists/JobTableExtensions.cs index 0c1561d8..1eea487b 100644 --- a/Disco.Services/Jobs/JobLists/JobTableExtensions.cs +++ b/Disco.Services/Jobs/JobLists/JobTableExtensions.cs @@ -264,7 +264,7 @@ namespace Disco.Services foreach (var j in items) { - j.UserFriendlyId =j.UserId == null ? null : ActiveDirectory.FriendlyAccountId(j.UserId); + j.UserFriendlyId = j.UserId == null ? null : ActiveDirectory.FriendlyAccountId(j.UserId); j.OpenedTechUserFriendlyId = ActiveDirectory.FriendlyAccountId(j.OpenedTechUserId); if (j.DeviceAddressId.HasValue) diff --git a/Disco.Services/Jobs/JobQueues/JobQueueDeleteTask.cs b/Disco.Services/Jobs/JobQueues/JobQueueDeleteTask.cs index 37c27c2a..cde34af2 100644 --- a/Disco.Services/Jobs/JobQueues/JobQueueDeleteTask.cs +++ b/Disco.Services/Jobs/JobQueues/JobQueueDeleteTask.cs @@ -8,7 +8,7 @@ namespace Disco.Services.Jobs.JobQueues { public override string TaskName { get { return "Job Queues - Delete Queue"; } } - public override bool SingleInstanceTask { get { return false; }} + public override bool SingleInstanceTask { get { return false; } } public override bool CancelInitiallySupported { get { return false; } } public override bool LogExceptionsOnly { get { return true; } } diff --git a/Disco.Services/Jobs/JobUpdatesHub.cs b/Disco.Services/Jobs/JobUpdatesHub.cs index 63fd3a6a..ef4a1403 100644 --- a/Disco.Services/Jobs/JobUpdatesHub.cs +++ b/Disco.Services/Jobs/JobUpdatesHub.cs @@ -2,6 +2,7 @@ using Disco.Data.Repository.Monitor; using Disco.Models.Repository; using Disco.Services.Authorization; +using Disco.Services.Users; using Disco.Services.Web.Signalling; using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR.Hubs; @@ -9,7 +10,6 @@ using System; using System.Linq; using System.Reactive.Linq; using System.Threading.Tasks; -using Disco.Services.Users; namespace Disco.Services.Jobs { diff --git a/Disco.Services/Jobs/Noticeboards/HeldDevices.cs b/Disco.Services/Jobs/Noticeboards/HeldDevices.cs index cbf330fd..6cff6396 100644 --- a/Disco.Services/Jobs/Noticeboards/HeldDevices.cs +++ b/Disco.Services/Jobs/Noticeboards/HeldDevices.cs @@ -19,7 +19,7 @@ namespace Disco.Services.Jobs.Noticeboards "DeviceSerialNumber", "UserId", "ExpectedClosedDate", - "ClosedDate", + "ClosedDate", "WaitingForUserAction", "DeviceHeld", "DeviceReadyForReturn", diff --git a/Disco.Services/Logging/LogContext.cs b/Disco.Services/Logging/LogContext.cs index e8c7d360..3f9241b6 100644 --- a/Disco.Services/Logging/LogContext.cs +++ b/Disco.Services/Logging/LogContext.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Disco.Data.Repository; -using System.IO; -using System.Data.SqlServerCe; +using Disco.Data.Repository; +using Newtonsoft.Json; using Quartz; using Quartz.Impl; -using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data.SqlServerCe; +using System.IO; +using System.Linq; namespace Disco.Services.Logging { @@ -50,7 +50,7 @@ namespace Disco.Services.Logging var appDomain = AppDomain.CurrentDomain; var servicesAssemblyName = typeof(LogContext).Assembly.GetName().Name; - var logModuleTypes = appDomain.GetAssemblies() + var logModuleTypes = appDomain.GetAssemblies() .Where(a => !a.GlobalAssemblyCache && !a.IsDynamic && (a.GetName().Name == servicesAssemblyName || a.GetReferencedAssemblies().Any(ra => ra.Name == servicesAssemblyName))) .SelectMany(a => a.GetTypes()) diff --git a/Disco.Services/Logging/LogReInitalizeJob.cs b/Disco.Services/Logging/LogReInitalizeJob.cs index afa51485..e8d22777 100644 --- a/Disco.Services/Logging/LogReInitalizeJob.cs +++ b/Disco.Services/Logging/LogReInitalizeJob.cs @@ -1,5 +1,5 @@ -using Quartz; -using Disco.Data.Repository; +using Disco.Data.Repository; +using Quartz; namespace Disco.Services.Logging { diff --git a/Disco.Services/Logging/Models/LogEvent.cs b/Disco.Services/Logging/Models/LogEvent.cs index 33fa3267..24ec8476 100644 --- a/Disco.Services/Logging/Models/LogEvent.cs +++ b/Disco.Services/Logging/Models/LogEvent.cs @@ -15,7 +15,7 @@ namespace Disco.Services.Logging.Models public int EventTypeId { get; set; } [Required] public DateTime Timestamp { get; set; } - [Column(TypeName="ntext"), MaxLength] + [Column(TypeName = "ntext"), MaxLength] public string Arguments { get; set; } } } diff --git a/Disco.Services/Logging/Models/LogEventType.cs b/Disco.Services/Logging/Models/LogEventType.cs index 7e65bade..89ec85d8 100644 --- a/Disco.Services/Logging/Models/LogEventType.cs +++ b/Disco.Services/Logging/Models/LogEventType.cs @@ -1,13 +1,13 @@ -using System.Linq; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; namespace Disco.Services.Logging.Models { [Table("EventTypes")] public class LogEventType { - [Required, Key, Column(Order=0), DatabaseGenerated(DatabaseGeneratedOption.None)] + [Required, Key, Column(Order = 0), DatabaseGenerated(DatabaseGeneratedOption.None)] public int ModuleId { get; set; } [Required, Key, Column(Order = 1), DatabaseGenerated(DatabaseGeneratedOption.None)] public int Id { get; set; } @@ -17,7 +17,7 @@ namespace Disco.Services.Logging.Models public int Severity { get; set; } [MaxLength(1024)] public string Format { get; set; } - + [NotMapped] public bool UsePersist { get; set; } [NotMapped] diff --git a/Disco.Services/Logging/Models/LogLiveEvent.cs b/Disco.Services/Logging/Models/LogLiveEvent.cs index 9134b85a..4aa12e07 100644 --- a/Disco.Services/Logging/Models/LogLiveEvent.cs +++ b/Disco.Services/Logging/Models/LogLiveEvent.cs @@ -1,6 +1,6 @@ -using System; -using Disco.Models.Exporting; +using Disco.Models.Exporting; using Newtonsoft.Json; +using System; namespace Disco.Services.Logging.Models { diff --git a/Disco.Services/Logging/Utilities.cs b/Disco.Services/Logging/Utilities.cs index 25a291cc..c728efea 100644 --- a/Disco.Services/Logging/Utilities.cs +++ b/Disco.Services/Logging/Utilities.cs @@ -1,9 +1,9 @@ -using System; +using Microsoft.Win32.SafeHandles; +using System; using System.Collections.Generic; -using System.Linq; -using Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; using System.IO; +using System.Linq; +using System.Runtime.InteropServices; using System.Web.Mvc; namespace Disco.Services.Logging diff --git a/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs b/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs index 028440c6..83a489be 100644 --- a/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs +++ b/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs @@ -90,7 +90,8 @@ namespace Disco.Services.Plugins.Features.DetailsProvider return user.UserDetails .Where(d => string.Equals(d.Scope, DetailsScope, StringComparison.Ordinal)) .ToDictionary(d => d.Key, d => d.Value, StringComparer.OrdinalIgnoreCase); - } else + } + else { return database.UserDetails .Where(d => d.UserId == user.UserId && diff --git a/Disco.Services/Plugins/Features/RepairProvider/RepairProviderFeature.cs b/Disco.Services/Plugins/Features/RepairProvider/RepairProviderFeature.cs index e68a82aa..c12b7db9 100644 --- a/Disco.Services/Plugins/Features/RepairProvider/RepairProviderFeature.cs +++ b/Disco.Services/Plugins/Features/RepairProvider/RepairProviderFeature.cs @@ -15,7 +15,7 @@ namespace Disco.Services.Plugins.Features.RepairProvider /// The repairer identifier. Used to link this provider to any . This identifier is used to automatically set the RepairerName when a job is submitted using this plugin. /// public abstract string ProviderId { get; } - + #region Job Submission /// @@ -64,7 +64,7 @@ namespace Disco.Services.Plugins.Features.RepairProvider public virtual Tuple JobDetails(DiscoDataContext Database, Controller controller, Job Job) { return null; - } + } #endregion diff --git a/Disco.Services/Plugins/Features/UIExtension/UIExtensionFeature.cs b/Disco.Services/Plugins/Features/UIExtension/UIExtensionFeature.cs index 41dfd59e..bfa8895a 100644 --- a/Disco.Services/Plugins/Features/UIExtension/UIExtensionFeature.cs +++ b/Disco.Services/Plugins/Features/UIExtension/UIExtensionFeature.cs @@ -1,7 +1,7 @@ -using System; -using System.Web.Mvc; -using Disco.Models.UI; +using Disco.Models.UI; using Disco.Services.Plugins.Features.UIExtension.Results; +using System; +using System.Web.Mvc; namespace Disco.Services.Plugins.Features.UIExtension { @@ -19,7 +19,8 @@ namespace Disco.Services.Plugins.Features.UIExtension } public UIExtensionFeature() { - plugin = new Lazy(new Func(() => { + plugin = new Lazy(new Func(() => + { if (Context == null) throw new InvalidOperationException("The Context property is not initialized"); diff --git a/Disco.Services/Plugins/Features/UIExtension/UIExtensionResult.cs b/Disco.Services/Plugins/Features/UIExtension/UIExtensionResult.cs index 05c5018e..47b770fd 100644 --- a/Disco.Services/Plugins/Features/UIExtension/UIExtensionResult.cs +++ b/Disco.Services/Plugins/Features/UIExtension/UIExtensionResult.cs @@ -5,7 +5,7 @@ namespace Disco.Services.Plugins.Features.UIExtension public abstract class UIExtensionResult { public PluginFeatureManifest Source { get; private set; } - + public UIExtensionResult(PluginFeatureManifest Source) { this.Source = Source; diff --git a/Disco.Services/Plugins/Features/UIExtension/UIExtensions.cs b/Disco.Services/Plugins/Features/UIExtension/UIExtensions.cs index 0d184e7d..337a21d3 100644 --- a/Disco.Services/Plugins/Features/UIExtension/UIExtensions.cs +++ b/Disco.Services/Plugins/Features/UIExtension/UIExtensions.cs @@ -1,9 +1,9 @@ -using System; +using Disco.Models.UI; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Web; using System.Web.Mvc; -using Disco.Models.UI; namespace Disco.Services.Plugins.Features.UIExtension { diff --git a/Disco.Services/Plugins/Features/WarrantyProvider/WarrantyProviderFeature.cs b/Disco.Services/Plugins/Features/WarrantyProvider/WarrantyProviderFeature.cs index 7350b69d..dededab8 100644 --- a/Disco.Services/Plugins/Features/WarrantyProvider/WarrantyProviderFeature.cs +++ b/Disco.Services/Plugins/Features/WarrantyProvider/WarrantyProviderFeature.cs @@ -1,10 +1,10 @@ -using System; +using Disco.Data.Repository; +using Disco.Models.BI.Config; +using Disco.Models.Repository; +using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; -using Disco.Data.Repository; -using Disco.Models.BI.Config; -using Disco.Models.Repository; namespace Disco.Services.Plugins.Features.WarrantyProvider { diff --git a/Disco.Services/Plugins/InstallPluginTask.cs b/Disco.Services/Plugins/InstallPluginTask.cs index e14e9ad9..6e93f3de 100644 --- a/Disco.Services/Plugins/InstallPluginTask.cs +++ b/Disco.Services/Plugins/InstallPluginTask.cs @@ -72,7 +72,7 @@ namespace Disco.Services.Plugins Status.UpdateStatus(20, $"{packageManifest.Name} [{packageManifest.Id} v{packageManifest.Version.ToString(4)}] by {packageManifest.Author}", "Initializing Install Environment"); PluginsLog.LogInstalling(packageManifest); - + lock (Plugins._PluginLock) { if (!Plugins.PluginsLoaded) diff --git a/Disco.Services/Plugins/Plugin.cs b/Disco.Services/Plugins/Plugin.cs index 502bc4c4..57c691fb 100644 --- a/Disco.Services/Plugins/Plugin.cs +++ b/Disco.Services/Plugins/Plugin.cs @@ -1,12 +1,12 @@ -using System; -using Disco.Data.Repository; +using Disco.Data.Repository; using Disco.Services.Tasks; +using System; namespace Disco.Services.Plugins { public abstract class Plugin : IDisposable { - public PluginManifest Manifest {get; internal set;} + public PluginManifest Manifest { get; internal set; } #region Lifecycle // Events/Triggers for Custom Plugin Initialization (Optional) diff --git a/Disco.Services/Plugins/PluginConfigurationHandler.cs b/Disco.Services/Plugins/PluginConfigurationHandler.cs index 09e252ec..f1dd8a90 100644 --- a/Disco.Services/Plugins/PluginConfigurationHandler.cs +++ b/Disco.Services/Plugins/PluginConfigurationHandler.cs @@ -1,6 +1,6 @@ -using System; +using Disco.Data.Repository; +using System; using System.Web.Mvc; -using Disco.Data.Repository; namespace Disco.Services.Plugins { diff --git a/Disco.Services/Plugins/PluginExtensions.cs b/Disco.Services/Plugins/PluginExtensions.cs index 1bcc1ac8..b0c2024f 100644 --- a/Disco.Services/Plugins/PluginExtensions.cs +++ b/Disco.Services/Plugins/PluginExtensions.cs @@ -1,13 +1,13 @@ -using System; +using Disco.Services.Web.Bundles; +using System; using System.Collections.Generic; -using System.IO; -using System.Web.Mvc; -using System.Web.WebPages; -using System.Web.Routing; -using System.Web; -using System.Web.Mvc.Html; using System.Globalization; -using Disco.Services.Web.Bundles; +using System.IO; +using System.Web; +using System.Web.Mvc; +using System.Web.Mvc.Html; +using System.Web.Routing; +using System.Web.WebPages; namespace Disco.Services.Plugins { diff --git a/Disco.Services/Plugins/PluginFeature.cs b/Disco.Services/Plugins/PluginFeature.cs index 1ff8d78b..81b51e1f 100644 --- a/Disco.Services/Plugins/PluginFeature.cs +++ b/Disco.Services/Plugins/PluginFeature.cs @@ -1,11 +1,11 @@ -using System; -using Disco.Data.Repository; +using Disco.Data.Repository; +using System; namespace Disco.Services.Plugins { public abstract class PluginFeature : IDisposable { - public PluginFeatureManifest Manifest {get; internal set;} + public PluginFeatureManifest Manifest { get; internal set; } // Allow Custom Initialization (Optional) public virtual void Initialize(DiscoDataContext Database) { return; } diff --git a/Disco.Services/Plugins/PluginFeatureManifest.cs b/Disco.Services/Plugins/PluginFeatureManifest.cs index dd155968..351fe182 100644 --- a/Disco.Services/Plugins/PluginFeatureManifest.cs +++ b/Disco.Services/Plugins/PluginFeatureManifest.cs @@ -1,7 +1,7 @@ -using System; -using System.Linq; -using Disco.Data.Repository; +using Disco.Data.Repository; using Newtonsoft.Json; +using System; +using System.Linq; namespace Disco.Services.Plugins { diff --git a/Disco.Services/Plugins/PluginManifest.cs b/Disco.Services/Plugins/PluginManifest.cs index cbcf0edf..768cc5ae 100644 --- a/Disco.Services/Plugins/PluginManifest.cs +++ b/Disco.Services/Plugins/PluginManifest.cs @@ -1,4 +1,9 @@ -using System; +using Disco.Data.Repository; +using Disco.Services.Authorization; +using Disco.Services.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -6,11 +11,6 @@ using System.Reflection; using System.Security.Cryptography; using System.Web; using System.Web.Mvc; -using Disco.Data.Repository; -using Disco.Services.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Disco.Services.Authorization; using System.Web.Routing; namespace Disco.Services.Plugins diff --git a/Disco.Services/Plugins/PluginWebViewPage.cs b/Disco.Services/Plugins/PluginWebViewPage.cs index 5a8dd3a2..efb79b1b 100644 --- a/Disco.Services/Plugins/PluginWebViewPage.cs +++ b/Disco.Services/Plugins/PluginWebViewPage.cs @@ -6,7 +6,7 @@ namespace Disco.Services.Plugins { private Lazy> _plugin; - public PluginManifest Manifest {get;private set;} + public PluginManifest Manifest { get; private set; } public WebPageHelper Plugin { get @@ -20,7 +20,8 @@ namespace Disco.Services.Plugins var self = GetType(); Manifest = Plugins.GetPlugin(self.Assembly); - _plugin = new Lazy>(() => { + _plugin = new Lazy>(() => + { if (Context == null) throw new InvalidOperationException("The WebViewPage Context property is not initialized"); diff --git a/Disco.Services/Plugins/PluginsLog.cs b/Disco.Services/Plugins/PluginsLog.cs index b758d930..5d44495b 100644 --- a/Disco.Services/Plugins/PluginsLog.cs +++ b/Disco.Services/Plugins/PluginsLog.cs @@ -1,7 +1,7 @@ -using System; -using System.Collections.Generic; -using Disco.Services.Logging; +using Disco.Services.Logging; using Disco.Services.Logging.Models; +using System; +using System.Collections.Generic; using System.Reflection; namespace Disco.Services.Plugins @@ -180,249 +180,249 @@ namespace Disco.Services.Plugins { return new List { - new LogEventType - { - Id = (int)EventTypeIds.InitializingPlugins, - ModuleId = _ModuleId, - Name = "Initializing Plugins", - Format = "Starting plugin discovery and initialization from: {0}", - Severity = (int)LogEventType.Severities.Information, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.InitializingPluginAssembly, - ModuleId = _ModuleId, - Name = "Initializing Plugin Assembly", - Format = "Initializing Plugin Assembly: [{0}] From '{1}'", - Severity = (int)LogEventType.Severities.Information, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.InitializedPlugin, - ModuleId = _ModuleId, - Name = "Initialized Plugin", - Format = "Initialized Plugin: '{0} (v{1})' [{2}] From '{3}'", - Severity = (int)LogEventType.Severities.Information, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, new LogEventType - { - Id = (int)EventTypeIds.InitializedPluginFeature, - ModuleId = _ModuleId, - Name = "Initialized Plugin Feature", - Format = "Initialized Plugin Feature: '{1}' From '{0}'", - Severity = (int)LogEventType.Severities.Information, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.InitializeWarning, - ModuleId = _ModuleId, - Name = "Initialize Warning", - Format = "Initialize Warning: {0}", - Severity = (int)LogEventType.Severities.Warning, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.InitializeError, - ModuleId = _ModuleId, - Name = "Initialize Error", - Format = "Initialize Error: {0}", - Severity = (int)LogEventType.Severities.Error, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.InitializeException, - ModuleId = _ModuleId, - Name = "Initialize Exception", - Format = "Exception: {0}; {1}: {2}; {3}", - Severity = (int)LogEventType.Severities.Error, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.InitializeExceptionWithInner, - ModuleId = _ModuleId, - Name = "Initialize Exception with Inner Exception", - Format = "Exception: {0}; {1}: {2}; {3}; Inner: {4}: {5}; {6}", - Severity = (int)LogEventType.Severities.Error, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.PluginException, - ModuleId = _ModuleId, - Name = "Plugin Exception", - Format = "Exception: {0}; {1}: {2}; {3}", - Severity = (int)LogEventType.Severities.Error, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.PluginExceptionWithInner, - ModuleId = _ModuleId, - Name = "Plugin Exception with Inner Exception", - Format = "Exception: {0}; {1}: {2}; {3}; Inner: {4}: {5}; {6}", - Severity = (int)LogEventType.Severities.Error, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, + { + Id = (int)EventTypeIds.InitializingPlugins, + ModuleId = _ModuleId, + Name = "Initializing Plugins", + Format = "Starting plugin discovery and initialization from: {0}", + Severity = (int)LogEventType.Severities.Information, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, new LogEventType - { - Id = (int)EventTypeIds.PluginWarning, - ModuleId = _ModuleId, - Name = "Plugin Warning", - Format = "{0} [{1} v{2}]: {3}", - Severity = (int)LogEventType.Severities.Warning, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, + { + Id = (int)EventTypeIds.InitializingPluginAssembly, + ModuleId = _ModuleId, + Name = "Initializing Plugin Assembly", + Format = "Initializing Plugin Assembly: [{0}] From '{1}'", + Severity = (int)LogEventType.Severities.Information, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, new LogEventType - { - Id = (int)EventTypeIds.PluginMessage, - ModuleId = _ModuleId, - Name = "Plugin Message", - Format = "{0} [{1} v{2}]: {3}", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.PluginReferenceAssemblyLoaded, - ModuleId = _ModuleId, - Name = "Plugin Reference Assembly Loaded", - Format = "Loaded Plugin Reference Assembly: [{0}] From: '{1}'; Requested by: [{2}]", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.PluginConfigurationLoaded, - ModuleId = _ModuleId, - Name = "Plugin Configuration Loaded", - Format = "Plugin Configuration Loaded: [{0}] by [{1}]", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.PluginConfigurationSaved, - ModuleId = _ModuleId, - Name = "Plugin Configuration Saved", - Format = "Plugin Configuration Saved: [{0}] by [{1}]", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.PluginWebControllerAccessed, - ModuleId = _ModuleId, - Name = "Plugin Web Controller Accessed", - Format = "Plugin Web Controller Accessed: Plugin [{0}], Action [{1}], By [{2}]", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.Installing, - ModuleId = _ModuleId, - Name = "Installing Plugin", - Format = "Installing Plugin: {2} [{0} v{1}]", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.Installed, - ModuleId = _ModuleId, - Name = "Plugin Installed", - Format = "Plugin Installed: {2} [{0} v{1}], Location: {3}", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.BeforeUpdate, - ModuleId = _ModuleId, - Name = "Updating Plugin", - Format = "Updating Plugin: {1} [{0}], v{3} -> v{4}, Location: {2}", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.AfterUpdate, - ModuleId = _ModuleId, - Name = "Plugin Updated", - Format = "Plugin Updated: {1} [{0}], v{3} -> v{4}, Location: {2}", - Severity = (int)LogEventType.Severities.Information, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.Uninstalling, - ModuleId = _ModuleId, - Name = "Uninstalling Plugin", - Format = "Uninstalling Plugin: {1} [{0} v{3}], Location: {2}, UninstallData: {4}", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.Uninstalled, - ModuleId = _ModuleId, - Name = "Plugin Uninstalled", - Format = "Plugin Uninstalled: {1} [{0} v{3}], Location: {2}, UninstallData: {4}", - Severity = (int)LogEventType.Severities.Information, - UseLive = false, - UsePersist = true, - UseDisplay = true - } - }; + { + Id = (int)EventTypeIds.InitializedPlugin, + ModuleId = _ModuleId, + Name = "Initialized Plugin", + Format = "Initialized Plugin: '{0} (v{1})' [{2}] From '{3}'", + Severity = (int)LogEventType.Severities.Information, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.InitializedPluginFeature, + ModuleId = _ModuleId, + Name = "Initialized Plugin Feature", + Format = "Initialized Plugin Feature: '{1}' From '{0}'", + Severity = (int)LogEventType.Severities.Information, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.InitializeWarning, + ModuleId = _ModuleId, + Name = "Initialize Warning", + Format = "Initialize Warning: {0}", + Severity = (int)LogEventType.Severities.Warning, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.InitializeError, + ModuleId = _ModuleId, + Name = "Initialize Error", + Format = "Initialize Error: {0}", + Severity = (int)LogEventType.Severities.Error, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.InitializeException, + ModuleId = _ModuleId, + Name = "Initialize Exception", + Format = "Exception: {0}; {1}: {2}; {3}", + Severity = (int)LogEventType.Severities.Error, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.InitializeExceptionWithInner, + ModuleId = _ModuleId, + Name = "Initialize Exception with Inner Exception", + Format = "Exception: {0}; {1}: {2}; {3}; Inner: {4}: {5}; {6}", + Severity = (int)LogEventType.Severities.Error, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.PluginException, + ModuleId = _ModuleId, + Name = "Plugin Exception", + Format = "Exception: {0}; {1}: {2}; {3}", + Severity = (int)LogEventType.Severities.Error, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.PluginExceptionWithInner, + ModuleId = _ModuleId, + Name = "Plugin Exception with Inner Exception", + Format = "Exception: {0}; {1}: {2}; {3}; Inner: {4}: {5}; {6}", + Severity = (int)LogEventType.Severities.Error, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.PluginWarning, + ModuleId = _ModuleId, + Name = "Plugin Warning", + Format = "{0} [{1} v{2}]: {3}", + Severity = (int)LogEventType.Severities.Warning, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.PluginMessage, + ModuleId = _ModuleId, + Name = "Plugin Message", + Format = "{0} [{1} v{2}]: {3}", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.PluginReferenceAssemblyLoaded, + ModuleId = _ModuleId, + Name = "Plugin Reference Assembly Loaded", + Format = "Loaded Plugin Reference Assembly: [{0}] From: '{1}'; Requested by: [{2}]", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.PluginConfigurationLoaded, + ModuleId = _ModuleId, + Name = "Plugin Configuration Loaded", + Format = "Plugin Configuration Loaded: [{0}] by [{1}]", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.PluginConfigurationSaved, + ModuleId = _ModuleId, + Name = "Plugin Configuration Saved", + Format = "Plugin Configuration Saved: [{0}] by [{1}]", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.PluginWebControllerAccessed, + ModuleId = _ModuleId, + Name = "Plugin Web Controller Accessed", + Format = "Plugin Web Controller Accessed: Plugin [{0}], Action [{1}], By [{2}]", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.Installing, + ModuleId = _ModuleId, + Name = "Installing Plugin", + Format = "Installing Plugin: {2} [{0} v{1}]", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.Installed, + ModuleId = _ModuleId, + Name = "Plugin Installed", + Format = "Plugin Installed: {2} [{0} v{1}], Location: {3}", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.BeforeUpdate, + ModuleId = _ModuleId, + Name = "Updating Plugin", + Format = "Updating Plugin: {1} [{0}], v{3} -> v{4}, Location: {2}", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.AfterUpdate, + ModuleId = _ModuleId, + Name = "Plugin Updated", + Format = "Plugin Updated: {1} [{0}], v{3} -> v{4}, Location: {2}", + Severity = (int)LogEventType.Severities.Information, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.Uninstalling, + ModuleId = _ModuleId, + Name = "Uninstalling Plugin", + Format = "Uninstalling Plugin: {1} [{0} v{3}], Location: {2}, UninstallData: {4}", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.Uninstalled, + ModuleId = _ModuleId, + Name = "Plugin Uninstalled", + Format = "Plugin Uninstalled: {1} [{0} v{3}], Location: {2}, UninstallData: {4}", + Severity = (int)LogEventType.Severities.Information, + UseLive = false, + UsePersist = true, + UseDisplay = true + } + }; } } } diff --git a/Disco.Services/Plugins/UpdatePluginTask.cs b/Disco.Services/Plugins/UpdatePluginTask.cs index e40fab5d..ff9238f2 100644 --- a/Disco.Services/Plugins/UpdatePluginTask.cs +++ b/Disco.Services/Plugins/UpdatePluginTask.cs @@ -139,7 +139,8 @@ namespace Disco.Services.Plugins pluginPackagesLocation = database.DiscoConfiguration.PluginPackagesLocation; installedPluginManifests = OfflineInstalledPlugins(database); - if (installedPluginManifests.Count > 0){ + if (installedPluginManifests.Count > 0) + { libraryManifest = PluginLibrary.LoadManifest(database); libraryIncompatibility = libraryManifest.LoadIncompatibilityData(); } diff --git a/Disco.Services/Tasks/IScheduledTaskStatus.cs b/Disco.Services/Tasks/IScheduledTaskStatus.cs index db642825..5ed4ad30 100644 --- a/Disco.Services/Tasks/IScheduledTaskStatus.cs +++ b/Disco.Services/Tasks/IScheduledTaskStatus.cs @@ -17,8 +17,8 @@ namespace Disco.Services.Tasks string FinishedMessage { get; } string FinishedUrl { get; } - - Exception TaskException { get; } + + Exception TaskException { get; } void UpdateStatus(byte Progress); void UpdateStatus(double Progress); diff --git a/Disco.Services/Tasks/ScheduledTaskNotificationsHub.cs b/Disco.Services/Tasks/ScheduledTaskNotificationsHub.cs index a4370155..d777fe79 100644 --- a/Disco.Services/Tasks/ScheduledTaskNotificationsHub.cs +++ b/Disco.Services/Tasks/ScheduledTaskNotificationsHub.cs @@ -3,8 +3,8 @@ using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR.Hubs; using System; using System.Collections.Generic; -using System.Reactive.Linq; using System.Linq; +using System.Reactive.Linq; namespace Disco.Services.Tasks { diff --git a/Disco.Services/Tasks/ScheduledTasks.cs b/Disco.Services/Tasks/ScheduledTasks.cs index 3f824773..8963b2d1 100644 --- a/Disco.Services/Tasks/ScheduledTasks.cs +++ b/Disco.Services/Tasks/ScheduledTasks.cs @@ -1,9 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using Disco.Data.Repository; using Quartz; using Quartz.Impl; -using Disco.Data.Repository; +using System; +using System.Collections.Generic; +using System.Linq; using System.Reflection; namespace Disco.Services.Tasks diff --git a/Disco.Services/Tasks/ScheduledTasksLog.cs b/Disco.Services/Tasks/ScheduledTasksLog.cs index 48647b7e..ca6c050a 100644 --- a/Disco.Services/Tasks/ScheduledTasksLog.cs +++ b/Disco.Services/Tasks/ScheduledTasksLog.cs @@ -1,10 +1,10 @@ -using System; +using Disco.Services.Logging; +using Disco.Services.Logging.Models; +using System; using System.Collections.Generic; using System.Data; using System.Data.Entity.Validation; using System.Text; -using Disco.Services.Logging; -using Disco.Services.Logging.Models; namespace Disco.Services.Tasks { @@ -128,83 +128,83 @@ namespace Disco.Services.Tasks { return new List { - new LogEventType - { - Id = (int)EventTypeIds.InitializingScheduledTasks, - ModuleId = _ModuleId, - Name = "Initializing Scheduled Tasks", - Format = "Starting Scheduled Task discovery and initialization", - Severity = (int)LogEventType.Severities.Information, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.InitializeException, - ModuleId = _ModuleId, - Name = "Initialize Exception", - Format = "Exception: {0}: {1}; {2}", - Severity = (int)LogEventType.Severities.Error, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.InitializeExceptionWithInner, - ModuleId = _ModuleId, - Name = "Initialize Exception with Inner Exception", - Format = "Exception: {0}: {1}; {2}; Inner: {3}: {4}; {5}", - Severity = (int)LogEventType.Severities.Error, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, new LogEventType - { - Id = (int)EventTypeIds.InitializeScheduledTasksException, - ModuleId = _ModuleId, - Name = "Initialize Task Exception", - Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}", - Severity = (int)LogEventType.Severities.Error, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.InitializeScheduledTasksExceptionWithInner, - ModuleId = _ModuleId, - Name = "Initialize Task Exception with Inner Exception", - Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}; Inner: {5}: {6}; {7}", - Severity = (int)LogEventType.Severities.Error, - UseLive = false, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.ScheduledTasksException, - ModuleId = _ModuleId, - Name = "Scheduled Task Exception", - Format = "Task Name: {0}; SessionId: {1}; At: '{2}'; Exception: {3}: {4}; {5}", - Severity = (int)LogEventType.Severities.Error, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.ScheduledTasksExceptionWithInner, - ModuleId = _ModuleId, - Name = "Scheduled Task Exception with Inner Exception", - Format = "Task Name: {0}; SessionId: {1}; At: '{2}'; Exception: {3}: {4}; {5}; Inner: {6}: {7}; {8}", - Severity = (int)LogEventType.Severities.Error, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, + { + Id = (int)EventTypeIds.InitializingScheduledTasks, + ModuleId = _ModuleId, + Name = "Initializing Scheduled Tasks", + Format = "Starting Scheduled Task discovery and initialization", + Severity = (int)LogEventType.Severities.Information, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.InitializeException, + ModuleId = _ModuleId, + Name = "Initialize Exception", + Format = "Exception: {0}: {1}; {2}", + Severity = (int)LogEventType.Severities.Error, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.InitializeExceptionWithInner, + ModuleId = _ModuleId, + Name = "Initialize Exception with Inner Exception", + Format = "Exception: {0}: {1}; {2}; Inner: {3}: {4}; {5}", + Severity = (int)LogEventType.Severities.Error, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.InitializeScheduledTasksException, + ModuleId = _ModuleId, + Name = "Initialize Task Exception", + Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}", + Severity = (int)LogEventType.Severities.Error, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.InitializeScheduledTasksExceptionWithInner, + ModuleId = _ModuleId, + Name = "Initialize Task Exception with Inner Exception", + Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}; Inner: {5}: {6}; {7}", + Severity = (int)LogEventType.Severities.Error, + UseLive = false, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.ScheduledTasksException, + ModuleId = _ModuleId, + Name = "Scheduled Task Exception", + Format = "Task Name: {0}; SessionId: {1}; At: '{2}'; Exception: {3}: {4}; {5}", + Severity = (int)LogEventType.Severities.Error, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.ScheduledTasksExceptionWithInner, + ModuleId = _ModuleId, + Name = "Scheduled Task Exception with Inner Exception", + Format = "Task Name: {0}; SessionId: {1}; At: '{2}'; Exception: {3}: {4}; {5}; Inner: {6}: {7}; {8}", + Severity = (int)LogEventType.Severities.Error, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, new LogEventType { Id = (int)EventTypeIds.ScheduledTasksWarning, @@ -226,29 +226,29 @@ namespace Disco.Services.Tasks UseLive = true, UsePersist = true, UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.ScheduledTaskExecuted, - ModuleId = _ModuleId, - Name = "Scheduled Task Started", - Format = "Scheduled Task Started: {0}; Session Id: {1}", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - }, - new LogEventType - { - Id = (int)EventTypeIds.ScheduledTaskFinished, - ModuleId = _ModuleId, - Name = "Scheduled Task Finished", - Format = "Scheduled Task Finished: {0}; Session Id: {1}", - Severity = (int)LogEventType.Severities.Information, - UseLive = true, - UsePersist = true, - UseDisplay = true - } + }, + new LogEventType + { + Id = (int)EventTypeIds.ScheduledTaskExecuted, + ModuleId = _ModuleId, + Name = "Scheduled Task Started", + Format = "Scheduled Task Started: {0}; Session Id: {1}", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + }, + new LogEventType + { + Id = (int)EventTypeIds.ScheduledTaskFinished, + ModuleId = _ModuleId, + Name = "Scheduled Task Finished", + Format = "Scheduled Task Finished: {0}; Session Id: {1}", + Severity = (int)LogEventType.Severities.Information, + UseLive = true, + UsePersist = true, + UseDisplay = true + } }; } } diff --git a/Disco.Services/Users/UserFlags/UserFlagService.cs b/Disco.Services/Users/UserFlags/UserFlagService.cs index 8e2532ad..8139907a 100644 --- a/Disco.Services/Users/UserFlags/UserFlagService.cs +++ b/Disco.Services/Users/UserFlags/UserFlagService.cs @@ -189,7 +189,7 @@ namespace Disco.Services.Users.UserFlags Status.UpdateStatus((chunkIndexOffset + index) * progressInterval, $"Removing Flag: {flagAssignment.User.ToString()}"); flagAssignment.OnRemoveUnsafe(Database, Technician); - + return flagAssignment; }).ToList(); diff --git a/Disco.Services/Users/UserFlags/UserFlagsDeleteTask.cs b/Disco.Services/Users/UserFlags/UserFlagsDeleteTask.cs index 3c1a7026..fc8fb77f 100644 --- a/Disco.Services/Users/UserFlags/UserFlagsDeleteTask.cs +++ b/Disco.Services/Users/UserFlags/UserFlagsDeleteTask.cs @@ -8,7 +8,7 @@ namespace Disco.Services.Users.UserFlags { public override string TaskName { get { return "User Flags - Delete Flag"; } } - public override bool SingleInstanceTask { get { return false; }} + public override bool SingleInstanceTask { get { return false; } } public override bool CancelInitiallySupported { get { return false; } } public override bool LogExceptionsOnly { get { return true; } } diff --git a/Disco.Services/Web/AuthorizedDatabaseController.cs b/Disco.Services/Web/AuthorizedDatabaseController.cs index a9405126..5030164f 100644 --- a/Disco.Services/Web/AuthorizedDatabaseController.cs +++ b/Disco.Services/Web/AuthorizedDatabaseController.cs @@ -1,5 +1,5 @@ -using Disco.Services.Authorization; -using Disco.Models.Repository; +using Disco.Models.Repository; +using Disco.Services.Authorization; using Disco.Services.Users; namespace Disco.Services.Web diff --git a/Disco.Services/Web/Bundles/BundleExtensions.cs b/Disco.Services/Web/Bundles/BundleExtensions.cs index 35cc9240..1338101c 100644 --- a/Disco.Services/Web/Bundles/BundleExtensions.cs +++ b/Disco.Services/Web/Bundles/BundleExtensions.cs @@ -25,7 +25,7 @@ namespace Disco.Services.Web public static void BundleDeferred(this HtmlHelper htmlHelper, string BundleUrl) => htmlHelper.ViewContext.HttpContext.BundleDeferred(BundleUrl); - + public static HtmlString BundleRenderDeferred(this HtmlHelper htmlHelper) { var deferredBundles = htmlHelper.ViewContext.HttpContext.Items[BundleTable.DeferredKey] as List; diff --git a/Disco.Services/Web/Bundles/UrlBundle.cs b/Disco.Services/Web/Bundles/UrlBundle.cs index f5c39a39..a18b12a2 100644 --- a/Disco.Services/Web/Bundles/UrlBundle.cs +++ b/Disco.Services/Web/Bundles/UrlBundle.cs @@ -5,7 +5,7 @@ namespace Disco.Services.Web.Bundles public class UrlBundle : IBundle { public bool RemapRequest { get { return false; } } - + public string Url { get; private set; } public string VersionUrl { get; private set; } diff --git a/Disco.Services/Web/HelperExtensions.cs b/Disco.Services/Web/HelperExtensions.cs index 42c240e1..21f3adc5 100644 --- a/Disco.Services/Web/HelperExtensions.cs +++ b/Disco.Services/Web/HelperExtensions.cs @@ -28,7 +28,7 @@ namespace Disco.Services.Web ViewData = new ViewDataDictionary(model), TempData = filterContext.Controller.TempData }; - + filterContext.Result = result; filterContext.ExceptionHandled = true; contextResponse.Clear(); diff --git a/Disco.Web.Extensions/BIModelExtensions/PluginExtensions.cs b/Disco.Web.Extensions/BIModelExtensions/PluginExtensions.cs index 97f81c90..336bde25 100644 --- a/Disco.Web.Extensions/BIModelExtensions/PluginExtensions.cs +++ b/Disco.Web.Extensions/BIModelExtensions/PluginExtensions.cs @@ -1,8 +1,8 @@ -using System; +using Disco.Services.Plugins; +using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; -using Disco.Services.Plugins; namespace Disco.Web.Extensions { diff --git a/Disco.Web.Extensions/DataModelExtension/DeviceBatchExtensions.cs b/Disco.Web.Extensions/DataModelExtension/DeviceBatchExtensions.cs index 25c1d23e..237f733d 100644 --- a/Disco.Web.Extensions/DataModelExtension/DeviceBatchExtensions.cs +++ b/Disco.Web.Extensions/DataModelExtension/DeviceBatchExtensions.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Disco.Models.Repository; +using System.Collections.Generic; using System.Linq; using System.Web.Mvc; -using Disco.Models.Repository; namespace Disco.Web.Extensions { diff --git a/Disco.Web.Extensions/DataModelExtension/DeviceModelExtensions.cs b/Disco.Web.Extensions/DataModelExtension/DeviceModelExtensions.cs index 26f6dda7..53bf35dc 100644 --- a/Disco.Web.Extensions/DataModelExtension/DeviceModelExtensions.cs +++ b/Disco.Web.Extensions/DataModelExtension/DeviceModelExtensions.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Disco.Models.Repository; +using System.Collections.Generic; using System.Linq; using System.Web.Mvc; -using Disco.Models.Repository; namespace Disco.Web.Extensions { diff --git a/Disco.Web.Extensions/DataModelExtension/DeviceProfileExtensions.cs b/Disco.Web.Extensions/DataModelExtension/DeviceProfileExtensions.cs index ccffb83c..a60c27cb 100644 --- a/Disco.Web.Extensions/DataModelExtension/DeviceProfileExtensions.cs +++ b/Disco.Web.Extensions/DataModelExtension/DeviceProfileExtensions.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Disco.Models.Repository; +using System.Collections.Generic; using System.Linq; using System.Web.Mvc; -using Disco.Models.Repository; namespace Disco.Web.Extensions { diff --git a/Disco.Web.Extensions/DataModelExtension/JobSubTypeExtensions.cs b/Disco.Web.Extensions/DataModelExtension/JobSubTypeExtensions.cs index 5fdea7a6..9994875e 100644 --- a/Disco.Web.Extensions/DataModelExtension/JobSubTypeExtensions.cs +++ b/Disco.Web.Extensions/DataModelExtension/JobSubTypeExtensions.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Disco.Models.Repository; +using System.Collections.Generic; using System.Linq; using System.Web.Mvc; -using Disco.Models.Repository; namespace Disco.Web.Extensions { diff --git a/Disco.Web.Extensions/DataModelExtension/JobTypeExtensions.cs b/Disco.Web.Extensions/DataModelExtension/JobTypeExtensions.cs index 847fd52e..54039777 100644 --- a/Disco.Web.Extensions/DataModelExtension/JobTypeExtensions.cs +++ b/Disco.Web.Extensions/DataModelExtension/JobTypeExtensions.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Disco.Models.Repository; +using System.Collections.Generic; using System.Linq; -using Disco.Models.Repository; using System.Web.Mvc; namespace Disco.Web.Extensions diff --git a/Disco.Web.Extensions/MvcExtensions/JsonNet/JsonNetResult.cs b/Disco.Web.Extensions/MvcExtensions/JsonNet/JsonNetResult.cs index 8e58924a..82ca526f 100644 --- a/Disco.Web.Extensions/MvcExtensions/JsonNet/JsonNetResult.cs +++ b/Disco.Web.Extensions/MvcExtensions/JsonNet/JsonNetResult.cs @@ -1,7 +1,7 @@ -using System; +using Newtonsoft.Json; +using System; using System.Text; using System.Web.Mvc; -using Newtonsoft.Json; namespace Disco.Web.Extensions { diff --git a/Disco.Web.Extensions/MvcExtensions/PartialCompiled/PartialCompiledHtmlExtensions.cs b/Disco.Web.Extensions/MvcExtensions/PartialCompiled/PartialCompiledHtmlExtensions.cs index 1368749d..d98cdd54 100644 --- a/Disco.Web.Extensions/MvcExtensions/PartialCompiled/PartialCompiledHtmlExtensions.cs +++ b/Disco.Web.Extensions/MvcExtensions/PartialCompiled/PartialCompiledHtmlExtensions.cs @@ -1,9 +1,9 @@ using System; -using System.Web.Mvc; -using System.Web; -using System.Web.WebPages; -using System.IO; using System.Globalization; +using System.IO; +using System.Web; +using System.Web.Mvc; +using System.Web.WebPages; namespace Disco.Web.Extensions { diff --git a/Disco.Web.Extensions/RazorExtensions/DropDownListExtensions.cs b/Disco.Web.Extensions/RazorExtensions/DropDownListExtensions.cs index d7e6a321..4c0cc708 100644 --- a/Disco.Web.Extensions/RazorExtensions/DropDownListExtensions.cs +++ b/Disco.Web.Extensions/RazorExtensions/DropDownListExtensions.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using System.Web.Mvc.Html; using System.Web.Mvc; +using System.Web.Mvc.Html; namespace Disco.Web.Extensions { diff --git a/Disco.Web/App_Start/RazorGeneratorMvcStart.cs b/Disco.Web/App_Start/RazorGeneratorMvcStart.cs index 301ba032..54df704e 100644 --- a/Disco.Web/App_Start/RazorGeneratorMvcStart.cs +++ b/Disco.Web/App_Start/RazorGeneratorMvcStart.cs @@ -1,6 +1,6 @@ +using RazorGenerator.Mvc; using System.Web.Mvc; using System.Web.WebPages; -using RazorGenerator.Mvc; [assembly: WebActivatorEx.PostApplicationStartMethod(typeof(Disco.Web.RazorGeneratorMvcStart), "Start")] diff --git a/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs b/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs index 37bc8d2b..9072c8f4 100644 --- a/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs +++ b/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs @@ -121,7 +121,7 @@ namespace Disco.Web.Areas.API.Controllers } #region Update Shortcut Methods - + [DiscoAuthorize(Claims.Config.DeviceBatch.Configure)] public virtual ActionResult UpdateName(int id, string BatchName = null, bool redirect = false) { @@ -139,7 +139,7 @@ namespace Disco.Web.Areas.API.Controllers { return Update(id, pSupplier, Supplier, redirect); } - + [DiscoAuthorize(Claims.Config.DeviceBatch.Configure), ValidateInput(false)] public virtual ActionResult UpdatePurchaseDetails(int id, string PurchaseDetails = null, bool redirect = false) { @@ -169,7 +169,7 @@ namespace Disco.Web.Areas.API.Controllers { return Update(id, pWarrantyValidUntil, WarrantyValidUntil, redirect); } - + [DiscoAuthorize(Claims.Config.DeviceBatch.Configure), ValidateInput(false)] public virtual ActionResult UpdateWarrantyDetails(int id, string WarrantyDetails = null, bool redirect = false) { @@ -193,7 +193,7 @@ namespace Disco.Web.Areas.API.Controllers { return Update(id, pInsuredUntil, InsuredUntil, redirect); } - + [DiscoAuthorize(Claims.Config.DeviceBatch.Configure), ValidateInput(false)] public virtual ActionResult UpdateInsuranceDetails(int id, string InsuranceDetails = null, bool redirect = false) { diff --git a/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs b/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs index ffeb953a..994aa050 100644 --- a/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs +++ b/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs @@ -1263,7 +1263,8 @@ namespace Disco.Web.Areas.API.Controllers Scope = $"User Detail '{key}' didn't match any users{(string.IsNullOrWhiteSpace(value) ? null : $" with the value '{value}'")}", IsError = true, }); - } else + } + else { foreach (var user in details.Select(d => d.User).Distinct()) { @@ -1431,7 +1432,7 @@ namespace Disco.Web.Areas.API.Controllers UiUrl = handler.GenerationOptionsUi == null ? null : Url.Action(MVC.API.DocumentTemplate.GenerateDocumentHandlerUi(template.Id, target.AttachmentReferenceId, f.Id)), Icon = handler.GenerationOptionsIcon, }); - }; + } return Enumerable.Empty(); }).ToList(); diff --git a/Disco.Web/Areas/API/Controllers/JobQueueJobController.cs b/Disco.Web/Areas/API/Controllers/JobQueueJobController.cs index b49decd3..7726067a 100644 --- a/Disco.Web/Areas/API/Controllers/JobQueueJobController.cs +++ b/Disco.Web/Areas/API/Controllers/JobQueueJobController.cs @@ -92,7 +92,7 @@ namespace Disco.Web.Areas.API.Controllers { if (id < 0) throw new ArgumentOutOfRangeException("id"); - + var jobQueueJob = Database.JobQueueJobs.Include("Job").FirstOrDefault(jqj => jqj.Id == id); if (jobQueueJob != null) { @@ -115,7 +115,7 @@ namespace Disco.Web.Areas.API.Controllers else return Json($"Error: {ex.Message}", JsonRequestBehavior.AllowGet); } - } + } #endregion #region Update Properties @@ -139,7 +139,7 @@ namespace Disco.Web.Areas.API.Controllers { if (!jobQueueJob.CanEditSla()) throw new InvalidOperationException("Editing SLA for job queue job is Denied"); - + if (!string.IsNullOrEmpty(Sla)) { DateTime SLADate; diff --git a/Disco.Web/Areas/API/Controllers/PluginController.cs b/Disco.Web/Areas/API/Controllers/PluginController.cs index 41b094ac..98097db4 100644 --- a/Disco.Web/Areas/API/Controllers/PluginController.cs +++ b/Disco.Web/Areas/API/Controllers/PluginController.cs @@ -124,7 +124,7 @@ namespace Disco.Web.Areas.API.Controllers } } } - + ScheduledTaskStatus status; if (Plugins.PluginInstalled(packageManifest.Id)) status = UpdatePluginTask.UpdateLocalPlugin(packageManifest.Id, tempPluginLocation, immediateRestart); diff --git a/Disco.Web/Areas/API/Controllers/UserController.cs b/Disco.Web/Areas/API/Controllers/UserController.cs index 475a88d5..e02b0df2 100644 --- a/Disco.Web/Areas/API/Controllers/UserController.cs +++ b/Disco.Web/Areas/API/Controllers/UserController.cs @@ -246,7 +246,7 @@ namespace Disco.Web.Areas.API.Controllers public virtual async Task AttachmentOnlineUploadSession(string id, string domain) { var userId = ActiveDirectory.ParseDomainAccountId(id, domain); - if (!UserService.TryGetUser(userId, Database, false,out var user)) + if (!UserService.TryGetUser(userId, Database, false, out var user)) throw new InvalidOperationException("Unknown User"); try diff --git a/Disco.Web/Areas/API/Models/DocumentTemplate/DocumentHandlersModel.cs b/Disco.Web/Areas/API/Models/DocumentTemplate/DocumentHandlersModel.cs index 75961340..a30f1127 100644 --- a/Disco.Web/Areas/API/Models/DocumentTemplate/DocumentHandlersModel.cs +++ b/Disco.Web/Areas/API/Models/DocumentTemplate/DocumentHandlersModel.cs @@ -8,7 +8,7 @@ namespace Disco.Web.Areas.API.Models.DocumentTemplate public string TemplateName { get; set; } public string TargetId { get; set; } public string TargetName { get; set; } - + public List Handlers { get; set; } } diff --git a/Disco.Web/Areas/API/Models/Logs/LogModuleModel.cs b/Disco.Web/Areas/API/Models/Logs/LogModuleModel.cs index f396b37f..c1b64f0a 100644 --- a/Disco.Web/Areas/API/Models/Logs/LogModuleModel.cs +++ b/Disco.Web/Areas/API/Models/Logs/LogModuleModel.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Disco.Services.Logging; +using System.Collections.Generic; using System.Linq; -using Disco.Services.Logging; namespace Disco.Web.Areas.API.Models.Logs { diff --git a/Disco.Web/Areas/Config/ConfigAreaRegistration.cs b/Disco.Web/Areas/Config/ConfigAreaRegistration.cs index 6ee44e7b..c7b83a2e 100644 --- a/Disco.Web/Areas/Config/ConfigAreaRegistration.cs +++ b/Disco.Web/Areas/Config/ConfigAreaRegistration.cs @@ -138,7 +138,7 @@ namespace Disco.Web.Areas.Config context.MapRoute( "Config_Plugins", "Config/Plugins", - new { controller = "Plugins", action = "Index"} + new { controller = "Plugins", action = "Index" } ); context.MapRoute( "Config_Plugins_Install", diff --git a/Disco.Web/Areas/Config/Controllers/PluginsController.cs b/Disco.Web/Areas/Config/Controllers/PluginsController.cs index 6273165e..d004d975 100644 --- a/Disco.Web/Areas/Config/Controllers/PluginsController.cs +++ b/Disco.Web/Areas/Config/Controllers/PluginsController.cs @@ -15,10 +15,10 @@ namespace Disco.Web.Areas.Config.Controllers public virtual ActionResult Index() { IndexViewModel vm = new IndexViewModel() - { - PluginManifests = Plugins.GetPlugins(), - PluginLibrary = PluginLibrary.LoadManifest(Database) - }; + { + PluginManifests = Plugins.GetPlugins(), + PluginLibrary = PluginLibrary.LoadManifest(Database) + }; return View(vm); } diff --git a/Disco.Web/Areas/Config/Models/AuthorizationRole/IndexModel.cs b/Disco.Web/Areas/Config/Models/AuthorizationRole/IndexModel.cs index 86cd3e58..882d4e02 100644 --- a/Disco.Web/Areas/Config/Models/AuthorizationRole/IndexModel.cs +++ b/Disco.Web/Areas/Config/Models/AuthorizationRole/IndexModel.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Disco.Models.Services.Authorization; using Disco.Models.UI.Config.AuthorizationRole; -using Disco.Models.Services.Authorization; using Disco.Web.Areas.API.Models.Shared; +using System.Collections.Generic; namespace Disco.Web.Areas.Config.Models.AuthorizationRole { diff --git a/Disco.Web/Areas/Config/Models/DeviceBatch/IndexModel.cs b/Disco.Web/Areas/Config/Models/DeviceBatch/IndexModel.cs index 2d926f46..4ef95bce 100644 --- a/Disco.Web/Areas/Config/Models/DeviceBatch/IndexModel.cs +++ b/Disco.Web/Areas/Config/Models/DeviceBatch/IndexModel.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Linq; -using Disco.Data.Repository; +using Disco.Data.Repository; using Disco.Models.UI.Config.DeviceBatch; +using System.Collections.Generic; +using System.Linq; namespace Disco.Web.Areas.Config.Models.DeviceBatch { diff --git a/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs b/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs index 263fd256..fc8d39d8 100644 --- a/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs +++ b/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs @@ -10,7 +10,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceBatch public Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; } public Disco.Models.Repository.DeviceModel DefaultDeviceModel { get; set; } - + public List DeviceModels { get; set; } public List DeviceModelMembers { get; set; } diff --git a/Disco.Web/Areas/Config/Models/DeviceBatch/_IndexModelItem.cs b/Disco.Web/Areas/Config/Models/DeviceBatch/_IndexModelItem.cs index 134d4ac0..d5e788e6 100644 --- a/Disco.Web/Areas/Config/Models/DeviceBatch/_IndexModelItem.cs +++ b/Disco.Web/Areas/Config/Models/DeviceBatch/_IndexModelItem.cs @@ -1,6 +1,6 @@ -using System; +using Disco.Models.UI.Config.DeviceBatch; +using System; using System.ComponentModel.DataAnnotations; -using Disco.Models.UI.Config.DeviceBatch; namespace Disco.Web.Areas.Config.Models.DeviceBatch { diff --git a/Disco.Web/Areas/Config/Models/DeviceModel/IndexModel.cs b/Disco.Web/Areas/Config/Models/DeviceModel/IndexModel.cs index 23607116..0b213961 100644 --- a/Disco.Web/Areas/Config/Models/DeviceModel/IndexModel.cs +++ b/Disco.Web/Areas/Config/Models/DeviceModel/IndexModel.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Linq; -using Disco.Data.Repository; +using Disco.Data.Repository; using Disco.Models.UI.Config.DeviceModel; +using System.Collections.Generic; +using System.Linq; namespace Disco.Web.Areas.Config.Models.DeviceModel { diff --git a/Disco.Web/Areas/Config/Models/DocumentTemplate/CreateModel.cs b/Disco.Web/Areas/Config/Models/DocumentTemplate/CreateModel.cs index 82be2e0c..4ae057c0 100644 --- a/Disco.Web/Areas/Config/Models/DocumentTemplate/CreateModel.cs +++ b/Disco.Web/Areas/Config/Models/DocumentTemplate/CreateModel.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; +using Disco.Data.Repository; +using Disco.Models.UI.Config.DocumentTemplate; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; -using System.ComponentModel.DataAnnotations; -using Disco.Data.Repository; -using Disco.Models.UI.Config.DocumentTemplate; namespace Disco.Web.Areas.Config.Models.DocumentTemplate { diff --git a/Disco.Web/Areas/Config/Models/DocumentTemplate/CreatePackageModel.cs b/Disco.Web/Areas/Config/Models/DocumentTemplate/CreatePackageModel.cs index 9f79be0d..bfe637d8 100644 --- a/Disco.Web/Areas/Config/Models/DocumentTemplate/CreatePackageModel.cs +++ b/Disco.Web/Areas/Config/Models/DocumentTemplate/CreatePackageModel.cs @@ -7,7 +7,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate public class CreatePackageModel : ConfigDocumentTemplateCreatePackageModel { public DocumentTemplatePackage Package { get; set; } - + public List Scopes { get diff --git a/Disco.Web/Areas/Config/Models/DocumentTemplate/UndetectedPagesModel.cs b/Disco.Web/Areas/Config/Models/DocumentTemplate/UndetectedPagesModel.cs index b5cbc267..7ff6c1b7 100644 --- a/Disco.Web/Areas/Config/Models/DocumentTemplate/UndetectedPagesModel.cs +++ b/Disco.Web/Areas/Config/Models/DocumentTemplate/UndetectedPagesModel.cs @@ -7,7 +7,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate { public class UndetectedPagesModel : ConfigDocumentTemplateUndetectedPagesModel { - + public List DocumentTemplates { get; set; } public List DocumentTemplatesSelectListItems diff --git a/Disco.Web/Areas/Config/Models/Logging/IndexModel.cs b/Disco.Web/Areas/Config/Models/Logging/IndexModel.cs index 887d0e02..5f63ad3e 100644 --- a/Disco.Web/Areas/Config/Models/Logging/IndexModel.cs +++ b/Disco.Web/Areas/Config/Models/Logging/IndexModel.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Disco.Models.UI.Config.Logging; using Disco.Services.Logging; using Disco.Services.Logging.Models; -using Disco.Models.UI.Config.Logging; +using System.Collections.Generic; namespace Disco.Web.Areas.Config.Models.Logging { diff --git a/Disco.Web/Areas/Config/Models/Organisation/IndexModel.cs b/Disco.Web/Areas/Config/Models/Organisation/IndexModel.cs index 7ebfc3ff..fd0a6dd7 100644 --- a/Disco.Web/Areas/Config/Models/Organisation/IndexModel.cs +++ b/Disco.Web/Areas/Config/Models/Organisation/IndexModel.cs @@ -1,14 +1,14 @@ -using System.Collections.Generic; -using Disco.Models.BI.Config; -using System.ComponentModel.DataAnnotations; +using Disco.Models.BI.Config; using Disco.Models.UI.Config.Organisation; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; namespace Disco.Web.Areas.Config.Models.Organisation { public class IndexModel : ConfigOrganisationIndexModel { public string OrganisationName { get; set; } - [Display(Name="Enabled")] + [Display(Name = "Enabled")] public bool MultiSiteMode { get; set; } public List OrganisationAddresses { get; set; } } diff --git a/Disco.Web/Areas/Config/Models/Plugins/IndexViewModel.cs b/Disco.Web/Areas/Config/Models/Plugins/IndexViewModel.cs index 22af0711..047b3760 100644 --- a/Disco.Web/Areas/Config/Models/Plugins/IndexViewModel.cs +++ b/Disco.Web/Areas/Config/Models/Plugins/IndexViewModel.cs @@ -23,7 +23,7 @@ namespace Disco.Web.Areas.Config.Models.Plugins if (PluginLibrary == null || PluginLibrary.Plugins == null || PluginLibrary.Plugins.Count == 0 || PluginManifests == null || PluginManifests.Count == 0) { - _PluginUpdates = new Dictionary>(); // No Updates + _PluginUpdates = new Dictionary>(); // No Updates } else { diff --git a/Disco.Web/Areas/Config/Models/Shared/LinkedGroupModel.cs b/Disco.Web/Areas/Config/Models/Shared/LinkedGroupModel.cs index bdfd4e2e..c88db861 100644 --- a/Disco.Web/Areas/Config/Models/Shared/LinkedGroupModel.cs +++ b/Disco.Web/Areas/Config/Models/Shared/LinkedGroupModel.cs @@ -8,7 +8,7 @@ namespace Disco.Web.Areas.Config.Models.Shared public string Description { get; set; } public string CategoryDescription { get; set; } - + public string UpdateUrl { get; set; } public ADManagedGroup ManagedGroup { get; set; } diff --git a/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs b/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs index 9adb5d4e..2252b0db 100644 --- a/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs +++ b/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs @@ -77,7 +77,7 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig #region Active Directory - [Display(Name="Search All Servers")] + [Display(Name = "Search All Servers")] public bool ADSearchAllServers { get; set; } public List ADDomains { get; set; } diff --git a/Disco.Web/Areas/Public/Models/UserHeldDevices/HeldJobDeviceModel.cs b/Disco.Web/Areas/Public/Models/UserHeldDevices/HeldJobDeviceModel.cs index 3608302f..6a3add7f 100644 --- a/Disco.Web/Areas/Public/Models/UserHeldDevices/HeldJobDeviceModel.cs +++ b/Disco.Web/Areas/Public/Models/UserHeldDevices/HeldJobDeviceModel.cs @@ -20,14 +20,14 @@ namespace Disco.Web.Areas.Public.Models.UserHeldDevices public UserHeldDeviceModel ToUserHeldDeviceModel(DiscoDataContext Database) { var uhdm = new UserHeldDeviceModel() - { - UserId = UserId, - UserDisplayName = UserDisplayName, - ReadyForReturn = ReadyForReturn, - WaitingForUserAction = WaitingForUserAction, - DeviceProfileId = DeviceProfileId, - DeviceAddress = (DeviceAddressId.HasValue ? Database.DiscoConfiguration.OrganisationAddresses.GetAddress(DeviceAddressId.Value)?.ShortName : string.Empty) - }; + { + UserId = UserId, + UserDisplayName = UserDisplayName, + ReadyForReturn = ReadyForReturn, + WaitingForUserAction = WaitingForUserAction, + DeviceProfileId = DeviceProfileId, + DeviceAddress = (DeviceAddressId.HasValue ? Database.DiscoConfiguration.OrganisationAddresses.GetAddress(DeviceAddressId.Value)?.ShortName : string.Empty) + }; var n = DateTime.Now; if (!ReadyForReturn && EstimatedReturnTime.HasValue && EstimatedReturnTime.Value > n) { diff --git a/Disco.Web/Controllers/InitialConfigController.cs b/Disco.Web/Controllers/InitialConfigController.cs index 173575a9..d57e9e02 100644 --- a/Disco.Web/Controllers/InitialConfigController.cs +++ b/Disco.Web/Controllers/InitialConfigController.cs @@ -67,7 +67,8 @@ namespace Disco.Web.Controllers { if (!Request.IsLocal && !ServerIsCoreSKU.Value && !("true".Equals(ConfigurationManager.AppSettings["DiscoAllowRemoteMaintenance"], StringComparison.OrdinalIgnoreCase))) { - filterContext.Result = new ContentResult() { + filterContext.Result = new ContentResult() + { Content = "Initial Configuration of Disco ICT is only allowed via a localhost connection", ContentType = "text/plain" }; diff --git a/Disco.Web/Controllers/PluginWebHandlerController.cs b/Disco.Web/Controllers/PluginWebHandlerController.cs index 2d7f7bb8..37ff0f8d 100644 --- a/Disco.Web/Controllers/PluginWebHandlerController.cs +++ b/Disco.Web/Controllers/PluginWebHandlerController.cs @@ -1,10 +1,10 @@ -using System; +using Disco.Services.Authorization; +using Disco.Services.Interop; +using Disco.Services.Plugins; +using Disco.Services.Users; +using System; using System.IO; using System.Web.Mvc; -using Disco.Services.Plugins; -using Disco.Services.Authorization; -using Disco.Services.Users; -using Disco.Services.Interop; namespace Disco.Web.Controllers { diff --git a/Disco.Web/Models/Device/AddOfflineModel.cs b/Disco.Web/Models/Device/AddOfflineModel.cs index be0e1150..887cf68e 100644 --- a/Disco.Web/Models/Device/AddOfflineModel.cs +++ b/Disco.Web/Models/Device/AddOfflineModel.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; -using Disco.Models.UI.Device; +using Disco.Models.UI.Device; +using System.Collections.Generic; namespace Disco.Web.Models.Device { diff --git a/Disco.Web/Models/InitialConfig/DatabaseModel.cs b/Disco.Web/Models/InitialConfig/DatabaseModel.cs index 625cd30e..a0f7bb49 100644 --- a/Disco.Web/Models/InitialConfig/DatabaseModel.cs +++ b/Disco.Web/Models/InitialConfig/DatabaseModel.cs @@ -73,7 +73,7 @@ namespace Disco.Web.Models.InitialConfig [CustomValidation(typeof(DatabaseModel), "SqlAuthRequired", ErrorMessage = "When using SQL Authentication a Username is required")] public string Auth_SQL_Username { get; set; } - [DataType(DataType.Password), CustomValidation(typeof(DatabaseModel), "SqlAuthRequired", ErrorMessage="When using SQL Authentication a Password is required")] + [DataType(DataType.Password), CustomValidation(typeof(DatabaseModel), "SqlAuthRequired", ErrorMessage = "When using SQL Authentication a Password is required")] public string Auth_SQL_Password { get; set; } public List AuthMethods diff --git a/Disco.Web/Models/Job/IndexModel.cs b/Disco.Web/Models/Job/IndexModel.cs index 56770f84..87a4168e 100644 --- a/Disco.Web/Models/Job/IndexModel.cs +++ b/Disco.Web/Models/Job/IndexModel.cs @@ -1,6 +1,6 @@ using Disco.Models.ClientServices; -using Disco.Models.Services.Jobs.Statistics; using Disco.Models.Services.Jobs.JobLists; +using Disco.Models.Services.Jobs.Statistics; using Disco.Models.UI.Job; using System.Collections.Generic; diff --git a/Disco.Web/Models/Job/LogInsuranceModel.cs b/Disco.Web/Models/Job/LogInsuranceModel.cs index cb5c7ae0..94aa90dc 100644 --- a/Disco.Web/Models/Job/LogInsuranceModel.cs +++ b/Disco.Web/Models/Job/LogInsuranceModel.cs @@ -6,8 +6,8 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; using System.Data.Entity; +using System.Linq; namespace Disco.Web.Models.Job { diff --git a/Disco.Web/Models/Job/LogWarrantyModel.cs b/Disco.Web/Models/Job/LogWarrantyModel.cs index 7fa1855b..6eca7ff4 100644 --- a/Disco.Web/Models/Job/LogWarrantyModel.cs +++ b/Disco.Web/Models/Job/LogWarrantyModel.cs @@ -82,7 +82,8 @@ namespace Disco.Web.Models.Job try { UserService.GetUser(jobUserId, Database, true); - } catch (Exception) {} + } + catch (Exception) { } } Job = Database.Jobs diff --git a/Disco.Web/Models/Search/QueryModel.cs b/Disco.Web/Models/Search/QueryModel.cs index 5b0894fa..08a53bfd 100644 --- a/Disco.Web/Models/Search/QueryModel.cs +++ b/Disco.Web/Models/Search/QueryModel.cs @@ -1,5 +1,5 @@ -using Disco.Models.Services.Searching; -using Disco.Models.Services.Jobs.JobLists; +using Disco.Models.Services.Jobs.JobLists; +using Disco.Models.Services.Searching; using Disco.Models.UI.Search; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/Disco.Web/Models/Shared/ExportFieldsModel.cs b/Disco.Web/Models/Shared/ExportFieldsModel.cs index 76f9b18c..cb5c9ba7 100644 --- a/Disco.Web/Models/Shared/ExportFieldsModel.cs +++ b/Disco.Web/Models/Shared/ExportFieldsModel.cs @@ -69,7 +69,7 @@ namespace Disco.Web.Models.Shared List userCustomDetailKeys; using (var database = new DiscoDataContext()) userCustomDetailKeys = database.UserDetails.Where(d => d.Scope == "Details").Select(d => d.Key).Distinct().OrderBy(k => k).ToList(); - + if (userCustomDetailKeys.Any()) { var fieldKey = ((MemberExpression)modelAccessor.Body).Member.Name;