From 27aa4f2ffe4718cc1bf3ced7875d17fb4ddb4b26 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Fri, 6 Mar 2026 16:19:28 +0800 Subject: [PATCH] =?UTF-8?q?20260306=20=E7=83=AD=E5=A4=84=E7=90=86=E5=A7=94?= =?UTF-8?q?=E6=89=98=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/HJGLDB_DS_2026-03-06_bwj.sql | 51 +++ ...reTestOfPipelineSystemRecordItemService.cs | 8 +- ...essureTestOfPipelineSystemRecordService.cs | 1 + .../JGZL/管道吹扫、清洗检验记录.frx | 4 +- .../Fastreport/JGZL/管道系统压力试验记录.frx | 4 +- .../File/Fastreport/热处理委托单.frx | 6 +- .../HJGL/HotProessManage/HotProessTrust.aspx | 361 +++++++++--------- .../HotProessManage/HotProessTrust.aspx.cs | 62 ++- .../HotProessTrust.aspx.designer.cs | 104 +++-- .../FineUIPro.Web/JGZL/BlowingCleaning.aspx | 2 +- .../JGZL/BlowingCleaning.aspx.cs | 299 ++++++++++----- ...estOfPipelineSystemConfirmationRecord.aspx | 1 + ...OfPipelineSystemConfirmationRecord.aspx.cs | 43 ++- ...eSystemConfirmationRecord.aspx.designer.cs | 9 + .../PressureTestOfPipelineSystemRecord.aspx | 49 ++- ...PressureTestOfPipelineSystemRecord.aspx.cs | 322 ++++++++++------ 16 files changed, 846 insertions(+), 480 deletions(-) create mode 100644 DataBase/版本日志/HJGLDB_DS_2026-03-06_bwj.sql diff --git a/DataBase/版本日志/HJGLDB_DS_2026-03-06_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2026-03-06_bwj.sql new file mode 100644 index 0000000..1498a2d --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2026-03-06_bwj.sql @@ -0,0 +1,51 @@ +ALTER PROCEDURE [dbo].[HJGL_spCH_HotProessTrustItem] +( + @HotProessTrustId nvarchar(50), + @ProessTypes nvarchar(50)=null +) +AS +--ͨidȡίеϢ +BEGIN +SELECT + HotProessTrustId,ISO_IsoNo,JOT_JointNo,JOT_JointDesc,STE_Code,Sort1,Sort2,Sort3,Sort4,Sort5, + STUFF( + ( + SELECT '+' + CASE + WHEN t.ProessTypes = '1' THEN 'Ԥ' + WHEN t.ProessTypes = '2' THEN '' + WHEN t.ProessTypes = '3' THEN '' + WHEN t.ProessTypes = '4' THEN 'Ӧȴ' + WHEN t.ProessTypes = '5' THEN 'ȶ' + ELSE '' + END + FROM HJGL_View_CH_HotProessTrustItem t + WHERE + t.HotProessTrustId = TrustItem.HotProessTrustId + AND t.ISO_IsoNo = TrustItem.ISO_IsoNo + AND t.JOT_JointNo = TrustItem.JOT_JointNo + AND t.JOT_JointDesc = TrustItem.JOT_JointDesc + AND t.STE_Code = TrustItem.STE_Code + AND t.Sort1 = TrustItem.Sort1 + AND t.Sort2 = TrustItem.Sort2 + AND t.Sort3 = TrustItem.Sort3 + AND t.Sort4 = TrustItem.Sort4 + AND t.Sort5 = TrustItem.Sort5 + ORDER BY t.ProessTypes -- ProessTypes ƴ + FOR XML PATH(''), TYPE + ).value('.', 'NVARCHAR(MAX)'), + 1, 1, '' -- ȥͷ '+' + ) AS ProessTypes +FROM HJGL_View_CH_HotProessTrustItem TrustItem +WHERE + HotProessTrustId=@HotProessTrustId + and (ProessTypes=@ProessTypes or @ProessTypes is null) +GROUP BY + HotProessTrustId,ISO_IsoNo,JOT_JointNo,JOT_JointDesc,STE_Code,Sort1,Sort2,Sort3,Sort4,Sort5 + +union + +select '99999999' as Number,'¿հ' AS ISO_IsoNo,null,null,null,null,null,null,null,null,null + + +ORDER BY ISO_IsoNo,JOT_JointNo,Sort1,Sort2,Sort3,Sort4,Sort5 +end \ No newline at end of file diff --git a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordItemService.cs b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordItemService.cs index d34383e..32ebfb6 100644 --- a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordItemService.cs +++ b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordItemService.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using Model; using System.Linq; +using System; namespace BLL @@ -34,7 +35,7 @@ namespace BLL public static List GetItemByRecordId(string recordId) { return Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem.Where(e => - e.RecordId == recordId).ToList(); + e.RecordId == recordId).OrderBy(e => e.PipelineNo).OrderBy(e => e.VoltageStabilizationTime).ToList(); } @@ -111,5 +112,10 @@ namespace BLL db.SubmitChanges(); } } + + public static List GetPressureTestOfPipelineSystemRecordByPipeLine(string recordId, string iSO_IsoNo) + { + return (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem where x.RecordId == recordId && x.PipelineNo == iSO_IsoNo select x).ToList(); + } } } \ No newline at end of file diff --git a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs index be6df3f..adc7271 100644 --- a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs +++ b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs @@ -1,4 +1,5 @@ using Model; +using System; using System.Linq; diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道吹扫、清洗检验记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道吹扫、清洗检验记录.frx index 7ea17c4..e14fb86 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道吹扫、清洗检验记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道吹扫、清洗检验记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验记录.frx index db48ad6..f30956e 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/热处理委托单.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/热处理委托单.frx index d0e8706..1cb7471 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/热处理委托单.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/热处理委托单.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + @@ -115,7 +115,7 @@ namespace FastReport - + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/HotProessManage/HotProessTrust.aspx b/HJGL_DS/FineUIPro.Web/HJGL/HotProessManage/HotProessTrust.aspx index 8cb24d2..7d65443 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/HotProessManage/HotProessTrust.aspx +++ b/HJGL_DS/FineUIPro.Web/HJGL/HotProessManage/HotProessTrust.aspx @@ -14,188 +14,195 @@
- - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - <%-- + + + + + + + + + + + + + + + + + + + + + <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + --%> + diff --git a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.cs index 50765bf..79520e9 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.cs @@ -1,15 +1,17 @@ using BLL; -using System; -using System.Collections.Generic; -using System.Data.SqlClient; -using System.Data; -using System.Linq; -using System.IO; -using Model; -using Newtonsoft.Json.Linq; -using FineUIPro.Web.HJGL.DataIn; using FastReport; using FastReport.Export.Dbf; +using FineUIPro.Web.HJGL.DataIn; +using Model; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.ServiceModel.PeerResolvers; +using System.Text.RegularExpressions; namespace FineUIPro.Web.JGZL { @@ -90,25 +92,25 @@ namespace FineUIPro.Web.JGZL this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; this.ProjectId = this.tvControlItem.SelectedNodeID; - var record = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByProjectId(this.tvControlItem.SelectedNodeID); - if (record != null) - { - this.RecordId = record.RecordId; - this.txtSystemName.Text = record.SystemName; - this.txtSystemCode.Text = record.SystemCode; - } + //var record = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByProjectId(this.tvControlItem.SelectedNodeID); + //if (record != null) + //{ + // this.RecordId = record.RecordId; + // this.txtSystemName.Text = record.SystemName; + // this.txtSystemCode.Text = record.SystemCode; + //} //管线下拉选择 - var isoLists = (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem - where x.RecordId == this.RecordId - select x.PipelineNo).Distinct().ToList(); + //var isoLists = (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem + // where x.RecordId == this.RecordId + // select x.PipelineNo).Distinct().ToList(); this.drpIsoNoS.Items.Clear(); - this.drpIsoNoS.DataTextField = "PipelineNo"; - this.drpIsoNoS.DataValueField = "PipelineNo"; - this.drpIsoNoS.DataSource = isoLists; + this.drpIsoNoS.DataTextField = "ISO_IsoNo"; + this.drpIsoNoS.DataValueField = "ISO_IsoNo"; + this.drpIsoNoS.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); this.drpIsoNoS.DataBind(); - Funs.FineUIPleaseSelect(this.drpIsoNoS); - this.drpIsoNoS.SelectedIndex = 0; + //Funs.FineUIPleaseSelect(this.drpIsoNoS); + //this.drpIsoNoS.SelectedIndex = 0; DataIsoInfo(); } @@ -116,62 +118,117 @@ namespace FineUIPro.Web.JGZL private void DataIsoInfo() { - this.txtSystemCode.Text = "01"; - this.txtSystemName.Text = "材质"; itemLists.Clear(); - if (!string.IsNullOrEmpty(this.ProjectId)) + this.txtSystemName.Text = string.Empty; + string serName = string.Empty; + this.txtSystemCode.Text = "01"; + if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue)) { - var record = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByProjectId(this.ProjectId); - if (record != null) + List serList = new List(); + foreach (var isoNo in this.drpIsoNoS.SelectedValueArray) { - this.RecordId = record.RecordId; - this.txtSystemCode.Text = record.SystemCode; - this.txtSystemName.Text = record.SystemName; - itemLists = BLL.PressureTestOfPipelineSystemRecordItemService.GetItemByRecordId(this.RecordId); - } - else - { - //var pro = BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId); - //if (pro != null) - //{ - // this.txtProjectCode.Text = pro.ProjectCode; - // this.txtProjectName.Text = pro.ProjectName; - //} - } - var isoInfos = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); - foreach (var item in isoInfos) - { - var teamWeldingInspectionItem = BLL.PressureTestOfPipelineSystemRecordItemService.GetItemByIsoNo(this.ProjectId,item.ISO_IsoNo); - if (teamWeldingInspectionItem != null) + var iso = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoNo(isoNo, ProjectId); + if (iso != null) { - //itemLists.Add(teamWeldingInspectionItem); + if (!string.IsNullOrEmpty(iso.SER_ID)) + { + serList.Add(BLL.HJGL_MediumService.GetServiceBySERID(iso.SER_ID).SER_Name); + } } - else + } + if (serList.Count > 0) + { + foreach (var item in serList.Distinct()) { - Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem = new JGZL_PressureTestOfPipelineSystemRecordItem(); - newItem.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); - newItem.PipelineNo = item.ISO_IsoNo; - newItem.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; - newItem.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; - newItem.TestMedium = "水"; - newItem.TestPressure = item.ISO_TestPress.HasValue ? item.ISO_TestPress.Value.ToString(("0.##")) + "MPa" : ""; - newItem.VoltageStabilizationTime = "10min"; - itemLists.Add(newItem); + serName += item + "、"; + } + if (!string.IsNullOrEmpty(serName)) + { + serName = serName.Substring(0, serName.LastIndexOf('、')); + } + } + this.txtSystemName.Text = serName; + if (!string.IsNullOrEmpty(this.ProjectId)) + { + var isoInfos = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + foreach (var item in isoInfos) + { + var record = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByProjectId(this.ProjectId); + if (record != null) + { + this.RecordId = record.RecordId; + if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue)) + { + if (this.drpIsoNoS.SelectedValueArray.Contains(item.ISO_IsoNo)) + { + var recordItems = BLL.PressureTestOfPipelineSystemRecordItemService.GetPressureTestOfPipelineSystemRecordByPipeLine(this.RecordId, item.ISO_IsoNo); + if (recordItems.Count > 0) + { + foreach (var recordItem in recordItems) + { + itemLists.Add(recordItem); + } + } + else + { + Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem = new JGZL_PressureTestOfPipelineSystemRecordItem(); + newItem.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); + newItem.PipelineNo = item.ISO_IsoNo; + newItem.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; + newItem.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; + newItem.TestMedium = "水"; + newItem.TestPressure = (item.ISO_DesignPress.Value * 1.5m).ToString("0.##") + "Mpa"; + newItem.VoltageStabilizationTime = "10min"; + itemLists.Add(newItem); - Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem2 = new JGZL_PressureTestOfPipelineSystemRecordItem(); - newItem2.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); - newItem2.PipelineNo = item.ISO_IsoNo; - newItem2.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; - newItem2.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; - newItem2.TestMedium = "水"; - newItem2.TestPressure = item.ISO_TestPress.HasValue ? item.ISO_TestPress.Value.ToString("0.##") + "MPa" : ""; - newItem2.VoltageStabilizationTime = "30min"; - itemLists.Add(newItem2); + Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem2 = new JGZL_PressureTestOfPipelineSystemRecordItem(); + newItem2.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); + newItem2.PipelineNo = item.ISO_IsoNo; + newItem2.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; + newItem2.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; + newItem2.TestMedium = "水"; + newItem2.TestPressure = newItem2.DesignPressure; + newItem2.VoltageStabilizationTime = "30min"; + itemLists.Add(newItem2); + } + } + } + } + else + { + //var teamWeldingInspectionItem = BLL.PressureTestOfPipelineSystemRecordItemService.GetItemByIsoNo(this.ProjectId, item.ISO_IsoNo); + //if (teamWeldingInspectionItem != null) + //{ + // //itemLists.Add(teamWeldingInspectionItem); + //} + //else + //{ + if (this.drpIsoNoS.SelectedValueArray.Contains(item.ISO_IsoNo)) + { + Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem = new JGZL_PressureTestOfPipelineSystemRecordItem(); + newItem.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); + newItem.PipelineNo = item.ISO_IsoNo; + newItem.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; + newItem.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; + newItem.TestMedium = "水"; + newItem.TestPressure = (item.ISO_DesignPress.Value * 1.5m).ToString("0.##") + "Mpa"; + newItem.VoltageStabilizationTime = "10min"; + itemLists.Add(newItem); + + Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem2 = new JGZL_PressureTestOfPipelineSystemRecordItem(); + newItem2.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); + newItem2.PipelineNo = item.ISO_IsoNo; + newItem2.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; + newItem2.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; + newItem2.TestMedium = "水"; + newItem2.TestPressure = newItem2.DesignPressure; + newItem2.VoltageStabilizationTime = "30min"; + itemLists.Add(newItem2); + //} + } + } } - } - if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue) && this.drpIsoNoS.SelectedValue != BLL.Const._Null) - { - itemLists = itemLists.Where(e => e.PipelineNo.Contains(this.drpIsoNoS.SelectedValue)).ToList(); ; + itemLists.OrderBy(e => e.PipelineNo).OrderBy(e => e.VoltageStabilizationTime); } } this.Grid1.DataSource = itemLists; @@ -349,20 +406,20 @@ namespace FineUIPro.Web.JGZL string rootPath = Server.MapPath("~/"); BLL.Common.FastReportService.ResetData(); - var report = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByProjectId(projectId); - if (report != null) - { - string strSql = @"SELECT * from JGZL_PressureTestOfPipelineSystemRecordItem m left join JGZL_PressureTestOfPipelineSystemRecord d on d.RecordId = m.RecordId where d.ProjectId=@projectId "; - List listStr = new List(); - listStr.Add(new SqlParameter("@projectId", projectId)); - if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue) && this.drpIsoNoS.SelectedValue != BLL.Const._Null) - { - strSql += " and PipelineNo like @isoNo"; - listStr.Add(new SqlParameter("@isoNo", "%" + this.drpIsoNoS.SelectedValue + "%")); - } - strSql += " order by PipelineNo,VoltageStabilizationTime asc"; - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + //var report = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByProjectId(projectId); + //if (report != null) + //{ + //string strSql = @"SELECT * from JGZL_PressureTestOfPipelineSystemRecordItem m left join JGZL_PressureTestOfPipelineSystemRecord d on d.RecordId = m.RecordId where d.ProjectId=@projectId "; + //List listStr = new List(); + //listStr.Add(new SqlParameter("@projectId", projectId)); + //if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue) && this.drpIsoNoS.SelectedValue != BLL.Const._Null) + //{ + // strSql += " and PipelineNo like @isoNo"; + // listStr.Add(new SqlParameter("@isoNo", "%" + this.drpIsoNoS.SelectedValue + "%")); + //} + //strSql += " order by PipelineNo,VoltageStabilizationTime asc"; + //SqlParameter[] parameter = listStr.ToArray(); + //DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); DataTable dt = new DataTable(); dt.TableName = "Data"; @@ -375,29 +432,42 @@ namespace FineUIPro.Web.JGZL dt.Columns.Add("TestPressure"); dt.Columns.Add("VoltageStabilizationTime"); - DataRow[] rows = tb.DefaultView.ToTable().Select(); - foreach (var row in rows) - { - var newRow = dt.NewRow(); - newRow["PipelineNo"] = row["PipelineNo"].ToString(); - newRow["DesignPressure"] = row["DesignPressure"].ToString(); - newRow["DesignTemperature"] = row["DesignTemperature"].ToString(); - newRow["TestTemperature"] = row["TestTemperature"].ToString(); - newRow["TestMedium"] = row["TestMedium"].ToString(); - newRow["TestMediumTemperature"] = row["TestMediumTemperature"].ToString(); - newRow["TestPressure"] = row["TestPressure"].ToString(); - newRow["VoltageStabilizationTime"] = row["VoltageStabilizationTime"].ToString(); - dt.Rows.Add(newRow); - } + //DataRow[] rows = tb.DefaultView.ToTable().Select(); + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var newRow = dt.NewRow(); + newRow["PipelineNo"] = this.Grid1.Rows[i].Values[1].ToString(); + newRow["DesignPressure"] = this.Grid1.Rows[i].Values[2].ToString(); + newRow["DesignTemperature"] = this.Grid1.Rows[i].Values[3].ToString(); + newRow["TestTemperature"] = this.Grid1.Rows[i].Values[4].ToString(); + newRow["TestMedium"] = this.Grid1.Rows[i].Values[5].ToString(); + newRow["TestMediumTemperature"] = this.Grid1.Rows[i].Values[6].ToString(); + newRow["TestPressure"] = this.Grid1.Rows[i].Values[7].ToString(); + newRow["VoltageStabilizationTime"] = this.Grid1.Rows[i].Values[8].ToString(); + dt.Rows.Add(newRow); + } + //foreach (var row in rows) + //{ + //var newRow = dt.NewRow(); + //newRow["PipelineNo"] = row["PipelineNo"].ToString(); + //newRow["DesignPressure"] = row["DesignPressure"].ToString(); + //newRow["DesignTemperature"] = row["DesignTemperature"].ToString(); + //newRow["TestTemperature"] = row["TestTemperature"].ToString(); + //newRow["TestMedium"] = row["TestMedium"].ToString(); + //newRow["TestMediumTemperature"] = row["TestMediumTemperature"].ToString(); + //newRow["TestPressure"] = row["TestPressure"].ToString(); + //newRow["VoltageStabilizationTime"] = row["VoltageStabilizationTime"].ToString(); + //dt.Rows.Add(newRow); + //} BLL.Common.FastReportService.AddFastreportTable(dt); Dictionary keyValuePairs = new Dictionary(); keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); - keyValuePairs.Add("SystemName", report.SystemName); - keyValuePairs.Add("SystemCode", report.SystemCode); - keyValuePairs.Add("TestConclusion", report.TestConclusion); - keyValuePairs.Add("Remark", report.Remark); + keyValuePairs.Add("SystemName", this.txtSystemName.Text.Trim()); + keyValuePairs.Add("SystemCode", this.txtSystemCode.Text.Trim()); + //keyValuePairs.Add("TestConclusion", report.TestConclusion); + //keyValuePairs.Add("Remark", report.Remark); BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); initTemplatePath = "File\\Fastreport\\JGZL\\管道系统压力试验记录.frx"; @@ -405,12 +475,12 @@ namespace FineUIPro.Web.JGZL { PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); } - } - else - { - Alert.ShowInTop("请先保存数据!", MessageBoxIcon.Warning); - return; - } + //} + //else + //{ + // Alert.ShowInTop("请先保存数据!", MessageBoxIcon.Warning); + // return; + //} } else { @@ -653,16 +723,16 @@ namespace FineUIPro.Web.JGZL saveItem(); //管线下拉选择 - var isoLists = (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem - where x.RecordId == this.RecordId - select x.PipelineNo).Distinct().ToList(); - this.drpIsoNoS.Items.Clear(); - this.drpIsoNoS.DataTextField = "PipelineNo"; - this.drpIsoNoS.DataValueField = "PipelineNo"; - this.drpIsoNoS.DataSource = isoLists; - this.drpIsoNoS.DataBind(); - Funs.FineUIPleaseSelect(this.drpIsoNoS); - this.drpIsoNoS.SelectedIndex = 0; + //var isoLists = (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem + // where x.RecordId == this.RecordId + // select x.PipelineNo).Distinct().ToList(); + //this.drpIsoNoS.Items.Clear(); + //this.drpIsoNoS.DataTextField = "PipelineNo"; + //this.drpIsoNoS.DataValueField = "PipelineNo"; + //this.drpIsoNoS.DataSource = isoLists; + //this.drpIsoNoS.DataBind(); + //Funs.FineUIPleaseSelect(this.drpIsoNoS); + //this.drpIsoNoS.SelectedIndex = 0; ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); @@ -676,13 +746,22 @@ namespace FineUIPro.Web.JGZL void saveItem() { - BLL.PressureTestOfPipelineSystemRecordItemService.DeleteItemByRecordId(this.RecordId); + //BLL.PressureTestOfPipelineSystemRecordItemService.DeleteItemByRecordId(this.RecordId); itemLists.Clear(); JArray teamGroupData = Grid1.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) { JObject values = teamGroupRow.Value("values"); int rowIndex = teamGroupRow.Value("index"); + + //删除原有信息 + var item = BLL.PressureTestOfPipelineSystemRecordItemService.GetPressureTestOfPipelineSystemRecordByPipeLine(this.RecordId, values.Value("PipelineNo")); + if (item.Count > 0) + { + Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem.DeleteAllOnSubmit(item); + Funs.DB.SubmitChanges(); + } + Model.JGZL_PressureTestOfPipelineSystemRecordItem newDetail = new Model.JGZL_PressureTestOfPipelineSystemRecordItem { Id = values.Value("Id"), @@ -717,5 +796,6 @@ namespace FineUIPro.Web.JGZL { DataIsoInfo(); } + } } \ No newline at end of file