温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:博客源代码(课程设计,3层架构)
当前文件:
MVCBlog/App_Code/Comment.cs,打开代码结构图
MVCBlog/App_Code/Comment.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Data.SqlClient; 4
using System.Collections.Generic; 5
//using System.Data.OleDb; 6
//留言类 7
public class Comment 8
{ 9
private string _id; 10
private string _gid; 11
private string _gcontent; 12
private string _gauthor; 13
private DateTime _gtime; 14
15
public string id 16
{ 17
get { return this._id; } 18
set { this._id = value; } 19
} 20
public string gid 21
{ 22
get { return this._gid; } 23
set { this._gid = value; } 24
} 25
public string gcontent 26
{ 27
get { return this._gcontent; } 28
set { this._gcontent = value; } 29
} 30
public string gauthor 31
{ 32
get { return this._gauthor; } 33
set { this._gauthor = value; } 34
} 35
public DateTime gtime 36
{ 37
get { return this._gtime; } 38
set { this._gtime = value; } 39
} 40
41
42
public Comment() 43
{ 44
// 45
// TODO: 在此处添加构造函数逻辑 46
// 47
} 48
public Comment(string aid,string comment) 49
{ 50
this._id = aid; 51
this._gcontent =comment; 52
} 53
public Comment(SqlDataReader dr) 54
{ 55
this._id =dr["id"].ToString(); 56
this._gid = dr["g_ID"].ToString(); 57
this._gcontent = dr["g_content"].ToString(); 58
this._gauthor = dr["g_author"].ToString(); 59
this._gtime =Convert.ToDateTime(dr["g_time"]); 60
} 61
} 62





}
}