2023-11-11
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -25,6 +26,10 @@ namespace FineUIPro.Web.DataShow
|
||||
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
|
||||
// 绑定表格t
|
||||
BindGrid();
|
||||
|
||||
// 合计
|
||||
OutputSummaryData();
|
||||
|
||||
this.Panel1.Title = "计量器具数据(" + BLL.UnitService.GetUnitNameByUnitId(BLL.CommonService.GetThisUnitId()) + ")";
|
||||
}
|
||||
}
|
||||
@@ -170,7 +175,8 @@ namespace FineUIPro.Web.DataShow
|
||||
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var getD1 = from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectId.ToString() && x.IsOnSite == true && x.InspectionType.Contains("计量")
|
||||
where x.ProjectId == projectId.ToString() && x.IsOnSite == true && x.InspectionType.Contains("计量")
|
||||
// && x.CompileDate == Funs.minSysDate
|
||||
select x;
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
@@ -200,6 +206,7 @@ namespace FineUIPro.Web.DataShow
|
||||
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var getD1 = from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectId.ToString() && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
|
||||
// && x.CompileDate == Funs.minSysDate
|
||||
select x;
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
@@ -214,5 +221,28 @@ namespace FineUIPro.Web.DataShow
|
||||
}
|
||||
return cout1;
|
||||
}
|
||||
|
||||
#region 合计
|
||||
private void OutputSummaryData() {
|
||||
string strSql = @"select ProjectId,ProjectCode, ProjectName ,
|
||||
isnull((select count(*) from Comprehensive_InspectionMachine as a where a.ProjectId=P.ProjectId and a.IsOnSite=1 and a.InspectionType like '%计量%' ),0) as Count1,
|
||||
isnull((select count(*) from Comprehensive_InspectionMachine as a where a.ProjectId=P.ProjectId and a.IsOnSite=1 and a.InspectionType like '%计量%' and a.IsCheckOK=1 ),0) as Count2
|
||||
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;
|
||||
foreach (DataRow row in tb.Rows)
|
||||
{
|
||||
Count1 += Convert.ToInt32(row["Count1"]);
|
||||
Count2 += Convert.ToInt32(row["Count2"]);
|
||||
}
|
||||
JObject summary = new JObject();
|
||||
summary.Add("ProjectName", "合计:");
|
||||
summary.Add("Count1", Count1.ToString());
|
||||
summary.Add("Count2", Count2.ToString());
|
||||
Grid1.SummaryData = summary;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user