This commit is contained in:
jackchenyang
2024-05-23 20:10:26 +08:00
parent 9db2db1ad1
commit 1dcadf1a61
4 changed files with 47 additions and 5 deletions
@@ -318,6 +318,20 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
//}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
if (string.IsNullOrEmpty(this.PTP_ID))
{
foreach (DataRow dr in tb.Rows)
{
string pipelineId = dr["PipelineId"].ToString();
string joinCodeList = dr["WeldJointCode"].ToString();
int count = countWeldJointCode(pipelineId);
int baseCount = countBaseWeldJointCode(pipelineId);
if (count == baseCount)
{
dr.Delete();
}
}
}
// 2.获取当前分页数据
//var table = this.GetPagedDataTable(Grid1, tb1);
Grid1.RecordCount = tb.Rows.Count;
@@ -327,7 +341,32 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
Grid1.DataBind();
}
private int countBaseWeldJointCode(string pipelineId)
{
string sql = "select count(1) from Pipeline_WeldJoint where PipelineId=@PipelineId";
SqlParameter[] parameters = new SqlParameter[] {
new SqlParameter("@PipelineId",pipelineId)
};
int count = SQLHelper.getIntValue(sql, parameters);
return count;
}
private int countWeldJointCode(string pipelineId)
{
string sql = @"select WeldJointCode=(stuff((select ','+ WeldJonintCode from PTP_PipelineList where PipelineId=@PipelineId and isALL=0 for xml path('')),1,1,''))";
SqlParameter[] parameters = new SqlParameter[] {
new SqlParameter("@PipelineId",pipelineId)
};
string strCode = SQLHelper.GetStr(sql, parameters);
if(!string.IsNullOrEmpty(strCode) )
{
string[] arr=strCode.Split(',');
return arr==null?0:arr.Length;
}
else
{
return 0;
}
}
/// <summary>
/// 对GV 赋值
/// </summary>