Files
BeWoPlaner/Shared/DataContracts/Compact/ClientPartials/CompactEmployeeDC.cs

71 lines
2.0 KiB
C#
Raw Normal View History

using System.Windows.Media;
using BS.Shared.DataContracts.ClientPartials;
2016-06-27 01:45:38 +02:00
namespace BS.Shared.DataContracts.Compact
{
public partial class CompactEmployeeDC : IFilterableDC, IMoKSearchableDC
2016-06-27 01:45:38 +02:00
{
public long EntityOid => EmployeeOid;
public string DetailDescription
{
get
{
var text = $"{LastName}, {FirstName}";
2016-06-27 01:45:38 +02:00
if(!string.IsNullOrWhiteSpace(PersonnelNumber))
{
text += $" ({PersonnelNumber})";
}
return text;
}
}
public string FilterRelevants => $"{FirstName} {LastName} {PersonnelNumber} {Details2} {Details3} {Teams}";
2016-06-27 01:45:38 +02:00
public string IconPath => @"..\..\Ressources\Icons\UserBusinessMaleDisabled.png";
2016-06-27 01:45:38 +02:00
public string SimpleDescription => LastName + ", " + FirstName;
2016-06-27 01:45:38 +02:00
public string Teams => RelatedTeams;
public bool SupportsActivationType => true;
2016-06-27 01:45:38 +02:00
public long Version
{
get => EmployeeVersion;
2016-06-27 01:45:38 +02:00
set => EmployeeVersion = value;
2016-06-27 01:45:38 +02:00
}
public override bool Equals(object obj)
{
if(obj is CompactEmployeeDC employee)
2016-06-27 01:45:38 +02:00
{
return EmployeeOid == employee.EmployeeOid;
}
return false;
}
public override int GetHashCode()
{
return GetType().Name.GetHashCode() ^ EmployeeOid.GetHashCode();
}
public override string ToString()
{
return LastName + ", " + FirstName;
2016-06-27 01:45:38 +02:00
}
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}";
2016-06-27 01:45:38 +02:00
}
}