diff --git a/HJGL/.vs/HJGL/config/applicationhost.config b/HJGL/.vs/HJGL/config/applicationhost.config index 1963de0..e47cfd0 100644 --- a/HJGL/.vs/HJGL/config/applicationhost.config +++ b/HJGL/.vs/HJGL/config/applicationhost.config @@ -162,7 +162,7 @@ - + @@ -250,7 +250,7 @@ - + diff --git a/HJGL/BLL/SQLHelper.cs b/HJGL/BLL/SQLHelper.cs index 20b3a83..bb0a1d1 100644 --- a/HJGL/BLL/SQLHelper.cs +++ b/HJGL/BLL/SQLHelper.cs @@ -971,7 +971,7 @@ namespace BLL return maxId; } - public static int getIntValue(string sql) + public static int getIntValue(string sql, SqlParameter[] param=null) { int i = 0; using (SqlConnection Connection = new SqlConnection(connectionString)) @@ -981,7 +981,10 @@ namespace BLL Connection.Open(); SqlCommand command = new SqlCommand(sql, Connection); command.CommandType = CommandType.Text; - + if (param != null) + { + AddParameterToCommand(command, param); + } i = Convert.ToInt32(command.ExecuteScalar()); } finally diff --git a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.cs index c05e947..56646b7 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.cs @@ -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; + } + } /// /// 对GV 赋值 ///