温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:博客源代码(课程设计,3层架构)
当前文件:
MVCBlog/App_Code/Article.cs,打开代码结构图
MVCBlog/App_Code/Article.cs,打开代码结构图1using System; 2
using System.Data.SqlClient; 3
//using System.Data.OleDb; 4
5
//文章的各个字段 6
//该源码下载自www.51aspx.com(51aspx.com) 7
8
public class Article 9
{ 10
private string _id;//ID 11
private string _title;//题目 12
private int _leibie;//类别 13
private string _content;//文章内容能够 14
private DateTime _time;//发表时间 15
private string _Author;//作者 16
private int _times;//阅读次数 17
private int _gentieCount;//跟帖次数 18
private string _leibiestr; 19
20
21
public Article() 22
{} 23
public Article(string id, string title, string content) 24
{ 25
this._id=id; 26
this._title=title; 27
this._content=content; 28
29
} 30
public Article(string id, int leibie, string title, string content) 31
{ 32
this._id = id; 33
this._leibie = leibie; 34
this._title = title; 35
this._content = content; 36
} 37
public string leibiestr 38
{ 39
get { return this._leibiestr; } 40
set { this._leibiestr = value; } 41
42
} 43
public string id //获取文章id 44
{ 45
get { return this._id;} 46
set { this._id = value; } 47
} 48
public string title //获取文章标题 49
{ 50
get { return this._title; } 51
set { this._title = value; } 52
} 53
public int liebie //获取文章类别 54
{ 55
get { return this._leibie; } 56
set { this._leibie = value; } 57
} 58
public string content //获取文章内容 59
{ 60
get { return this._content; } 61
set { this._content = value; } 62
} 63
public DateTime postdatetime//发表文章时间 64
{ 65
get {return this._time;} 66
set {this._time=value;} 67
} 68
public string author 69
{ 70
get {return this._Author;} 71
set {this._Author=value;} 72
} 73
public int readcount 74
{ 75
get{return this._times;} 76
set {this._times=value;} 77
} 78
public int gentieCount 79
{ 80
get { return this._gentieCount;} 81
set { this._gentieCount=value;} 82
} 83
public Article(SqlDataReader dr) 84
{ 85
this._Author = dr["Author"].ToString(); 86
this._content = dr["Content"].ToString(); 87
this._gentieCount = Convert.ToInt32(dr["GentieCount"]); 88
this._id = dr["ID"].ToString(); 89
this._leibie = Convert.ToInt32(dr["LeiBie"]); 90
this._time = Convert.ToDateTime(dr["Time"]); 91
this._times = Convert.ToInt32(dr["Times"]); 92
this._title = dr["Title"].ToString(); 93
} 94
95
} 96





}
}