查询优化
This commit is contained in:
@@ -59,7 +59,7 @@ namespace FineUIPro.Web.DataShow
|
||||
|
||||
// cpara += " AND c.RegisterDate <=" + this.txtEndTime.Text;
|
||||
//}
|
||||
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
@@ -164,7 +164,7 @@ namespace FineUIPro.Web.DataShow
|
||||
int cout1 = 0;
|
||||
if (projectId != null)
|
||||
{
|
||||
cout1= getcount(projectId.ToString(), "B");
|
||||
cout1 = getcount(projectId.ToString(), "B");
|
||||
}
|
||||
return cout1;
|
||||
}
|
||||
@@ -178,11 +178,11 @@ namespace FineUIPro.Web.DataShow
|
||||
}
|
||||
return cout1;
|
||||
}
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.WBS_BreakdownProject> getDataLists = from x in Funs.DB.WBS_BreakdownProject
|
||||
select x;
|
||||
///// <summary>
|
||||
///// 定义变量
|
||||
///// </summary>
|
||||
//private static IQueryable<Model.WBS_BreakdownProject> getDataLists = from x in Funs.DB.WBS_BreakdownProject
|
||||
// select x;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -191,7 +191,8 @@ namespace FineUIPro.Web.DataShow
|
||||
/// <returns></returns>
|
||||
private int getcount(string projectId, string level)
|
||||
{
|
||||
int count = 0;
|
||||
var getDataLists = from x in Funs.DB.WBS_BreakdownProject select x;
|
||||
int count = 0;
|
||||
count = getDataLists.Where(x => x.ProjectId == projectId && x.Class.Contains(level)).Count();
|
||||
return count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user