/** * EC_DemandDescribeExtend.cs * * 功 能: 用户需求信息实体类扩展类 * 类 名: EC_DemandDescribe * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── * V0.01 2013-4-23 10:13:00 吴崎均 迁移Visiter到此类 * V0.02 2013-5-23 9:16 吴崎均 增加扩展属性: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_DemandDescribe { #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; } } private Sys_Dictionary _calltype = null; /// /// 状态类型 /// public Sys_Dictionary CallType { get { _calltype = null == _calltype ? new Sys_Dictionary() : _calltype; return _calltype; } set { _calltype = value; } } /// /// 状态名称 /// public string StateName { get { return this.EndTime.HasValue && this.EndTime > DateTime.Now ? StateType.Name : "已过期"; } } #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 ("MemberId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 2) { this.MemberId = isChange ? MyConvert.ConvertToGuid(value) : MemberId; theValue = this.MemberId; } else if ("PrintTypeId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 3) { this.PrintTypeId = isChange ? MyConvert.ConvertToInt32(value) : PrintTypeId; theValue = this.PrintTypeId; } else if ("DemandName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 4) { this.DemandName = isChange ? MyConvert.ConvertToString(value) : DemandName; theValue = this.DemandName; } else if ("PrintCount".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 7) { this.PrintCount = isChange ? MyConvert.ConvertToInt32(value) : PrintCount; theValue = this.PrintCount; } else if ("DemandDemand".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 5) { this.DemandDemand = isChange ? MyConvert.ConvertToString(value) : DemandDemand; theValue = this.DemandDemand; } else if ("EndTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 6) { this.EndTime = isChange ? MyConvert.ConvertToDateTime(value) : EndTime; theValue = this.EndTime; } else if ("CallTypeId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 7) { this.CallTypeId = isChange ? MyConvert.ConvertToInt32(value) : CallTypeId; theValue = this.CallTypeId; } else if ("State".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 8) { this.State = isChange ? MyConvert.ConvertToInt32(value) : State; theValue = this.State; } else if ("CreateTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 9) { this.CreateTime = isChange ? MyConvert.ConvertToDateTime(value) : CreateTime; theValue = this.CreateTime; } else if ("LastUpdateTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 10) { this.LastUpdateTime = isChange ? MyConvert.ConvertToDateTime(value) : LastUpdateTime; theValue = this.LastUpdateTime; } else if ("Operator".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 11) { this.Operator = isChange ? MyConvert.ConvertToString(value) : Operator; theValue = this.Operator; } else if ("Remark".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 12) { 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 ("MemberName".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 ("CallTypeName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 33) { this.CallType.Name = isChange ? MyConvert.ConvertToString(value) : this.StateType.Name; theValue = this.StateType.Name; } #endregion return theValue; } #endregion } }