当前文件:
SinaVote/Bll/Vote_Count.cs[4K,2009-6-12 11:54:10],
打开代码结构图
1
using System;
2
using System.Data;
3
using System.Collections.Generic;
4
using Charmmax.Model;
5
namespace Charmmax.BLL
6
...{
7
/**//// <summary>
8
/// 业务逻辑类Vote_Count 的摘要说明。
9
/// </summary>
10
public class Vote_Count
11
...{
12
private readonly Charmmax.DAL.Vote_Count dal = new Charmmax.DAL.Vote_Count();
13
public Vote_Count()
14
...{ }
15
成员方法#region 成员方法
16
/**//// <summary>
17
/// 是否存在该记录
18
/// </summary>
19
public bool Exists(int Q_ID, int I_ID)
20
...{
21
return dal.Exists(Q_ID, I_ID);
22
}
23
24
/**//// <summary>
25
/// 增加一条数据
26
/// </summary>
27
public int Add(Charmmax.Model.Vote_Count model)
28
...{
29
return dal.Add(model);
30
}
31
32
/**//// <summary>
33
/// 更新一条数据
34
/// </summary>
35
public void Update(Charmmax.Model.Vote_Count model)
36
...{
37
dal.Update(model);
38
}
39
40
/**//// <summary>
41
/// 删除一条数据
42
/// </summary>
43
public void Delete(int C_ID)
44
...{
45
46
dal.Delete(C_ID);
47
}
48
49
/**//// <summary>
50
/// 得到一个对象实体
51
/// </summary>
52
public Charmmax.Model.Vote_Count GetModel(int Q_ID, int I_ID)
53
...{
54
55
return dal.GetModel(Q_ID, I_ID);
56
}
57
58
/**//// <summary>
59
/// 得到一个对象实体,从缓存中。
60
/// </summary>
61
//public Charmmax.Model.Vote_Count GetModelByCache(int C_ID)
62
//{
63
64
// string CacheKey = "Vote_CountModel-" + C_ID;
65
// object objModel = LTP.Common.DataCache.GetCache(CacheKey);
66
// if (objModel == null)
67
// {
68
// try
69
// {
70
// objModel = dal.GetModel(C_ID);
71
// if (objModel != null)
72
// {
73
// int ModelCache = LTP.Common.ConfigHelper.GetConfigInt("ModelCache");
74
// LTP.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
75
// }
76
// }
77
// catch { }
78
// }
79
// return (Charmmax.Model.Vote_Count)objModel;
80
//}
81
82
/**//// <summary>
83
/// 获得数据列表
84
/// </summary>
85
public DataSet GetList(string strWhere)
86
...{
87
return dal.GetList(strWhere);
88
}
89
90
/**//// <summary>
91
/// 获得数据列表
92
/// </summary>
93
public List<Charmmax.Model.Vote_Count> GetModelList(string strWhere)
94
...{
95
DataSet ds = dal.GetList(strWhere);
96
List<Charmmax.Model.Vote_Count> modelList = new List<Charmmax.Model.Vote_Count>();
97
int rowsCount = ds.Tables[0].Rows.Count;
98
if (rowsCount > 0)
99
...{
100
Charmmax.Model.Vote_Count model;
101
for (int n = 0; n < rowsCount; n++)
102
...{
103
model = new Charmmax.Model.Vote_Count();
104
if (ds.Tables[0].Rows[n]["C_ID"].ToString() != "")
105
...{
106
model.C_ID = int.Parse(ds.Tables[0].Rows[n]["C_ID"].ToString());
107
}
108
if (ds.Tables[0].Rows[n]["Q_ID"].ToString() != "")
109
...{
110
model.Q_ID = int.Parse(ds.Tables[0].Rows[n]["Q_ID"].ToString());
111
}
112
if (ds.Tables[0].Rows[n]["I_ID"].ToString() != "")
113
...{
114
model.I_ID = int.Parse(ds.Tables[0].Rows[n]["I_ID"].ToString());
115
}
116
modelList.Add(model);
117
}
118
}
119
return modelList;
120
}
121
122
/**//// <summary>
123
/// 获得数据列表
124
/// </summary>
125
public DataSet GetAllList()
126
...{
127
return GetList("");
128
}
129
130
/**//// <summary>
131
/// 获得数据列表
132
/// </summary>
133
//public DataSet GetList(int PageSize,int PageIndex,string strWhere)
134
//{
135
//return dal.GetList(PageSize,PageIndex,strWhere);
136
//}
137
138
#endregion 成员方法
139
}
140
}
141
142