66 lines
1.9 KiB
C#
66 lines
1.9 KiB
C#
using System;
|
|
using System.Windows.Media;
|
|
|
|
namespace BS.Shared.DataContracts.Compact
|
|
{
|
|
public partial class CompactEmployeeDC : IFilterableDC
|
|
{
|
|
public string DetailDescription
|
|
{
|
|
get
|
|
{
|
|
var text = LastName + ", " + FirstName;
|
|
|
|
if (!string.IsNullOrWhiteSpace(PersonnelNumber))
|
|
{
|
|
text += String.Format(" ({0})", PersonnelNumber);
|
|
}
|
|
return text;
|
|
}
|
|
}
|
|
|
|
|
|
public string FilterRelevants => String.Format("{0} {1} {2} {3} {4} {5}", FirstName, LastName, PersonnelNumber, Details2, Details3, Teams);
|
|
|
|
public string IconPath => @"..\..\Ressources\Icons\UserBusinessMaleDisabled.png";
|
|
|
|
public string SimpleDescription => LastName + ", " + FirstName;
|
|
|
|
public string Teams => this.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;
|
|
}
|
|
} |