1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/**  
* EC_DemandQuoteExtend.cs
*
* 功 能: 需求报价实体扩展类
* 类 名: EC_DemandQuote
*
* Ver    变更日期             负责人  变更内容
* ───────────────────────────────────
* V0.01  2013-4-23 10:13:00   吴崎均  迁移Visiter到此类
* V0.02  2013-5-23 9:09       吴崎均  修改Visiter:增加需求报价、需求截止日期、需求状态对应部分
*
*
*
*
*
*/
using System;
using CY.Infrastructure.Domain;
using CY.Infrastructure.Common;
namespace CY.Model
{
    /// <summary>
    /// 需求报价
    /// </summary>
    public partial class EC_DemandQuote
    {
        #region ExtendProperties
 
        private EC_MemberBasic _quoter = null;
 
        /// <summary>
        /// 报价人(会员)
        /// </summary>
        public EC_MemberBasic Quoter
        {
            get
            {
                _quoter = null == _quoter ? new EC_MemberBasic() : _quoter;
                return _quoter;
            }
            set { _quoter = value; }
        }
 
        private EC_QuoteDemand _demand = null;
 
        /// <summary>
        /// 报价需求
        /// </summary>
        public EC_QuoteDemand Demand
        {
            get
            {
                _demand = null == _demand ? new EC_QuoteDemand() : _demand;
                return _demand;
            }
            set { _demand = value; }
        }
 
        #endregion
 
        #region Visiter
 
        /// <summary>
        /// 属性访问器
        /// </summary>
        /// <param name="name">属性名</param>
        /// <param name="index">索引</param>
        /// <param name="isChange">是否将指定属性设置为传入值</param>
        /// <param name="value">需要赋予的值</param>
        /// <returns>与名称对应的属性值</returns>
        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 ("DemandId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 2)
            {
                this.DemandId = isChange ? MyConvert.ConvertToInt32(value) : DemandId;
                theValue = this.DemandId;
            }
            else if ("QuoteInfo".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 3)
            {
                this.QuoteInfo = isChange ? MyConvert.ConvertToString(value) : QuoteInfo;
                theValue = this.QuoteInfo;
            }
            else if ("QuoteRemark".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 4)
            {
                this.QuoteRemark = isChange ? MyConvert.ConvertToString(value) : QuoteRemark;
                theValue = this.QuoteRemark;
            }
            else if ("QuoteTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 5)
            {
                this.QuoteTime = isChange ? MyConvert.ConvertToDateTime(value) : QuoteTime;
                theValue = this.QuoteTime;
            }
            else if ("QuoterId".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 6)
            {
                this.QuoterId = isChange ? MyConvert.ConvertToGuid(value) : QuoterId;
                theValue = this.QuoterId;
            }
            else if ("QuoterPrice".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 7)
            {
                this.QuoterPrice = isChange ? MyConvert.ConvertToDecimal(value) : QuoterPrice;
                theValue = this.QuoterPrice;
            }
 
            #region 扩展属性处理
 
            else if ("QuoterName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 7)
            {
                this.Quoter.Name = isChange ? MyConvert.ConvertToString(value) : this.Quoter.Name;
                theValue = this.Quoter.Name;
            }
            else if ("DemandName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 8)
            {
                this.Demand.DemandName = isChange ? MyConvert.ConvertToString(value) : this.Demand.DemandName;
                theValue = Demand.DemandName;
            }
            else if ("DemandEndTime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 9)
            {
                this.Demand.EndTime = isChange ? MyConvert.ConvertToDateTime(value) : this.Demand.EndTime;
                theValue = Demand.EndTime;
            }
            else if ("DemandStateName".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 10)
            {
                this.Demand.StateType.Name = isChange ? MyConvert.ConvertToString(value) : this.Demand.StateType.Name;
                theValue = Demand.StateType.Name;
            }
 
            #endregion
 
            return theValue;
        }
        #endregion
    }
}