修改穿透页面
This commit is contained in:
@@ -30,32 +30,17 @@ namespace FineUIPro.Web.DataShow
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"select NEWID() as ID, v.ProjectId,v.ProjectCode,v.ProjectName,v.allcount,v.ccount,isnull(v.allCount,0)-ISNULL(v.cCount,0) as ucCount,
|
||||
(case when isnull(v.allCount,0) > 0 then cast(ISNULL(v.cCount,0) *1.0 /isnull(v.allCount,0)*100 as decimal(18, 2))
|
||||
else 0 end) as rateV
|
||||
from (select B.ProjectId,p.ProjectCode,p.ProjectName,COUNT(*) as allCount,
|
||||
isnull((select COUNT(*)
|
||||
from ProcessControl_InspectionManagementDetail AS Detail
|
||||
LEFT JOIN WBS_BreakdownProject AS Breakp ON Detail.ControlPointType=Breakp.BreakdownProjectId
|
||||
LEFT JOIN ProcessControl_InspectionManagement AS Inspection ON Detail.InspectionId=Inspection.InspectionId
|
||||
where Breakp.CheckAcceptType =@type AND Inspection.IsOnceQualified = 1
|
||||
group by Breakp.ProjectId),0) as cCount
|
||||
FROM ProcessControl_InspectionManagementDetail AS A
|
||||
LEFT JOIN WBS_BreakdownProject AS B ON A.ControlPointType=B.BreakdownProjectId
|
||||
left join Base_Project as p on B.ProjectId=p.ProjectId
|
||||
where p.projectId is not null AND B.CheckAcceptType =@type ";
|
||||
|
||||
string strSql = @"select ProjectId,ProjectCode, ProjectName from Base_Project where ProjectState =1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@type", this.rbType.SelectedValue));
|
||||
string cpara = string.Empty;
|
||||
if (this.drpProject.SelectedValue != Const._Null)
|
||||
{
|
||||
strSql += " AND B.projectId = @projectId"; ///状态为已完成
|
||||
strSql += " AND projectId = @projectId"; ///状态为已完成
|
||||
listStr.Add(new SqlParameter("@projectId", this.drpProject.SelectedValue));
|
||||
}
|
||||
|
||||
@@ -63,13 +48,17 @@ namespace FineUIPro.Web.DataShow
|
||||
//{
|
||||
// strSql += " AND h.RegisterDate >=@StartTime";
|
||||
// listStr.Add(new SqlParameter("@StartTime", this.txtStartTime.Text));
|
||||
|
||||
// cpara += " AND c.RegisterDate >=" + this.txtStartTime.Text;
|
||||
//}
|
||||
//if (!string.IsNullOrEmpty(this.txtEndTime.Text))
|
||||
//{
|
||||
// strSql += " AND h.RegisterDate <=@EndTime";
|
||||
// listStr.Add(new SqlParameter("@EndTime", this.txtEndTime.Text));
|
||||
|
||||
// cpara += " AND c.RegisterDate <=" + this.txtEndTime.Text;
|
||||
//}
|
||||
strSql += " group by B.ProjectId,p.ProjectCode,p.ProjectName) as v";
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
@@ -77,7 +66,6 @@ namespace FineUIPro.Web.DataShow
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
@@ -133,5 +121,98 @@ namespace FineUIPro.Web.DataShow
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected int Count1(object projectId)
|
||||
{
|
||||
int cout1 = 0;
|
||||
if (projectId != null)
|
||||
{
|
||||
var getT = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
||||
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
|
||||
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue
|
||||
select x).Distinct().ToList();
|
||||
cout1 = getT.Count();
|
||||
}
|
||||
return cout1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected int Count2(object projectId)
|
||||
{
|
||||
int cout1 = 0;
|
||||
if (projectId != null)
|
||||
{
|
||||
var getT = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
||||
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
|
||||
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue && y.IsOnceQualified == true
|
||||
select x).Distinct().ToList();
|
||||
cout1 = getT.Count();
|
||||
}
|
||||
return cout1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected int Count3(object projectId)
|
||||
{
|
||||
int cout1 = 0;
|
||||
if (projectId != null)
|
||||
{
|
||||
var getT1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
||||
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
|
||||
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue
|
||||
select x).Distinct().ToList();
|
||||
var getT2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
||||
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
|
||||
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue && y.IsOnceQualified == true
|
||||
select x).Distinct().ToList();
|
||||
cout1 = getT1.Count() - getT2.Count();
|
||||
}
|
||||
return cout1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected string Count4(object projectId)
|
||||
{
|
||||
string rate = string.Empty;
|
||||
if (projectId != null)
|
||||
{
|
||||
var getT1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
||||
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
|
||||
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue
|
||||
select x).Distinct().ToList();
|
||||
var getT2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
|
||||
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
|
||||
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue && y.IsOnceQualified == true
|
||||
select x).Distinct().ToList();
|
||||
if (getT1.Count() > 0)
|
||||
{
|
||||
rate = Math.Round(getT2.Count() * 1.0 / getT1.Count() * 100, 2).ToString();
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user