using System; using System.ComponentModel.DataAnnotations; namespace Dfs.WayneChina.PosModelMini { public class BusinessUnit { /// /// Unique id of the business unit. /// public Guid Id { get; set; } /// /// When the business unit is created. /// public virtual DateTime? CreatedDateTime { get; set; } /// /// Business unit type. /// public BusinessUnitTypeEnum UnitType { get; set; } /// /// Name of the business unit. /// [MaxLength(50)] public string Name { get; set; } /// /// Address of the business unit. /// public string Address { get; set; } /// /// Anything could help to understand what this unit means, like a Site, then try put info about this site. /// or a region, then try put info about the region. /// public string Description { get; set; } /// /// Parent business unit id of the current business unit. /// public Guid? ParentBusinessUnitId { get; set; } /// /// Parent business unit of the current business unit. /// public virtual BusinessUnit ParentBusinessUnit { get; set; } /// /// Pos item group system. /// public virtual PosItemGroupSystem PosItemGroupSystem { get; set; } /// /// Checks whether the target business unit is the same as the current one. /// /// /// public override bool Equals(object obj) { var target = obj as BusinessUnit; if (target == null) return false; if (target.Name == this.Name) return true; return false; } /// /// Overrides the method just to make the compiler happy. /// /// public override int GetHashCode() { return base.GetHashCode(); } } }