74 lines
2.1 KiB
C#
74 lines
2.1 KiB
C#
using System.Diagnostics;
|
|
using System.Windows.Media;
|
|
using BS.Shared.DataContracts.ClientPartials;
|
|
|
|
namespace BS.Shared.DataContracts.Compact
|
|
{
|
|
[DebuggerDisplay("{FirstNameLastName}")]
|
|
|
|
public partial class CompactEmployeeDC : IFilterableDC, IMoKSearchableDC
|
|
{
|
|
public long EntityOid => EmployeeOid;
|
|
|
|
public string DetailDescription
|
|
{
|
|
get
|
|
{
|
|
var text = $"{LastName}, {FirstName}";
|
|
|
|
if(!string.IsNullOrWhiteSpace(PersonnelNumber))
|
|
{
|
|
text += $" ({PersonnelNumber})";
|
|
}
|
|
|
|
return text;
|
|
}
|
|
}
|
|
|
|
|
|
public string FilterRelevants => $"{FirstName} {LastName} {PersonnelNumber} {Details2} {Details3} {Teams}";
|
|
|
|
public string IconPath => @"..\..\Ressources\Icons\UserBusinessMaleDisabled.png";
|
|
|
|
public string SimpleDescription => LastName + ", " + FirstName;
|
|
|
|
public string Teams => RelatedTeams;
|
|
|
|
public bool SupportsActivationType => true;
|
|
|
|
public long Version
|
|
{
|
|
get => EmployeeVersion;
|
|
|
|
set => EmployeeVersion = value;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
if(obj is CompactEmployeeDC employee)
|
|
{
|
|
return EmployeeOid == employee.EmployeeOid;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return GetType().Name.GetHashCode() ^ EmployeeOid.GetHashCode();
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return LastName + ", " + FirstName;
|
|
}
|
|
|
|
public SolidColorBrush FilterableBrush => new SolidColorBrush((Color) ColorConverter.ConvertFromString(EmployeeColor ?? Colors.Transparent.ToString()));
|
|
|
|
public bool IsArchived => ActivationType == ActivationTypeId.Archived;
|
|
|
|
public bool IsDeleted => ActivationType == ActivationTypeId.Deleted;
|
|
|
|
public string FirstNameLastName => $"{FirstName} {LastName}";
|
|
}
|
|
} |