using System.Windows.Media;

namespace BS.Shared.DataContracts.Compact
{
    public partial class CompactEmployeeDC : IFilterableDC
    {
        public string DetailDescription
        {
            get
            {
                return this.LastName + ", " + this.FirstName;
            }
        }

        public string FilterRelevants
        {
            get
            {
                return this.FirstName + " " + this.LastName + " " + this.PersonnelNumber;
            }
        }

        public string IconPath
        {
            get
            {
                return @"..\..\Ressources\Icons\UserBusinessMaleDisabled.png";
            }
        }

        public string SimpleDescription
        {
            get
            {
                return this.LastName + ", " + this.FirstName;
            }
        }

        public bool SupportsActivationType
        {
            get
            {
                return true;
            }
        }

        public long Version
        {
            get
            {
                return this.EmployeeVersion;
            }

            set
            {
                this.EmployeeVersion = value;
            }
        }

        public override bool Equals(object obj)
        {
            if (obj is CompactEmployeeDC)
            {
                var employee = (CompactEmployeeDC) obj;

                return EmployeeOid == employee.EmployeeOid;
            }

            return false;
        }

        public override int GetHashCode()
        {
            return GetType().Name.GetHashCode() ^ EmployeeOid.GetHashCode();
        }

        public override string ToString()
        {
            return this.LastName + ", " + this.FirstName;
        }

        public SolidColorBrush FilterableBrush
        {
            get
            {
                return new SolidColorBrush((Color)ColorConverter.ConvertFromString(EmployeeColor ?? Colors.Transparent.ToString()));
            }
        }
    }
}