using System; using System.ComponentModel.DataAnnotations; namespace Dfs.WayneChina.PosModelMini { public class BusinessUnit { /// <summary> /// Unique id of the business unit. /// </summary> public Guid Id { get; set; } /// <summary> /// When the business unit is created. /// </summary> public virtual DateTime? CreatedDateTime { get; set; } /// <summary> /// Business unit type. /// </summary> public BusinessUnitTypeEnum UnitType { get; set; } /// <summary> /// Name of the business unit. /// </summary> [MaxLength(50)] public string Name { get; set; } /// <summary> /// Address of the business unit. /// </summary> public string Address { get; set; } /// <summary> /// 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. /// </summary> public string Description { get; set; } /// <summary> /// Parent business unit id of the current business unit. /// </summary> public Guid? ParentBusinessUnitId { get; set; } /// <summary> /// Parent business unit of the current business unit. /// </summary> public virtual BusinessUnit ParentBusinessUnit { get; set; } /// <summary> /// Pos item group system. /// </summary> public virtual PosItemGroupSystem PosItemGroupSystem { get; set; } /// <summary> /// Checks whether the target business unit is the same as the current one. /// </summary> /// <param name="obj"></param> /// <returns></returns> 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; } /// <summary> /// Overrides the method just to make the compiler happy. /// </summary> /// <returns></returns> public override int GetHashCode() { return base.GetHashCode(); } } }