/** * EC_SeckillInfoExtend.cs * * 功 能: 特价信息实体扩展类 * 类 名: EC_SeckillInfo * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── * V0.01 2013-4-23 10:13:00 吴崎均 迁移Visiter到此类 * V0.02 2013-5-23 9:22 吴崎均 增加扩展属性:StateName 用于获取状态(当过期时状态为已过期) * * * * * * */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using CY.Infrastructure.Domain; using CY.Model; using CY.Infrastructure.Common; namespace CY.Model { /// /// 扩展部分 /// public partial class EC_SeckillInfo { #region ExtendProperties private EC_MemberBasic _meberbasic = null; /// /// 会员信息 /// public EC_MemberBasic MemberBasic { get { _meberbasic = null == _meberbasic ? new EC_MemberBasic() : _meberbasic; return _meberbasic; } set { _meberbasic = value; } } private SysInquiry_PrintingType _printtype = null; /// /// 印刷业务类型 /// public SysInquiry_PrintingType PrintType { get { _printtype = null == _printtype ? new SysInquiry_PrintingType() : _printtype; return _printtype; } set { _printtype = value; } } private Sys_Dictionary _statetype = null; /// /// 状态类型 /// public Sys_Dictionary StateType { get { _statetype = null == _statetype ? new Sys_Dictionary() : _statetype; return _statetype; } set { _statetype = value; } } /// /// 状态名称 /// public string StateName { get { return this.EndTime.HasValue && this.EndTime > DateTime.Now ? StateType.Name : "已过期"; } } /// /// 厂商信誉图标 /// public string LevelIcon { get; set; } #endregion #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 ("SellerId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 2) { this.SellerId = isChange ? MyConvert.ConvertToGuid(value) : this.SellerId; theValue = this.SellerId; } else if ("BusinessInfoName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 3) { this.BusinessInfoName = isChange ? MyConvert.ConvertToString(value) : BusinessInfoName; theValue = this.BusinessInfoName; } else if ("PrintTypeId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 4) { this.PrintTypeId = isChange ? MyConvert.ConvertToInt32(value) : PrintTypeId; theValue = this.PrintTypeId; } else if ("BusinessContent".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 5) { this.BusinessContent = isChange ? MyConvert.ConvertToString(value) : BusinessContent; theValue = this.BusinessContent; } else if ("Contacts".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 6) { this.Contacts = isChange ? MyConvert.ConvertToString(value) : Contacts; theValue = this.Contacts; } else if ("ContactPhone".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 7) { this.ContactPhone = isChange ? MyConvert.ConvertToString(value) : ContactPhone; theValue = this.ContactPhone; } else if ("QQ".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 8) { this.QQ = isChange ? MyConvert.ConvertToString(value) : QQ; theValue = this.QQ; } else if ("CreateTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 9) { this.CreateTime = isChange ? MyConvert.ConvertToDateTime(value) : CreateTime; theValue = this.CreateTime; } else if ("EndTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 10) { this.EndTime = isChange ? MyConvert.ConvertToDateTime(value) : EndTime; theValue = this.EndTime; } else if ("State".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 11) { this.State = isChange ? MyConvert.ConvertToInt32(value) : State; theValue = this.State; } else if ("LastUpdateTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 12) { this.LastUpdateTime = isChange ? MyConvert.ConvertToDateTime(value) : LastUpdateTime; theValue = this.LastUpdateTime; } else if ("Operator".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 13) { this.Operator = isChange ? MyConvert.ConvertToString(value) : Operator; theValue = this.Operator; } else if ("Remark".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 14) { this.Remark = isChange ? MyConvert.ConvertToString(value) : Remark; theValue = this.Remark; } #region 扩展属性处理 else if ("PrintTypeName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 30) { this.PrintType.PrintName = isChange ? MyConvert.ConvertToString(value) : this.PrintType.PrintName; theValue = this.PrintType.PrintName; } else if ("SellerName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 31) { this.MemberBasic.Name = isChange ? MyConvert.ConvertToString(value) : this.MemberBasic.Name; theValue = this.MemberBasic.Name; } else if ("StateName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 32) { this.StateType.Name = isChange ? MyConvert.ConvertToString(value) : this.StateType.Name; theValue = this.StateType.Name; } else if ("LevelIcon".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 33) { this.LevelIcon = isChange ? MyConvert.ConvertToString(value) : this.LevelIcon; theValue = this.LevelIcon; } #endregion return theValue; } #endregion } }