温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:中小企业网站系统前台源码(SmallBusinessStarterKit)
当前文件:
SmallBusinessStarterKit/App_Code/Catalog/Category.cs[1K,2009-6-12 11:54:21],打开代码结构图
SmallBusinessStarterKit/App_Code/Catalog/Category.cs[1K,2009-6-12 11:54:21],打开代码结构图1using System; 2
3
4
///<summary> 5
/// 分类项 6
/// 表示企业的产品类别,以便于企业组织他们的产品 7
/// </summary> 8
public class Category 9
{ 10
private string _id; 11
private bool _visible; 12
private string _title; 13
private string _description; 14
private string _imageUrl; 15
private string _imageAltText; 16
17
public Category(string id, bool visible, string title) 18
{ 19
if (String.IsNullOrEmpty(id)) throw new ArgumentException(Messages.CategoryIdUndefined); 20
if (String.IsNullOrEmpty(title)) throw new ArgumentException(Messages.CategoryTitleUndefined); 21
22
_id = id; 23
_visible = visible; 24
_title = title; 25
26
} 27
28
29
public string Id 30
{ 31
get { return _id; } 32
} 33
34
public string Title 35
{ 36
get { return String.IsNullOrEmpty(_title) ? String.Empty : _title; } 37
set 38
{ 39
if (String.IsNullOrEmpty(value)) 40
throw new InvalidOperationException(Messages.ItemTitleIsNull); 41
_title = value; } 42
} 43
44
public bool Visible 45
{ 46
get { return _visible; } 47
set { _visible = value; } 48
} 49
50
51
public string Description 52
{ 53
get { return String.IsNullOrEmpty(_description) ? String.Empty : _description; } 54
set { _description= value; } 55
} 56
57
public string ImageUrl 58
{ 59
get { return String.IsNullOrEmpty(_imageUrl) ? String.Empty : _imageUrl; } 60
set { _imageUrl= value; } 61
} 62
63
public string ImageAltText 64
{ 65
get { return String.IsNullOrEmpty(_imageAltText) ? String.Empty : _imageAltText; } 66
set { _imageAltText = value; } 67
} 68
69
} // end class 70
71








}