2023-11-11

This commit is contained in:
2023-11-11 16:02:42 +08:00
parent b2ffd4b8d0
commit 48dd589a7f
66 changed files with 2334 additions and 1232 deletions
@@ -1,5 +1,5 @@
using BLL;
using FineUIPro.Web.BaseInfo;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -25,6 +25,9 @@ namespace FineUIPro.Web.DataShow
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
// 绑定表格t
BindGrid();
// 合计
OutputSummaryData();
this.Panel1.Title = "质量控制点数据(" + BLL.UnitService.GetUnitNameByUnitId(BLL.CommonService.GetThisUnitId()) + "";
}
}
@@ -196,5 +199,35 @@ namespace FineUIPro.Web.DataShow
return count;
}
#region
private void OutputSummaryData() {
string strSql = @"select ProjectId,ProjectCode, ProjectName,
isnull((select count(*) from WBS_BreakdownProject as a where a.ProjectId=P.ProjectId and a.Class LIKE'%S%'),0) as Count1,
isnull((select count(*) from WBS_BreakdownProject as a where a.ProjectId=P.ProjectId and a.Class LIKE'%A%'),0) as Count2,
isnull((select count(*) from WBS_BreakdownProject as a where a.ProjectId=P.ProjectId and a.Class LIKE'%B%'),0) as Count3,
isnull((select count(*) from WBS_BreakdownProject as a where a.ProjectId=P.ProjectId and a.Class LIKE'%C%'),0) as Count4
from Base_Project as P
where ProjectState =1 and (ProjectState2 is null or ProjectState2 !=9) ";
List<SqlParameter> listStr = new List<SqlParameter>();
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
int Count1 = 0, Count2 = 0, Count3 = 0, Count4 = 0;
foreach (DataRow row in tb.Rows)
{
Count1 += Convert.ToInt32(row["Count1"]);
Count2 += Convert.ToInt32(row["Count2"]);
Count3 += Convert.ToInt32(row["Count3"]);
Count4 += Convert.ToInt32(row["Count4"]);
}
JObject summary = new JObject();
summary.Add("ProjectName", "合计:");
summary.Add("Count1", Count1.ToString());
summary.Add("Count2", Count2.ToString());
summary.Add("Count3", Count3.ToString());
summary.Add("Count4", Count4.ToString());
Grid1.SummaryData = summary;
}
#endregion
}
}