using System.Windows.Media;

namespace BS.Shared.DataContracts.Compact
{
    public partial class CompactUserDC : IFilterableDC
    {
        public ActivationTypeId ActivationType
        {
            get
            {
                return ActivationTypeId.Active;
            }

            set
            {
            }
        }

        public string DetailDescription
        {
            get
            {
                return this.ToString();
            }
        }

        public string FilterRelevants
        {
            get
            {
                return this.EmployeeFirstName + " " + this.EmployeeLastName + " " + this.LoginName;
            }
        }

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

        public string SimpleDescription
        {
            get
            {
                return this.EmployeeLastName + " (" + this.LoginName + ")";
            }
        }

        public bool SupportsActivationType
        {
            get
            {
                return false;
            }
        }

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

            set
            {
                this.UserVersion = value;
            }
        }

        public override bool Equals(object obj)
        {
            if (obj is CompactUserDC)
            {
                return this.UserOid == ((CompactUserDC)obj).UserOid;
            }

            return false;
        }

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

        public override string ToString()
        {
            return this.EmployeeFirstName + " " + this.EmployeeLastName + " (" + this.LoginName + ")";
        }

        public SolidColorBrush FilterableBrush { get { return new SolidColorBrush(Colors.Transparent); } }
    }
}