diff --git a/HJGL_DS/BLL/JGZL/IndustrialPipelineInstallationSummaryService.cs b/HJGL_DS/BLL/JGZL/IndustrialPipelineInstallationSummaryService.cs index a5427e8..8d28e39 100644 --- a/HJGL_DS/BLL/JGZL/IndustrialPipelineInstallationSummaryService.cs +++ b/HJGL_DS/BLL/JGZL/IndustrialPipelineInstallationSummaryService.cs @@ -19,6 +19,11 @@ namespace BLL return Funs.DB.JGZL_IndustrialPipelineInstallationSummary.FirstOrDefault(e => e.SummaryId == Id); } + public static Model.JGZL_IndustrialPipelineInstallationSummary GetIndustrialPipelineInstallationSummaryByPipelineCode(string pipelineCode) + { + return Funs.DB.JGZL_IndustrialPipelineInstallationSummary.FirstOrDefault(e => e.PipelineCode == pipelineCode); + } + public static List GetIndustrialPipelineInstallationSummaryByProjectId(string projectId) { return (from x in Funs.DB.JGZL_IndustrialPipelineInstallationSummary where x.ProjectId == projectId select x).ToList(); diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/压力管道安装汇总表.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/压力管道安装汇总表.frx index 2657bcf..6a58f61 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/JGZL/IndustrialPipelineInstallationSummary.aspx b/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx index c2de478..9dd86cc 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx +++ b/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx @@ -10,8 +10,6 @@
- <%-- 隐藏域存储Grid的ClientID,避免JS代码块冲突 --%> - + @@ -61,6 +60,7 @@ + @@ -74,7 +74,7 @@ + FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px"> @@ -224,7 +224,7 @@ + diff --git a/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx.cs index df3170a..18c6634 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx.cs @@ -12,6 +12,7 @@ using Newtonsoft.Json.Linq; using System.Web.Services; using Org.BouncyCastle.Asn1.IsisMtt; using Model; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace FineUIPro.Web.JGZL { @@ -98,64 +99,58 @@ namespace FineUIPro.Web.JGZL this.txtDeliveryUnitCode.Text = certificate.DeliveryUnitCode; } } - - var summary = BLL.IndustrialPipelineInstallationSummaryService.GetIndustrialPipelineInstallationSummaryByProjectId(this.tvControlItem.SelectedNodeID); - if (summary.Count > 0) - { - this.BindGrid(); - } - else - { - JArray teamGroupData = Grid1.GetMergedData(); - List list = new List(); - foreach (JObject teamGroupRow in teamGroupData) - { - JObject values = teamGroupRow.Value("values"); - list.Add(values); - } - - JObject defaultObj = new JObject - { - { "SummaryId", Guid.NewGuid() }, - { "CertificateId", CertificateId }, - { "PipelineCode", "" }, - { "PipelineLevel", "" }, - { "PipelineStartPoint", "" }, - { "PipelineEndPoint", "" }, - { "DesignPressure", "" }, - { "DesignTemperature", "" }, - { "Medium", "" }, - { "Material", "" }, - { "Specifications", "" }, - { "Length", "" }, - { "LayingMethod", "" }, - { "WeldsNum", "" }, - { "LosslessRatio", "" }, - { "VoltageResistantTestMedium", "" }, - { "VoltageResistantTestPressure", "" }, - { "LeakageTestMedium", "" }, - { "LeakageTestPressure", "" }, - { "CleaningMethod", "" }, - { "CorrosionControlMethod", "" }, - { "InsulationMethod", "" }, - { "OperatingTemperature", "" }, - { "VoltageResistantTestDate", "" }, - { "LeakageTestDate", "" }, - { "Remark", "" }, - { - "Delete3", - String.Format("", - GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) - } - }; - list.Add(defaultObj); - Grid1.DataSource = list; - Grid1.DataBind(); - } + DataIsoInfo(); + BindGrid(); } } #endregion + private void DataIsoInfo() + { + var isoInfo = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.tvControlItem.SelectedNodeID); + foreach (var item in isoInfo) + { + var summary = BLL.IndustrialPipelineInstallationSummaryService.GetIndustrialPipelineInstallationSummaryByPipelineCode(item.ISO_IsoNo); + if (summary == null) + { + Model.JGZL_IndustrialPipelineInstallationSummary newSummary = new JGZL_IndustrialPipelineInstallationSummary(); + newSummary.SummaryId = SQLHelper.GetNewID(typeof(Model.JGZL_IndustrialPipelineInstallationSummary)); + newSummary.ProjectId = this.tvControlItem.SelectedNodeID; + newSummary.CertificateId = this.drpCertificateCode.SelectedValue; + newSummary.PipelineCode = item.ISO_IsoNo; + if (!string.IsNullOrEmpty(item.ISC_ID)) + { + newSummary.PipelineLevel = BLL.HJGL_PipingClassService.GetPipingClassByPipingClassId(item.ISC_ID).ISC_IsoName; + } + newSummary.DesignPressure = item.ISO_DesignPress.ToString(); + newSummary.DesignTemperature = item.ISO_DesignTemperature.ToString(); + if (!string.IsNullOrEmpty(item.SER_ID)) + { + newSummary.Medium = BLL.HJGL_MediumService.GetServiceBySERID(item.SER_ID).SER_Name; + } + if (!string.IsNullOrEmpty(item.STE_ID)) + { + newSummary.Material = BLL.HJGL_MaterialService.GetSteelBySteID(item.STE_ID).STE_Code; + } + var jointInfo = (from x in Funs.DB.HJGL_PW_JointInfo where x.ISO_ID == item.ISO_ID select x).FirstOrDefault(); + if (jointInfo != null) + { + newSummary.Specifications = jointInfo.JOT_JointDesc; + } + newSummary.Length = item.PipeLineLength.ToString(); + newSummary.WeldsNum = BLL.HJGL_PW_JointInfoService.GetJointCountByIsoId(item.ISO_ID).ToString(); + if (!string.IsNullOrEmpty(item.Joty_B_Rate)) + { + newSummary.LosslessRatio = HJGL_DetectionService.GetNDTRateByNDTRID(item.Joty_B_Rate).NDTR_Name;//无损检测比例 + } + newSummary.VoltageResistantTestMethod = "水压";//耐压试验方法 + newSummary.VoltageResistantTestMedium = "水";//耐压试验介质 + newSummary.CleaningMethod = "压缩空气吹扫";//吹扫、清洗方法 + BLL.IndustrialPipelineInstallationSummaryService.AddIndustrialPipelineInstallationSummary(newSummary); + } + } + } + #region 加载树项目 /// /// 加载树 @@ -199,6 +194,7 @@ namespace FineUIPro.Web.JGZL { if (this.tvControlItem.SelectedNodeID != "0") { + DataIsoInfo(); this.BindGrid(); } } @@ -218,7 +214,12 @@ namespace FineUIPro.Web.JGZL { strSql += " AND ProjectId = @ProjectId"; listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); - } + } + if (!string.IsNullOrEmpty(this.txtIsoNoS.Text)) + { + strSql += " AND PipelineCode like @PipelineCode"; + listStr.Add(new SqlParameter("@PipelineCode", "%" + this.txtIsoNoS.Text + "%")); + } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); // 2.获取当前分页数据 @@ -278,6 +279,7 @@ namespace FineUIPro.Web.JGZL { this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; this.InitTreeMenu(); + DataIsoInfo(); BindGrid(); } @@ -311,95 +313,107 @@ namespace FineUIPro.Web.JGZL string strSql = @"SELECT * from JGZL_IndustrialPipelineInstallationSummary where ProjectId = @ProjectId "; List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", projectId)); + if (!string.IsNullOrEmpty(this.txtIsoNoS.Text)) + { + strSql += " And PipelineCode like @pipeLineCode"; + listStr.Add(new SqlParameter("@pipeLineCode", "%" + this.txtIsoNoS.Text + "%")); + } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - - DataTable dt = new DataTable(); - dt.TableName = "Data"; - dt.Columns.Add("Num"); - dt.Columns.Add("PipelineCode"); - dt.Columns.Add("PipelineLevel"); - dt.Columns.Add("DesignPressure"); - dt.Columns.Add("DesignTemperature"); - dt.Columns.Add("OperatingTemperature"); - dt.Columns.Add("Medium"); - dt.Columns.Add("Material"); - dt.Columns.Add("Specifications"); - dt.Columns.Add("Length"); - dt.Columns.Add("LayingMethod"); - dt.Columns.Add("WeldsNum"); - dt.Columns.Add("LosslessRatio"); - dt.Columns.Add("VoltageResistantTestMedium"); - dt.Columns.Add("VoltageResistantTestPressure"); - dt.Columns.Add("VoltageResistantTestDate"); - dt.Columns.Add("LeakageTestMedium"); - dt.Columns.Add("LeakageTestPressure"); - dt.Columns.Add("LeakageTestDate"); - dt.Columns.Add("CleaningMethod"); - dt.Columns.Add("CorrosionControlMethod"); - dt.Columns.Add("InsulationMethod"); - dt.Columns.Add("PipelineStartPoint"); - dt.Columns.Add("PipelineEndPoint"); - dt.Columns.Add("Remark"); - - DataRow[] rows = tb.DefaultView.ToTable().Select(); - int i = 0; - foreach (var row in rows) + if (tb.Rows.Count > 0) { - var newRow = dt.NewRow(); - newRow["Num"] = (i + 1).ToString(); - newRow["PipelineCode"] = row["PipelineCode"].ToString(); - newRow["PipelineLevel"] = row["PipelineLevel"].ToString(); - newRow["DesignPressure"] = row["DesignPressure"].ToString(); - newRow["DesignTemperature"] = row["DesignTemperature"].ToString(); - newRow["OperatingTemperature"] = row["OperatingTemperature"].ToString(); - newRow["Medium"] = row["Medium"].ToString(); - newRow["Material"] = row["Material"].ToString(); - newRow["Specifications"] = row["Specifications"].ToString(); - newRow["Length"] = row["Length"].ToString(); - newRow["LayingMethod"] = row["LayingMethod"].ToString(); - newRow["WeldsNum"] = row["WeldsNum"].ToString(); - newRow["LosslessRatio"] = row["LosslessRatio"].ToString(); - newRow["VoltageResistantTestMedium"] = row["VoltageResistantTestMedium"].ToString(); - newRow["VoltageResistantTestPressure"] = row["VoltageResistantTestPressure"].ToString(); - string VoltageResistantTestDate = string.Format("{0:yyyy.MM.dd}", row["VoltageResistantTestDate"]); - newRow["VoltageResistantTestDate"] = VoltageResistantTestDate; - newRow["LeakageTestMedium"] = row["LeakageTestMedium"].ToString(); - newRow["LeakageTestPressure"] = row["LeakageTestPressure"].ToString(); - string LeakageTestDate = string.Format("{0:yyyy.MM.dd}", row["LeakageTestDate"]); - newRow["LeakageTestDate"] = LeakageTestDate; - newRow["CleaningMethod"] = row["CleaningMethod"].ToString(); - newRow["CorrosionControlMethod"] = row["CorrosionControlMethod"].ToString(); - newRow["InsulationMethod"] = row["InsulationMethod"].ToString(); - newRow["PipelineStartPoint"] = row["PipelineStartPoint"].ToString(); - newRow["PipelineEndPoint"] = row["PipelineEndPoint"].ToString(); - newRow["Remark"] = row["Remark"].ToString(); - dt.Rows.Add(newRow); - i++; + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("Num"); + dt.Columns.Add("PipelineCode"); + dt.Columns.Add("PipelineLevel"); + dt.Columns.Add("DesignPressure"); + dt.Columns.Add("DesignTemperature"); + dt.Columns.Add("OperatingTemperature"); + dt.Columns.Add("Medium"); + dt.Columns.Add("Material"); + dt.Columns.Add("Specifications"); + dt.Columns.Add("Length"); + dt.Columns.Add("LayingMethod"); + dt.Columns.Add("WeldsNum"); + dt.Columns.Add("LosslessRatio"); + dt.Columns.Add("VoltageResistantTestMedium"); + dt.Columns.Add("VoltageResistantTestPressure"); + dt.Columns.Add("VoltageResistantTestDate"); + dt.Columns.Add("LeakageTestMedium"); + dt.Columns.Add("LeakageTestPressure"); + dt.Columns.Add("LeakageTestDate"); + dt.Columns.Add("CleaningMethod"); + dt.Columns.Add("CorrosionControlMethod"); + dt.Columns.Add("InsulationMethod"); + dt.Columns.Add("PipelineStartPoint"); + dt.Columns.Add("PipelineEndPoint"); + dt.Columns.Add("Remark"); + + DataRow[] rows = tb.DefaultView.ToTable().Select(); + int i = 0; + foreach (var row in rows) + { + var newRow = dt.NewRow(); + newRow["Num"] = (i + 1).ToString(); + newRow["PipelineCode"] = row["PipelineCode"].ToString(); + newRow["PipelineLevel"] = row["PipelineLevel"].ToString(); + newRow["DesignPressure"] = row["DesignPressure"].ToString(); + newRow["DesignTemperature"] = row["DesignTemperature"].ToString(); + newRow["OperatingTemperature"] = row["OperatingTemperature"].ToString(); + newRow["Medium"] = row["Medium"].ToString(); + newRow["Material"] = row["Material"].ToString(); + newRow["Specifications"] = row["Specifications"].ToString(); + newRow["Length"] = row["Length"].ToString(); + newRow["LayingMethod"] = row["LayingMethod"].ToString(); + newRow["WeldsNum"] = row["WeldsNum"].ToString(); + newRow["LosslessRatio"] = row["LosslessRatio"].ToString(); + newRow["VoltageResistantTestMedium"] = row["VoltageResistantTestMedium"].ToString(); + newRow["VoltageResistantTestPressure"] = row["VoltageResistantTestPressure"].ToString(); + string VoltageResistantTestDate = string.Format("{0:yyyy.MM.dd}", row["VoltageResistantTestDate"]); + newRow["VoltageResistantTestDate"] = VoltageResistantTestDate; + newRow["LeakageTestMedium"] = row["LeakageTestMedium"].ToString(); + newRow["LeakageTestPressure"] = row["LeakageTestPressure"].ToString(); + string LeakageTestDate = string.Format("{0:yyyy.MM.dd}", row["LeakageTestDate"]); + newRow["LeakageTestDate"] = LeakageTestDate; + newRow["CleaningMethod"] = row["CleaningMethod"].ToString(); + newRow["CorrosionControlMethod"] = row["CorrosionControlMethod"].ToString(); + newRow["InsulationMethod"] = row["InsulationMethod"].ToString(); + newRow["PipelineStartPoint"] = row["PipelineStartPoint"].ToString(); + newRow["PipelineEndPoint"] = row["PipelineEndPoint"].ToString(); + newRow["Remark"] = row["Remark"].ToString(); + dt.Rows.Add(newRow); + i++; + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + string certificateCode = string.Empty; + string deliveryUnit = string.Empty; + string deliveryUnitCode = string.Empty; + string certificateId = rows[0]["CertificateId"].ToString(); + var certificate = BLL.IndustrialPipelineInstallationQualityCertificateService.GetIndustrialPipelineInstallationQualityCertificateById(certificateId); + if (certificate != null) + { + certificateCode = certificate.CertificateCode; + deliveryUnit = certificate.DeliveryUnit; + deliveryUnitCode = certificate.DeliveryUnitCode; + } + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("CertificateCode", certificateCode); + keyValuePairs.Add("DeliveryUnit", deliveryUnit); + keyValuePairs.Add("DeliveryUnitCode", deliveryUnitCode); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\压力管道安装汇总表.frx"; + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + } } - BLL.Common.FastReportService.AddFastreportTable(dt); - - string certificateCode = string.Empty; - string deliveryUnit = string.Empty; - string deliveryUnitCode = string.Empty; - string certificateId = rows[0]["CertificateId"].ToString(); - var certificate = BLL.IndustrialPipelineInstallationQualityCertificateService.GetIndustrialPipelineInstallationQualityCertificateById(certificateId); - if (certificate != null) + else { - certificateCode = certificate.CertificateCode; - deliveryUnit = certificate.DeliveryUnit; - deliveryUnitCode = certificate.DeliveryUnitCode; - } - Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("CertificateCode", certificateCode); - keyValuePairs.Add("DeliveryUnit", deliveryUnit); - keyValuePairs.Add("DeliveryUnitCode", deliveryUnitCode); - BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - - initTemplatePath = "File\\Fastreport\\JGZL\\压力管道安装汇总表.frx"; - if (File.Exists(rootPath + initTemplatePath)) - { - PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + Alert.ShowInTop("没有要打印的数据!", MessageBoxIcon.Warning); + return; } } else diff --git a/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx.designer.cs index 74d8a50..935679d 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/IndustrialPipelineInstallationSummary.aspx.designer.cs @@ -32,15 +32,6 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.PageManager PageManager1; - /// - /// hidGridClientID 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.WebControls.HiddenField hidGridClientID; - /// /// Panel1 控件。 /// @@ -104,6 +95,15 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Toolbar Toolbar2; + /// + /// txtIsoNoS 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtIsoNoS; + /// /// ToolbarFill1 控件。 /// @@ -185,6 +185,15 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.TextBox txtDeliveryUnitCode; + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + /// /// txtIsoNo 控件。 ///