/**
* EC_QuoteDemandExtend.cs
*
* 功 能: 报价需求实体扩展类
* 类 名: EC_QuoteDemand
*
* Ver 变更日期 负责人 变更内容
* ───────────────────────────────────
* V0.01 2013-4-23 10:13:00 吴崎均 迁移Visiter到此类
* V0.02 2013-5-22 10:37 吴崎均 增加印刷参数属性
* V0.03 2013-5-22 11:54 吴崎均 修改Visiter实现:增加印刷参数对应项
* V0.04 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_QuoteDemand
{
#region ExtendProperties
///
/// 需求印刷参数
///
private EC_DemandPrintParameter _printparameter;
///
/// 需求印刷选项
///
///
///
public EC_DemandPrintParameter PrintParameter(EC_DemandPrintParameter value = null)
{
_printparameter = null == _printparameter ? new EC_DemandPrintParameter() : _printparameter;
_printparameter = null == value ? _printparameter : value;
return _printparameter;
}
private EC_MemberBasic _memberbasic = null;
///
/// 会员信息
///
public EC_MemberBasic MemberBasic
{
get
{
_memberbasic = null == _memberbasic ? new EC_MemberBasic() : _memberbasic;
return _memberbasic;
}
set { _memberbasic = 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) : this.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 ("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 ("AskPriceNoteId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 10)
{
this.AskPriceNoteId = isChange ? MyConvert.ConvertToInt32(value) : AskPriceNoteId;
theValue = this.AskPriceNoteId;
}
else if ("LastUpdateTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 11)
{
this.LastUpdateTime = isChange ? MyConvert.ConvertToDateTime(value) : LastUpdateTime;
theValue = this.LastUpdateTime;
}
else if ("Operator".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 12)
{
this.Operator = isChange ? MyConvert.ConvertToString(value) : Operator;
theValue = this.Operator;
}
else if ("Remark".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 13)
{
this.Remark = isChange ? MyConvert.ConvertToString(value) : Remark;
theValue = this.Remark;
}
else if ("QuoteCount".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 13)
{
this.QuoteCount = isChange ? MyConvert.ConvertToInt32(value) : QuoteCount;
theValue = this.QuoteCount;
}
else if ("ContactPhone".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 13)
{
this.ContactPhone = isChange ? MyConvert.ConvertToString(value) : ContactPhone;
theValue = this.ContactPhone;
}
else if ("QQ".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 13)
{
this.QQ = isChange ? MyConvert.ConvertToString(value) : QQ;
theValue = this.QQ;
}
#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;
}
else if ("TargetId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 34)
{
this.PrintParameter().TargetId = isChange ? MyConvert.ConvertToInt32(value) : this.PrintParameter().TargetId;
theValue = this.PrintParameter().TargetId;
}
else if ("PrintParameter".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 35)
{
this.PrintParameter().PrintParameter = isChange ? MyConvert.ConvertToString(value) : this.PrintParameter().PrintParameter;
theValue = this.PrintParameter().PrintParameter;
}
else if ("City".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 36)
{
this.MemberBasic.City = isChange ? MyConvert.ConvertToString(value) : this.MemberBasic.City;
theValue = this.MemberBasic.City;
}
#endregion
return theValue;
}
#endregion
}
}