using System;
using System.Runtime.Serialization;

namespace BS.Shared.DataContracts
{
    [DataContract]
    public class AdditionalServiceRegionDC : IDataContract
    {
        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public long? AdditionalServiceOid { get; set; }

        [DataMember]
        public AdditionalServiceDC AdditionalService { get; set; }

        [DataMember]
        public long? AdditionalServiceRegionOid { get; set; }

        [DataMember]
        public string Notice { get; set; }

        [DataMember]
        public string InsUser { get; set; }

        [DataMember]
        public DateTime? InsertedOn { get; set; }

        [DataMember]
        public long? AdditionalServiceRegionVersion { get; set; }

        public override string ToString()
        {
            return Name;
        }

	    public override bool Equals(object obj)
	    {
		    if (obj is AdditionalServiceRegionDC)
		    {
			    var vergleichsobjekt = (AdditionalServiceRegionDC) obj;

				return AdditionalServiceRegionOid == vergleichsobjekt.AdditionalServiceRegionOid &&
					   AdditionalServiceOid == vergleichsobjekt.AdditionalServiceOid &&
					   AdditionalServiceRegionOid == vergleichsobjekt.AdditionalServiceRegionOid &&
					   AdditionalServiceRegionVersion == vergleichsobjekt.AdditionalServiceRegionVersion;
		    }

		    return false;
	    }
    }
}
