diff --git a/Disco.ClientBootstrapper/BootstrapperLoop.cs b/Disco.ClientBootstrapper/BootstrapperLoop.cs index a9577cfc..0e7359e3 100644 --- a/Disco.ClientBootstrapper/BootstrapperLoop.cs +++ b/Disco.ClientBootstrapper/BootstrapperLoop.cs @@ -30,15 +30,15 @@ namespace Disco.ClientBootstrapper public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback) { - this.statusUI = StatusUI; - this.mLoopCompleteCallback = Callback; - this.errorMessage = new StringBuilder(); + statusUI = StatusUI; + mLoopCompleteCallback = Callback; + errorMessage = new StringBuilder(); } public void Start() { - this.LoopThread = new Thread(new ThreadStart(loopHost)); - this.LoopThread.Start(); + LoopThread = new Thread(new ThreadStart(loopHost)); + LoopThread.Start(); } private void loopHost() @@ -133,9 +133,9 @@ namespace Disco.ClientBootstrapper if (!Interop.NetworkInterop.PingDiscoIct(DiscoServerName)) { // Client Failed - if (this.mLoopCompleteCallback != null) + if (mLoopCompleteCallback != null) { - this.mLoopCompleteCallback.BeginInvoke(null, null); + mLoopCompleteCallback.BeginInvoke(null, null); } return; } @@ -197,15 +197,15 @@ namespace Disco.ClientBootstrapper Interop.CertificateInterop.RemoveTempCerts(); // Pause if Error - if (this.errorMessage.Length > 0) + if (errorMessage.Length > 0) { Program.SleepThread(10000, true); } // End Of Loop - if (this.mLoopCompleteCallback != null) + if (mLoopCompleteCallback != null) { - this.mLoopCompleteCallback.BeginInvoke(null, null); + mLoopCompleteCallback.BeginInvoke(null, null); } } diff --git a/Disco.ClientBootstrapper/InstallLoop.cs b/Disco.ClientBootstrapper/InstallLoop.cs index 36a9a798..8923f22f 100644 --- a/Disco.ClientBootstrapper/InstallLoop.cs +++ b/Disco.ClientBootstrapper/InstallLoop.cs @@ -22,9 +22,9 @@ namespace Disco.ClientBootstrapper public void Start(CompleteCallback Callback) { - this.mCompleteCallback = Callback; - this.LoopThread = new Thread(new ThreadStart(loopHost)); - this.LoopThread.Start(); + mCompleteCallback = Callback; + LoopThread = new Thread(new ThreadStart(loopHost)); + LoopThread.Start(); } private void loopHost() { @@ -33,10 +33,10 @@ namespace Disco.ClientBootstrapper //Program.Status.UpdateStatus(null, null, "Testing UI"); //Program.SleepThread(5000, false); - Interop.InstallInterop.Install(this.InstallLocation, this.WimImageId, this.TempPath); - if (this.mCompleteCallback != null) + Interop.InstallInterop.Install(InstallLocation, WimImageId, TempPath); + if (mCompleteCallback != null) { - this.mCompleteCallback.BeginInvoke(null, null); + mCompleteCallback.BeginInvoke(null, null); } } catch (Exception ex) diff --git a/Disco.ClientBootstrapper/Interop/NetworkAdapter.cs b/Disco.ClientBootstrapper/Interop/NetworkAdapter.cs index ccbf53b0..8c446b2e 100644 --- a/Disco.ClientBootstrapper/Interop/NetworkAdapter.cs +++ b/Disco.ClientBootstrapper/Interop/NetworkAdapter.cs @@ -27,28 +27,28 @@ namespace Disco.ClientBootstrapper.Interop private void UpdateFromWmi(ManagementObject wmiObject) { - this.WmiPath = (string)wmiObject.GetPropertyValue("__PATH"); - this.Index = (UInt32)wmiObject.GetPropertyValue("Index"); - this.Guid = Guid.Parse((string)wmiObject.GetPropertyValue("GUID")); - this.MACAddress = (string)wmiObject.GetPropertyValue("MACAddress"); - this.Name = (string)wmiObject.GetPropertyValue("Name"); - this.NetConnectionID = (string)wmiObject.GetPropertyValue("NetConnectionID"); - this.Speed = (UInt64)wmiObject.GetPropertyValue("Speed"); + WmiPath = (string)wmiObject.GetPropertyValue("__PATH"); + Index = (UInt32)wmiObject.GetPropertyValue("Index"); + Guid = Guid.Parse((string)wmiObject.GetPropertyValue("GUID")); + MACAddress = (string)wmiObject.GetPropertyValue("MACAddress"); + Name = (string)wmiObject.GetPropertyValue("Name"); + NetConnectionID = (string)wmiObject.GetPropertyValue("NetConnectionID"); + Speed = (UInt64)wmiObject.GetPropertyValue("Speed"); var connectionStatus = ConnectionStatus; - this.IsWireless = true; + IsWireless = true; try { var wirelessConnectionStatus = WirelessConnectionStatus; } catch (Exception) { - this.IsWireless = false; + IsWireless = false; }; } public int WirelessConnectionStatus { get { - if (this.IsWireless) + if (IsWireless) { IntPtr handle = IntPtr.Zero; uint negotiatedVersion; @@ -61,17 +61,17 @@ namespace Disco.ClientBootstrapper.Interop uint dataSize; - var interfaceGuid = this.Guid; + var interfaceGuid = Guid; if (NetworkInterop.WlanQueryInterface(handle, ref interfaceGuid, NetworkInterop.WLAN_INTF_OPCODE.wlan_intf_opcode_interface_state, IntPtr.Zero, out dataSize, ref ptr, IntPtr.Zero) != 0) throw new NotSupportedException("This network adapter does not support Wireless"); - this.LastWirelessConnectionStatus = Marshal.ReadInt32(ptr); + LastWirelessConnectionStatus = Marshal.ReadInt32(ptr); NetworkInterop.WlanFreeMemory(ptr); - return this.LastWirelessConnectionStatus; + return LastWirelessConnectionStatus; } finally { @@ -115,11 +115,11 @@ namespace Disco.ClientBootstrapper.Interop { get { - using (var wmiObject = new ManagementObject(this.WmiPath)) + using (var wmiObject = new ManagementObject(WmiPath)) { - this.LastConnectionStatus = (UInt16)wmiObject.GetPropertyValue("NetConnectionStatus"); + LastConnectionStatus = (UInt16)wmiObject.GetPropertyValue("NetConnectionStatus"); } - return this.LastConnectionStatus; + return LastConnectionStatus; } } public string ConnectionStatusMeaning(UInt16 status) diff --git a/Disco.ClientBootstrapper/Interop/NetworkInterop.cs b/Disco.ClientBootstrapper/Interop/NetworkInterop.cs index 297ca536..37aa8a04 100644 --- a/Disco.ClientBootstrapper/Interop/NetworkInterop.cs +++ b/Disco.ClientBootstrapper/Interop/NetworkInterop.cs @@ -239,7 +239,7 @@ namespace Disco.ClientBootstrapper.Interop public bool AddProfile(IntPtr WlanHandle, Guid interfaceGuid) { var pInterfaceGuid = interfaceGuid; - var pProfileXml = this.ProfileXml; + var pProfileXml = ProfileXml; uint pFlag = 0; uint failReason; return (WlanSetProfile(WlanHandle, ref pInterfaceGuid, pFlag, pProfileXml, null, true, IntPtr.Zero, out failReason) == 0); diff --git a/Disco.ClientBootstrapper/Interop/RegistryInterop.cs b/Disco.ClientBootstrapper/Interop/RegistryInterop.cs index 98e1f151..e8111704 100644 --- a/Disco.ClientBootstrapper/Interop/RegistryInterop.cs +++ b/Disco.ClientBootstrapper/Interop/RegistryInterop.cs @@ -80,20 +80,20 @@ namespace Disco.ClientBootstrapper.Interop uint regHive = (uint)hive; - this.Hive = hive; - this.SubKey = subKey; + Hive = hive; + SubKey = subKey; RegLoadKey(regHive, subKey, filePath); - this.IsUnloaded = false; + IsUnloaded = false; } public void Unload() { if (!IsUnloaded) { - uint regHive = (uint)this.Hive; - string subKey = this.SubKey; + uint regHive = (uint)Hive; + string subKey = SubKey; RegUnLoadKey(regHive, subKey); - this.IsUnloaded = true; + IsUnloaded = true; } } diff --git a/Disco.ClientBootstrapper/Interop/WIMInterop.cs b/Disco.ClientBootstrapper/Interop/WIMInterop.cs index e68cb9a9..81a3a9db 100644 --- a/Disco.ClientBootstrapper/Interop/WIMInterop.cs +++ b/Disco.ClientBootstrapper/Interop/WIMInterop.cs @@ -480,7 +480,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop // //Never commit changes when destroying this object. // - this.DismountImage(false); + DismountImage(false); } GC.KeepAlive(this); } diff --git a/Disco.Data/Configuration/ConfigurationBase.cs b/Disco.Data/Configuration/ConfigurationBase.cs index a148e41a..1f1bc278 100644 --- a/Disco.Data/Configuration/ConfigurationBase.cs +++ b/Disco.Data/Configuration/ConfigurationBase.cs @@ -28,17 +28,17 @@ namespace Disco.Data.Configuration { get { - return ConfigurationCache.GetScopeKeys(Database, this.Scope); + return ConfigurationCache.GetScopeKeys(Database, Scope); } } private void SetValue(string Key, T Value) { - ConfigurationCache.Helpers.SetValue(Database, this.Scope, Key, Value); + ConfigurationCache.Helpers.SetValue(Database, Scope, Key, Value); } private T GetValue(string Key, T Default) { - return ConfigurationCache.Helpers.GetValue(Database, this.Scope, Key, Default); + return ConfigurationCache.Helpers.GetValue(Database, Scope, Key, Default); } protected void Set(T Value, [CallerMemberName] string Key = null) @@ -46,7 +46,7 @@ namespace Disco.Data.Configuration if (Key == null) throw new ArgumentNullException("Key"); - this.SetValue(Key, Value); + SetValue(Key, Value); } protected T Get(T Default, [CallerMemberName] string Key = null) @@ -54,17 +54,17 @@ namespace Disco.Data.Configuration if (Key == null) throw new ArgumentNullException("Key"); - return this.GetValue(Key, Default); + return GetValue(Key, Default); } protected void SetObsfucated(string Value, [CallerMemberName] string Key = null) { - this.Set(Value.Obsfucate(), Key); + Set(Value.Obsfucate(), Key); } protected string GetDeobsfucated(string Default, [CallerMemberName] string Key = null) { - var obsfucatedValue = this.Get(null, Key); + var obsfucatedValue = Get(null, Key); if (obsfucatedValue == null) return Default; @@ -74,35 +74,35 @@ namespace Disco.Data.Configuration protected void RemoveScope() { - ConfigurationCache.RemoveScope(Database, this.Scope); + ConfigurationCache.RemoveScope(Database, Scope); } protected void RemoveItem(string Key) { - ConfigurationCache.RemoveScopeKey(Database, this.Scope, Key); + ConfigurationCache.RemoveScopeKey(Database, Scope, Key); } [Obsolete("Types are automatically serialized/deserialized if required, use Set(T Value) instead.")] protected void SetAsJson(T Value, [CallerMemberName] string Key = null) { - this.Set(Value, Key); + Set(Value, Key); } [Obsolete("Types are automatically serialized/deserialized if required, use Get(T Default) instead.")] protected T GetFromJson(T Default, [CallerMemberName] string Key = null) { - return this.Get(Default, Key); + return Get(Default, Key); } [Obsolete("Types are automatically serialized/deserialized if required, use Set(T Value) instead.")] protected void SetAsEnum(T Value, [CallerMemberName] string Key = null) { - this.Set(Value, Key); + Set(Value, Key); } [Obsolete("Types are automatically serialized/deserialized if required, use Set(T Value) instead.")] protected T GetFromEnum(T Default, [CallerMemberName] string Key = null) { - return this.Get(Default, Key); + return Get(Default, Key); } } } diff --git a/Disco.Data/Configuration/Modules/DeviceProfilesConfiguration.cs b/Disco.Data/Configuration/Modules/DeviceProfilesConfiguration.cs index 37916ced..92c8dc17 100644 --- a/Disco.Data/Configuration/Modules/DeviceProfilesConfiguration.cs +++ b/Disco.Data/Configuration/Modules/DeviceProfilesConfiguration.cs @@ -13,7 +13,7 @@ namespace Disco.Data.Configuration.Modules { get { - var v = this.Get(1); + var v = Get(1); if (v > 0) return v; else @@ -24,21 +24,21 @@ namespace Disco.Data.Configuration.Modules if (value < 1) throw new ArgumentOutOfRangeException("value", "Expected >= 1"); - this.Set(value); + Set(value); } } public int DefaultAddDeviceOfflineDeviceProfileId { get { - return this.Get(0); + return Get(0); } set { if (value < 0) throw new ArgumentOutOfRangeException("value", "Expected >= 0"); - this.Set(value); + Set(value); } } diff --git a/Disco.Data/Repository/DiscoDataContext.cs b/Disco.Data/Repository/DiscoDataContext.cs index ce77cf6a..303d0394 100644 --- a/Disco.Data/Repository/DiscoDataContext.cs +++ b/Disco.Data/Repository/DiscoDataContext.cs @@ -11,7 +11,7 @@ namespace Disco.Data.Repository public DiscoDataContext() { - this._Configuration = new Lazy(() => new Configuration.SystemConfiguration(this)); + _Configuration = new Lazy(() => new Configuration.SystemConfiguration(this)); } public virtual DbSet ConfigurationItems { get; set; } @@ -60,7 +60,7 @@ namespace Disco.Data.Repository { get { - return this._Configuration.Value; + return _Configuration.Value; } } diff --git a/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs b/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs index cfb9e1ec..63cb7829 100644 --- a/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs +++ b/Disco.Data/Repository/DiscoDatabaseConnectionFactory.cs @@ -55,8 +55,8 @@ namespace Disco.Data.Repository public DiscoDatabaseConnectionFactory(IDbConnectionFactory Default) { - this.DefaultConnectionFactory = Default; - this.SqlCeConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0"); + DefaultConnectionFactory = Default; + SqlCeConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0"); } public DbConnection CreateConnection(string nameOrConnectionString) diff --git a/Disco.Models/Repository/Device/Device.cs b/Disco.Models/Repository/Device/Device.cs index 03502c4c..9922ac77 100644 --- a/Disco.Models/Repository/Device/Device.cs +++ b/Disco.Models/Repository/Device/Device.cs @@ -73,9 +73,9 @@ namespace Disco.Models.Repository public override string ToString() { if (DeviceModel != null) - return string.Format("{0} - {1}", this.DeviceModel, this.SerialNumber); + return string.Format("{0} - {1}", DeviceModel, SerialNumber); else - return this.SerialNumber; + return SerialNumber; } [NotMapped] diff --git a/Disco.Models/Repository/Device/DeviceBatch.cs b/Disco.Models/Repository/Device/DeviceBatch.cs index 83a57f4a..9775c48c 100644 --- a/Disco.Models/Repository/Device/DeviceBatch.cs +++ b/Disco.Models/Repository/Device/DeviceBatch.cs @@ -53,11 +53,11 @@ namespace Disco.Models.Repository public override string ToString() { - if (string.IsNullOrWhiteSpace(this.Name)) + if (string.IsNullOrWhiteSpace(Name)) { - return string.Format("{0}: {1}", this.Id, this.PurchaseDate.ToLongDateString()); + return string.Format("{0}: {1}", Id, PurchaseDate.ToLongDateString()); } - return this.Name; + return Name; } } } diff --git a/Disco.Models/Repository/Device/DeviceProfile.cs b/Disco.Models/Repository/Device/DeviceProfile.cs index 6146a1b0..4a364ca6 100644 --- a/Disco.Models/Repository/Device/DeviceProfile.cs +++ b/Disco.Models/Repository/Device/DeviceProfile.cs @@ -48,11 +48,11 @@ namespace Disco.Models.Repository public override string ToString() { - if (string.IsNullOrEmpty(this.ShortName)) + if (string.IsNullOrEmpty(ShortName)) { - return this.Name; + return Name; } - return string.Format("{0} ({1})", this.Name, this.ShortName); + return string.Format("{0} ({1})", Name, ShortName); } [StringLength(200)] diff --git a/Disco.Models/Repository/Job/Job.cs b/Disco.Models/Repository/Job/Job.cs index 87a9ce61..92860329 100644 --- a/Disco.Models/Repository/Job/Job.cs +++ b/Disco.Models/Repository/Job/Job.cs @@ -79,9 +79,9 @@ namespace Disco.Models.Repository #region Helper Members public decimal JobComponentsTotalCost() { - if (this.JobComponents != null) + if (JobComponents != null) { - return this.JobComponents.Sum(jc => jc.Cost); + return JobComponents.Sum(jc => jc.Cost); } return decimal.Zero; } diff --git a/Disco.Models/Repository/Job/JobSubType.cs b/Disco.Models/Repository/Job/JobSubType.cs index 25e71ee9..6e550a00 100644 --- a/Disco.Models/Repository/Job/JobSubType.cs +++ b/Disco.Models/Repository/Job/JobSubType.cs @@ -30,7 +30,7 @@ namespace Disco.Models.Repository public override string ToString() { - return this.Description; + return Description; } } } diff --git a/Disco.Models/Repository/Job/JobType.cs b/Disco.Models/Repository/Job/JobType.cs index 62e0d18d..1f7504f6 100644 --- a/Disco.Models/Repository/Job/JobType.cs +++ b/Disco.Models/Repository/Job/JobType.cs @@ -14,7 +14,7 @@ namespace Disco.Models.Repository public override string ToString() { - return this.Description; + return Description; } public static class JobTypeIds diff --git a/Disco.Models/Repository/Job/Queue/JobQueue.cs b/Disco.Models/Repository/Job/Queue/JobQueue.cs index c5d188f0..4466f2b6 100644 --- a/Disco.Models/Repository/Job/Queue/JobQueue.cs +++ b/Disco.Models/Repository/Job/Queue/JobQueue.cs @@ -28,7 +28,7 @@ namespace Disco.Models.Repository public override string ToString() { - return this.Name; + return Name; } } } diff --git a/Disco.Models/Repository/User/Flag/UserFlag.cs b/Disco.Models/Repository/User/Flag/UserFlag.cs index 6ab37235..e5e18fb9 100644 --- a/Disco.Models/Repository/User/Flag/UserFlag.cs +++ b/Disco.Models/Repository/User/Flag/UserFlag.cs @@ -31,7 +31,7 @@ namespace Disco.Models.Repository public override string ToString() { - return this.Name; + return Name; } } } \ No newline at end of file diff --git a/Disco.Models/Repository/User/User.cs b/Disco.Models/Repository/User/User.cs index a168bfff..e7e4ad22 100644 --- a/Disco.Models/Repository/User/User.cs +++ b/Disco.Models/Repository/User/User.cs @@ -73,32 +73,32 @@ namespace Disco.Models.Repository { var changed = false; - if (!this.UserId.Equals(u.UserId, StringComparison.OrdinalIgnoreCase)) + if (!UserId.Equals(u.UserId, StringComparison.OrdinalIgnoreCase)) throw new ArgumentException("User Id's do not match", nameof(u)); - if (this.Surname != u.Surname) + if (Surname != u.Surname) { - this.Surname = u.Surname; + Surname = u.Surname; changed = true; } - if (this.GivenName != u.GivenName) + if (GivenName != u.GivenName) { - this.GivenName = u.GivenName; + GivenName = u.GivenName; changed = true; } - if (this.DisplayName != u.DisplayName) + if (DisplayName != u.DisplayName) { - this.DisplayName = u.DisplayName; + DisplayName = u.DisplayName; changed = true; } - if (this.EmailAddress != u.EmailAddress) + if (EmailAddress != u.EmailAddress) { - this.EmailAddress = u.EmailAddress; + EmailAddress = u.EmailAddress; changed = true; } - if (this.PhoneNumber != u.PhoneNumber) + if (PhoneNumber != u.PhoneNumber) { - this.PhoneNumber = u.PhoneNumber; + PhoneNumber = u.PhoneNumber; changed = true; } diff --git a/Disco.Models/Services/Documents/DocumentState.cs b/Disco.Models/Services/Documents/DocumentState.cs index 5245d198..fa7af417 100644 --- a/Disco.Models/Services/Documents/DocumentState.cs +++ b/Disco.Models/Services/Documents/DocumentState.cs @@ -13,24 +13,24 @@ namespace Disco.Models.Services.Documents public DocumentState(int SequenceNumber) { this.SequenceNumber = SequenceNumber; - this.FieldCache = new Hashtable(); - this.ScopeCache = new Hashtable(); - this.DocumentCache = new Hashtable(); + FieldCache = new Hashtable(); + ScopeCache = new Hashtable(); + DocumentCache = new Hashtable(); } public void FlushFieldCache() { - FlushDictionary(this.FieldCache); + FlushDictionary(FieldCache); } public void FlushScopeCache() { FlushFieldCache(); - FlushDictionary(this.ScopeCache); + FlushDictionary(ScopeCache); } public void FlushDocumentCache() { FlushScopeCache(); - FlushDictionary(this.DocumentCache); + FlushDictionary(DocumentCache); } private static void FlushDictionary(Hashtable d) { diff --git a/Disco.Models/Services/Jobs/JobLists/JobTableItemModel.cs b/Disco.Models/Services/Jobs/JobLists/JobTableItemModel.cs index f400bdf5..9533f417 100644 --- a/Disco.Models/Services/Jobs/JobLists/JobTableItemModel.cs +++ b/Disco.Models/Services/Jobs/JobLists/JobTableItemModel.cs @@ -13,12 +13,12 @@ namespace Disco.Models.Services.Jobs.JobLists { get { - return this.JobId.ToString(); + return JobId.ToString(); } set { base.Id = value; - this.JobId = int.Parse(value); + JobId = int.Parse(value); } } #pragma warning restore 618 diff --git a/Disco.Models/Services/Searching/DeviceSearchResultItem.cs b/Disco.Models/Services/Searching/DeviceSearchResultItem.cs index 9914487e..79d7afc3 100644 --- a/Disco.Models/Services/Searching/DeviceSearchResultItem.cs +++ b/Disco.Models/Services/Searching/DeviceSearchResultItem.cs @@ -11,12 +11,12 @@ namespace Disco.Models.Services.Searching public DeviceSearchResultItem() { - this.LazyScoreValue = new Lazy(BuildScoreValues, false); + LazyScoreValue = new Lazy(BuildScoreValues, false); } public string Id { get; set; } public string Type { get { return type; } } - public string Description { get { return string.Format("{0} ({1})", this.Id, this.ComputerName); } } + public string Description { get { return string.Format("{0} ({1})", Id, ComputerName); } } public string[] ScoreValues { get { return LazyScoreValue.Value; } } public string AssetNumber { get; set; } @@ -46,23 +46,23 @@ namespace Disco.Models.Services.Searching private string[] BuildScoreValues() { - if (this.AssignedUserId == null) + if (AssignedUserId == null) { return new string[] { - this.Id, - this.AssetNumber, - this.ComputerName + Id, + AssetNumber, + ComputerName }; } else { return new string[] { - this.Id, - this.AssetNumber, - this.ComputerName, - this.AssignedUserId.Substring(this.AssignedUserId.IndexOf('\\') + 1), - this.AssignedUserId, - this.AssignedUserDisplayName + Id, + AssetNumber, + ComputerName, + AssignedUserId.Substring(AssignedUserId.IndexOf('\\') + 1), + AssignedUserId, + AssignedUserDisplayName }; } } diff --git a/Disco.Models/Services/Searching/JobSearchResultItem.cs b/Disco.Models/Services/Searching/JobSearchResultItem.cs index c3e96a80..054efa19 100644 --- a/Disco.Models/Services/Searching/JobSearchResultItem.cs +++ b/Disco.Models/Services/Searching/JobSearchResultItem.cs @@ -9,12 +9,12 @@ namespace Disco.Models.Services.Searching public JobSearchResultItem() { - this.LazyScoreValue = new Lazy(BuildScoreValues, false); + LazyScoreValue = new Lazy(BuildScoreValues, false); } public virtual string Id { get; set; } public string Type { get { return type; } } - public string Description { get { return string.Format("{0} ({1}; {2})", this.Id, this.UserId, this.DeviceSerialNumber); } } + public string Description { get { return string.Format("{0} ({1}; {2})", Id, UserId, DeviceSerialNumber); } } public string[] ScoreValues { get { return LazyScoreValue.Value; } } public string DeviceSerialNumber { get; set; } @@ -25,21 +25,21 @@ namespace Disco.Models.Services.Searching private string[] BuildScoreValues() { - if (this.UserId == null) + if (UserId == null) { return new string[] { - this.Id, - this.DeviceSerialNumber + Id, + DeviceSerialNumber }; } else { return new string[] { - this.Id, - this.UserId.Substring(this.UserId.IndexOf('\\') + 1), - this.UserId, - this.UserDisplayName, - this.DeviceSerialNumber + Id, + UserId.Substring(UserId.IndexOf('\\') + 1), + UserId, + UserDisplayName, + DeviceSerialNumber }; } } diff --git a/Disco.Models/Services/Searching/UserSearchResultItem.cs b/Disco.Models/Services/Searching/UserSearchResultItem.cs index f2722c00..8410eb8d 100644 --- a/Disco.Models/Services/Searching/UserSearchResultItem.cs +++ b/Disco.Models/Services/Searching/UserSearchResultItem.cs @@ -11,13 +11,13 @@ namespace Disco.Models.Services.Searching public UserSearchResultItem() { - this.LazyScoreValue = new Lazy(BuildScoreValues, false); + LazyScoreValue = new Lazy(BuildScoreValues, false); } public string Id { get; set; } public string FriendlyId { get; set; } public string Type { get { return type; } } - public string Description { get { return string.Format("{0} ({1})", this.DisplayName, this.Id); } } + public string Description { get { return string.Format("{0} ({1})", DisplayName, Id); } } public string[] ScoreValues { get { return LazyScoreValue.Value; } } public string DisplayName { get; set; } @@ -34,9 +34,9 @@ namespace Disco.Models.Services.Searching private string[] BuildScoreValues() { return new string[] { - this.Id.Substring(this.Id.IndexOf('\\') + 1), - this.Id, - this.DisplayName + Id.Substring(Id.IndexOf('\\') + 1), + Id, + DisplayName }; } } diff --git a/Disco.Web.Extensions/MvcExtensions/File/FileContentSpanResult.cs b/Disco.Web.Extensions/MvcExtensions/File/FileContentSpanResult.cs index b71210b2..2da0a1ce 100644 --- a/Disco.Web.Extensions/MvcExtensions/File/FileContentSpanResult.cs +++ b/Disco.Web.Extensions/MvcExtensions/File/FileContentSpanResult.cs @@ -28,7 +28,7 @@ namespace Disco.Web.Extensions protected override void WriteFile(HttpResponseBase response) { - response.OutputStream.Write(this.FileBuffer, Start, Length); + response.OutputStream.Write(FileBuffer, Start, Length); } } } diff --git a/Disco.Web/Areas/API/Models/Job/_DateChangeModel.cs b/Disco.Web/Areas/API/Models/Job/_DateChangeModel.cs index 7b2fb714..e1a9b23b 100644 --- a/Disco.Web/Areas/API/Models/Job/_DateChangeModel.cs +++ b/Disco.Web/Areas/API/Models/Job/_DateChangeModel.cs @@ -14,10 +14,10 @@ namespace Disco.Web.Areas.API.Models.Job public _DateChangeModel SetDateTime(DateTime? date) { - this.DateTimeFriendly = date.FromNow(null); - this.DateTimeISO8601 = date.ToISO8601(); - this.DateTimeUnixEpoc = date.ToUnixEpoc() ?? -1; - this.DateTimeFull = date.ToFullDateTime(null); + DateTimeFriendly = date.FromNow(null); + DateTimeISO8601 = date.ToISO8601(); + DateTimeUnixEpoc = date.ToUnixEpoc() ?? -1; + DateTimeFull = date.ToFullDateTime(null); return this; } diff --git a/Disco.Web/Areas/Config/Controllers/AuthorizationRoleController.cs b/Disco.Web/Areas/Config/Controllers/AuthorizationRoleController.cs index a4663679..cc1f90d2 100644 --- a/Disco.Web/Areas/Config/Controllers/AuthorizationRoleController.cs +++ b/Disco.Web/Areas/Config/Controllers/AuthorizationRoleController.cs @@ -43,7 +43,7 @@ namespace Disco.Web.Areas.Config.Controllers // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(MVC.Config.AuthorizationRole.Views.Show, m); } @@ -66,7 +66,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -81,7 +81,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -106,7 +106,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, model); + UIExtensions.ExecuteExtensions(ControllerContext, model); return View(model); } diff --git a/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs b/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs index e90ece24..ef1aeaba 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs @@ -65,7 +65,7 @@ namespace Disco.Web.Areas.Config.Controllers m.BulkGenerateDocumentTemplates = Database.DocumentTemplates.Where(t => !t.IsHidden).ToList(); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(MVC.Config.DeviceBatch.Views.Show, m); } @@ -74,7 +74,7 @@ namespace Disco.Web.Areas.Config.Controllers var m = Models.DeviceBatch.IndexModel.Build(Database); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -90,7 +90,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -115,7 +115,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, model); + UIExtensions.ExecuteExtensions(ControllerContext, model); return View(model); } @@ -126,7 +126,7 @@ namespace Disco.Web.Areas.Config.Controllers var m = new Models.DeviceBatch.TimelineModel(); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(); } diff --git a/Disco.Web/Areas/Config/Controllers/DeviceFlagController.cs b/Disco.Web/Areas/Config/Controllers/DeviceFlagController.cs index 2061feb4..a5fbf8da 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceFlagController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceFlagController.cs @@ -49,7 +49,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(MVC.Config.DeviceFlag.Views.Show, m); } @@ -70,7 +70,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -90,7 +90,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -115,7 +115,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, model); + UIExtensions.ExecuteExtensions(ControllerContext, model); return View(model); } diff --git a/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs b/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs index 21ace969..cc869834 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs @@ -91,7 +91,7 @@ namespace Disco.Web.Areas.Config.Controllers m.BulkGenerateDocumentTemplates = Database.DocumentTemplates.Where(t => !t.IsHidden).ToList(); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(MVC.Config.DeviceProfile.Views.Show, m); } @@ -100,7 +100,7 @@ namespace Disco.Web.Areas.Config.Controllers var m = Models.DeviceProfile.IndexModel.Build(Database); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -121,7 +121,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -148,7 +148,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, model); + UIExtensions.ExecuteExtensions(ControllerContext, model); return View(model); } @@ -166,7 +166,7 @@ namespace Disco.Web.Areas.Config.Controllers m.DeviceProfilesAndNone.Insert(0, new DeviceProfile() { Id = 0, Name = "" }); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } diff --git a/Disco.Web/Areas/Config/Controllers/DocumentTemplateController.cs b/Disco.Web/Areas/Config/Controllers/DocumentTemplateController.cs index 41525320..ffdb7626 100644 --- a/Disco.Web/Areas/Config/Controllers/DocumentTemplateController.cs +++ b/Disco.Web/Areas/Config/Controllers/DocumentTemplateController.cs @@ -43,7 +43,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -72,7 +72,7 @@ namespace Disco.Web.Areas.Config.Controllers m.BulkGenerateDownloadFilename = bulkGenerateFilename; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(MVC.Config.DocumentTemplate.Views.Show, m); } @@ -99,7 +99,7 @@ namespace Disco.Web.Areas.Config.Controllers m.DocumentTemplatesSelected = m.Package.GetDocumentTemplates(m.DocumentTemplates); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(MVC.Config.DocumentTemplate.Views.ShowPackage, m); } @@ -110,7 +110,7 @@ namespace Disco.Web.Areas.Config.Controllers var m = new ImportStatusModel(); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(); } @@ -124,7 +124,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -136,7 +136,7 @@ namespace Disco.Web.Areas.Config.Controllers m.UpdateModel(Database); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -174,7 +174,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, model); + UIExtensions.ExecuteExtensions(ControllerContext, model); return View(model); } @@ -185,7 +185,7 @@ namespace Disco.Web.Areas.Config.Controllers var m = new CreatePackageModel(); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -210,7 +210,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, model); + UIExtensions.ExecuteExtensions(ControllerContext, model); return View(model); } diff --git a/Disco.Web/Areas/Config/Controllers/EnrolmentController.cs b/Disco.Web/Areas/Config/Controllers/EnrolmentController.cs index 5d834420..4fcf2968 100644 --- a/Disco.Web/Areas/Config/Controllers/EnrolmentController.cs +++ b/Disco.Web/Areas/Config/Controllers/EnrolmentController.cs @@ -19,7 +19,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -34,7 +34,7 @@ namespace Disco.Web.Areas.Config.Controllers m.DeviceBatches = Database.DeviceBatches.ToList(); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } diff --git a/Disco.Web/Areas/Config/Controllers/JobPreferencesController.cs b/Disco.Web/Areas/Config/Controllers/JobPreferencesController.cs index e2ea7c1a..1cb9880f 100644 --- a/Disco.Web/Areas/Config/Controllers/JobPreferencesController.cs +++ b/Disco.Web/Areas/Config/Controllers/JobPreferencesController.cs @@ -26,7 +26,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } diff --git a/Disco.Web/Areas/Config/Controllers/JobQueueController.cs b/Disco.Web/Areas/Config/Controllers/JobQueueController.cs index 8464a7d9..c96443c7 100644 --- a/Disco.Web/Areas/Config/Controllers/JobQueueController.cs +++ b/Disco.Web/Areas/Config/Controllers/JobQueueController.cs @@ -55,7 +55,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(MVC.Config.JobQueue.Views.Show, m); } @@ -71,7 +71,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -92,7 +92,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -117,7 +117,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, model); + UIExtensions.ExecuteExtensions(ControllerContext, model); return View(model); } diff --git a/Disco.Web/Areas/Config/Controllers/LoggingController.cs b/Disco.Web/Areas/Config/Controllers/LoggingController.cs index 94592ec8..e88e76ba 100644 --- a/Disco.Web/Areas/Config/Controllers/LoggingController.cs +++ b/Disco.Web/Areas/Config/Controllers/LoggingController.cs @@ -29,7 +29,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -46,7 +46,7 @@ namespace Disco.Web.Areas.Config.Controllers var m = new Models.Shared.TaskStatusModel() { SessionId = taskStatus.SessionId }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } diff --git a/Disco.Web/Areas/Config/Controllers/OrganisationController.cs b/Disco.Web/Areas/Config/Controllers/OrganisationController.cs index 4467c432..0e50d661 100644 --- a/Disco.Web/Areas/Config/Controllers/OrganisationController.cs +++ b/Disco.Web/Areas/Config/Controllers/OrganisationController.cs @@ -22,7 +22,7 @@ namespace Disco.Web.Areas.Config.Controllers viewModel.OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList(); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, viewModel); + UIExtensions.ExecuteExtensions(ControllerContext, viewModel); return View(viewModel); } diff --git a/Disco.Web/Areas/Config/Controllers/UserFlagController.cs b/Disco.Web/Areas/Config/Controllers/UserFlagController.cs index ba20ed53..4b09c87f 100644 --- a/Disco.Web/Areas/Config/Controllers/UserFlagController.cs +++ b/Disco.Web/Areas/Config/Controllers/UserFlagController.cs @@ -50,7 +50,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(MVC.Config.UserFlag.Views.Show, m); } @@ -71,7 +71,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -91,7 +91,7 @@ namespace Disco.Web.Areas.Config.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -116,7 +116,7 @@ namespace Disco.Web.Areas.Config.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, model); + UIExtensions.ExecuteExtensions(ControllerContext, model); return View(model); } diff --git a/Disco.Web/Areas/Config/Models/AuthorizationRole/ShowModel.cs b/Disco.Web/Areas/Config/Models/AuthorizationRole/ShowModel.cs index 11a14902..dcf0a3c1 100644 --- a/Disco.Web/Areas/Config/Models/AuthorizationRole/ShowModel.cs +++ b/Disco.Web/Areas/Config/Models/AuthorizationRole/ShowModel.cs @@ -18,7 +18,7 @@ namespace Disco.Web.Areas.Config.Models.AuthorizationRole { get { - var rootNode = FancyTreeNode.FromClaimNavigatorItem(this.ClaimNavigator, false); + var rootNode = FancyTreeNode.FromClaimNavigatorItem(ClaimNavigator, false); rootNode.expanded = true; return new FancyTreeNode[] { diff --git a/Disco.Web/Areas/Config/Models/DeviceProfile/ShowModel.cs b/Disco.Web/Areas/Config/Models/DeviceProfile/ShowModel.cs index cbc7ecba..80852d2d 100644 --- a/Disco.Web/Areas/Config/Models/DeviceProfile/ShowModel.cs +++ b/Disco.Web/Areas/Config/Models/DeviceProfile/ShowModel.cs @@ -22,15 +22,15 @@ namespace Disco.Web.Areas.Config.Models.DeviceProfile { get { - if (string.IsNullOrEmpty(this.DeviceProfile.OrganisationalUnit)) + if (string.IsNullOrEmpty(DeviceProfile.OrganisationalUnit)) { var domain = ActiveDirectory.Context.PrimaryDomain; return domain.FriendlyDistinguishedNamePath(domain.DefaultComputerContainer); } else { - var domain = ActiveDirectory.Context.GetDomainFromDistinguishedName(this.DeviceProfile.OrganisationalUnit); - return domain.FriendlyDistinguishedNamePath(this.DeviceProfile.OrganisationalUnit); + var domain = ActiveDirectory.Context.GetDomainFromDistinguishedName(DeviceProfile.OrganisationalUnit); + return domain.FriendlyDistinguishedNamePath(DeviceProfile.OrganisationalUnit); } } } diff --git a/Disco.Web/Areas/Config/Models/DocumentTemplate/CreateModel.cs b/Disco.Web/Areas/Config/Models/DocumentTemplate/CreateModel.cs index 1bb6e335..76826bc5 100644 --- a/Disco.Web/Areas/Config/Models/DocumentTemplate/CreateModel.cs +++ b/Disco.Web/Areas/Config/Models/DocumentTemplate/CreateModel.cs @@ -49,9 +49,9 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate public void UpdateModel(DiscoDataContext Database) { - if (this.JobTypes == null) + if (JobTypes == null) JobTypes = Database.JobTypes.ToList(); - if (this.JobSubTypes == null) + if (JobSubTypes == null) JobSubTypes = Database.JobSubTypes.ToList(); } diff --git a/Disco.Web/Areas/Config/Models/DocumentTemplate/ShowModel.cs b/Disco.Web/Areas/Config/Models/DocumentTemplate/ShowModel.cs index a81ca1c5..7e2c5534 100644 --- a/Disco.Web/Areas/Config/Models/DocumentTemplate/ShowModel.cs +++ b/Disco.Web/Areas/Config/Models/DocumentTemplate/ShowModel.cs @@ -43,20 +43,20 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate public void UpdateModel(DiscoDataContext Database) { - switch (this.DocumentTemplate.Scope) + switch (DocumentTemplate.Scope) { case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Device: - this.StoredInstanceCount = Database.DeviceAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id); + StoredInstanceCount = Database.DeviceAttachments.Count(a => a.DocumentTemplateId == DocumentTemplate.Id); break; case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job: - this.StoredInstanceCount = Database.JobAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id); + StoredInstanceCount = Database.JobAttachments.Count(a => a.DocumentTemplateId == DocumentTemplate.Id); break; case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.User: - this.StoredInstanceCount = Database.UserAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id); + StoredInstanceCount = Database.UserAttachments.Count(a => a.DocumentTemplateId == DocumentTemplate.Id); break; } - if (this.JobTypes == null) + if (JobTypes == null) JobTypes = Database.JobTypes.Include("JobSubTypes").ToList(); UserFlags = Database.UserFlags.ToList(); diff --git a/Disco.Web/Areas/Config/Models/DocumentTemplate/UndetectedPagesModel.cs b/Disco.Web/Areas/Config/Models/DocumentTemplate/UndetectedPagesModel.cs index a5dbff4c..b5cbc267 100644 --- a/Disco.Web/Areas/Config/Models/DocumentTemplate/UndetectedPagesModel.cs +++ b/Disco.Web/Areas/Config/Models/DocumentTemplate/UndetectedPagesModel.cs @@ -18,7 +18,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate list.Add(new SelectListItem() { Selected = false, Value = "--DEVICE", Text = "" }); list.Add(new SelectListItem() { Selected = true, Value = "--JOB", Text = "" }); list.Add(new SelectListItem() { Selected = false, Value = "--USER", Text = "" }); - list.AddRange(this.DocumentTemplates.ToSelectListItems()); + list.AddRange(DocumentTemplates.ToSelectListItems()); return list; } } diff --git a/Disco.Web/Areas/Config/Models/JobPreferences/IndexModel.cs b/Disco.Web/Areas/Config/Models/JobPreferences/IndexModel.cs index c175ab4d..1039bf7d 100644 --- a/Disco.Web/Areas/Config/Models/JobPreferences/IndexModel.cs +++ b/Disco.Web/Areas/Config/Models/JobPreferences/IndexModel.cs @@ -67,7 +67,7 @@ namespace Disco.Web.Areas.Config.Models.JobPreferences new KeyValuePair(56, "8 Weeks") }; - var current = this.LongRunningJobDaysThreshold; + var current = LongRunningJobDaysThreshold; if (!options.Any(o => o.Key == current)) { options.Add(new KeyValuePair(current, string.Format("{0} Days", current))); @@ -103,7 +103,7 @@ namespace Disco.Web.Areas.Config.Models.JobPreferences new KeyValuePair(60 * 24 * 7 * 8, "8 weeks") }; - var current = this.StaleJobMinutesThreshold; + var current = StaleJobMinutesThreshold; if (!options.Any(o => o.Key == current)) { options.Add(new KeyValuePair(current, string.Format("{0} Minutes", current))); diff --git a/Disco.Web/Areas/Config/Models/Plugins/PluginConfigurationViewModel.cs b/Disco.Web/Areas/Config/Models/Plugins/PluginConfigurationViewModel.cs index c05b67f2..6c9ecb57 100644 --- a/Disco.Web/Areas/Config/Models/Plugins/PluginConfigurationViewModel.cs +++ b/Disco.Web/Areas/Config/Models/Plugins/PluginConfigurationViewModel.cs @@ -11,10 +11,10 @@ namespace Disco.Web.Areas.Config.Models.Plugins public PluginConfigurationViewModel(PluginConfigurationHandler.PluginConfigurationHandlerGetResponse response) { - this.Manifest = response.Manifest; + Manifest = response.Manifest; - this.PluginViewType = response.ViewType; - this.PluginViewModel = response.Model; + PluginViewType = response.ViewType; + PluginViewModel = response.Model; } } } \ No newline at end of file diff --git a/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs b/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs index f739d057..9adb5d4e 100644 --- a/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs +++ b/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs @@ -49,28 +49,28 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig { get { - return this.DatabaseConnectionString.Value.DataSource; + return DatabaseConnectionString.Value.DataSource; } } public string DatabaseName { get { - return this.DatabaseConnectionString.Value.InitialCatalog; + return DatabaseConnectionString.Value.InitialCatalog; } } public string DatabaseAuthentication { get { - return this.DatabaseConnectionString.Value.IntegratedSecurity ? "Integrated Authentication" : "SQL Authentication"; + return DatabaseConnectionString.Value.IntegratedSecurity ? "Integrated Authentication" : "SQL Authentication"; } } public string DatabaseSqlAuthUsername { get { - return this.DatabaseConnectionString.Value.IntegratedSecurity ? null : this.DatabaseConnectionString.Value.UserID; + return DatabaseConnectionString.Value.IntegratedSecurity ? null : DatabaseConnectionString.Value.UserID; } } #endregion diff --git a/Disco.Web/Areas/Public/Models/UserHeldDevices/HeldJobDeviceModel.cs b/Disco.Web/Areas/Public/Models/UserHeldDevices/HeldJobDeviceModel.cs index c6578b3a..3608302f 100644 --- a/Disco.Web/Areas/Public/Models/UserHeldDevices/HeldJobDeviceModel.cs +++ b/Disco.Web/Areas/Public/Models/UserHeldDevices/HeldJobDeviceModel.cs @@ -21,27 +21,27 @@ namespace Disco.Web.Areas.Public.Models.UserHeldDevices { var uhdm = new UserHeldDeviceModel() { - UserId = this.UserId, - UserDisplayName = this.UserDisplayName, - ReadyForReturn = this.ReadyForReturn, - WaitingForUserAction = this.WaitingForUserAction, - DeviceProfileId = this.DeviceProfileId, - DeviceAddress = (this.DeviceAddressId.HasValue ? Database.DiscoConfiguration.OrganisationAddresses.GetAddress(this.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 (!this.ReadyForReturn && this.EstimatedReturnTime.HasValue && this.EstimatedReturnTime.Value > n) + if (!ReadyForReturn && EstimatedReturnTime.HasValue && EstimatedReturnTime.Value > n) { - uhdm.EstimatedReturnTime = this.EstimatedReturnTime.FromNow(); + uhdm.EstimatedReturnTime = EstimatedReturnTime.FromNow(); } - if (this.ReadyForReturn) + if (ReadyForReturn) { - uhdm.ReadyForReturnSince = this.ReadyForReturnSince.FromNow(); - uhdm.IsAlert = (this.ReadyForReturnSince.Value < DateTime.Now.AddDays(-3)); + uhdm.ReadyForReturnSince = ReadyForReturnSince.FromNow(); + uhdm.IsAlert = (ReadyForReturnSince.Value < DateTime.Now.AddDays(-3)); } - if (this.WaitingForUserAction) + if (WaitingForUserAction) { - uhdm.WaitingForUserActionSince = this.WaitingForUserActionSince.FromNow(); - uhdm.IsAlert = (this.WaitingForUserActionSince.Value < n.AddDays(-6)); + uhdm.WaitingForUserActionSince = WaitingForUserActionSince.FromNow(); + uhdm.IsAlert = (WaitingForUserActionSince.Value < n.AddDays(-6)); } return uhdm; } diff --git a/Disco.Web/Controllers/DeviceController.cs b/Disco.Web/Controllers/DeviceController.cs index a50bb4f5..aabbe474 100644 --- a/Disco.Web/Controllers/DeviceController.cs +++ b/Disco.Web/Controllers/DeviceController.cs @@ -29,7 +29,7 @@ namespace Disco.Web.Controllers Models.Device.IndexModel m = new Models.Device.IndexModel(); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(); } @@ -57,7 +57,7 @@ namespace Disco.Web.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -162,7 +162,7 @@ namespace Disco.Web.Controllers m.CompletedImportSessionContext = Areas.API.Controllers.DeviceController.Import_RetrieveContext(Id, Remove: true); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -184,7 +184,7 @@ namespace Disco.Web.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -210,7 +210,7 @@ namespace Disco.Web.Controllers }; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -328,7 +328,7 @@ namespace Disco.Web.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } diff --git a/Disco.Web/Controllers/JobController.cs b/Disco.Web/Controllers/JobController.cs index 580cdb05..8ba01e26 100644 --- a/Disco.Web/Controllers/JobController.cs +++ b/Disco.Web/Controllers/JobController.cs @@ -54,7 +54,7 @@ namespace Disco.Web.Controllers m.PendingEnrolments = WindowsDeviceEnrolment.GetPendingEnrolments(); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -73,7 +73,7 @@ namespace Disco.Web.Controllers m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j => j.ActiveJobQueues.Any(jqj => jqj.QueueId == queueToken.JobQueue.Id))); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -85,7 +85,7 @@ namespace Disco.Web.Controllers m.JobTable = ManagedJobList.OpenJobsTable(q => q.OrderBy(j => j.JobId)); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -98,7 +98,7 @@ namespace Disco.Web.Controllers m.JobTable = ManagedJobList.OpenJobsTable(ManagedJobList.AwaitingTechnicianActionFilter); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -114,7 +114,7 @@ namespace Disco.Web.Controllers .OrderBy(j => j.JobId)); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -130,7 +130,7 @@ namespace Disco.Web.Controllers ).OrderBy(j => j.JobId)); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -148,7 +148,7 @@ namespace Disco.Web.Controllers )); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -162,7 +162,7 @@ namespace Disco.Web.Controllers ).OrderBy(j => j.JobId)); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -176,7 +176,7 @@ namespace Disco.Web.Controllers ).OrderBy(j => j.JobId)); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -190,7 +190,7 @@ namespace Disco.Web.Controllers ).OrderBy(j => j.JobId)); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -204,7 +204,7 @@ namespace Disco.Web.Controllers ).OrderBy(j => j.JobId)); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -221,7 +221,7 @@ namespace Disco.Web.Controllers ).OrderBy(j => j.JobId)); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -241,7 +241,7 @@ namespace Disco.Web.Controllers m.JobTable.Fill(Database, Disco.Services.Searching.Search.BuildJobTableModel(Database).Where(j => j.ClosedDate > closedThreshold).OrderBy(j => j.Id), true); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -257,7 +257,7 @@ namespace Disco.Web.Controllers m.JobTable.ShowType = false; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -271,7 +271,7 @@ namespace Disco.Web.Controllers m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j => j.OpenedDate < longRunningThreshold).OrderBy(j => j.JobId)); // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -287,7 +287,7 @@ namespace Disco.Web.Controllers m.JobTable.ShowDates = false; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(Views.List, m); } @@ -393,7 +393,7 @@ namespace Disco.Web.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -414,7 +414,7 @@ namespace Disco.Web.Controllers m.RegenerateCommentsOnTypeChange = isTypeDynamic; // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } @@ -426,7 +426,7 @@ namespace Disco.Web.Controllers if (!ModelState.IsValid) { // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } diff --git a/Disco.Web/Controllers/SearchController.cs b/Disco.Web/Controllers/SearchController.cs index 0dca8d6d..1433026a 100644 --- a/Disco.Web/Controllers/SearchController.cs +++ b/Disco.Web/Controllers/SearchController.cs @@ -269,7 +269,7 @@ namespace Disco.Web.Controllers } // UI Extensions - UIExtensions.ExecuteExtensions(this.ControllerContext, m); + UIExtensions.ExecuteExtensions(ControllerContext, m); return View(m); } diff --git a/Disco.Web/Models/Device/ImportReviewModel.cs b/Disco.Web/Models/Device/ImportReviewModel.cs index 85f13f9b..8836120a 100644 --- a/Disco.Web/Models/Device/ImportReviewModel.cs +++ b/Disco.Web/Models/Device/ImportReviewModel.cs @@ -18,7 +18,7 @@ namespace Disco.Web.Models.Device public int StatisticImportRecords { - get { return this.StatisticNewRecords + StatisticModifiedRecords; } + get { return StatisticNewRecords + StatisticModifiedRecords; } } public IEnumerable> HeaderTypes { get; set; } diff --git a/Disco.Web/Models/InitialConfig/DatabaseModel.cs b/Disco.Web/Models/InitialConfig/DatabaseModel.cs index b2f3e8f3..625cd30e 100644 --- a/Disco.Web/Models/InitialConfig/DatabaseModel.cs +++ b/Disco.Web/Models/InitialConfig/DatabaseModel.cs @@ -11,9 +11,9 @@ namespace Disco.Web.Models.InitialConfig public DatabaseModel() { // Set Defaults - this.Server = "(local)"; - this.DatabaseName = "Disco"; - this.AuthMethod = "SSPI"; + Server = "(local)"; + DatabaseName = "Disco"; + AuthMethod = "SSPI"; } public static DatabaseModel FromConnectionString(string ConnectionString) @@ -51,11 +51,11 @@ namespace Disco.Web.Models.InitialConfig { var csb = new SqlConnectionStringBuilder() { - DataSource = this.Server, - InitialCatalog = this.DatabaseName, - IntegratedSecurity = (this.AuthMethod.Equals("SSPI", StringComparison.OrdinalIgnoreCase)), - UserID = (this.AuthMethod.Equals("SQL", StringComparison.OrdinalIgnoreCase)) ? this.Auth_SQL_Username : string.Empty, - Password = (this.AuthMethod.Equals("SQL", StringComparison.OrdinalIgnoreCase)) ? this.Auth_SQL_Password : string.Empty, + DataSource = Server, + InitialCatalog = DatabaseName, + IntegratedSecurity = (AuthMethod.Equals("SSPI", StringComparison.OrdinalIgnoreCase)), + UserID = (AuthMethod.Equals("SQL", StringComparison.OrdinalIgnoreCase)) ? Auth_SQL_Username : string.Empty, + Password = (AuthMethod.Equals("SQL", StringComparison.OrdinalIgnoreCase)) ? Auth_SQL_Password : string.Empty, ApplicationName = "Disco ICT WebApp", MultipleActiveResultSets = true, Pooling = true diff --git a/Disco.Web/Models/InitialConfig/FileStoreModel.cs b/Disco.Web/Models/InitialConfig/FileStoreModel.cs index 7da6574d..57a52d98 100644 --- a/Disco.Web/Models/InitialConfig/FileStoreModel.cs +++ b/Disco.Web/Models/InitialConfig/FileStoreModel.cs @@ -21,10 +21,10 @@ namespace Disco.Web.Models.InitialConfig { if (!string.IsNullOrWhiteSpace(FileStoreLocation)) { - var branches = this.FileStoreLocation.ToUpper().Split(Path.DirectorySeparatorChar); - var branchesCase = this.FileStoreLocation.Split(Path.DirectorySeparatorChar); + var branches = FileStoreLocation.ToUpper().Split(Path.DirectorySeparatorChar); + var branchesCase = FileStoreLocation.Split(Path.DirectorySeparatorChar); FileStoreDirectoryModel branchModel; - FileStoreDirectoryModel branchParent = this.DirectoryModel; + FileStoreDirectoryModel branchParent = DirectoryModel; for (int i = 0; i < branches.Length; i++) { var branch = branches[i]; @@ -154,10 +154,10 @@ namespace Disco.Web.Models.InitialConfig internal void ExpandSubDirectories() { - if (this.SubDirectories == null) + if (SubDirectories == null) { - this.SubDirectories = new Dictionary(); - if (!this.IsNew) + SubDirectories = new Dictionary(); + if (!IsNew) { var dirInfo = new DirectoryInfo(Path); if (dirInfo.Exists) @@ -167,13 +167,13 @@ namespace Disco.Web.Models.InitialConfig if (((subDir.Attributes & FileAttributes.System) != FileAttributes.System) && ((subDir.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden)) { - this.SubDirectories.Add(subDir.Name.ToUpper(), FileStoreDirectoryModel.FromInfo(subDir)); + SubDirectories.Add(subDir.Name.ToUpper(), FileStoreDirectoryModel.FromInfo(subDir)); } } } else { - this.IsNew = true; + IsNew = true; } } } diff --git a/Disco.Web/Models/InitialConfig/WelcomeModel.cs b/Disco.Web/Models/InitialConfig/WelcomeModel.cs index 76fb8e8d..26d9d5c3 100644 --- a/Disco.Web/Models/InitialConfig/WelcomeModel.cs +++ b/Disco.Web/Models/InitialConfig/WelcomeModel.cs @@ -15,7 +15,7 @@ namespace Disco.Web.Models.InitialConfig { if (_OrganisationNameCache != null) { - this.OrganisationName = _OrganisationNameCache; + OrganisationName = _OrganisationNameCache; return true; } @@ -23,8 +23,8 @@ namespace Disco.Web.Models.InitialConfig if (whoAmIResult != null && !string.IsNullOrWhiteSpace(whoAmIResult.Item2)) { - this.OrganisationName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(whoAmIResult.Item2); - _OrganisationNameCache = this.OrganisationName; + OrganisationName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(whoAmIResult.Item2); + _OrganisationNameCache = OrganisationName; return true; } diff --git a/Disco.Web/Models/Job/CreateModel.cs b/Disco.Web/Models/Job/CreateModel.cs index 4689a97a..cd6e2118 100644 --- a/Disco.Web/Models/Job/CreateModel.cs +++ b/Disco.Web/Models/Job/CreateModel.cs @@ -42,24 +42,24 @@ namespace Disco.Web.Models.Job public void UpdateModel(DiscoDataContext Database, AuthorizationToken Authorization) { - if (this.JobTypes == null) - this.JobTypes = Database.JobTypes.Include("JobSubTypes.JobQueues").FilterCreatableTypePermissions(Authorization).ToList(); + if (JobTypes == null) + JobTypes = Database.JobTypes.Include("JobSubTypes.JobQueues").FilterCreatableTypePermissions(Authorization).ToList(); if (!string.IsNullOrEmpty(DeviceSerialNumber)) { - this.Device = Database.Devices.Include("DeviceModel").Where(d => d.SerialNumber == DeviceSerialNumber).FirstOrDefault(); - if (this.Device == null) + Device = Database.Devices.Include("DeviceModel").Where(d => d.SerialNumber == DeviceSerialNumber).FirstOrDefault(); + if (Device == null) { throw new ArgumentException("Invalid Device Serial Number Specified", "DeviceSerialNumber"); } - if (string.IsNullOrEmpty(this.UserId) && !string.IsNullOrEmpty(this.Device.AssignedUserId)) + if (string.IsNullOrEmpty(UserId) && !string.IsNullOrEmpty(Device.AssignedUserId)) { - this.UserId = this.Device.AssignedUserId; + UserId = Device.AssignedUserId; } - if (string.IsNullOrEmpty(this.Type)) - this.Type = this.JobTypes.Any(jt => jt.Id == Disco.Models.Repository.JobType.JobTypeIds.HWar) ? Disco.Models.Repository.JobType.JobTypeIds.HWar : this.JobTypes.First().Id; + if (string.IsNullOrEmpty(Type)) + Type = JobTypes.Any(jt => jt.Id == Disco.Models.Repository.JobType.JobTypeIds.HWar) ? Disco.Models.Repository.JobType.JobTypeIds.HWar : JobTypes.First().Id; - if (string.IsNullOrEmpty(this.UserId)) + if (string.IsNullOrEmpty(UserId)) { // No User - Remove User Types foreach (var jobType in JobTypes.ToArray()) @@ -94,20 +94,20 @@ namespace Disco.Web.Models.Job } // Set Default Job Type for Users - if (string.IsNullOrEmpty(this.Type)) - this.Type = this.JobTypes.Any(jt => jt.Id == Disco.Models.Repository.JobType.JobTypeIds.SApp) ? Disco.Models.Repository.JobType.JobTypeIds.SApp : this.JobTypes.First().Id; + if (string.IsNullOrEmpty(Type)) + Type = JobTypes.Any(jt => jt.Id == Disco.Models.Repository.JobType.JobTypeIds.SApp) ? Disco.Models.Repository.JobType.JobTypeIds.SApp : JobTypes.First().Id; } if (!string.IsNullOrEmpty(UserId)) { - this.User = Database.Users.Find(UserId); - if (this.User == null) + User = Database.Users.Find(UserId); + if (User == null) { throw new ArgumentException("Invalid User Id Specified", "UserId"); } - if (string.IsNullOrEmpty(this.Type)) - this.Type = Disco.Models.Repository.JobType.JobTypeIds.SApp; + if (string.IsNullOrEmpty(Type)) + Type = Disco.Models.Repository.JobType.JobTypeIds.SApp; } - if (this.User == null && this.Device == null) + if (User == null && Device == null) { throw new InvalidOperationException("A Job must reference a Device and/or a User"); } @@ -118,9 +118,9 @@ namespace Disco.Web.Models.Job { get { - if (!string.IsNullOrEmpty(this.Type)) + if (!string.IsNullOrEmpty(Type)) { - return this.JobTypes.FirstOrDefault(m => m.Id == this.Type); + return JobTypes.FirstOrDefault(m => m.Id == Type); } return null; } @@ -131,8 +131,8 @@ namespace Disco.Web.Models.Job { if (SubTypes != null) { - var subTypes = this.SubTypes; - return this.JobTypes.SelectMany(jt => jt.JobSubTypes).Where(m => subTypes.Contains(String.Format("{0}_{1}", m.JobTypeId, m.Id))).ToList(); + var subTypes = SubTypes; + return JobTypes.SelectMany(jt => jt.JobSubTypes).Where(m => subTypes.Contains(String.Format("{0}_{1}", m.JobTypeId, m.Id))).ToList(); } return null; } diff --git a/Disco.Web/Models/Job/LogRepairModel.cs b/Disco.Web/Models/Job/LogRepairModel.cs index 6c2807c5..bace70a9 100644 --- a/Disco.Web/Models/Job/LogRepairModel.cs +++ b/Disco.Web/Models/Job/LogRepairModel.cs @@ -50,11 +50,11 @@ namespace Disco.Web.Models.Job public Dictionary ProviderProperties() { Dictionary p = default(Dictionary); - if (!string.IsNullOrEmpty(this.ProviderPropertiesJson)) + if (!string.IsNullOrEmpty(ProviderPropertiesJson)) { try { - p = JsonConvert.DeserializeObject>(this.ProviderPropertiesJson); + p = JsonConvert.DeserializeObject>(ProviderPropertiesJson); } catch (Exception) { @@ -98,7 +98,7 @@ namespace Disco.Web.Models.Job } // Update TechUser's Details [#12] - this.TechUser = UserService.GetUser(UserService.CurrentUserId, Database, true); + TechUser = UserService.GetUser(UserService.CurrentUserId, Database, true); RepairProviders = Plugins.GetPluginFeatures(typeof(RepairProviderFeature)); @@ -113,16 +113,16 @@ namespace Disco.Web.Models.Job if (!string.IsNullOrEmpty(RepairProviderId) && RepairProviderId != "MANUAL") RepairProvider = Plugins.GetPluginFeature(RepairProviderId, typeof(RepairProviderFeature)); - this.OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList(); + OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList(); - if (!IsPostBack && !this.OrganisationAddressId.HasValue) + if (!IsPostBack && !OrganisationAddressId.HasValue) { OrganisationAddressId = Job.Device.DeviceProfile.DefaultOrganisationAddress; if (!OrganisationAddressId.HasValue && OrganisationAddresses.Count == 1) OrganisationAddressId = OrganisationAddresses[0].Id; } - if (this.OrganisationAddressId.HasValue) - this.OrganisationAddress = this.OrganisationAddresses.FirstOrDefault(oa => oa.Id == this.OrganisationAddressId.Value); + if (OrganisationAddressId.HasValue) + OrganisationAddress = OrganisationAddresses.FirstOrDefault(oa => oa.Id == OrganisationAddressId.Value); if (!string.IsNullOrEmpty(RepairDescription)) RepairDescription = RepairDescription.Trim(); diff --git a/Disco.Web/Models/Job/LogWarrantyModel.cs b/Disco.Web/Models/Job/LogWarrantyModel.cs index 2f1403b0..7fa1855b 100644 --- a/Disco.Web/Models/Job/LogWarrantyModel.cs +++ b/Disco.Web/Models/Job/LogWarrantyModel.cs @@ -51,11 +51,11 @@ namespace Disco.Web.Models.Job public Dictionary ProviderProperties() { Dictionary p = default(Dictionary); - if (!string.IsNullOrEmpty(this.ProviderPropertiesJson)) + if (!string.IsNullOrEmpty(ProviderPropertiesJson)) { try { - p = JsonConvert.DeserializeObject>(this.ProviderPropertiesJson); + p = JsonConvert.DeserializeObject>(ProviderPropertiesJson); } catch (Exception) { @@ -98,7 +98,7 @@ namespace Disco.Web.Models.Job } // Update TechUser's Details [#12] - this.TechUser = UserService.GetUser(UserService.CurrentUserId, Database, true); + TechUser = UserService.GetUser(UserService.CurrentUserId, Database, true); WarrantyProviders = Plugins.GetPluginFeatures(typeof(WarrantyProviderFeature)); @@ -113,16 +113,16 @@ namespace Disco.Web.Models.Job if (!string.IsNullOrEmpty(WarrantyProviderId) && WarrantyProviderId != "MANUAL") WarrantyProvider = Plugins.GetPluginFeature(WarrantyProviderId, typeof(WarrantyProviderFeature)); - this.OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList(); + OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList(); - if (!IsPostBack && !this.OrganisationAddressId.HasValue) + if (!IsPostBack && !OrganisationAddressId.HasValue) { OrganisationAddressId = Job.Device.DeviceProfile.DefaultOrganisationAddress; if (!OrganisationAddressId.HasValue && OrganisationAddresses.Count == 1) OrganisationAddressId = OrganisationAddresses[0].Id; } - if (this.OrganisationAddressId.HasValue) - this.OrganisationAddress = this.OrganisationAddresses.FirstOrDefault(oa => oa.Id == this.OrganisationAddressId.Value); + if (OrganisationAddressId.HasValue) + OrganisationAddress = OrganisationAddresses.FirstOrDefault(oa => oa.Id == OrganisationAddressId.Value); if (!string.IsNullOrEmpty(FaultDescription)) FaultDescription = FaultDescription.Trim();