简单评论系统开发过程(二)
上回说到程序设计,这次继续往下看。
⑵评论实体类
这个代码大家都了解了,可是我原来不知道可以动态生成,所以就手写的,看起来还真累人。
后来查资料有“NET代码生成器”,或者用CodeSmith等吧。话不多说了,看代码吧。
comment.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
namespace Model
6
{
7
public class comment
8
{
9
private int comm_id;
10
private int comm_tid;
11
private string comm_name;
12
private DateTime comm_time;
13
private string comm_ip;
14
private int comm_agree;
15
private int comm_against;
16
private int comm_audit;
17
private int comm_hot;
18
private int comm_hits;
19
private string comm_content;
20![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
21
public comment() { }
22
/// <summary>
23
/// 初始化评论构造器
24
/// </summary>
25
/// <param name="comm_id">评论ID</param>
26
/// <param name="comm_title">评论标题</param>
27
/// <param name="comm_name">评论人</param>
28
/// <param name="comm_time">发布时间</param>
29
/// <param name="comm_ip">评论人IP</param>
30
/// <param name="comm_agree">赞同</param>
31
/// <param name="comm_against">反对</param>
32
/// <param name="comm_audit">审核</param>
33
/// <param name="comm_hot">精华</param>
34
/// <param name="comm_hits">阅读次数</param>
35
/// <param name="comm_content">评论内容</param>
36
public comment(int id, int tid, string name, DateTime time, string ip, int agree, int against, int audit, int hot, int hits, string content)
37
{
38
this.comm_id = id;
39
this.comm_tid = tid;
40
this.comm_name = name;
41
this.comm_time = time;
42
this.comm_ip = ip;
43
this.comm_agree = agree;
44
this.comm_against = against;
45
this.comm_audit = audit;
46
this.comm_hot = hot;
47
this.comm_hits = hits;
48
this.comm_content = content;
49
}
50![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
51
public int Comm_id
52
{
53
get
54
{
55
return this.comm_id;
56
}
57
set
58
{
59
this.comm_id = value;
60
}
61
}
62![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
63
public int Comm_tid
64
{
65
get
66
{
67
return this.comm_tid;
68
}
69
set
70
{
71
this.comm_tid = value;
72
}
73
}
74![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
75
public string Comm_name
76
{
77
get
78
{
79
return this.comm_name;
80
}
81
set
82
{
83
this.comm_name = value;
84
}
85
}
86![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
87
public DateTime Comm_time
88
{
89
get
90
{
91
return this.comm_time;
92
}
93
set
94
{
95
this.comm_time = value;
96
}
97
}
98![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
99
public string Comm_ip
100
{
101
get
102
{
103
return this.comm_ip;
104
}
105
set
106
{
107
this.comm_ip = value;
108
}
109
}
110![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
111
public int Comm_agree
112
{
113
get
114
{
115
return this.comm_agree;
116
}
117
set
118
{
119
this.comm_agree = value;
120
}
121
}
122![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
123
public int Comm_against
124
{
125
get
126
{
127
return this.comm_against;
128
}
129
set
130
{
131
this.comm_against = value;
132
}
133
}
134![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
135
public int Comm_audit
136
{
137
get
138
{
139
return this.comm_audit;
140
}
141
set
142
{
143
this.comm_audit = value;
144
}
145
}
146![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
147
public int Comm_hot
148
{
149
get
150
{
151
return this.comm_hot;
152
}
153
set
154
{
155
this.comm_hot = value;
156
}
157
}
158![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
159
public int Comm_hits
160
{
161
get
162
{
163
return this.comm_hits;
164
}
165
set
166
{
167
this.comm_hits = value;
168
}
169
}
170![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
171
public string Comm_content
172
{
173
get
174
{
175
return this.comm_content;
176
}
177
set
178
{
179
this.comm_content = value;
180
}
181
}
182
}
183
}
184![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
22
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
23
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
24
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
25
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
26
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
27
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
28
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
29
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
30
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
31
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
32
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
33
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
34
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
35
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
36
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
37
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
38
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
39
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
40
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
41
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
42
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
43
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
44
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
45
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
46
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
47
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
48
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
49
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
50
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
51
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
52
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
53
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
54
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
55
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
56
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
57
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
58
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
59
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
60
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
61
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
62
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
63
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
64
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
65
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
66
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
67
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
68
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
69
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
70
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
71
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
72
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
73
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
74
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
75
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
76
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
77
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
78
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
79
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
80
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
81
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
82
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
83
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
84
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
85
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
86
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
87
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
88
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
89
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
90
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
91
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
92
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
93
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
94
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
95
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
96
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
97
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
98
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
99
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
100
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
101
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
102
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
103
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
104
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
105
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
106
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
107
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
108
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
109
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
110
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
111
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
112
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
113
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
114
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
115
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
116
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
117
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
118
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
119
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
120
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
121
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
122
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
123
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
124
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
125
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
126
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
127
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
128
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
129
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
130
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
131
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
132
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
133
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
134
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
135
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
136
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
137
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
138
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
139
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
140
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
141
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
142
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
143
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
144
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
145
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
146
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
147
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
148
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
149
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
150
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
151
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
152
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
153
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
154
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
155
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
156
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
157
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
158
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
159
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
160
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
161
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
162
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
163
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
164
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
165
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
166
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
167
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
168
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
169
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
170
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
171
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
172
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
173
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
174
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
175
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
176
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
177
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
178
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
179
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
180
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
181
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
182
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
183
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
184
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
待续……