using System; using System.Collections.Generic; using System.Linq; using System.Text; using CY.Infrastructure.Domain; using CY.Infrastructure.Common; namespace CY.Model { public class Info_CompanyAd : IAggregateRoot { Guid _FirmId; /// /// 所属商家ID /// public Guid FirmId { get { return _FirmId; } set { _FirmId = value; } } string _picUrl; /// /// 图片url /// public string PicUrl { get { return _picUrl; } set { _picUrl = value; } } string _tittle; /// /// 图片标题 /// public string Tittle { get { return _tittle; } set { _tittle = value; } } int? _KeyId; /// /// Id /// public int? KeyId { get { return _KeyId; } set { _KeyId = value; } } string _Operator; /// /// 操作人 /// public string Operator { get { return _Operator; } set { _Operator = value; } } string _LinkUrl; /// /// 图片链接url /// public string LinkUrl { get { return _LinkUrl; } set { _LinkUrl = value; } } int? _type; /// /// 图片所属广告类型 /// public int? Type { get { return _type; } set { _type = value; } } DateTime? _createTime; /// /// 上传时间 /// public DateTime? CreateTime { get { return _createTime; } set { _createTime = value; } } private string _TypeName; /// /// 类型名称 /// public string TypeName { get { return _TypeName; } set { _TypeName = value; } } #region Visiter /// /// 属性访问器 /// /// 属性名 /// 索引 /// 是否将指定属性设置为传入值 /// 需要赋予的值 /// 与名称对应的属性值 public object Visiter(string name, int? index = -1, bool isChange = false, object value = null) { object theValue = null; if ("Keyid".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 1) { this.KeyId = isChange ? MyConvert.ConvertToInt32(value) : KeyId; theValue = this.KeyId; } else if ("FirmId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 2) { this.FirmId = isChange ? MyConvert.ConvertToGuid(value) : this.FirmId; theValue = this.FirmId; } else if ("PicUrl".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 3) { this.PicUrl = isChange ? MyConvert.ConvertToString(value) : PicUrl; theValue = this.PicUrl; } else if ("Operator".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 4) { this.Operator = isChange ? MyConvert.ConvertToString(value) : Operator; theValue = this.Operator; } else if ("Tittle".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 5) { this.Tittle = isChange ? MyConvert.ConvertToString(value) : Tittle; theValue = this.Tittle; } else if ("Type".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 6) { this.Type = isChange ? MyConvert.ConvertToInt32(value) : Type; theValue = this.Type; } else if ("CreateTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 7) { this.CreateTime = isChange ? MyConvert.ConvertToDateTime(value) : CreateTime; theValue = this.CreateTime; } else if ("LinkUrl".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 8) { this.LinkUrl = isChange ? MyConvert.ConvertToString(value) : LinkUrl; theValue = this.LinkUrl; } else if ("TypeName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 9) { this.TypeName = isChange ? MyConvert.ConvertToString(value) : TypeName; theValue = this.TypeName; } return theValue; } #endregion } }