qol: remove this

This commit is contained in:
Gary Sharp
2025-07-20 11:39:42 +10:00
parent b4e54c9edf
commit 4e518d6684
56 changed files with 282 additions and 282 deletions
+2 -2
View File
@@ -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]
@@ -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;
}
}
}
@@ -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)]
+2 -2
View File
@@ -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;
}
+1 -1
View File
@@ -30,7 +30,7 @@ namespace Disco.Models.Repository
public override string ToString()
{
return this.Description;
return Description;
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace Disco.Models.Repository
public override string ToString()
{
return this.Description;
return Description;
}
public static class JobTypeIds
@@ -28,7 +28,7 @@ namespace Disco.Models.Repository
public override string ToString()
{
return this.Name;
return Name;
}
}
}
@@ -31,7 +31,7 @@ namespace Disco.Models.Repository
public override string ToString()
{
return this.Name;
return Name;
}
}
}
+11 -11
View File
@@ -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;
}
@@ -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)
{
@@ -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
@@ -11,12 +11,12 @@ namespace Disco.Models.Services.Searching
public DeviceSearchResultItem()
{
this.LazyScoreValue = new Lazy<string[]>(BuildScoreValues, false);
LazyScoreValue = new Lazy<string[]>(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
};
}
}
@@ -9,12 +9,12 @@ namespace Disco.Models.Services.Searching
public JobSearchResultItem()
{
this.LazyScoreValue = new Lazy<string[]>(BuildScoreValues, false);
LazyScoreValue = new Lazy<string[]>(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
};
}
}
@@ -11,13 +11,13 @@ namespace Disco.Models.Services.Searching
public UserSearchResultItem()
{
this.LazyScoreValue = new Lazy<string[]>(BuildScoreValues, false);
LazyScoreValue = new Lazy<string[]>(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
};
}
}