diff --git a/DataBase/版本日志/SGGLDB_V2025-09-01-001-lpf.sql b/DataBase/版本日志/SGGLDB_V2025-09-01-001-lpf.sql new file mode 100644 index 00000000..39e7f371 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-09-01-001-lpf.sql @@ -0,0 +1,31 @@ + +create table dbo.PTP_TestPackagePrint +( + Id varchar(50) not null + constraint PTP_TestPackagePrint_pk + primary key, + PTP_ID varchar(50), + TypeInt int, + PrintCount int +) +go + +exec sp_addextendedproperty 'MS_Description', N'ѹӡ', 'SCHEMA', 'dbo', 'TABLE', 'PTP_TestPackagePrint' +go + +exec sp_addextendedproperty 'MS_Description', N'id', 'SCHEMA', 'dbo', 'TABLE', 'PTP_TestPackagePrint', 'COLUMN', + 'Id' +go + +exec sp_addextendedproperty 'MS_Description', N'ѹid', 'SCHEMA', 'dbo', 'TABLE', 'PTP_TestPackagePrint', 'COLUMN', + 'PTP_ID' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'PTP_TestPackagePrint', 'COLUMN', + 'TypeInt' +go + +exec sp_addextendedproperty 'MS_Description', N'ӡ', 'SCHEMA', 'dbo', 'TABLE', 'PTP_TestPackagePrint', 'COLUMN', + 'PrintCount' +go + diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 0c153ad3..5a63de0e 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -438,6 +438,7 @@ + diff --git a/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs b/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs new file mode 100644 index 00000000..3a2e63db --- /dev/null +++ b/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs @@ -0,0 +1,1315 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public static class TestPackagePrintService + { + /// + /// 类别Map + /// + public static Dictionary TypeIntMap = new Dictionary() + { + //{ 0, "File\\Fastreport\\JGZL\\管道试压包文件资料.frx" }, + //{ 1, "File\\Fastreport\\JGZL\\管道压力试验技术要求.frx" }, + //{ 2, "File\\Fastreport\\JGZL\\管道压力包文件资料目录.frx" }, + //{ 3, "File\\Fastreport\\JGZL\\管道系统压力试验条件确认记录.frx" }, + //{ 4, "File\\Fastreport\\JGZL\\管道试压包尾项清单.frx" }, + //{ 5, "File\\Fastreport\\JGZL\\管道系统压力试验记录.frx" }, + //{ 6, "File\\Fastreport\\JGZL\\管道材料材质标识检查记录.frx" }, + //{ 7, "File\\Fastreport\\JGZL\\管道焊接工作记录.frx" }, + //{ 8, "File\\Fastreport\\JGZL\\管道无损检测数量统计表.frx" }, + //{ 9, "File\\Fastreport\\JGZL\\无损检测结果汇总表.frx" } + { 0, "管道试压包文件资料" }, + { 1, "管道压力试验技术要求" }, + { 2, "管道压力包文件资料目录" }, + { 3, "管道系统压力试验条件确认记录" }, + { 4, "管道试压包尾项清单" }, + { 5, "管道系统压力试验记录" }, + { 6, "管道材料材质标识检查记录" }, + { 7, "管道焊接工作记录" }, + { 8, "管道无损检测数量统计表" }, + { 9, "无损检测结果汇总表" } + }; + + public static List GetListByPTP_ID(string PTP_ID) + { + return Funs.DB.PTP_TestPackagePrint.Where(x => x.PTP_ID == PTP_ID).OrderBy(x => x.TypeInt).ToList(); + } + + /// + /// 根据试压包ID和类别,打印次数+1 + /// + /// + /// + public static void AddPrintCountByTypeInt(string PTP_ID, int typeInt) + { + Model.PTP_TestPackagePrint table = Funs.DB.PTP_TestPackagePrint.FirstOrDefault(x => x.PTP_ID == PTP_ID && x.TypeInt == typeInt); + + if (table != null) + { + table.PrintCount = table.PrintCount + 1; + } + else + { + table = new Model.PTP_TestPackagePrint + { + Id = Guid.NewGuid().ToString(), + PTP_ID = PTP_ID, + TypeInt = typeInt, + PrintCount = 1 + }; + Funs.DB.PTP_TestPackagePrint.InsertOnSubmit(table); + } + + Funs.DB.SubmitChanges(); + } + /// + /// 根据试压包ID,打印所有类别,打印次数+1 + /// + /// + public static void AddPrintCountByPTP_ID(string PTP_ID) + { + var list = Funs.DB.PTP_TestPackagePrint.Where(x => x.PTP_ID == PTP_ID).ToList(); + + //检查是否所有类型都存在,如果不存在则添加,PrintCount 初始化为 0 + foreach (var typeInt in TypeIntMap.Keys) + { + if (!list.Any(x => x.TypeInt == typeInt)) + { + var newEntry = new Model.PTP_TestPackagePrint + { + Id= Guid.NewGuid().ToString(), + PTP_ID = PTP_ID, + TypeInt = typeInt, + PrintCount = 1 + }; + Funs.DB.PTP_TestPackagePrint.InsertOnSubmit(newEntry); + } + } + + // 循环所有类型,PrintCount +1 + foreach (var table in list) + { + table.PrintCount = table.PrintCount + 1; + } + + Funs.DB.SubmitChanges(); + } + + + public static void Add(Model.PTP_TestPackagePrint newtable) + { + + Model.PTP_TestPackagePrint table = new Model.PTP_TestPackagePrint + { + Id = newtable.Id, + PTP_ID = newtable.PTP_ID, + TypeInt = newtable.TypeInt, + PrintCount = newtable.PrintCount, + }; + Funs.DB.PTP_TestPackagePrint.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + public static void Update(Model.PTP_TestPackagePrint newtable) + { + + Model.PTP_TestPackagePrint table = Funs.DB.PTP_TestPackagePrint.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.PTP_ID = newtable.PTP_ID; + table.TypeInt = newtable.TypeInt; + table.PrintCount = newtable.PrintCount; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.PTP_TestPackagePrint table = Funs.DB.PTP_TestPackagePrint.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.PTP_TestPackagePrint.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + /// + /// 获取打印明细 + /// + /// + /// + /// + /// + /// + public static Model.FastReportItem GetFastReportItem(Model.PTP_TestPackage updateTestPackage, string printType, string ptp_id,string projectid ) + { + string initTemplatePath = ""; + Model.FastReportItem fastReportItem = new Model.FastReportItem(); + switch (printType) + { + case "0"://管道试压包文件资料 + { + Dictionary keyValuePairs = new Dictionary(); + var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid); + var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName; + keyValuePairs.Add("ProjectName", projectName); + keyValuePairs.Add("InstallationName", projectName + InstallationName); + keyValuePairs.Add("TestPackageNo", updateTestPackage.TestPackageNo); + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\管道试压包文件资料.frx"; + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + } + break; + case "1"://管道压力试验技术要求 + { + Dictionary keyValuePairs = new Dictionary(); + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\管道压力试验技术要求.frx"; + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + } + break; + case "2"://管道压力包文件资料目录 + { + Dictionary keyValuePairs = new Dictionary(); + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\管道压力包文件资料目录.frx"; + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + } + break; + case "3"://管道系统压力试验条件确认记录 + { + Dictionary keyValuePairs = new Dictionary(); + var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid); + var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName; + keyValuePairs.Add("ProjectName", projectName); + keyValuePairs.Add("InstallationName", InstallationName); + keyValuePairs.Add("TestPackageNo", updateTestPackage.TestPackageNo); + keyValuePairs.Add("TestPackageName", updateTestPackage.TestPackageName); + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\管道系统压力试验条件确认记录.frx"; + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + } + break; + case "4"://管道试压包尾项清单 + { + string sql = @"select ItemCheckId,PTP_ID,PTP_ItemEndCheck.PipelineId,Content,ItemType,Result,HJGL_Pipeline.PipelineCode from PTP_ItemEndCheck + left join PTP_ItemEndCheckList on PTP_ItemEndCheckList.ItemEndCheckListId = PTP_ItemEndCheck.ItemEndCheckListId + left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = PTP_ItemEndCheck.PipelineId + where PTP_ItemEndCheckList.PTP_ID=@ptp_id"; + List listStr = new List + { + new SqlParameter("@ptp_id", ptp_id), + }; + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("SortNumber"); + dt.Columns.Add("PipelineCode"); + dt.Columns.Add("Content"); + dt.Columns.Add("ItemType"); + + for (int i = 0; i < tb.Rows.Count; i++) + { + var newRows = dt.NewRow(); + newRows["SortNumber"] = (i + 1).ToString(); + newRows["PipelineCode"] = tb.Rows[i]["PipelineCode"].ToString(); + newRows["Content"] = tb.Rows[i]["Content"].ToString(); + newRows["ItemType"] = tb.Rows[i]["ItemType"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.FastReportService.AddFastreportTable(dt); + + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("TestPackageNo", updateTestPackage.TestPackageNo); + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\管道试压包尾项清单.frx"; + + List dataTables = new List(); + dataTables.Add(dt); + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + fastReportItem.DataTables = dataTables; + } + break; + case "5"://管道系统压力试验记录 + { + string sql = @"SELECT ptpPipe.PT_PipeId, + ptpPipe.PTP_ID, + ptpPipe.PipelineId, + IsoInfo.DesignPress, --设计压力 + IsoInfo.DesignTemperature, --设计温度 + IsoInfo.TestPressure, --试验压力 + IsoInfo.PipelineCode,--管道编号/单线号 + testMedium.MediumName,--试验介质 + testPackage.AmbientTemperature,--试验环境温度 + testPackage.TestMediumTemperature--试验介质温度 + FROM dbo.PTP_PipelineList AS ptpPipe + LEFT JOIN dbo.HJGL_Pipeline AS IsoInfo ON ptpPipe.PipelineId = IsoInfo.PipelineId + LEFT JOIN dbo.Base_TestMedium AS testMedium ON testMedium.TestMediumId = IsoInfo.TestMedium + left join PTP_TestPackage as testPackage on testPackage.PTP_ID = ptpPipe.PTP_ID + where ptpPipe.PTP_ID=@ptp_id"; + List listStr = new List + { + new SqlParameter("@ptp_id", ptp_id), + }; + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("PipelineCode"); + dt.Columns.Add("DesignPress"); + dt.Columns.Add("DesignTemperature"); + dt.Columns.Add("MediumName"); + dt.Columns.Add("TestPressure"); + dt.Columns.Add("AmbientTemperature"); + dt.Columns.Add("TestMediumTemperature"); + + for (int i = 0; i < tb.Rows.Count; i++) + { + var newRows = dt.NewRow(); + newRows["PipelineCode"] = tb.Rows[i]["PipelineCode"].ToString(); + newRows["DesignPress"] = tb.Rows[i]["DesignPress"].ToString(); + newRows["DesignTemperature"] = tb.Rows[i]["DesignTemperature"].ToString(); + newRows["MediumName"] = tb.Rows[i]["MediumName"].ToString(); + newRows["TestPressure"] = tb.Rows[i]["TestPressure"].ToString(); + newRows["AmbientTemperature"] = tb.Rows[i]["AmbientTemperature"].ToString(); + var temp = tb.Rows[i]["TestMediumTemperature"].ToString(); + newRows["TestMediumTemperature"] = tb.Rows[i]["TestMediumTemperature"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.FastReportService.AddFastreportTable(dt); + + var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid); + var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName; + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", projectName); + keyValuePairs.Add("InstallationName", InstallationName); + keyValuePairs.Add("TestPackageNo", updateTestPackage.TestPackageNo); + keyValuePairs.Add("TestPackageName", updateTestPackage.TestPackageName); + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\管道系统压力试验记录.frx"; + + List dataTables = new List(); + dataTables.Add(dt); + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + fastReportItem.DataTables = dataTables; + } + break; + case "6"://管道材料材质标识检查记录 + { + string sql = @"select PT_PipeId, PTP_ID,pipelineList.PipelineId,pipeline.PipelineCode + from PTP_PipelineList as pipelineList + left join HJGL_Pipeline as pipeline on pipeline.PipelineId = pipelineList.PipelineId + where PTP_ID=@ptp_id"; + List listStr = new List + { + new SqlParameter("@ptp_id", ptp_id), + }; + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("PipelineCode"); + dt.Columns.Add("ManterialCode"); + dt.Columns.Add("Specification"); + + for (int i = 0; i < tb.Rows.Count; i++) + { + var newRows = dt.NewRow(); + newRows["PipelineCode"] = tb.Rows[i]["PipelineCode"].ToString(); + newRows["ManterialCode"] = getMaterialCodeByPipelineId(tb.Rows[i]["PipelineId"].ToString()); + newRows["Specification"] = getSpecificationByPipelineId(tb.Rows[i]["PipelineId"].ToString()); + + dt.Rows.Add(newRows); + } + BLL.FastReportService.AddFastreportTable(dt); + + var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid); + var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName; + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", projectName); + keyValuePairs.Add("InstallationName", InstallationName); + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\管道材料材质标识检查记录.frx"; + + List dataTables = new List(); + dataTables.Add(dt); + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + fastReportItem.DataTables = dataTables; + } + break; + case "7"://管道焊接工作记录 + { + var iosList = BLL.TestPackageEditService.GetPipeLineListByPTP_ID(ptp_id); + if (iosList.Count > 0) + { + var q = iosList[0]; + var isoIds = string.Join("','", iosList.Select(x => x.PipelineId).ToArray()); + string sql = @"select weldJoint.WeldJointId, + weldJoint.PipelineId, + weldJoint.ProjectId, + weldJoint.PipelineCode,--管线号 + weldJoint.WeldJointCode,--焊口号 + (case when person.WelderCode is not null then + case when person2.WelderCode is not null and person.WelderCode<>person2.WelderCode + then person.WelderCode+'/'+person2.WelderCode + else person2.WelderCode end + else person.WelderCode end) as WelderCode,--焊工代号 + weldJoint.Specification, --规格 + (case when material1.MaterialCode is not null then + case when material2.MaterialCode is not null and material1.MaterialCode<>material2.MaterialCode + then material1.MaterialCode+'/'+material2.MaterialCode + else material2.MaterialCode end + else material1.MaterialCode end) as MaterialCode, --材质 + weldJoint.WeldingLocationId,--焊接位置 + weldingMethod.WeldingMethodCode,--焊接方法 + (case + when consumables1.ConsumablesName is not null then + case + when consumables2.ConsumablesName is not null and consumables1.ConsumablesName <> consumables2.ConsumablesName + then consumables1.ConsumablesName + '+' + consumables2.ConsumablesName + else consumables1.ConsumablesName end + else consumables2.ConsumablesName end) as WeldingMaterial,--焊材牌号 + convert(varchar(10),weldingDaily.WeldingDate,111) as WeldingDate --焊接日期 + from HJGL_WeldJoint as weldJoint + left join HJGL_Pipeline as pipeline on pipeline.PipelineId = weldJoint.PipelineId + left join SitePerson_Person as person on person.PersonId = weldJoint.CoverWelderId + left join SitePerson_Person as person2 on person2.PersonId = weldJoint.BackingWelderId + left join Base_Material as material1 on material1.MaterialId = weldJoint.Material1Id + left join Base_Material as material2 on material2.MaterialId = weldJoint.Material2Id + left join HJGL_WeldingDaily as weldingDaily on weldingDaily.WeldingDailyId = weldJoint.WeldingDailyId + left join Base_WeldingMethod as weldingMethod on weldingMethod.WeldingMethodId = weldJoint.WeldingMethodId + left join Base_Consumables as consumables1 on consumables1.ConsumablesId = weldJoint.WeldingWire + left join Base_Consumables as consumables2 on consumables2.ConsumablesId = weldJoint.WeldingRod + where weldJoint.WeldingDailyId is not null and weldJoint.PipelineId in ('" + isoIds + "')"; + + List listStr = new List + { + //new SqlParameter("@ptp_id", this.PTP_ID), + }; + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("PipelineCode"); + dt.Columns.Add("WeldJointCode"); + dt.Columns.Add("WelderCode"); + dt.Columns.Add("Specification"); + dt.Columns.Add("MaterialCode"); + dt.Columns.Add("WeldingLocationId"); + dt.Columns.Add("WeldingMethodCode"); + dt.Columns.Add("WeldingMaterial"); + dt.Columns.Add("WeldingDate"); + + for (int i = 0; i < tb.Rows.Count; i++) + { + var newRows = dt.NewRow(); + newRows["PipelineCode"] = tb.Rows[i]["PipelineCode"].ToString(); + newRows["WeldJointCode"] = tb.Rows[i]["WeldJointCode"].ToString(); + newRows["WelderCode"] = tb.Rows[i]["WelderCode"].ToString(); + newRows["Specification"] = tb.Rows[i]["Specification"].ToString(); + newRows["MaterialCode"] = tb.Rows[i]["MaterialCode"].ToString(); + newRows["WeldingLocationId"] = tb.Rows[i]["WeldingLocationId"].ToString(); + newRows["WeldingMethodCode"] = tb.Rows[i]["WeldingMethodCode"].ToString(); + newRows["WeldingMaterial"] = tb.Rows[i]["WeldingMaterial"].ToString(); + newRows["WeldingDate"] = tb.Rows[i]["WeldingDate"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.FastReportService.AddFastreportTable(dt); + + var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid); + var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName; + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", projectName); + keyValuePairs.Add("InstallationName", InstallationName); + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\管道焊接工作记录.frx"; + + List dataTables = new List(); + dataTables.Add(dt); + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + fastReportItem.DataTables = dataTables; + } + } + break; + case "8"://管道无损检测数量统计表 + { + var iosList = BLL.TestPackageEditService.GetPipeLineListByPTP_ID(ptp_id); + if (iosList.Count > 0) + { + var q = iosList[0]; + var isoIds = string.Join("','", iosList.Select(x => x.PipelineId).ToArray()); + Dictionary keyValuePairs = new Dictionary(); + var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid); + var UnitWorkName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName; + keyValuePairs.Add("projectName", projectName); + keyValuePairs.Add("UnitWorkName", UnitWorkName); + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + string sql3 = @"SELECT isoList.PT_PipeId, + isoList.PTP_ID, + isoList.PipelineId, + testPackage.ProjectId, + isoInfo.PipelineCode, + isoInfo.SingleNumber, + (convert(nvarchar(10),dr.DetectionRateValue)+'%') as DetectionRateValue, + '' as totalJotCountBW, + '' as RTtotalJotCountBW, + '' as UTtotalJotCountBW, + '' as MTtotalJotCountBW, + '' as PTtotalJotCountBW, + '' as totalJotCountFW, + '' as MTtotalJotCountFW, + '' as PTtotalJotCountFW, + '' as totalJotCountDW, + '' as RTtotalJotCountDW, + '' as UTtotalJotCountDW, + '' as MTtotalJotCountDW, + '' as PTtotalJotCountDW + FROM PTP_PipelineList AS isoList + LEFT JOIN PTP_TestPackage AS testPackage ON testPackage.PTP_ID = isoList.PTP_ID + LEFT JOIN HJGL_Pipeline AS isoInfo ON isoInfo.PipelineId = isoList.PipelineId + left join Base_DetectionRate as dr on dr.DetectionRateId = isoInfo.DetectionRateId + where isoList.PipelineId in ('" + isoIds + "')"; + DataTable dt = SQLHelper.GetDataTableRunText(sql3, null); + if (dt != null) + { + dt.TableName = "Data"; + + for (int i = 0; i < dt.Rows.Count; i++) + { + #region 对接焊接头 + int totalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "BW" + select x).Count();//对接检测合格数量 + int RTtotalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "BW" + && w.DetectionTypeCode == "RT" + select x).Count();//RT对接检测合格数量 + int UTtotalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "BW" + && w.DetectionTypeCode == "UT" + select x).Count();//UT对接检测合格数量 + int MTtotalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "BW" + && w.DetectionTypeCode == "MT" + select x).Count();// MT对接检测合格数量 + int PTtotalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "BW" + && w.DetectionTypeCode == "PT" + select x).Count();//PT对接检测合格数量 + + dt.Rows[i]["totalJotCountBW"] = totalJotCountBW.ToString(); + dt.Rows[i]["RTtotalJotCountBW"] = RTtotalJotCountBW.ToString(); + dt.Rows[i]["UTtotalJotCountBW"] = UTtotalJotCountBW.ToString(); + dt.Rows[i]["MTtotalJotCountBW"] = MTtotalJotCountBW.ToString(); + dt.Rows[i]["PTtotalJotCountBW"] = PTtotalJotCountBW.ToString(); + #endregion + + #region 角焊接头 + int totalJotCountFW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && (z.WeldTypeCode == "C" || z.WeldTypeCode == "E") + select x).Count();//对接检测合格数量 + int MTtotalJotCountFW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && (z.WeldTypeCode == "C" || z.WeldTypeCode == "E") + && w.DetectionTypeCode == "MT" + select x).Count();//MT对接检测合格数量 + int PTtotalJotCountFW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && (z.WeldTypeCode == "C" || z.WeldTypeCode == "E") + && w.DetectionTypeCode == "PT" + select x).Count();//PT对接检测合格数量 + + dt.Rows[i]["totalJotCountFW"] = totalJotCountFW.ToString(); + dt.Rows[i]["MTtotalJotCountFW"] = MTtotalJotCountFW.ToString(); + dt.Rows[i]["PTtotalJotCountFW"] = PTtotalJotCountFW.ToString(); + #endregion + + #region 支管连接接头 + int totalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "D" + select x).Count();//支管检测合格数量 + int RTtotalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "D" + && w.DetectionTypeCode == "RT" + select x).Count();//支管检测合格数量 + int UTtotalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "D" + && w.DetectionTypeCode == "UT" + select x).Count();//支管检测合格数量 + int MTtotalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "D" + && w.DetectionTypeCode == "MT" + select x).Count();//支管检测合格数量 + int PTtotalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId + join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId + join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId + where y.PipelineId == dt.Rows[i]["PipelineId"].ToString() + && x.CheckResult == "1" + && z.WeldTypeCode == "D" + && w.DetectionTypeCode == "PT" + select x).Count();//支管检测合格数量 + + dt.Rows[i]["totalJotCountDW"] = totalJotCountDW.ToString(); + dt.Rows[i]["RTtotalJotCountDW"] = RTtotalJotCountDW.ToString(); + dt.Rows[i]["UTtotalJotCountDW"] = UTtotalJotCountDW.ToString(); + dt.Rows[i]["MTtotalJotCountDW"] = MTtotalJotCountDW.ToString(); + dt.Rows[i]["PTtotalJotCountDW"] = PTtotalJotCountDW.ToString(); + #endregion + } + } + BLL.FastReportService.AddFastreportTable(dt); + initTemplatePath = "File\\Fastreport\\JGZL\\管道无损检测数量统计表.frx"; + List dataTables = new List(); + dataTables.Add(dt); + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + fastReportItem.DataTables = dataTables; + } + } + break; + case "9"://无损检测结果汇总表 + { + var iosList = BLL.TestPackageEditService.GetPipeLineListByPTP_ID(ptp_id); + if (iosList.Count > 0) + { + var q = iosList[0]; + var isoNos = string.Join(",", iosList.Select(x => x.PipelineCode).ToArray()); + var isoIds = string.Join("','", iosList.Select(x => x.PipelineId).ToArray()); + Dictionary keyValuePairs = new Dictionary(); + var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid); + var UnitWorkName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName; + var unitNames = BLL.UnitService.GetUnitNameByUnitId(updateTestPackage.UnitId); + keyValuePairs.Add("ProjectName", projectName); + keyValuePairs.Add("UnitWorkName", UnitWorkName); + keyValuePairs.Add("UnitName2", unitNames);//施工单位 + if (!string.IsNullOrEmpty(q.PipingClassId)) + { + var PipingClass = BLL.Base_PipingClassService.GetPipingClassByPipingClassId(q.PipingClassId); + if (PipingClass != null) + { + keyValuePairs.Add("ISOLevel", PipingClass.PipingClassName); + } + } + keyValuePairs.Add("isoCode", isoNos); + + //监理单位 + var Unit1 = BLL.UnitService.GetUnitByProjectIdUnitTypeList(projectid, BLL.Const.ProjectUnitType_3); + if (Unit1 != null) + { + var unitNames1 = string.Join(",", Unit1.Select(x => x.UnitName).ToArray()); + keyValuePairs.Add("UnitName1", unitNames1); + + } + #region 定义变量 + int rtdjJoint = 0;//RT对接焊口数 + int? rtdjFilm = 0;//RT对接片数 + int rtjhJoint = 0;//RT角焊焊口数 + int? rtjhFilm = 0;//RT角焊片数 + int rtzgJoint = 0;//RT支管连接焊口数 + int? rtzgFilm = 0;//RT支管连接片数 + + int utdjJoint = 0;//UT对接焊口数 + //int? utdjFilm = 0;//UT对接片数 + int utjhJoint = 0;//UT角焊焊口数 + //int? utjhFilm = 0;//UT角焊片数 + int utzgJoint = 0;//UT支管连接焊口数 + //int? utzgFilm = 0;//UT支管连接片数 + + int mtdjJoint = 0;//MT对接焊口数 + //int? mtdjFilm = 0;//MT对接片数 + int mtjhJoint = 0;//MT角焊焊口数 + //int? mtjhFilm = 0;//MT角焊片数 + int mtzgJoint = 0;//MT支管连接焊口数 + //int? mtzgFilm = 0;//MT支管连接片数 + + int ptdjJoint = 0;//PT对接焊口数 + //int? ptdjFilm = 0;//PT对接片数 + int ptjhJoint = 0;//PT角焊焊口数 + //int? ptjhFilm = 0;//PT角焊片数 + int ptzgJoint = 0;//PT支管连接焊口数 + //int? ptzgFilm = 0;//PT支管连接片数 + + int rtdjNoPassJoint = 0; + int? rtdjNoPassFilm = 0; + int rtjhNoPassJoint = 0; + int? rtjhNoPassFilm = 0; + int rtzgNoPassJoint = 0; + int? rtzgNoPassFilm = 0; + + int utdjNoPassJoint = 0; + decimal? utdjNoPassFilm = 0; + int utjhNoPassJoint = 0; + decimal? utjhNoPassFilm = 0; + int utzgNoPassJoint = 0; + decimal? utzgNoPassFilm = 0; + + int mtdjNoPassJoint = 0; + decimal? mtdjNoPassFilm = 0; + int mtjhNoPassJoint = 0; + decimal? mtjhNoPassFilm = 0; + int mtzgNoPassJoint = 0; + decimal? mtzgNoPassFilm = 0; + + int ptdjNoPassJoint = 0; + decimal? ptdjNoPassFilm = 0; + int ptjhNoPassJoint = 0; + decimal? ptjhNoPassFilm = 0; + int ptzgNoPassJoint = 0; + decimal? ptzgNoPassFilm = 0; + #endregion + foreach (var iso in iosList) + { + #region 检测数量统计 + #region RT对焊接头 + rtdjJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId + select x).Count();//RT对接焊口数 + + rtdjFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId + select x.TotalFilm).Sum();//RT对接片数 + #endregion + #region RT角焊接头 + rtjhJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId + select x).Count();//RT角焊焊口数 + + rtjhFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId + select x.TotalFilm).Sum();//RT角焊片数 + #endregion + #region RT支管连接焊口数 + rtzgJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId + select x).Count();//RT支管连接焊口数 + + rtzgFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId + select x.TotalFilm).Sum();//RT支管连接片数 + #endregion + + #region UT对焊接头 + utdjJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId + select x).Count();//UT对接焊口数 + + //utdjFilm += (from x in Funs.DB.CH_CheckItem + // join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId + // join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID + // join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId + // where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "BW" && z.ISO_ID == iso.ISO_ID + // select x.CHT_TotalFilm).Sum();//UT对接片数 + #endregion + #region UT角焊接头 + utjhJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "UT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId + select x).Count();//UT角焊焊口数 + //utjhFilm += (from x in Funs.DB.CH_CheckItem + // join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId + // join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID + // join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId + // where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "FW" && z.ISO_ID == iso.ISO_ID + // select x.CHT_TotalFilm).Sum();//UT角焊片数 + #endregion + #region UT支管连接焊口数 + utzgJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId + select x).Count();//UT支管连接焊口数 + + //utzgFilm += (from x in Funs.DB.CH_CheckItem + // join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId + // join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID + // join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId + // where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "DW" && z.ISO_ID == iso.ISO_ID + // select x.CHT_TotalFilm).Sum();//UT支管连接片数 + #endregion + + #region MT对焊接头 + mtdjJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId + select x).Count();//MT对接焊口数 + + //mtdjFilm += (from x in Funs.DB.CH_CheckItem + // join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId + // join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID + // join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId + // where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "BW" && z.ISO_ID == iso.ISO_ID + // select x.CHT_TotalFilm).Sum();//MT对接片数 + #endregion + #region MT角焊接头 + mtjhJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "MT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId + select x).Count();//MT角焊焊口数 + + //mtjhFilm += (from x in Funs.DB.CH_CheckItem + // join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId + // join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID + // join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId + // where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "FW" && z.ISO_ID == iso.ISO_ID + // select x.CHT_TotalFilm).Sum();//MT角焊片数 + #endregion + #region MT支管连接焊口数 + mtzgJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId + select x).Count();//MT支管连接焊口数 + //mtzgFilm += (from x in Funs.DB.CH_CheckItem + // join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId + // join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID + // join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId + // where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "DW" && z.ISO_ID == iso.ISO_ID + // select x.CHT_TotalFilm).Sum();//MT支管连接片数 + #endregion + + #region PT对焊接头 + ptdjJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId + select x).Count();//PT对接焊口数 + //ptdjFilm += (from x in Funs.DB.CH_CheckItem + // join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId + // join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID + // join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId + // where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "BW" && z.ISO_ID == iso.ISO_ID + // select x.CHT_TotalFilm).Sum();//PT对接片数 + #endregion + #region PT角焊接头 + ptjhJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "PT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId + select x).Count();//PT角焊焊口数 + //ptjhFilm += (from x in Funs.DB.CH_CheckItem + // join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId + // join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID + // join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId + // where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "FW" && z.ISO_ID == iso.ISO_ID + // select x.CHT_TotalFilm).Sum();//PT角焊片数 + #endregion + #region PT支管连接焊口数 + ptzgJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId + select x).Count();//PT支管连接焊口数 + //ptzgFilm += (from x in Funs.DB.CH_CheckItem + // join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId + // join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID + // join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId + // where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "DW" && z.ISO_ID == iso.ISO_ID + // select x.CHT_TotalFilm).Sum();//PT支管连接片数 + #endregion + #endregion + + #region 不合格情况统计 + #region RT对焊接头 + rtdjNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//RT对接焊口数 + rtdjNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select (x.TotalFilm - x.PassFilm)).Sum();//RT对接片数 + #endregion + #region RT角焊接头 + rtjhNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//RT角焊焊口数 + + rtjhNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select (x.TotalFilm - x.PassFilm)).Sum();//RT角焊片数 + #endregion + #region RT支管连接焊口数 + rtzgNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//RT支管连接焊口数 + rtzgNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select (x.TotalFilm - x.PassFilm)).Sum();//RT支管连接片数 + #endregion + + #region UT对焊接头 + utdjNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//UT对接焊口数 + + utdjNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x.TotalFilm - x.PassFilm).Sum();//UT对接片数 + #endregion + #region UT角焊接头 + utjhNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "UT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//UT角焊焊口数 + utjhNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "UT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x.TotalFilm - x.PassFilm).Sum();//UT角焊片数 + #endregion + #region UT支管连接焊口数 + utzgNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//UT支管连接焊口数 + utzgNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x.TotalFilm - x.PassFilm).Sum();//UT支管连接片数 + #endregion + + #region MT对焊接头 + mtdjNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//MT对接焊口数 + mtdjNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x.TotalFilm - x.PassFilm).Sum();//MT对接片数 + #endregion + #region MT角焊接头 + mtjhNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "MT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//MT角焊焊口数 + mtjhNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "MT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x.TotalFilm - x.PassFilm).Sum();//MT角焊片数 + #endregion + #region MT支管连接焊口数 + mtzgNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//MT支管连接焊口数 + mtzgNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x.TotalFilm - x.PassFilm).Sum();//MT支管连接片数 + #endregion + + #region PT对焊接头 + ptdjNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//PT对接焊口数 + ptdjNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x.TotalFilm - x.PassFilm).Sum();//PT对接片数 + #endregion + #region PT角焊接头 + ptjhNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "PT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//PT角焊焊口数 + ptjhNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "PT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x.TotalFilm - x.PassFilm).Sum();//PT角焊片数 + #endregion + #region PT支管连接焊口数 + ptzgNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x).Count();//PT支管连接焊口数 + ptzgNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId + join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId + join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId + where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2" + select x.TotalFilm - x.PassFilm).Sum();//PT支管连接片数 + #endregion + #endregion + } + keyValuePairs.Add("RTBW", (rtdjJoint > 0 ? rtdjJoint.ToString() + "道" : "") + "/" + (rtdjFilm > 0 ? rtdjFilm.ToString() + "张" : "")); + keyValuePairs.Add("RTFW", (rtjhJoint > 0 ? rtjhJoint.ToString() + "道" : "") + "/" + (rtjhFilm > 0 ? rtjhFilm.ToString() + "张" : "")); + keyValuePairs.Add("RTDW", (rtzgJoint > 0 ? rtzgJoint.ToString() + "道" : "") + "/" + (rtzgFilm > 0 ? rtzgFilm.ToString() + "张" : "")); + keyValuePairs.Add("UTBW", (utdjJoint > 0 ? utdjJoint.ToString() + "道" : "") + "/" + (utdjJoint > 0 ? utdjJoint.ToString() + "米" : "")); + keyValuePairs.Add("UTFW", (utjhJoint > 0 ? utjhJoint.ToString() + "道" : "") + "/" + (utjhJoint > 0 ? utjhJoint.ToString() + "米" : "")); + keyValuePairs.Add("UTDW", (utzgJoint > 0 ? utzgJoint.ToString() + "道" : "") + "/" + (utzgJoint > 0 ? utzgJoint.ToString() + "米" : "")); + keyValuePairs.Add("MTBW", (mtdjJoint > 0 ? mtdjJoint.ToString() + "道" : "") + "/" + (mtdjJoint > 0 ? mtdjJoint.ToString() + "米" : "")); + keyValuePairs.Add("MTFW", (mtjhJoint > 0 ? mtjhJoint.ToString() + "道" : "") + "/" + (mtjhJoint > 0 ? mtjhJoint.ToString() + "米" : "")); + keyValuePairs.Add("MTDW", (mtzgJoint > 0 ? mtzgJoint.ToString() + "道" : "") + "/" + (mtzgJoint > 0 ? mtzgJoint.ToString() + "米" : "")); + keyValuePairs.Add("PTBW", (ptdjJoint > 0 ? ptdjJoint.ToString() + "道" : "") + "/" + (ptdjJoint > 0 ? ptdjJoint.ToString() + "米" : "")); + keyValuePairs.Add("PTFW", (ptjhJoint > 0 ? ptjhJoint.ToString() + "道" : "") + "/" + (ptjhJoint > 0 ? ptjhJoint.ToString() + "米" : "")); + keyValuePairs.Add("PTDW", (ptzgJoint > 0 ? ptzgJoint.ToString() + "道" : "") + "/" + (ptzgJoint > 0 ? ptzgJoint.ToString() + "米" : "")); + + keyValuePairs.Add("RTNoPassBW", (rtdjNoPassJoint > 0 ? rtdjNoPassJoint.ToString() + "道" : "") + "/" + (rtdjNoPassFilm > 0 ? rtdjNoPassFilm.ToString() + "张" : "")); + keyValuePairs.Add("RTNoPassFW", (rtjhNoPassJoint > 0 ? rtjhNoPassJoint.ToString() + "道" : "") + "/" + (rtjhNoPassFilm > 0 ? rtjhNoPassFilm.ToString() + "张" : "")); + keyValuePairs.Add("RTNoPassDW", (rtzgNoPassJoint > 0 ? rtzgNoPassJoint.ToString() + "道" : "") + "/" + (rtzgNoPassFilm > 0 ? rtzgNoPassFilm.ToString() + "张" : "")); + keyValuePairs.Add("UTNoPassBW", (utdjNoPassJoint > 0 ? utdjNoPassJoint.ToString() + "道" : "") + "/" + (utdjNoPassFilm > 0 ? utdjNoPassFilm.ToString() + "处" : "")); + keyValuePairs.Add("UTNoPassFW", (utjhNoPassJoint > 0 ? utjhNoPassJoint.ToString() + "道" : "") + "/" + (utjhNoPassFilm > 0 ? utjhNoPassFilm.ToString() + "处" : "")); + keyValuePairs.Add("UTNoPassDW", (utzgNoPassJoint > 0 ? utzgNoPassJoint.ToString() + "道" : "") + "/" + (utzgNoPassFilm > 0 ? utzgNoPassFilm.ToString() + "处" : "")); + keyValuePairs.Add("MTNoPassBW", (mtdjNoPassJoint > 0 ? mtdjNoPassJoint.ToString() + "道" : "") + "/" + (mtdjNoPassFilm > 0 ? mtdjNoPassFilm.ToString() + "处" : "")); + keyValuePairs.Add("MTNoPassFW", (mtjhNoPassJoint > 0 ? mtjhNoPassJoint.ToString() + "道" : "") + "/" + (mtjhNoPassFilm > 0 ? mtjhNoPassFilm.ToString() + "处" : "")); + keyValuePairs.Add("MTNoPassDW", (mtzgNoPassJoint > 0 ? mtzgNoPassJoint.ToString() + "道" : "") + "/" + (mtzgNoPassFilm > 0 ? mtzgNoPassFilm.ToString() + "处" : "")); + keyValuePairs.Add("PTNoPassBW", (ptdjNoPassJoint > 0 ? ptdjNoPassJoint.ToString() + "道" : "") + "/" + (ptdjNoPassFilm > 0 ? ptdjNoPassFilm.ToString() + "处" : "")); + keyValuePairs.Add("PTNoPassFW", (ptjhNoPassJoint > 0 ? ptjhNoPassJoint.ToString() + "道" : "") + "/" + (ptjhNoPassFilm > 0 ? ptjhNoPassFilm.ToString() + "处" : "")); + keyValuePairs.Add("PTNoPassDW", (ptzgNoPassJoint > 0 ? ptzgNoPassJoint.ToString() + "道" : "") + "/" + (ptzgNoPassFilm > 0 ? ptzgNoPassFilm.ToString() + "处" : "")); + keyValuePairs.Add("isoIds", isoIds); + + BLL.FastReportService.AddFastreportParameter(keyValuePairs); + string sql3 = @"select nDEItem.NDEItemID, + i.SingleName, + i.PipelineCode, + j.WeldJointCode, + (case when j.CoverWelderId is not null then ( + case when j.BackingWelderId is not null and j.CoverWelderId<>j.BackingWelderId + then cWelder.JobNum+'/'+fWelder.JobNum + else cWelder.JobNum end) else fWelder.JobNum end) as WelderCode, + (case when d.DetectionTypeCode='RT' or d.DetectionTypeCode='UT' then + (case nDEItem.CheckResult when '1' then '合格' when '2' then '不合格' else '/' end) else '/' end) as RTUTResult, + (case when d.DetectionTypeCode='RT' or d.DetectionTypeCode='UT' then nDEItem.NDEReportNo else '/' end) as RTUTCheckNo, + (case when d.DetectionTypeCode='MT' or d.DetectionTypeCode='PT' then + (case nDEItem.CheckResult when '1' then '合格' when '2' then '不合格' else '/' end) else '/' end) as MTPTResult, + (case when d.DetectionTypeCode='MT' or d.DetectionTypeCode='PT' then nDEItem.NDEReportNo else '/' end) as MTPTCheckNo, + nDEItem.Remark as CHT_Remark,pointBatch.PointBatchCode + from HJGL_Batch_NDEItem as nDEItem + left join HJGL_Batch_NDE as c on c.NDEID = nDEItem.NDEID + left join HJGL_Batch_BatchTrustItem as t on t.TrustBatchItemId = nDEItem.TrustBatchItemId + left join HJGL_WeldJoint as j on j.WeldJointId = t.WeldJointId + left join HJGL_Pipeline as i on i.PipelineId =j.PipelineId + left join Person_Persons as cWelder on cWelder.PersonId = j.CoverWelderId + left join Person_Persons as fWelder on fWelder.PersonId = j.BackingWelderId + left join Base_DetectionType as d on d.DetectionTypeId = nDEItem.DetectionTypeId + left join HJGL_Batch_PointBatchItem as pointBatchItem on pointBatchItem.PointBatchItemId = t.PointBatchItemId + left join HJGL_Batch_PointBatch as pointBatch on pointBatch.PointBatchId = pointBatchItem.PointBatchId + where j.PipelineId in ('" + isoIds + "')"; + + List listStr = new List(); + SqlParameter[] parameter = listStr.ToArray(); + DataTable dt0 = SQLHelper.GetDataTableRunText(sql3, parameter); + + sql3 += " order by PipelineCode,WeldJointCode"; + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("SingleName"); + dt.Columns.Add("WeldJointCode"); + dt.Columns.Add("WelderCode"); + dt.Columns.Add("PointBatchCode"); + dt.Columns.Add("RTUTResult"); + dt.Columns.Add("RTUTCheckNo"); + dt.Columns.Add("MTPTResult"); + dt.Columns.Add("MTPTCheckNo"); + dt.Columns.Add("CHT_Remark"); + + dt0.DefaultView.Sort = "PipelineCode,WeldJointCode asc"; + DataRow[] rows = dt0.DefaultView.ToTable().Select(); + + foreach (var row in rows) + { + var newRow = dt.NewRow(); + newRow["SingleName"] = row["SingleName"].ToString(); + newRow["WeldJointCode"] = row["WeldJointCode"].ToString(); + newRow["WelderCode"] = row["WelderCode"].ToString(); + newRow["PointBatchCode"] = row["PointBatchCode"].ToString(); + newRow["RTUTResult"] = row["RTUTResult"].ToString(); + newRow["RTUTCheckNo"] = row["RTUTCheckNo"].ToString(); + newRow["MTPTResult"] = row["MTPTResult"].ToString(); + newRow["MTPTCheckNo"] = row["MTPTCheckNo"].ToString(); + newRow["CHT_Remark"] = row["CHT_Remark"].ToString(); + dt.Rows.Add(newRow); + } + BLL.FastReportService.AddFastreportTable(dt); + initTemplatePath = "File\\Fastreport\\JGZL\\管道无损检测结果汇总表.frx"; + List dataTables = new List(); + dataTables.Add(dt); + fastReportItem.ReportPath = initTemplatePath; + fastReportItem.ParameterValues = keyValuePairs; + fastReportItem.DataTables = dataTables; + } + } + break; + } + return fastReportItem; + } + + + #region 格式化字符串 + public static string getMaterialCodeByPipelineId(string pipelineId) + { + string materialCode = string.Empty; + if (!string.IsNullOrEmpty(pipelineId)) + { + var weldjoint = (from x in Funs.DB.HJGL_WeldJoint + join y in Funs.DB.Base_Material on x.Material1Id equals y.MaterialId + join z in Funs.DB.Base_Material on x.Material2Id equals z.MaterialId + where x.PipelineId == pipelineId + select new { MaterialCode1 = y.MaterialCode, MaterialCode2 = z.MaterialCode }).FirstOrDefault(); + if (weldjoint != null) + { + if (!string.IsNullOrEmpty(weldjoint.MaterialCode1) && !string.IsNullOrEmpty(weldjoint.MaterialCode2)) + { + materialCode = weldjoint.MaterialCode1 + "/" + weldjoint.MaterialCode2; + } + else + { + if (!string.IsNullOrEmpty(weldjoint.MaterialCode1)) + { + materialCode = weldjoint.MaterialCode1; + } + else + { + materialCode = weldjoint.MaterialCode2; + } + } + + } + } + return materialCode; + } + + public static string getSpecificationByPipelineId(string pipelineId) + { + string spcificaation = string.Empty; + if (!string.IsNullOrEmpty(pipelineId)) + { + var weldjoint = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId select x).FirstOrDefault(); + if (weldjoint != null) + { + spcificaation = weldjoint.Specification; + } + } + return spcificaation; + } + #endregion + + } +} diff --git a/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道材料材质标识检查记录.frx b/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道材料材质标识检查记录.frx index eeb29ab2..c4c7c366 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道材料材质标识检查记录.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道材料材质标识检查记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,26 +42,11 @@ namespace FastReport } - + - - - - - - - - - - - - - - - diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 7c91181a..e80957ee 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1617,6 +1617,7 @@ + @@ -11010,6 +11011,13 @@ TestPackageData.aspx + + TestPackageDatePrint.aspx + ASPXCodeBehind + + + TestPackageDatePrint.aspx + TestPackageEdit.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs index a99cd7a5..4bd2e3bb 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs @@ -308,14 +308,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery var table = list.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize).ToList(); Grid1.DataSource = table; Grid1.DataBind(); - } - - - - - - - + } } private void get3DParmeter_weldjoint(List model) diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageData.aspx b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageData.aspx index 3b29f2c8..4f1e93c8 100644 --- a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageData.aspx +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageData.aspx @@ -30,7 +30,7 @@ runat="server" BoxFlex="1" DataKeyNames="PTP_ID" AllowCellEditing="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="PTP_ID" AllowSorting="true" SortField="TestPackageNo" SortDirection="ASC" OnSort="Grid1_Sort" EnableTextSelection="True" - AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true" EnableCheckBoxSelect="true"> + AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true" EnableCheckBoxSelect="true" OnRowCommand="Grid1_RowCommand"> @@ -41,7 +41,7 @@ - + @@ -63,7 +63,8 @@ - + + @@ -83,6 +84,10 @@ + + + diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageDatePrint.aspx.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageDatePrint.aspx.cs new file mode 100644 index 00000000..54383345 --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageDatePrint.aspx.cs @@ -0,0 +1,83 @@ +using BLL; +using NPOI.POIFS.Crypt.Dsig; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.HJGL.TestPackage +{ + public partial class TestPackageDatePrint : PageBase + { + /// + /// 试压包主键 + /// + public string PTP_ID + { + get + { + return (string)ViewState["PTP_ID"]; + } + set + { + ViewState["PTP_ID"] = value; + } + } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + PTP_ID = Request.Params["PTP_ID"]; + if (!string.IsNullOrEmpty(PTP_ID)) + { + BindGrid(); + } + } + + } + private void BindGrid() + { + var list = BLL.TestPackagePrintService.GetListByPTP_ID(PTP_ID); + //根据 BLL.TestPackagePrintService.TypeIntMap 和 list 进行左连接,确保所有类型都显示,获取对应的 PrintCount,没有的类型 PrintCount 为 0 + var result = from type in BLL.TestPackagePrintService.TypeIntMap + join item in list on type.Key equals item.TypeInt into gj + from subitem in gj.DefaultIfEmpty() + select new + { + TypeInt = type.Key, + TypeName = type.Value, + PrintCount = subitem != null ? subitem.PrintCount : 0 + }; + Grid1.DataSource = result; + Grid1.DataBind(); + + } + protected void btnPrint_Click(object sender, EventArgs e) + { + Model.PTP_TestPackage updateTestPackage = Funs.DB.PTP_TestPackage.FirstOrDefault(x => x.PTP_ID == PTP_ID); + + var fastReportItem = BLL.TestPackagePrintService.GetFastReportItem(updateTestPackage,Grid1.SelectedRowID,PTP_ID,this.CurrUser.LoginProjectId); + BLL.FastReportService.ResetData(); + BLL.FastReportService.AddFastreportParameter(fastReportItem.ParameterValues); + if (fastReportItem.DataTables!=null) + { + foreach (var item in fastReportItem.DataTables) + { + BLL.FastReportService.AddFastreportTable(item); + } + } + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + initTemplatePath = fastReportItem.ReportPath; + + if (File.Exists(rootPath + initTemplatePath)) + { + TestPackagePrintService.AddPrintCountByTypeInt(PTP_ID, int.Parse( Grid1.SelectedRowID)); + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageDatePrint.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageDatePrint.aspx.designer.cs new file mode 100644 index 00000000..abb5f54e --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageDatePrint.aspx.designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HJGL.TestPackage +{ + + + public partial class TestPackageDatePrint + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + } +} diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index ff837291..1125683b 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -1355,6 +1355,9 @@ namespace Model partial void InsertPTP_TestPackageApprove(PTP_TestPackageApprove instance); partial void UpdatePTP_TestPackageApprove(PTP_TestPackageApprove instance); partial void DeletePTP_TestPackageApprove(PTP_TestPackageApprove instance); + partial void InsertPTP_TestPackagePrint(PTP_TestPackagePrint instance); + partial void UpdatePTP_TestPackagePrint(PTP_TestPackagePrint instance); + partial void DeletePTP_TestPackagePrint(PTP_TestPackagePrint instance); partial void InsertQCManage_QCGroupRegistration(QCManage_QCGroupRegistration instance); partial void UpdateQCManage_QCGroupRegistration(QCManage_QCGroupRegistration instance); partial void DeleteQCManage_QCGroupRegistration(QCManage_QCGroupRegistration instance); @@ -5467,6 +5470,14 @@ namespace Model } } + public System.Data.Linq.Table PTP_TestPackagePrint + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table QCManage_QCGroupRegistration { get @@ -219561,6 +219572,140 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PTP_TestPackagePrint")] + public partial class PTP_TestPackagePrint : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Id; + + private string _PTP_ID; + + private System.Nullable _TypeInt; + + private System.Nullable _PrintCount; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnIdChanging(string value); + partial void OnIdChanged(); + partial void OnPTP_IDChanging(string value); + partial void OnPTP_IDChanged(); + partial void OnTypeIntChanging(System.Nullable value); + partial void OnTypeIntChanged(); + partial void OnPrintCountChanging(System.Nullable value); + partial void OnPrintCountChanged(); + #endregion + + public PTP_TestPackagePrint() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Id + { + get + { + return this._Id; + } + set + { + if ((this._Id != value)) + { + this.OnIdChanging(value); + this.SendPropertyChanging(); + this._Id = value; + this.SendPropertyChanged("Id"); + this.OnIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PTP_ID", DbType="VarChar(50)")] + public string PTP_ID + { + get + { + return this._PTP_ID; + } + set + { + if ((this._PTP_ID != value)) + { + this.OnPTP_IDChanging(value); + this.SendPropertyChanging(); + this._PTP_ID = value; + this.SendPropertyChanged("PTP_ID"); + this.OnPTP_IDChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TypeInt", DbType="Int")] + public System.Nullable TypeInt + { + get + { + return this._TypeInt; + } + set + { + if ((this._TypeInt != value)) + { + this.OnTypeIntChanging(value); + this.SendPropertyChanging(); + this._TypeInt = value; + this.SendPropertyChanged("TypeInt"); + this.OnTypeIntChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PrintCount", DbType="Int")] + public System.Nullable PrintCount + { + get + { + return this._PrintCount; + } + set + { + if ((this._PrintCount != value)) + { + this.OnPrintCountChanging(value); + this.SendPropertyChanging(); + this._PrintCount = value; + this.SendPropertyChanged("PrintCount"); + this.OnPrintCountChanged(); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.QCManage_QCGroupRegistration")] public partial class QCManage_QCGroupRegistration : INotifyPropertyChanging, INotifyPropertyChanged {