个人开发框架总结(二)
2009-05-05 08:27:18 来源:WEB开发网BuildLists 构造右边信息数据
/// <summary>
/// 构造信息集合
/// </summary>
/// <param name="queryArgs"></param>
/// <param name="isFull"></param>
/// <returns></returns>
protected override IList BuildLists(bool isFull)
{
TCompanies list = null;
try
{
ATCompany objDAL = (ATCompany)DAFactory.CreateDA(typeof(ATCompany));
if (!isFull) objDAL.PageArgs = base.PageArgs;
//得到所有字段
string[] fields = GetInfoFields();
QueryBuilder qb = new QueryBuilder();
qb.Append(QueryRelation.And, QueryCompare.Equal, TCompany._BaseType, baseType.ToString("D"));
qb.Append(QueryRelation.And, QueryCompare.Equal, TCompany._IsDelete, 0);
qb.Append(QueryRelation.And, QueryCompare.Equal, TCompany._ParentId, ContextArgs.Instance.CompanyId);
if (QueryArgs.TypeId != 0)
{
qb.Append(QueryRelation.And, QueryCompare.Equal, TCompany._CompanyTypeId, QueryArgs.TypeId);
}
//加上查询的条件
qb += QueryArgs.QueryBuilder;
list = objDAL.Select(qb, QueryArgs.Order, fields);
if (!isFull) base.PageArgs = objDAL.PageArgs;
objDAL.Dispose();
objDAL = null;
}
catch (System.Exception e)
{
Utility.ShowErrorMessage(e.Message);
}
return list;
}
更多精彩
赞助商链接