using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using Util.Domain; using Util.Domain.Biz.Enums; using Util.Domain.Entities; namespace Util.Applications.Models { /// /// 客户 /// [Description( "客户" )] public class Customer : AggregateRoot,IDelete{ /// /// 初始化客户 /// public Customer() : this( 0 ) { } /// /// 初始化客户 /// /// 客户标识 public Customer( int id ) : base( id ) { } /// /// 编码 /// [Description( "编码" )] [MaxLength( 100 )] public string Code { get; set; } /// /// 姓名 /// [Description( "姓名" )] [MaxLength( 200 )] public string Name { get; set; } /// /// 昵称 /// [Description( "昵称" )] [MaxLength( 50 )] public string Nickname { get; set; } /// /// 性别 /// [Description( "性别" )] public Gender? Gender { get; set; } /// /// 出生日期 /// [Description( "出生日期" )] public DateTime? Birthday { get; set; } /// /// 民族 /// [Description( "民族" )] public Nation? Nation { get; set; } /// /// 手机号 /// [Description( "手机号" )] [MaxLength( 50 )] public string Phone { get; set; } /// /// 电子邮件 /// [Description( "电子邮件" )] [MaxLength( 500 )] public string Email { get; set; } /// /// 创建时间 /// [Description( "创建时间" )] public DateTime? CreationTime { get; set; } /// /// 创建人 /// [Description( "创建人" )] public Guid? CreatorId { get; set; } /// /// 最后修改时间 /// [Description( "最后修改时间" )] public DateTime? LastModificationTime { get; set; } /// /// 最后修改人 /// [Description( "最后修改人" )] public Guid? LastModifierId { get; set; } /// /// 是否删除 /// [Description( "是否删除" )] public bool IsDeleted { get; set; } /// /// 添加变更列表 /// protected override void AddChanges( Customer other ) { AddChange( t => t.Code, other.Code ); AddChange( t => t.Name, other.Name ); AddChange( t => t.Nickname, other.Nickname ); AddChange( t => t.Gender, other.Gender ); AddChange( t => t.Birthday, other.Birthday ); AddChange( t => t.Nation, other.Nation ); AddChange( t => t.Phone, other.Phone ); AddChange( t => t.Email, other.Email ); AddChange( t => t.CreationTime, other.CreationTime ); AddChange( t => t.CreatorId, other.CreatorId ); AddChange( t => t.LastModificationTime, other.LastModificationTime ); AddChange( t => t.LastModifierId, other.LastModifierId ); } } }