温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:多层文章管理系统源码
当前文件:
MultiLayerArticle/Model/ArticleTypeCollection.cs,打开代码结构图
MultiLayerArticle/Model/ArticleTypeCollection.cs,打开代码结构图1using System; 2
using System.Collections.Generic; 3
using System.Text; 4
using System.Collections; 5
6
namespace Model 7
{ 8
public class ArticleTypeCollection:CollectionBase 9
{ 10
public ArticleTypeModel this[int index] 11
{ 12
set { List[index] = value; } 13
get { return (ArticleTypeModel)List[index]; } 14
} 15
16
public void Add(ArticleTypeModel articleType) 17
{ 18
List.Add(articleType); 19
} 20
21
public ArticleTypeModel GetArticleTypeModelByArticleTypeID(int articleTypeID) 22
{ 23
ArticleTypeModel articleType = new ArticleTypeModel(); 24
foreach (ArticleTypeModel atm in List) 25
{ 26
if (atm.TypeID == articleTypeID) 27
{ 28
articleType = atm; 29
} 30
} 31
return articleType; 32
} 33
} 34
} 35





}
}