/**
* EC_SeckillBusinessExtend.cs
*
* 功 能: 特价秒杀(特价业务)实体扩展类
* 类 名: EC_SeckillBusiness
*
* 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_SeckillBusiness
{
#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;
}
///
/// 表示是不是自己的订单,1表示是,0表示不是
///
public int IsMyOrder
{
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 ("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 ("BusinessName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 4)
{
this.BusinessName = isChange ? MyConvert.ConvertToString(value) : BusinessName;
theValue = this.BusinessName;
}
else if ("Specifications".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 5)
{
this.Specifications = isChange ? MyConvert.ConvertToString(value) : Specifications;
theValue = this.Specifications;
}
else if ("OrderCount".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 6)
{
this.OrderCount = isChange ? MyConvert.ConvertToInt32(value) : OrderCount;
theValue = this.OrderCount;
}
else if ("PrintCount".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 7)
{
this.PrintCount = isChange ? MyConvert.ConvertToInt32(value) : PrintCount;
theValue = this.PrintCount;
}
else if ("Price".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 8)
{
this.Price = isChange ? MyConvert.ConvertToDecimal(value) : Price;
theValue = this.Price;
}
else if ("SurplusOrderCount".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 9)
{
this.SurplusOrderCount = isChange ? MyConvert.ConvertToInt32(value) : SurplusOrderCount;
theValue = this.SurplusOrderCount;
}
else if ("Contacts".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 10)
{
this.Contacts = isChange ? MyConvert.ConvertToString(value) : Contacts;
theValue = this.Contacts;
}
else if ("ContactPhone".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 11)
{
this.ContactPhone = isChange ? MyConvert.ConvertToString(value) : ContactPhone;
theValue = this.ContactPhone;
}
else if ("QQ".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 12)
{
this.QQ = isChange ? MyConvert.ConvertToString(value) : QQ;
theValue = this.QQ;
}
else if ("CreateTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 13)
{
this.CreateTime = isChange ? MyConvert.ConvertToDateTime(value) : CreateTime;
theValue = this.CreateTime;
}
else if ("EndTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 14)
{
this.EndTime = isChange ? MyConvert.ConvertToDateTime(value) : EndTime;
theValue = this.EndTime;
}
else if ("State".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 15)
{
this.State = isChange ? MyConvert.ConvertToInt32(value) : State;
theValue = this.State;
}
else if ("LastUpdateTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 16)
{
this.LastUpdateTime = isChange ? MyConvert.ConvertToDateTime(value) : LastUpdateTime;
theValue = this.LastUpdateTime;
}
else if ("Operator".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 17)
{
this.Operator = isChange ? MyConvert.ConvertToString(value) : Operator;
theValue = this.Operator;
}
else if ("Remark".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 18)
{
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 ("LevelIcon".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 33)
{
this.LevelIcon = isChange ? MyConvert.ConvertToString(value) : this.LevelIcon;
theValue = this.LevelIcon;
}
#endregion
return theValue;
}
#endregion
}
}