qwj
2022-08-22 63f6c5de8832eaabf066fe9f9d492187f04011b7
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
 
namespace CY_DocumentSynchroWCFService
{
    [DataContract]
    public partial class T_Test : IAggregateRoot
    {
        public T_Test()
        {
        }
        #region Model
 
        /// <summary>
        /// id
        /// </summary>
        [DataMember]
        public int? id {get;set; }
 
        /// <summary>
        /// name
        /// </summary>
        [DataMember]
        public string username { get; set; }
 
        /// <summary>
        /// email
        /// </summary>
        [DataMember]
        public string useremail { get; set; }
 
        /// <summary>
        /// address
        /// </summary>
        [DataMember]
        public string address { get; set; }
               
 
        /// <summary>
        /// LeaveTime
        /// </summary>
        [DataMember]
        public DateTime? addtime { get; set; }
 
        /// <summary>
        /// IsWork
        /// </summary>
        [DataMember]
        public int? status { get; set; }
 
        #endregion Model
 
        #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 ("id".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 1)
            {
                this.id = isChange ? MyConvert.ConvertToInt(value) : id;
                theValue = this.id;
            }
            else if ("username".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 2)
            {
                this.username = isChange ? MyConvert.ConvertToString(value) : username;
                theValue = this.username;
            }
            else if ("useremail".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 3)
            {
                this.useremail = isChange ? MyConvert.ConvertToString(value) : useremail;
                theValue = this.useremail;
            }
            else if ("address".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 4)
            {
                this.address = isChange ? MyConvert.ConvertToString(value) : address;
                theValue = this.address;
            }
            else if ("addtime".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 5)
            {
                this.addtime = isChange ? MyConvert.ConvertToDateTime(value) : addtime;
                theValue = this.addtime;
            }
            
            else if ("status".Equals(name, StringComparison.CurrentCultureIgnoreCase) || index == 6)
            {
                this.status = isChange ? MyConvert.ConvertToInt(value) : status;
                theValue = this.status;
            }
            
            return theValue;
        }
        #endregion Visiter
    }
}