diff --git a/DataBase/版本日志/HJGLDB_DS_2026-07-07_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2026-07-07_bwj.sql new file mode 100644 index 0000000..8b4d403 --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2026-07-07_bwj.sql @@ -0,0 +1,617 @@ + +alter table SYBData_ApplicationForm add TestPackageDivisionId nvarchar(50) +go +ALTER TABLE [dbo].[SYBData_ApplicationForm] WITH CHECK ADD CONSTRAINT [FK_SYBData_ApplicationForm_SYBData_TestPackageDivision] FOREIGN KEY([TestPackageDivisionId]) +REFERENCES [dbo].[SYBData_TestPackageDivision] ([TestPackageDivisionId]) +GO + +ALTER TABLE [dbo].[SYBData_ApplicationForm] CHECK CONSTRAINT [FK_SYBData_ApplicationForm_SYBData_TestPackageDivision] +GO +alter table SYBData_PressureTestPackageList add ToIsoId nvarchar(50) +go +ALTER TABLE [dbo].[SYBData_PressureTestPackageList] WITH CHECK ADD CONSTRAINT [FK_SYBData_PressureTestPackageList_SYBData_ToIsoList] FOREIGN KEY([ToIsoId]) +REFERENCES [dbo].[SYBData_ToIsoList] ([ToIsoId]) +GO + +ALTER TABLE [dbo].[SYBData_PressureTestPackageList] CHECK CONSTRAINT [FK_SYBData_PressureTestPackageList_SYBData_ToIsoList] +GO + + +ALTER PROCEDURE [dbo].[SYB_TestPackagePipeList] +( + @testPackageDivisionId nvarchar(50), + @iso_no nvarchar(50)=null +) +/***************ܵѹһ*********************/ +AS +create table #SIS( +Number1 INT, +PipelineCode1 nvarchar(50), +TestPackageNo1 nvarchar(50), +Number2 INT, +PipelineCode2 nvarchar(50), +TestPackageNo2 nvarchar(50) +) + +BEGIN + DECLARE My_Cursor CURSOR + FOR SELECT ROW_NUMBER() OVER(ORDER BY pp.PipelineCode,pp.PressureTestPackageCode) AS Number, + pp.PipelineCode,pp.PressureTestPackageCode + FROM dbo.SYBData_PressureTestPackageList pp + LEFT JOIN dbo.SYBData_ToIsoList isoList ON isoList.ToIsoId = pp.ToIsoId + WHERE isoList.TestPackageDivisionId=@testPackageDivisionId + and (pp.PipelineCode like @iso_no or @iso_no is null) + ORDER BY pp.PipelineCode,pp.PressureTestPackageCode + +OPEN My_Cursor; --α +DECLARE @Number int,@PipelineCode nvarchar(50),@TestPackageNo nvarchar(50) + +FETCH NEXT FROM My_Cursor into @Number,@PipelineCode,@TestPackageNo; --ȡһ +WHILE @@FETCH_STATUS = 0 + BEGIN + IF(@Number%2=1) + BEGIN + INSERT into #SIS values(@Number,@PipelineCode,@TestPackageNo,null,null,null) + END + ELSE + BEGIN + UPDATE #SIS SET Number2=@Number,PipelineCode2=@PipelineCode,TestPackageNo2=@TestPackageNo + WHERE Number1=@Number-1 + END + FETCH NEXT FROM My_Cursor into @Number,@PipelineCode,@TestPackageNo; --ȡһ + END +CLOSE My_Cursor; --رα +DEALLOCATE My_Cursor; --ͷα + +END +SELECT * from #SIS +DROP TABLE #SIS + +GO + +update Sys_Menu set Url='SYBData/PipeWeldingWorkRecord.aspx' where MenuId='ECFED5F8-59ED-4CF8-9FF4-893E095CBDF8' +update Sys_Menu set Url='SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx' where MenuId='720F843F-3FDD-4072-9724-B320BDB9B6E0' +update Sys_Menu set Url='SYBData/PressureTestOfPipelineSystemRecord.aspx' where MenuId='91F25D94-7A6E-422E-A5C8-7485A3D8B155' +update Sys_Menu set Url='SYBData/TestResultsSummary.aspx' where MenuId='12A4B8C5-1404-4B79-9A9C-3FF9481671F6' +update Sys_Menu set Url='SYBData/TestQuantityStatistics.aspx' where MenuId='9CC5181C-7979-4EE0-A33F-ED2899E20EA9' +update Sys_Menu set Url='SYBData/ElectrostaticGrounding.aspx' where MenuId='51877524-A99F-4FCB-BDD8-D5A4A4E670DA' +go + +go + +CREATE PROCEDURE [dbo].[HJGL_rpt_spJointWorkRecordNew] +( + @projectId nvarchar(50), + @IsoId varchar(50)=null +) +as +SELECT v.* FROM +(SELECT j.JOT_ID, +(CASE WHEN j.JOT_CellWelder!=j.JOT_FloorWelder THEN FloorWelder.WED_Code+'/'+CellWelder.WED_Code ELSE FloorWelder.WED_Code END) AS WED_Code,-- + isoInfo.ISO_IsoNo + ,j.JOT_JointNo + ,convert(int,dbo.Fun_GetParseInt(j.JOT_JointNo)) AS ConvertJointNo + ,j.JOT_JointDesc + ,(CASE WHEN Steel.STE_Code IS NOT NULL AND Steel2.STE_Code IS NOT NULL and Steel.STE_Code!=Steel2.STE_Code + THEN Steel.STE_Code + '/' + Steel2.STE_Code + WHEN Steel.STE_Code IS NOT NULL THEN Steel.STE_Code + ELSE ISNULL(Steel2.STE_Code,'') END) AS STE_Code -- + ,isoInfo.ISO_IsoNo AS ISO_IsoNumber + ,j.JOT_Location as weldLocal + ,weldMethod.WME_Name, + CASE WHEN weldMaterial.WeldName IS NULL THEN ISNULL(weldMaterial1.WeldName,'') + ELSE (CASE WHEN weldMaterial1.WeldName IS NULL + THEN ISNULL(weldMaterial.WeldName,'') + ELSE (ISNULL(weldMaterial1.WeldName,'') +'/'+ ISNULL(weldMaterial.WeldName,'')) END) END AS WMT_MatName + ,(CASE WHEN j.JOT_PrepareTemp IS NOT NULL THEN CONVERT(NVARCHAR(10),CONVERT(FLOAT,j.JOT_PrepareTemp)) ELSE '/' END) AS JOT_PrepareTemp + ,CONVERT(FLOAT,j.JOT_LastTemp) as JOT_LastTemp + ,(CASE WHEN j.Jot_WeldingDate IS NOT NULL THEN CONVERT(varchar(100), j.Jot_WeldingDate, 23) + ELSE CONVERT(varchar(100), reportDay.JOT_WeldDate, 23) END) AS WeldDate + ,'' as NDTT_CheckCode + ,(select top 1 RecordChartNo from dbo.HJGL_HotProessItem HotProessItem where HotProessItem.JOT_ID=j.JOT_ID) as JOT_HotRpt + ,j.ISO_ID + ,jointType.JOTY_Group,j.Sort1,j.Sort2,j.Sort3,j.Sort4,j.Sort5 +from dbo.HJGL_pw_jointinfo j +LEFT JOIN dbo.HJGL_BS_Welder AS CellWelder ON CellWelder.WED_ID=j.JOT_CellWelder +LEFT JOIN dbo.HJGL_BS_Welder AS FloorWelder ON FloorWelder.WED_ID=j.JOT_FloorWelder +left join dbo.HJGL_PW_IsoInfo isoInfo on isoInfo.ISO_ID=j.ISO_ID +left join dbo.HJGL_BS_Steel steel on steel.STE_ID=j.STE_ID +LEFT JOIN dbo.HJGL_BS_Steel AS Steel2 ON Steel2.STE_ID=j.STE_ID2 +left join dbo.HJGL_BS_WeldMethod weldMethod on weldMethod.WME_ID=j.WME_ID +LEFT JOIN View_WeldInfoDropDownLists as weldMaterial on weldMaterial.WeldId = j.JOT_WeldMat and weldMaterial.WeldTypeName like '%%' +LEFT JOIN View_WeldInfoDropDownLists as weldMaterial1 on weldMaterial1.WeldId = j.JOT_WeldSilk and weldMaterial1.WeldTypeName like '%˿%' +left join dbo.HJGL_BO_WeldReportMain reportDay on reportDay.DReportID=j.DReportID +left join HJGL_BS_JointType jointType on jointType.JOTY_ID = j.JOTY_ID +where (j.DReportID is not null and j.DReportID !='') + and EXISTS (SELECT 1 FROM SYBData_ToIsoList isoList WHERE isoList.ISO_ID = j.ISO_ID) + and (j.ProjectId = @projectId) + and (j.ISO_ID=@IsoId or @IsoId is null)) v +order by v.ISO_IsoNo,v.JOTY_Group,v.Sort1,v.Sort2,v.Sort3,v.Sort4,v.Sort5 +go + +alter table JGZL_PressureTestOfPipelineSystemConfirmationRecord add TestPackageDivisionId nvarchar(50) +go +ALTER TABLE [dbo].[JGZL_PressureTestOfPipelineSystemConfirmationRecord] WITH CHECK ADD CONSTRAINT [FK_JGZL_PressureTestOfPipelineSystemConfirmationRecord_SYBData_TestPackageDivision] FOREIGN KEY([TestPackageDivisionId]) +REFERENCES [dbo].[SYBData_TestPackageDivision] ([TestPackageDivisionId]) +GO + +ALTER TABLE [dbo].[JGZL_PressureTestOfPipelineSystemConfirmationRecord] CHECK CONSTRAINT [FK_JGZL_PressureTestOfPipelineSystemConfirmationRecord_SYBData_TestPackageDivision] +GO + +alter table JGZL_PressureTestOfPipelineSystemRecord add TestPackageDivisionId nvarchar(50) +go + +ALTER TABLE [dbo].[JGZL_PressureTestOfPipelineSystemRecord] WITH CHECK ADD CONSTRAINT [FK_JGZL_PressureTestOfPipelineSystemRecord_SYBData_TestPackageDivision] FOREIGN KEY([TestPackageDivisionId]) +REFERENCES [dbo].[SYBData_TestPackageDivision] ([TestPackageDivisionId]) +GO + +ALTER TABLE [dbo].[JGZL_PressureTestOfPipelineSystemRecord] CHECK CONSTRAINT [FK_JGZL_PressureTestOfPipelineSystemRecord_SYBData_TestPackageDivision] +GO + + + +CREATE PROCEDURE [dbo].[HJGL_rpt_SYBRayCheckConfirmProject] +( + @ProjectId nvarchar(50)=null, + @TestPackageDivisionId nvarchar(50)=null +) +AS + +--ܵӽͷ߼ȷϱ2023.12.11 +SELECT +t.ProjectId,iso.ISO_IsoNo, t.STE_ID,t.JOT_JointDesc,wed.WED_Code, +[dbo].[Fun_GET_JOT_ReportCode](t.ProjectId,t.JOT_CellWelder,t.ISO_ID,t.STE_ID,t.JOT_JointDesc) AS ReportCode, +ISNULL(t.WeldNum,0) AS WeldNum,--ʩ +ISNULL(t1.TotalJotNum,0) AS TotalJotNum,--ʩ +ISNULL(t4.TotalJotGNum,0) AS TotalJotGNum,--ʩ̶ +ISNULL(t2.CheckNum,0) AS CheckNum,-- +ISNULL(t3.CheckGNum,0) AS CheckGNum,--̶ +(CASE WHEN ISNULL(t.WeldNum,0)>0 THEN CAST(CONVERT(DECIMAL(9,2),ISNULL(t2.CheckNum,0)*100.0/t.WeldNum) AS NVARCHAR(10))+'%' + ELSE '0%' END) AS CheckRate +FROM +(SELECT ProjectId,HJGL_PW_JointInfo.ISO_ID,(CASE WHEN STE_ID!=STE_ID2 THEN STE_ID+'/'+STE_ID2 ELSE STE_ID END) AS STE_ID, + JOT_JointDesc,JOT_CellWelder,COUNT(JOT_ID) AS WeldNum + FROM dbo.HJGL_PW_JointInfo +left join SYBData_ToIsoList on SYBData_ToIsoList.ISO_ID = HJGL_PW_JointInfo.ISO_ID +WHERE ProjectId=@ProjectId AND DReportID IS NOT NULL +and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE HJGL_PW_JointInfo.ISO_ID = SYBData_ToIsoList.ISO_ID) +and SYBData_ToIsoList.TestPackageDivisionId=@TestPackageDivisionId +GROUP BY ProjectId,HJGL_PW_JointInfo.ISO_ID,(CASE WHEN STE_ID!=STE_ID2 THEN STE_ID+'/'+STE_ID2 ELSE STE_ID END),JOT_JointDesc,JOT_CellWelder)t + +LEFT JOIN +(SELECT ProjectId,HJGL_PW_JointInfo.ISO_ID,(CASE WHEN STE_ID!=STE_ID2 THEN STE_ID+'/'+STE_ID2 ELSE STE_ID END) AS STE_ID,JOT_JointDesc, + COUNT(JOT_ID) AS TotalJotNum + FROM dbo.HJGL_PW_JointInfo +left join SYBData_ToIsoList on SYBData_ToIsoList.ISO_ID = HJGL_PW_JointInfo.ISO_ID + WHERE ProjectId=@ProjectId AND DReportID IS NOT NULL + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE HJGL_PW_JointInfo.ISO_ID = SYBData_ToIsoList.ISO_ID) + and SYBData_ToIsoList.TestPackageDivisionId=@TestPackageDivisionId + GROUP BY ProjectId,HJGL_PW_JointInfo.ISO_ID,(CASE WHEN STE_ID!=STE_ID2 THEN STE_ID+'/'+STE_ID2 ELSE STE_ID END),JOT_JointDesc)t1 + ON t1.ProjectId=t.ProjectId AND t1.ISO_ID=t.ISO_ID AND t1.STE_ID=t.STE_ID AND t1.JOT_JointDesc=t.JOT_JointDesc + +LEFT JOIN +(SELECT ProjectId,HJGL_PW_JointInfo.ISO_ID,(CASE WHEN STE_ID!=STE_ID2 THEN STE_ID+'/'+STE_ID2 ELSE STE_ID END) AS STE_ID,JOT_JointDesc, + COUNT(JOT_ID) AS TotalJotGNum + FROM dbo.HJGL_PW_JointInfo +left join SYBData_ToIsoList on SYBData_ToIsoList.ISO_ID = HJGL_PW_JointInfo.ISO_ID + WHERE ProjectId=@ProjectId AND DReportID IS NOT NULL AND JOT_JointAttribute='̶' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE HJGL_PW_JointInfo.ISO_ID = SYBData_ToIsoList.ISO_ID) +and SYBData_ToIsoList.TestPackageDivisionId=@TestPackageDivisionId + GROUP BY ProjectId,HJGL_PW_JointInfo.ISO_ID,(CASE WHEN STE_ID!=STE_ID2 THEN STE_ID+'/'+STE_ID2 ELSE STE_ID END),JOT_JointDesc)t4 + ON t4.ProjectId=t.ProjectId AND t4.ISO_ID=t.ISO_ID AND t4.STE_ID=t.STE_ID AND t4.JOT_JointDesc=t.JOT_JointDesc + + +LEFT JOIN +(SELECT jot.ProjectId,jot.ISO_ID,(CASE WHEN jot.STE_ID!=STE_ID2 THEN jot.STE_ID+'/'+ jot.STE_ID2 ELSE jot.STE_ID END) AS STE_ID, + jot.JOT_JointDesc,jot.JOT_CellWelder,COUNT(item.CH_TrustItemID) AS CheckNum + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust t ON t.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + WHERE jot.ProjectId=@ProjectId AND t.CH_NDTMethod='20d2cbca-8b3d-434b-b1c1-181796986fa5' + GROUP BY jot.ProjectId,jot.ISO_ID,(CASE WHEN jot.STE_ID!=STE_ID2 THEN jot.STE_ID+'/'+ jot.STE_ID2 ELSE jot.STE_ID END),jot.JOT_JointDesc,jot.JOT_CellWelder) t2 + ON t2.ProjectId=t.ProjectId AND t2.ISO_ID=t.ISO_ID AND t2.STE_ID=t.STE_ID AND t2.JOT_JointDesc=t.JOT_JointDesc + AND t2.JOT_CellWelder = t.JOT_CellWelder + + LEFT JOIN +(SELECT jot.ProjectId,jot.ISO_ID,(CASE WHEN jot.STE_ID!=STE_ID2 THEN jot.STE_ID+'/'+ jot.STE_ID2 ELSE jot.STE_ID END) AS STE_ID, + jot.JOT_JointDesc,jot.JOT_CellWelder,COUNT(item.CH_TrustItemID) AS CheckGNum + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust t ON t.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + WHERE jot.ProjectId=@ProjectId AND jot.JOT_JointAttribute='̶' AND t.CH_NDTMethod='20d2cbca-8b3d-434b-b1c1-181796986fa5' + GROUP BY jot.ProjectId,jot.ISO_ID,(CASE WHEN jot.STE_ID!=STE_ID2 THEN jot.STE_ID+'/'+ jot.STE_ID2 ELSE jot.STE_ID END),jot.JOT_JointDesc,jot.JOT_CellWelder) t3 + ON t3.ProjectId=t.ProjectId AND t3.ISO_ID=t.ISO_ID AND t3.STE_ID=t.STE_ID AND t3.JOT_JointDesc=t.JOT_JointDesc + AND t3.JOT_CellWelder = t.JOT_CellWelder + + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID=t.ISO_ID + LEFT JOIN dbo.HJGL_BS_Welder wed ON wed.WED_ID = t.JOT_CellWelder + ORDER BY iso.ISO_IsoNo, t.STE_ID,t.JOT_JointDesc,wed.WED_Code + + + +GO + +CREATE VIEW [dbo].[View_SYB_CheckResultsSummaryTree] +AS +/*****ܱܵṹ*****/ +SELECT v.ProjectId,(v.ISC_ID+'|'+v.SER_ID+'|'+v.STE_ID) AS PipeId, ('1-'+IsoClass.ISC_IsoName+'-'+Ser.SER_Code+'-'+Steel.STE_Code) AS PipeCode,TestPackageDivisionId +FROM + +(SELECT iso.ProjectId, ISO.ISC_ID,iso.SER_ID,jot.STE_ID,isoList.TestPackageDivisionId FROM dbo.HJGL_CH_TrustItem trustItem + +LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = trustItem.CH_TrustID +LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID=trustItem.JOT_ID +LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID=jot.ISO_ID +left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID +where EXISTS (SELECT 1 FROM SYBData_ToIsoList isoList WHERE isoList.ISO_ID = iso.ISO_ID) +GROUP BY iso.ProjectId,iso.ISC_ID,iso.SER_ID,jot.STE_ID,isoList.TestPackageDivisionId) v + +LEFT JOIN HJGL_BS_IsoClass AS IsoClass ON IsoClass.ISC_ID =v.ISC_ID +LEFT JOIN HJGL_BS_Service AS Ser ON Ser.SER_ID = v.SER_ID +LEFT JOIN DBO.HJGL_BS_Steel AS Steel ON Steel.STE_ID = v.STE_ID + +GO + +CREATE VIEW [dbo].[HJGL_View_SYB_CheckResultSummary1] +/*ܱ-1*/ +AS + +SELECT batchItem.BatchDetailId,batch.ProjectId,batch.BatchCode,iso.ISO_IsoNo,jot.JOT_JointNo, + jot.Sort1,jot.Sort2,jot.Sort3,jot.Sort4,jot.Sort5, + iso.ISO_ID,jot.JOT_JointDesc,batch.BatchId,batchItem.NDT, + (case when welder.WED_Code is null then + (case when welder2.WED_Code is not null then welder2.WED_Code end) + else (case when welder2.WED_Code is not null and welder.WED_Code<>welder2.WED_Code + then welder.WED_Code+'/'+welder2.WED_Code + else welder.WED_Code end) end) as WED_Code,-- + iso.ISC_ID,iso.SER_ID,jot.STE_ID,joty.JOTY_Group,jot.JOT_Dia,isoList.TestPackageDivisionId +FROM dbo.HJGL_BO_BatchDetail batchItem +LEFT JOIN dbo.HJGL_BO_Batch batch ON batch.BatchId = batchItem.BatchId +LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID=batchItem.JOT_ID +LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID=jot.ISO_ID +LEFT JOIN dbo.HJGL_BS_Welder welder ON welder.WED_ID = jot.JOT_CellWelder +LEFT JOIN dbo.HJGL_BS_Welder welder2 ON welder2.WED_ID = jot.JOT_FloorWelder +LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID +left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + +WHERE batchItem.NDT IS NOT NULL +and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + + +GO + +CREATE VIEW [dbo].[HJGL_View_SYB_CheckResultSummary] +/*ܱ*/ +AS + +SELECT c.*, + (CASE WHEN CHARINDEX('20d2cbca-8b3d-434b-b1c1-181796986fa5',c.NDT)>0 THEN + + (SELECT TOP (1) report.CH_TrustCode FROM dbo.HJGL_CH_Trust report + WHERE report.CH_NDTMethod='20d2cbca-8b3d-434b-b1c1-181796986fa5' AND report.BatchId=c.BatchId + ORDER BY report.CH_TrustCode) + ELSE NULL END) AS RTReport, + + (CASE WHEN CHARINDEX('20d2cbca-8b3d-434b-b1c1-181796986fa5',c.NDT)>0 THEN + (SELECT TOP (1) item.States FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + WHERE item.BatchDetailId=c.BatchDetailId AND trust.CH_NDTMethod='20d2cbca-8b3d-434b-b1c1-181796986fa5' AND item.States IN ('2','4')) + ELSE NULL end) AS RT , + + + (CASE WHEN CHARINDEX('ee316c8c-9899-4ab8-8152-7f00b655243d',c.NDT)>0 THEN + (SELECT TOP (1) report.CH_TrustCode FROM dbo.HJGL_CH_Trust report + WHERE report.CH_NDTMethod='ee316c8c-9899-4ab8-8152-7f00b655243d' AND report.BatchId=c.BatchId + ORDER BY report.CH_TrustCode) + ELSE NULL END) AS UTReport, + + (CASE WHEN CHARINDEX('ee316c8c-9899-4ab8-8152-7f00b655243d',c.NDT)>0 THEN + (SELECT TOP (1) item.States FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + WHERE item.BatchDetailId=c.BatchDetailId AND trust.CH_NDTMethod='ee316c8c-9899-4ab8-8152-7f00b655243d' AND item.States IN ('2','4')) + ELSE NULL end) AS UT , + + (CASE WHEN CHARINDEX('6bac78b9-0e82-4885-bb8f-36486b15e545',c.NDT)>0 THEN + (SELECT TOP (1) report.CH_TrustCode FROM dbo.HJGL_CH_Trust report + WHERE report.CH_NDTMethod='6bac78b9-0e82-4885-bb8f-36486b15e545' AND report.BatchId=c.BatchId + ORDER BY report.CH_TrustCode) + ELSE NULL END) AS MTReport, + + (CASE WHEN CHARINDEX('6bac78b9-0e82-4885-bb8f-36486b15e545',c.NDT)>0 THEN + (SELECT TOP (1) item.States FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + WHERE item.BatchDetailId=c.BatchDetailId AND trust.CH_NDTMethod='6bac78b9-0e82-4885-bb8f-36486b15e545' AND item.States IN ('2','4')) + ELSE NULL end) AS MT, + + (CASE WHEN CHARINDEX('3799c68a-895e-4ed1-b516-dbb487660832',c.NDT)>0 THEN + (SELECT TOP (1) report.CH_TrustCode FROM dbo.HJGL_CH_Trust report + WHERE report.CH_NDTMethod='3799c68a-895e-4ed1-b516-dbb487660832' AND report.BatchId=c.BatchId + ORDER BY report.CH_TrustCode) + ELSE NULL END) AS PTReport, + + (CASE WHEN CHARINDEX('3799c68a-895e-4ed1-b516-dbb487660832',c.NDT)>0 THEN + (SELECT TOP (1) item.States FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + WHERE item.BatchDetailId=c.BatchDetailId AND trust.CH_NDTMethod='3799c68a-895e-4ed1-b516-dbb487660832' AND item.States IN ('2','4')) + ELSE NULL end) AS PT + +FROM dbo.HJGL_View_SYB_CheckResultSummary1 c + + + +GO + + + +CREATE PROCEDURE [dbo].[HJGL_sp_SYB_CheckResultSummary] +( + @ProjectId NVARCHAR(50), + @ISC_ID NVARCHAR(50), --ܵȼ + @SER_ID NVARCHAR(50), -- + @STE_ID NVARCHAR(50), -- + @TestPackageDivisionId NVARCHAR(50) --ѹid +) +/*ܱ*/ +AS +BEGIN +SELECT v.* +FROM +(SELECT ROW_NUMBER() OVER(ORDER BY case when RTReport is null then 1 else 0 end asc, RTReport,UTReport,MTReport,PTReport) AS Number, + BatchDetailId,ISO_IsoNo, + (JOT_JointNo+(case (select top (1) PointType from + dbo.HJGL_BO_BatchDetail bd where bd.BatchDetailId=c.BatchDetailId ORDER BY bd.PointType) when '2' then 'K' + else '' end)) as JOT_JointNo, + WED_Code, BatchCode, + + (CASE (CASE WHEN RT IS NULL THEN ISNULL(UT,'') ELSE (CASE WHEN UT IS NULL THEN ISNULL(RT,'') + ELSE (ISNULL(RT,'') +'/'+ ISNULL(UT,'')) END) END) + WHEN '2' THEN 'ϸ' WHEN '2/4' THEN 'ϸ/ϸ' WHEN '4/2' THEN 'ϸ/ϸ' WHEN '4' THEN 'ϸ' ELSE '' END) AS RTUTResult, + + CASE WHEN RTReport IS NULL THEN ISNULL(UTReport,'') ELSE (CASE WHEN UTReport IS NULL THEN ISNULL(RTReport,'') + ELSE (ISNULL(RTReport,'') +'/'+ ISNULL(UTReport,'')) END) END AS RTUTReport, + + (CASE (CASE WHEN MT IS NULL THEN ISNULL(PT,'') ELSE (CASE WHEN PT IS NULL THEN ISNULL(MT,'') + ELSE (ISNULL(MT,'') +'/'+ ISNULL(PT,'')) END) END) WHEN '2' THEN 'ϸ' WHEN + '2/4' THEN 'ϸ/ϸ' WHEN '4/2' THEN 'ϸ/ϸ' WHEN '4' THEN 'ϸ' ELSE '' END) AS MTPTResult, + + CASE WHEN MTReport IS NULL THEN ISNULL(PTReport,'') ELSE (CASE WHEN PTReport IS NULL THEN ISNULL(MTReport,'') + ELSE (ISNULL(MTReport,'') +'/'+ ISNULL(PTReport,'')) END) END AS MTPTReport + ,c.Sort1,c.Sort2,c.Sort3,c.Sort4,c.Sort5,c.TestPackageDivisionId +FROM dbo.HJGL_View_SYB_CheckResultSummary c +WHERE Projectid=@ProjectId AND ISC_ID=@ISC_ID AND SER_ID=@SER_ID AND STE_ID=@STE_ID and TestPackageDivisionId=@TestPackageDivisionId) AS v +END + +GO + + + +CREATE VIEW [dbo].[HJGL_View_SYB_CheckResult] +AS +/*ܱ*/ +SELECT item.CH_TrustItemID,batch.ProjectId,batchItem.BatchId,iso.ISC_ID,iso.SER_ID,jot.STE_ID,joty.JOTY_Group, + item.States,ndt.SysType,item.JOT_ID,jot.JOT_Dia,isoList.TestPackageDivisionId +FROM dbo.HJGL_CH_TrustItem item +LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID +LEFT JOIN dbo.HJGL_BO_BatchDetail batchItem ON batchItem.BatchDetailId = item.BatchDetailId +LEFT JOIN dbo.HJGL_BO_Batch batch ON batch.BatchId = batchItem.BatchId +LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID=batchItem.JOT_ID +LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID=jot.ISO_ID +LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID +LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod +left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + +WHERE batchItem.NDT IS NOT NULL +and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + + +GO + + + + +CREATE VIEW [dbo].[HJGL_View_TrustNumSummary_SYB] +/*ܵͳƱܴ2019.06.03*/ +AS +SELECT v1.ProjectId,v1.InstallationId,v1.TestPackageDivisionId,v1.IsoNo,rate.NDTR_Name, + ISNULL(v1.Rt1Num,0) AS Rt1Num,ISNULL(v2.Ut1Num,0) AS Ut1Num,ISNULL(v3.Mt1Num,0) AS Mt1Num,ISNULL(v4.Pt1Num,0) AS Pt1Num, + (ISNULL(v1.Rt1Num,0)+ISNULL(v2.Ut1Num,0)+ISNULL(v3.Mt1Num,0)+ISNULL(v4.Pt1Num,0)) AS TotalNum1, + ISNULL(v5.Mt2Num,0) AS Mt2Num,ISNULL(v6.Pt2Num,0) AS Pt2Num,(ISNULL(v5.Mt2Num,0)+ISNULL(v6.Pt2Num,0)) AS TotalNum2, + ISNULL(v7.Rt3Num,0) AS Rt3Num,ISNULL(v8.Ut3Num,0) AS Ut3Num,ISNULL(v9.Mt3Num,0) AS Mt3Num,ISNULL(v10.Pt3Num,0) AS Pt3Num, + (ISNULL(v7.Rt3Num,0)+ISNULL(v8.Ut3Num,0)+ISNULL(v9.Mt3Num,0)+ISNULL(v10.Pt3Num,0)) AS TotalNum3 +FROM + +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Rt1Num +FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='߼' AND item.States='2' AND joty.JOTY_Group='1' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v1 + + LEFT JOIN +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Ut1Num + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='' AND item.States='2' AND joty.JOTY_Group='1' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v2 + ON v2.ProjectId = v1.ProjectId AND v2.InstallationId = v1.InstallationId AND v2.TestPackageDivisionId =v1.TestPackageDivisionId AND v2.ISO_ID = v1.ISO_ID AND v2.IsoNo = v1.IsoNo AND v2.CH_NDTRate = v1.CH_NDTRate + +LEFT JOIN +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Mt1Num + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='ŷۼ' AND item.States='2' AND joty.JOTY_Group='1' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v3 + ON v3.ProjectId = v1.ProjectId AND v3.InstallationId = v1.InstallationId AND v3.TestPackageDivisionId =v1.TestPackageDivisionId AND v3.ISO_ID = v1.ISO_ID AND v3.IsoNo = v1.IsoNo AND v3.CH_NDTRate = v1.CH_NDTRate + + LEFT JOIN +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Pt1Num + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='͸' AND item.States='2' AND joty.JOTY_Group='1' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v4 + ON v4.ProjectId = v1.ProjectId AND v4.InstallationId = v1.InstallationId and v4.TestPackageDivisionId=v1.TestPackageDivisionId AND v4.ISO_ID = v1.ISO_ID AND v4.IsoNo = v1.IsoNo AND v4.CH_NDTRate = v1.CH_NDTRate + +LEFT JOIN +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Mt2Num + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='ŷۼ' AND item.States='2' AND joty.JOTY_Group='2' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v5 + ON v5.ProjectId = v1.ProjectId AND v5.InstallationId = v1.InstallationId and v5.TestPackageDivisionId = v1.TestPackageDivisionId AND v5.ISO_ID = v1.ISO_ID AND v5.IsoNo = v1.IsoNo AND v5.CH_NDTRate = v1.CH_NDTRate + + LEFT JOIN +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Pt2Num + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='͸' AND item.States='2' AND joty.JOTY_Group='2' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v6 + ON v6.ProjectId = v1.ProjectId AND v6.InstallationId = v1.InstallationId and v6.TestPackageDivisionId=v1.TestPackageDivisionId AND v6.ISO_ID = v1.ISO_ID AND v6.IsoNo = v1.IsoNo AND v6.CH_NDTRate = v1.CH_NDTRate + +LEFT JOIN +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Rt3Num +FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='߼' AND item.States='2' AND joty.JOTY_Group='3' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v7 + ON v7.ProjectId = v1.ProjectId AND v7.InstallationId = v1.InstallationId and v7.TestPackageDivisionId=v1.TestPackageDivisionId AND v7.ISO_ID = v1.ISO_ID AND v7.IsoNo = v1.IsoNo AND v7.CH_NDTRate = v1.CH_NDTRate + + LEFT JOIN +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Ut3Num + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='' AND item.States='2' AND joty.JOTY_Group='3' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v8 + ON v8.ProjectId = v1.ProjectId AND v8.InstallationId = v1.InstallationId and v8.TestPackageDivisionId=v1.TestPackageDivisionId AND v8.ISO_ID = v1.ISO_ID AND v8.IsoNo = v1.IsoNo AND v8.CH_NDTRate = v1.CH_NDTRate + +LEFT JOIN +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Mt3Num + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='ŷۼ' AND item.States='2' AND joty.JOTY_Group='3' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v9 + ON v9.ProjectId = v1.ProjectId AND v9.InstallationId = v1.InstallationId and v9.TestPackageDivisionId =v1.TestPackageDivisionId AND v9.ISO_ID = v1.ISO_ID AND v9.IsoNo = v1.IsoNo AND v9.CH_NDTRate = v1.CH_NDTRate + + LEFT JOIN +(SELECT iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo as IsoNo,trust.CH_NDTRate, COUNT(item.CH_TrustItemID) AS Pt3Num + FROM dbo.HJGL_CH_TrustItem item + LEFT JOIN dbo.HJGL_CH_Trust trust ON trust.CH_TrustID = item.CH_TrustID + LEFT JOIN dbo.HJGL_BS_NDTType ndt ON ndt.NDT_ID=trust.CH_NDTMethod + LEFT JOIN dbo.HJGL_PW_JointInfo jot ON jot.JOT_ID = item.JOT_ID + LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = jot.ISO_ID + LEFT JOIN dbo.HJGL_BS_JointType joty ON joty.JOTY_ID = jot.JOTY_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = iso.ISO_ID + WHERE ndt.SysType='͸' AND item.States='2' AND joty.JOTY_Group='3' + and EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = iso.ISO_ID) + GROUP BY iso.ProjectId,jot.InstallationId,isoList.TestPackageDivisionId,iso.ISO_ID,iso.ISO_IsoNo,trust.CH_NDTRate) v10 + ON v10.ProjectId = v1.ProjectId AND v10.InstallationId = v1.InstallationId and v10.TestPackageDivisionId=v1.TestPackageDivisionId AND v10.ISO_ID = v1.ISO_ID AND v10.IsoNo = v1.IsoNo AND v10.CH_NDTRate = v1.CH_NDTRate + + LEFT JOIN dbo.HJGL_BS_NDTRate AS rate ON rate.NDTR_ID=v1.CH_NDTRate + + WHERE v1.IsoNo IS NOT NULL + +GO +alter table SYBData_BlindFlangeInstallationAndRemoval add TestPackageDivisionId nvarchar(50) +go +ALTER TABLE [dbo].[SYBData_BlindFlangeInstallationAndRemoval] WITH CHECK ADD CONSTRAINT [FK_SYBData_BlindFlangeInstallationAndRemoval_SYBData_TestPackageDivision] FOREIGN KEY([TestPackageDivisionId]) +REFERENCES [dbo].[SYBData_TestPackageDivision] ([TestPackageDivisionId]) +GO + +ALTER TABLE [dbo].[SYBData_BlindFlangeInstallationAndRemoval] CHECK CONSTRAINT [FK_SYBData_BlindFlangeInstallationAndRemoval_SYBData_TestPackageDivision] +GO + +alter table SYBData_SpringSupportHangBracket add TestPackageDivisionId nvarchar(50) +go + +ALTER TABLE [dbo].[SYBData_SpringSupportHangBracket] WITH CHECK ADD CONSTRAINT [FK_SYBData_SpringSupportHangBracket_SYBData_TestPackageDivision] FOREIGN KEY([TestPackageDivisionId]) +REFERENCES [dbo].[SYBData_TestPackageDivision] ([TestPackageDivisionId]) +GO + +ALTER TABLE [dbo].[SYBData_SpringSupportHangBracket] CHECK CONSTRAINT [FK_SYBData_SpringSupportHangBracket_SYBData_TestPackageDivision] +GO + +alter table SYBData_SlidingFixed add TestPackageDivisionId nvarchar(50) +go + +ALTER TABLE [dbo].[SYBData_SlidingFixed] WITH CHECK ADD CONSTRAINT [FK_SYBData_SlidingFixed_SYBData_TestPackageDivision] FOREIGN KEY([TestPackageDivisionId]) +REFERENCES [dbo].[SYBData_TestPackageDivision] ([TestPackageDivisionId]) +GO + +ALTER TABLE [dbo].[SYBData_SlidingFixed] CHECK CONSTRAINT [FK_SYBData_SlidingFixed_SYBData_TestPackageDivision] +GO + +alter table JGZL_ElectrostaticGrounding add TestPackageDivisionId nvarchar(50) +go + +ALTER TABLE [dbo].[JGZL_ElectrostaticGrounding] WITH CHECK ADD CONSTRAINT [FK_JGZL_ElectrostaticGrounding_SYBData_TestPackageDivision] FOREIGN KEY([TestPackageDivisionId]) +REFERENCES [dbo].[SYBData_TestPackageDivision] ([TestPackageDivisionId]) +GO + +ALTER TABLE [dbo].[JGZL_ElectrostaticGrounding] CHECK CONSTRAINT [FK_JGZL_ElectrostaticGrounding_SYBData_TestPackageDivision] +GO + +alter table SYBData_FinalitemList add TestPackageDivisionId nvarchar(50) +go + +ALTER TABLE [dbo].[SYBData_FinalitemList] WITH CHECK ADD CONSTRAINT [FK_SYBData_FinalitemList_SYBData_TestPackageDivision] FOREIGN KEY([TestPackageDivisionId]) +REFERENCES [dbo].[SYBData_TestPackageDivision] ([TestPackageDivisionId]) +GO + +ALTER TABLE [dbo].[SYBData_FinalitemList] CHECK CONSTRAINT [FK_SYBData_FinalitemList_SYBData_TestPackageDivision] +GO + + + + diff --git a/HJGL_DS/BLL/JGZL/ElectrostaticGroundingService.cs b/HJGL_DS/BLL/JGZL/ElectrostaticGroundingService.cs index b72933a..0677b2d 100644 --- a/HJGL_DS/BLL/JGZL/ElectrostaticGroundingService.cs +++ b/HJGL_DS/BLL/JGZL/ElectrostaticGroundingService.cs @@ -32,7 +32,10 @@ namespace BLL { return (from x in Funs.DB.JGZL_ElectrostaticGrounding where x.ProjectId == projectId select x).ToList(); } - + public static List GetElectrostaticGroundingByTestPackageDivisionId(string testPackageDivisionId) + { + return (from x in Funs.DB.JGZL_ElectrostaticGrounding where x.TestPackageDivisionId == testPackageDivisionId select x).ToList(); + } /// /// 添加 /// @@ -106,5 +109,15 @@ namespace BLL db.SubmitChanges(); } } + public static void DeleteDeleteElectrostaticGroundingByTestPackageDivisionId(string testPackageDivisionId) + { + SGGLDB db = Funs.DB; + var report = (from x in db.JGZL_ElectrostaticGrounding where x.TestPackageDivisionId == testPackageDivisionId select x).ToList(); + if (report.Count > 0) + { + db.JGZL_ElectrostaticGrounding.DeleteAllOnSubmit(report); + db.SubmitChanges(); + } + } } } diff --git a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemConfirmationRecordService.cs b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemConfirmationRecordService.cs index e2d9a39..438ff75 100644 --- a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemConfirmationRecordService.cs +++ b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemConfirmationRecordService.cs @@ -26,6 +26,11 @@ namespace BLL return Funs.DB.JGZL_PressureTestOfPipelineSystemConfirmationRecord.FirstOrDefault(e => e.ProjectId == projectId); } + public static Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord GetPressureTestOfPipelineSystemConfirmationRecordByTestPackageDivisionId(string testPackageDivisionId) + { + return Funs.DB.JGZL_PressureTestOfPipelineSystemConfirmationRecord.FirstOrDefault(e => e.TestPackageDivisionId == testPackageDivisionId); + } + /// /// 添加管道系统压力试验条件确认记录 /// @@ -108,7 +113,18 @@ namespace BLL public static void DeletePressureTestOfPipelineSystemConfirmationRecordByProjectId(string projectId) { SGGLDB db = Funs.DB; - var q = (from x in db.JGZL_PressureTestOfPipelineSystemConfirmationRecord where x.ProjectId==projectId select x).ToList(); + var q = (from x in db.JGZL_PressureTestOfPipelineSystemConfirmationRecord where x.ProjectId == projectId && x.TestPackageDivisionId == null select x).ToList(); + if (q != null) + { + db.JGZL_PressureTestOfPipelineSystemConfirmationRecord.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + + public static void DeletePressureTestOfPipelineSystemConfirmationRecordByTestPackageDivisionId(string testPackageDivisionId) + { + SGGLDB db = Funs.DB; + var q = (from x in db.JGZL_PressureTestOfPipelineSystemConfirmationRecord where x.TestPackageDivisionId == testPackageDivisionId select x).ToList(); if (q != null) { db.JGZL_PressureTestOfPipelineSystemConfirmationRecord.DeleteAllOnSubmit(q); diff --git a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs index adc7271..642da34 100644 --- a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs +++ b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs @@ -27,6 +27,11 @@ namespace BLL return Funs.DB.JGZL_PressureTestOfPipelineSystemRecord.FirstOrDefault(e => e.ProjectId == projectId); } + public static Model.JGZL_PressureTestOfPipelineSystemRecord GetPressureTestOfPipelineSystemRecordByTestPackageDivisionId(string testPackageDivisionId) + { + return Funs.DB.JGZL_PressureTestOfPipelineSystemRecord.FirstOrDefault(e => e.TestPackageDivisionId == testPackageDivisionId); + } + /// /// 添加管道系统压力试验记录 /// @@ -43,6 +48,7 @@ namespace BLL newModel.Remark = model.Remark; newModel.CompileMan = model.CompileMan; newModel.CompileDate = model.CompileDate; + newModel.TestPackageDivisionId = model.TestPackageDivisionId; db.JGZL_PressureTestOfPipelineSystemRecord.InsertOnSubmit(newModel); db.SubmitChanges(); } diff --git a/HJGL_DS/BLL/SYBData/ApplicationFormService.cs b/HJGL_DS/BLL/SYBData/ApplicationFormService.cs index 90cbb21..4e715cf 100644 --- a/HJGL_DS/BLL/SYBData/ApplicationFormService.cs +++ b/HJGL_DS/BLL/SYBData/ApplicationFormService.cs @@ -22,6 +22,16 @@ namespace BLL return Funs.DB.SYBData_ApplicationForm.FirstOrDefault(e => e.ProjectId == projectId); } + /// + /// 根据试压包id获取工艺管道试压包报审/报验申请表 + /// + /// + /// + public static Model.SYBData_ApplicationForm GetApplicationFormByTestPackageDivisionId(string testPackageDivisionId) + { + return Funs.DB.SYBData_ApplicationForm.FirstOrDefault(e => e.TestPackageDivisionId == testPackageDivisionId); + } + /// /// 添加工艺管道试压包报审/报验申请表 /// @@ -37,6 +47,7 @@ namespace BLL newApplicationForm.Contents = applicationForm.Contents; newApplicationForm.ProfessionalEngineer = applicationForm.ProfessionalEngineer; newApplicationForm.ApplicationDate = applicationForm.ApplicationDate; + newApplicationForm.TestPackageDivisionId= applicationForm.TestPackageDivisionId; db.SYBData_ApplicationForm.InsertOnSubmit(newApplicationForm); db.SubmitChanges(); } @@ -56,6 +67,7 @@ namespace BLL newApplicationForm.Contents = applicationForm.Contents; newApplicationForm.ProfessionalEngineer = applicationForm.ProfessionalEngineer; newApplicationForm.ApplicationDate = applicationForm.ApplicationDate; + newApplicationForm.TestPackageDivisionId= applicationForm.TestPackageDivisionId; db.SubmitChanges(); } } diff --git a/HJGL_DS/BLL/SYBData/BlindFlangeInstallationAndRemovalService.cs b/HJGL_DS/BLL/SYBData/BlindFlangeInstallationAndRemovalService.cs index 4a4a91e..16457fa 100644 --- a/HJGL_DS/BLL/SYBData/BlindFlangeInstallationAndRemovalService.cs +++ b/HJGL_DS/BLL/SYBData/BlindFlangeInstallationAndRemovalService.cs @@ -36,13 +36,13 @@ namespace BLL } /// - /// 根据项目Id删除管道系统试压临时盲板安装、拆除记录 + /// 根据试压包Id删除管道系统试压临时盲板安装、拆除记录 /// /// - public static void DeleteBlindFlangeInstallationAndRemovalByProjectId(string projectId) + public static void DeleteBlindFlangeInstallationAndRemovalByTestPackageDivisionId(string testPackageDivisionId) { SGGLDB db = Funs.DB; - var q = (from x in db.SYBData_BlindFlangeInstallationAndRemoval where x.ProjectId == projectId select x).ToList(); + var q = (from x in db.SYBData_BlindFlangeInstallationAndRemoval where x.TestPackageDivisionId == testPackageDivisionId select x).ToList(); if (q.Count > 0) { db.SYBData_BlindFlangeInstallationAndRemoval.DeleteAllOnSubmit(q); diff --git a/HJGL_DS/BLL/SYBData/PressureTestPackageListService.cs b/HJGL_DS/BLL/SYBData/PressureTestPackageListService.cs index 5fac18c..a337f74 100644 --- a/HJGL_DS/BLL/SYBData/PressureTestPackageListService.cs +++ b/HJGL_DS/BLL/SYBData/PressureTestPackageListService.cs @@ -22,6 +22,19 @@ namespace BLL return (from x in Funs.DB.SYBData_PressureTestPackageList where x.ProjectId == projectId select x).ToList(); } + /// + /// 根据试压包划分id获取一览表信息 + /// + /// + /// + public static List GetListsByTestPackageDivisionId(string testPackageDivisionId) + { + return (from x in Funs.DB.SYBData_PressureTestPackageList + join y in Funs.DB.SYBData_ToIsoList on x.ToIsoId equals y.ToIsoId + where x.PressureTestPackageListId == testPackageDivisionId + select x).ToList(); + } + /// /// 添加试压包一览表 /// diff --git a/HJGL_DS/BLL/SYBData/SlidingFixedService.cs b/HJGL_DS/BLL/SYBData/SlidingFixedService.cs index d300190..0db0794 100644 --- a/HJGL_DS/BLL/SYBData/SlidingFixedService.cs +++ b/HJGL_DS/BLL/SYBData/SlidingFixedService.cs @@ -17,19 +17,19 @@ namespace BLL /// /// /// - public static List GetListsByProjectId(string projectId) + public static List GetListsByTestPackageDivisionId(string testPackageDivisionId) { - return (from x in Funs.DB.SYBData_SlidingFixed where x.ProjectId == projectId select x).ToList(); + return (from x in Funs.DB.SYBData_SlidingFixed where x.TestPackageDivisionId == testPackageDivisionId select x).ToList(); } /// /// 根据项目id删除滑动/固定管托安装检验记录 /// /// - public static void DeleteSlidingFixedByProjectId(string projectId) + public static void DeleteSlidingFixedByTestPackageDivisionId(string testPackageDivisionId) { SGGLDB db = Funs.DB; - var q = (from x in db.SYBData_SlidingFixed where x.ProjectId == projectId select x).ToList(); + var q = (from x in db.SYBData_SlidingFixed where x.TestPackageDivisionId == testPackageDivisionId select x).ToList(); if (q.Count > 0) { db.SYBData_SlidingFixed.DeleteAllOnSubmit(q); diff --git a/HJGL_DS/BLL/SYBData/SpringSupportHangBracketService.cs b/HJGL_DS/BLL/SYBData/SpringSupportHangBracketService.cs index f6a9c51..29e980e 100644 --- a/HJGL_DS/BLL/SYBData/SpringSupportHangBracketService.cs +++ b/HJGL_DS/BLL/SYBData/SpringSupportHangBracketService.cs @@ -17,9 +17,9 @@ namespace BLL /// /// /// - public static List GetListByProjectId(string projectId) + public static List GetListByTestPackageDivisionId(string testPackageDivisionId) { - return (from x in Funs.DB.SYBData_SpringSupportHangBracket where x.ProjectId == projectId select x).ToList(); + return (from x in Funs.DB.SYBData_SpringSupportHangBracket where x.TestPackageDivisionId == testPackageDivisionId select x).ToList(); } /// @@ -49,10 +49,10 @@ namespace BLL /// 根据项目Id删除弹簧支/吊架安装检验记录 /// /// - public static void DeleteSpringSupportHangBracketByProjectId(string projectId) + public static void DeleteSpringSupportHangBracketByTestPackageDivisionId(string testPackageDivisionId) { SGGLDB db = Funs.DB; - var q = (from x in db.SYBData_SpringSupportHangBracket where x.ProjectId == projectId select x).ToList(); + var q = (from x in db.SYBData_SpringSupportHangBracket where x.TestPackageDivisionId == testPackageDivisionId select x).ToList(); if (q.Count > 0) { db.SYBData_SpringSupportHangBracket.DeleteAllOnSubmit(q); diff --git a/HJGL_DS/BLL/SYBData/ToIsoListService.cs b/HJGL_DS/BLL/SYBData/ToIsoListService.cs index 06621ec..a94a49c 100644 --- a/HJGL_DS/BLL/SYBData/ToIsoListService.cs +++ b/HJGL_DS/BLL/SYBData/ToIsoListService.cs @@ -12,6 +12,30 @@ namespace BLL /// public class ToIsoListService { + /// + /// 根据试压包id获取试压包管线信息 + /// + /// + /// + public static List GetToIsoListByTestPackageDivisionId(string testPackageDivisionId) + { + return (from x in Funs.DB.SYBData_ToIsoList where x.TestPackageDivisionId == testPackageDivisionId select x).ToList(); + } + + /// + /// 根据试压包划分id获取管线信息 + /// + /// + /// + public static List GetIsoInfoByTestPackageDivisionId(string testPackageDivisionId) + { + return (from x in Funs.DB.HJGL_PW_IsoInfo + join y in Funs.DB.SYBData_ToIsoList on x.ISO_ID equals y.ISO_ID + where y.TestPackageDivisionId == testPackageDivisionId + select x).ToList(); + } + + /// /// 增加试压包管线列表 /// diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj index 573455b..555f340 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj @@ -1597,14 +1597,20 @@ + + + + + + @@ -7685,6 +7691,13 @@ WelderTrain.aspx + + ElectrostaticGrounding.aspx + ASPXCodeBehind + + + ElectrostaticGrounding.aspx + FinalitemList.aspx ASPXCodeBehind @@ -7699,6 +7712,27 @@ HeatTreatmentReport.aspx + + PipeWeldingWorkRecord.aspx + ASPXCodeBehind + + + PipeWeldingWorkRecord.aspx + + + PressureTestOfPipelineSystemConfirmationRecord.aspx + ASPXCodeBehind + + + PressureTestOfPipelineSystemConfirmationRecord.aspx + + + PressureTestOfPipelineSystemRecord.aspx + ASPXCodeBehind + + + PressureTestOfPipelineSystemRecord.aspx + PressureTestPackageList.aspx ASPXCodeBehind @@ -7741,6 +7775,20 @@ TestPackageDivision.aspx + + TestQuantityStatistics.aspx + ASPXCodeBehind + + + TestQuantityStatistics.aspx + + + TestResultsSummary.aspx + ASPXCodeBehind + + + TestResultsSummary.aspx + WebService1.asmx Component diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user index e3436b8..6e29203 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ true - Release|Any CPU + Debug|Any CPU diff --git a/HJGL_DS/FineUIPro.Web/SYBData/ApplicationForm.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/ApplicationForm.aspx.cs index ea08588..2d2aa34 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/ApplicationForm.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/SYBData/ApplicationForm.aspx.cs @@ -39,6 +39,21 @@ namespace FineUIPro.Web.SYBData ViewState["ProjectId"] = value; } } + + /// + /// 试压包划分id + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } #endregion #region 加载页面 @@ -59,9 +74,9 @@ namespace FineUIPro.Web.SYBData this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.ProjectId = this.tvControlItem.SelectedNodeID; - DataInfo(); + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.ProjectId = this.tvControlItem.SelectedNodeID; + //DataInfo(); } } @@ -74,9 +89,9 @@ namespace FineUIPro.Web.SYBData this.txtProfessionalEngineer.Text = string.Empty; this.txtApplicationDate.Text = string.Empty; - if (!string.IsNullOrEmpty(this.ProjectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - var data = BLL.ApplicationFormService.GetApplicationFormByProjectId(this.ProjectId); + var data = BLL.ApplicationFormService.GetApplicationFormByTestPackageDivisionId(this.TestPackageDivisionId); if (data != null) { this.ApplicationFormId = data.ApplicationFormId; @@ -125,6 +140,19 @@ namespace FineUIPro.Web.SYBData rootProjectNode.ToolTip = item.ProjectName; rootProjectNode.CommandName = "项目名称"; rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } } } #endregion @@ -139,8 +167,16 @@ namespace FineUIPro.Web.SYBData { if (this.tvControlItem.SelectedNodeID != "0") { - this.ProjectId = this.tvControlItem.SelectedNodeID; - DataInfo(); + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + DataInfo(); + } } } #endregion @@ -155,7 +191,7 @@ namespace FineUIPro.Web.SYBData { this.ProjectId = this.drpProjectId.SelectedValue; this.InitTreeMenu(); - this.tvControlItem.SelectedNodeID = this.ProjectId; + //this.tvControlItem.SelectedNodeID = this.ProjectId; } #endregion @@ -164,6 +200,11 @@ namespace FineUIPro.Web.SYBData { if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.SYBData_ApplicationFormMenuId, Const.BtnSave)) { + if (string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); + return; + } Model.SYBData_ApplicationForm newData = new Model.SYBData_ApplicationForm(); newData.ProjectId = this.ProjectId; newData.ApplicationFormCode = this.txtApplicationFormCode.Text.Trim(); @@ -171,6 +212,7 @@ namespace FineUIPro.Web.SYBData newData.Contents = this.txtContents.Text.Trim(); newData.ProfessionalEngineer = this.txtProfessionalEngineer.Text.Trim(); newData.ApplicationDate = Funs.GetNewDateTime(this.txtApplicationDate.Text); + newData.TestPackageDivisionId = this.TestPackageDivisionId; if (!string.IsNullOrEmpty(this.ApplicationFormId)) { newData.ApplicationFormId = this.ApplicationFormId; @@ -202,7 +244,7 @@ namespace FineUIPro.Web.SYBData /// protected void btnPrint_Click(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(this.ProjectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { string initTemplatePath = ""; string rootPath = Server.MapPath("~/"); @@ -236,7 +278,7 @@ namespace FineUIPro.Web.SYBData } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); return; } } diff --git a/HJGL_DS/FineUIPro.Web/SYBData/BlindFlangeInstallationAndRemoval.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/BlindFlangeInstallationAndRemoval.aspx.cs index 99ea260..b9276dd 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/BlindFlangeInstallationAndRemoval.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/SYBData/BlindFlangeInstallationAndRemoval.aspx.cs @@ -15,6 +15,53 @@ namespace FineUIPro.Web.SYBData { public partial class BlindFlangeInstallationAndRemoval : PageBase { + #region 定义项 + /// + /// 主键 + /// + private string CoverId + { + get + { + return (string)ViewState["CoverId"]; + } + set + { + ViewState["CoverId"] = value; + } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 试压包号 + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + #endregion + #region 加载页面 /// /// 加载页面 @@ -35,8 +82,8 @@ namespace FineUIPro.Web.SYBData this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.BindGrid(); + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.BindGrid(); } } #endregion @@ -70,6 +117,19 @@ namespace FineUIPro.Web.SYBData rootProjectNode.ToolTip = item.ProjectName; rootProjectNode.CommandName = "项目名称"; rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } } } #endregion @@ -84,7 +144,16 @@ namespace FineUIPro.Web.SYBData { if (this.tvControlItem.SelectedNodeID != "0") { - this.BindGrid(); + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.BindGrid(); + } } } #endregion @@ -96,13 +165,13 @@ namespace FineUIPro.Web.SYBData private void BindGrid() { this.txtIndividualProject.Text = string.Empty; - string projectId = this.tvControlItem.SelectedNodeID; + //string projectId = this.tvControlItem.SelectedNodeID; string strSql = @"SELECT * from SYBData_BlindFlangeInstallationAndRemoval where 1=1"; List listStr = new List(); - if (!string.IsNullOrEmpty(projectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - strSql += " AND ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", projectId)); + strSql += " AND TestPackageDivisionId = @testPackageDivisionId"; + listStr.Add(new SqlParameter("@testPackageDivisionId", TestPackageDivisionId)); } //if (!string.IsNullOrEmpty(this.txtPipeSectionNumberS.Text)) //{ @@ -204,9 +273,9 @@ namespace FineUIPro.Web.SYBData /// protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; this.InitTreeMenu(); - BindGrid(); + //BindGrid(); } /// @@ -228,16 +297,15 @@ namespace FineUIPro.Web.SYBData /// protected void btnPrint_Click(object sender, EventArgs e) { - string projectId = this.tvControlItem.SelectedNodeID; - if (projectId != null) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { string initTemplatePath = ""; string rootPath = Server.MapPath("~/"); BLL.Common.FastReportService.ResetData(); - string strSql = @"SELECT * from SYBData_BlindFlangeInstallationAndRemoval where ProjectId = @ProjectId"; + string strSql = @"SELECT * from SYBData_BlindFlangeInstallationAndRemoval where TestPackageDivisionId = @TestPackageDivisionId"; List listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", projectId)); + listStr.Add(new SqlParameter("@TestPackageDivisionId", this.TestPackageDivisionId)); //if (!string.IsNullOrEmpty(this.txtPipeSectionNumberS.Text)) //{ // strSql += " and PipeSectionNumber like @PipeSectionNumber"; @@ -298,7 +366,7 @@ namespace FineUIPro.Web.SYBData } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); return; } } @@ -312,9 +380,7 @@ namespace FineUIPro.Web.SYBData /// protected void btnAdd_Click(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { JArray teamGroupData = Grid1.GetMergedData(); List list = new List(); @@ -327,7 +393,8 @@ namespace FineUIPro.Web.SYBData JObject defaultObj = new JObject { { "BlindFlangeInstallationAndRemovalId", Guid.NewGuid() }, - { "ProjectId", this.tvControlItem.SelectedNodeID }, + { "ProjectId", this.ProjectId }, + { "TestPackageDivisionId", this.TestPackageDivisionId }, { "PipeSectionNumber", "" }, { "BlindPlateNumber", "" }, { "Installer", "" }, @@ -348,10 +415,9 @@ namespace FineUIPro.Web.SYBData } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); return; } - } } protected void Grid1_PreDataBound(object sender, EventArgs e) @@ -392,7 +458,7 @@ namespace FineUIPro.Web.SYBData void saveItem() { - BLL.BlindFlangeInstallationAndRemovalService.DeleteBlindFlangeInstallationAndRemovalByProjectId(this.tvControlItem.SelectedNodeID); + BLL.BlindFlangeInstallationAndRemovalService.DeleteBlindFlangeInstallationAndRemovalByTestPackageDivisionId(this.TestPackageDivisionId); List detailLists = new List(); JArray teamGroupData = Grid1.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -402,7 +468,8 @@ namespace FineUIPro.Web.SYBData Model.SYBData_BlindFlangeInstallationAndRemoval newDetail = new Model.SYBData_BlindFlangeInstallationAndRemoval { BlindFlangeInstallationAndRemovalId = values.Value("BlindFlangeInstallationAndRemovalId"), - ProjectId = this.tvControlItem.SelectedNodeID, + ProjectId = this.ProjectId, + TestPackageDivisionId = this.TestPackageDivisionId, IndividualProject = txtIndividualProject.Text.Trim(), PipeSectionNumber = values.Value("PipeSectionNumber"), BlindPlateNumber = values.Value("BlindPlateNumber"), diff --git a/HJGL_DS/FineUIPro.Web/SYBData/ElectrostaticGrounding.aspx b/HJGL_DS/FineUIPro.Web/SYBData/ElectrostaticGrounding.aspx new file mode 100644 index 0000000..c2a1a56 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/ElectrostaticGrounding.aspx @@ -0,0 +1,156 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ElectrostaticGrounding.aspx.cs" Inherits="FineUIPro.Web.SYBData.ElectrostaticGrounding" %> + + + + + + + 管道静电接地测试记录 + + +
+ + + + + + + + + + + + + + + + + + + + + + <%-- + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + diff --git a/HJGL_DS/FineUIPro.Web/SYBData/ElectrostaticGrounding.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/ElectrostaticGrounding.aspx.cs new file mode 100644 index 0000000..51ce3f0 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/ElectrostaticGrounding.aspx.cs @@ -0,0 +1,612 @@ +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.SYBData +{ + public partial class ElectrostaticGrounding : PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string ElectrostaticGroundingId + { + get + { + return (string)ViewState["ElectrostaticGroundingId"]; + } + set + { + ViewState["ElectrostaticGroundingId"] = value; + } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 试压包划分id + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List items = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + + this.drpProjectId.DataTextField = "ProjectCode"; + this.drpProjectId.DataValueField = "ProjectId"; + this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + this.drpProjectId.DataBind(); + Funs.FineUIPleaseSelect(this.drpProjectId); + + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + this.InitTreeMenu();//加载树 + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.ProjectId = this.tvControlItem.SelectedNodeID; + + ////管线 + //this.drpIsoId.DataTextField = "ISO_IsoNo"; + //this.drpIsoId.DataValueField = "ISO_IsoNo"; + //this.drpIsoId.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + //this.drpIsoId.DataBind(); + + //PageInfo(); + } + } + + private void PageInfo() + { + items.Clear(); + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + var reportLists = BLL.ElectrostaticGroundingService.GetElectrostaticGroundingByTestPackageDivisionId(this.TestPackageDivisionId); + if (reportLists.Count > 0) + { + var isoLists = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + foreach (var item in isoLists) + { + var iso = (from x in Funs.DB.JGZL_ElectrostaticGrounding where x.TestPackageDivisionId == this.TestPackageDivisionId && x.PipelineCode == item.ISO_IsoNo select x).FirstOrDefault(); + if (iso == null) + { + Model.JGZL_ElectrostaticGrounding newReport = new Model.JGZL_ElectrostaticGrounding(); + newReport.ElectrostaticGroundingId = SQLHelper.GetNewID(); + newReport.ProjectId = this.ProjectId; + newReport.TestPackageDivisionId = this.TestPackageDivisionId; + newReport.PipelineCode = item.ISO_IsoNo; + reportLists.Add(newReport); + } + } + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) + { + reportLists = reportLists.Where(x => x.PipelineCode.Contains(this.drpIsoId.SelectedValue)).ToList(); + } + this.Grid1.DataSource = reportLists; + this.Grid1.DataBind(); + } + else + { + var isoLists = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + foreach (var iso in isoLists) + { + Model.JGZL_ElectrostaticGrounding newReport = new Model.JGZL_ElectrostaticGrounding(); + newReport.ElectrostaticGroundingId = SQLHelper.GetNewID(); + newReport.ProjectId = this.ProjectId; + newReport.TestPackageDivisionId = this.TestPackageDivisionId; + newReport.PipelineCode = iso.ISO_IsoNo; + items.Add(newReport); + } + + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) + { + items = items.Where(x => x.PipelineCode.Contains(this.drpIsoId.SelectedValue)).ToList(); + } + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + } + } + #endregion + + #region 加载树项目 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "项目"; + rootNode.ToolTip = "项目"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode); + + List projects = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + if (this.drpProjectId.SelectedValue != BLL.Const._Null) + { + projects = projects.Where(e => e.ProjectId == this.drpProjectId.SelectedValue).ToList(); + } + foreach (var item in projects) + { + TreeNode rootProjectNode = new TreeNode();//定义根节点 + rootProjectNode.Text = item.ProjectCode; + rootProjectNode.NodeID = item.ProjectId; + rootProjectNode.EnableClickEvent = true; + rootProjectNode.Expanded = true; + rootProjectNode.ToolTip = item.ProjectName; + rootProjectNode.CommandName = "项目名称"; + rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } + } + } + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (this.tvControlItem.SelectedNodeID != "0") + { + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + this.TestPackageDivisionId = string.Empty; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + + //管线 + this.drpIsoId.DataTextField = "ISO_IsoNo"; + this.drpIsoId.DataValueField = "ISO_IsoNo"; + this.drpIsoId.DataSource = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + this.drpIsoId.DataBind(); + + PageInfo(); + } + //this.ProjectId = this.tvControlItem.SelectedNodeID; + //PageInfo(); + //this.BindGrid(); + } + } + #endregion + + #region 数据绑定 + /// + /// 数据绑定 + /// + //private void BindGrid() + //{ + // //string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1"); + // string strSql = @"select g.ElectrostaticGroundingId, + // g.ProjectId, + // g.PipelineCode, + // g.ConnectionType, + // g.BWSpecification, + // g.BWMaterial, + // g.BWResistance, + // g.GWSpecification, + // g.GWMaterial, + // g.GWResistance, + // g.CompileMan, + // g.CompileDate, + // u.UserName as CompileManName + // from JGZL_ElectrostaticGrounding g + // left join Sys_User u on u.UserId=g.CompileMan where 1=1"; + // List listStr = new List(); + // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + // { + // strSql += " AND g.ProjectId = @ProjectId"; + // listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); + // } + // //if (!string.IsNullOrEmpty(this.txtStartDate.Text)) + // //{ + // // strSql += " AND g.CompileDate >=@satartDate"; + // // listStr.Add(new SqlParameter("@satartDate", Funs.GetNewDateTime(this.txtStartDate.Text))); + // //} + // //if (!string.IsNullOrEmpty(this.txtEndDate.Text)) + // //{ + // // strSql += " AND g.CompileDate <=@endDate"; + // // listStr.Add(new SqlParameter("@endDate", Funs.GetNewDateTime(this.txtEndDate.Text))); + // //} + // //else + // //{ + // // strSql += " AND CHARINDEX(ProjectId,@ProjectId)>0 "; + // // listStr.Add(new SqlParameter("@ProjectId", projectIds)); + // //} + // SqlParameter[] parameter = listStr.ToArray(); + // DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + // // 2.获取当前分页数据 + // Grid1.RecordCount = tb.Rows.Count; + // //tb = GetFilteredTable(Grid1.FilteredData, tb); + // var table = this.GetPagedDataTable(Grid1, tb); + // Grid1.DataSource = table; + // Grid1.DataBind(); + //} + #endregion + + #region 分页排序 + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + //BindGrid(); + PageInfo(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + //BindGrid(); + PageInfo(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + //BindGrid(); + PageInfo(); + } + #endregion + #endregion + + #region 查询 + /// + ///查询 + /// + /// + /// + protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) + { + //this.ProjectId = this.drpProjectId.SelectedValue; + this.InitTreeMenu(); + //this.tvControlItem.SelectedNodeID = this.ProjectId; + //PageInfo(); + //BindGrid(); + } + + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + //this.BindGrid(); + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + //string projectId = this.tvControlItem.SelectedNodeID; + + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + string strSql = @"select g.ElectrostaticGroundingId, + g.ProjectId, + g.PipelineCode, + g.ConnectionType, + g.BWSpecification, + g.BWMaterial, + g.BWResistance, + g.GWSpecification, + g.GWMaterial, + g.GWResistance, + g.CompileMan, + g.CompileDate, + u.UserName as CompileManName + from JGZL_ElectrostaticGrounding g + left join Sys_User u on u.UserId=g.CompileMan where g.TestPackageDivisionId = @TestPackageDivisionId"; + List listStr = new List(); + listStr.Add(new SqlParameter("@TestPackageDivisionId", this.TestPackageDivisionId)); + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue)) + { + strSql += " and g.PipelineCode like @isoNo"; + listStr.Add(new SqlParameter("@isoNo", "%" + this.drpIsoId.SelectedValue + "%")); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + if (tb.Rows.Count > 0) + { + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("PipelineCode"); + dt.Columns.Add("ConnectionType"); + dt.Columns.Add("BWSpecification"); + dt.Columns.Add("BWMaterial"); + dt.Columns.Add("BWResistance"); + dt.Columns.Add("GWSpecification"); + dt.Columns.Add("GWMaterial"); + dt.Columns.Add("GWResistance"); + + tb.DefaultView.Sort = "PipelineCode ASC"; + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRow = dt.NewRow(); + newRow["PipelineCode"] = row["PipelineCode"].ToString(); + newRow["ConnectionType"] = row["ConnectionType"].ToString(); + newRow["BWSpecification"] = row["BWSpecification"].ToString(); + newRow["BWMaterial"] = row["BWMaterial"].ToString(); + newRow["BWResistance"] = row["BWResistance"].ToString(); + newRow["GWSpecification"] = row["GWSpecification"].ToString(); + newRow["GWMaterial"] = row["GWMaterial"].ToString(); + newRow["GWResistance"] = row["GWResistance"].ToString(); + dt.Rows.Add(newRow); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); + keyValuePairs.Add("CompileMan", tb.Rows[0]["CompileManName"].ToString()); + if (!string.IsNullOrEmpty(tb.Rows[0]["CompileDate"].ToString())) + { + string compileDate = string.Format("{0:yyyy年MM月dd日}", tb.Rows[0]["CompileDate"]); + keyValuePairs.Add("CompileDate", compileDate); + } + 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))); + } + } + else + { + Alert.ShowInTop("无打印数据!", MessageBoxIcon.Warning); + return; + } + } + else + { + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 维护 + /// + /// 增加 + /// + /// + /// + protected void btnAdd_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + 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 + { + { "ElectrostaticGroundingId", Guid.NewGuid() }, + { "ProjectId", this.ProjectId }, + { "TestPackageDivisionId", this.TestPackageDivisionId }, + { "PipelineCode", "" }, + { "ConnectionType", "" }, + { "BWSpecification", "" }, + { "BWMaterial", "" }, + { "BWResistance", "" }, + { "GWSpecification", "" }, + { "GWMaterial", "" }, + { "GWResistance", "" }, + { + "Delete3", + String.Format("", + GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) + } + }; + list.Add(defaultObj); + Grid1.DataSource = list; + Grid1.DataBind(); + + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TeamWeldingInspectionEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); + } + else + { + Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + return; + } + } + + protected void Grid1_PreDataBound(object sender, EventArgs e) + { + // 设置LinkButtonField的点击客户端事件 + LinkButtonField deleteField = Grid1.FindColumn("Delete3") as LinkButtonField; + deleteField.OnClientClick = GetDeleteScriptGrid1(); + } + + /// + /// 删除提示 + /// + /// + private string GetDeleteScriptGrid1() + { + return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, + Grid1.GetDeleteSelectedRowsReference(), String.Empty); + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void Text_TextChanged(object sender, EventArgs e) + { + //DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text); + //DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text); + //if (startDate != null && endDate != null && startDate > endDate) + //{ + // Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning); + // return; + //} + //else + //{ + // BindGrid(); + //} + } + #endregion + + #region 提交按钮 + /// + /// 提交按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ElectrostaticGroundingMenuId, Const.BtnSave)) + { + items.Clear(); + BLL.ElectrostaticGroundingService.DeleteDeleteElectrostaticGroundingByTestPackageDivisionId(this.TestPackageDivisionId); + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + Model.JGZL_ElectrostaticGrounding newDetail = new Model.JGZL_ElectrostaticGrounding + { + ElectrostaticGroundingId = values.Value("ElectrostaticGroundingId"), + ProjectId = this.ProjectId, + TestPackageDivisionId = this.TestPackageDivisionId, + PipelineCode = values.Value("PipelineCode"), + ConnectionType = values.Value("ConnectionType"), + BWSpecification = values.Value("BWSpecification"), + BWMaterial = values.Value("BWMaterial"), + BWResistance = Funs.GetNewDecimal(values.Value("BWResistance")), + GWSpecification = values.Value("GWSpecification"), + GWMaterial = values.Value("GWMaterial"), + GWResistance = Funs.GetNewDecimal(values.Value("GWResistance")), + CompileMan = this.CurrUser.UserId, + CompileDate = DateTime.Now + }; + items.Add(newDetail); + } + try + { + if (items.Count > 0) + { + Funs.DB.JGZL_ElectrostaticGrounding.InsertAllOnSubmit(items); + } + Funs.DB.SubmitChanges(); + } + catch (Exception) + { + return; + } + ShowNotify("保存成功!", MessageBoxIcon.Success); + //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + protected void drpIsoId_SelectedIndexChanged(object sender, EventArgs e) + { + PageInfo(); + } + } +} \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/SYBData/ElectrostaticGrounding.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/SYBData/ElectrostaticGrounding.aspx.designer.cs new file mode 100644 index 0000000..150743c --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/ElectrostaticGrounding.aspx.designer.cs @@ -0,0 +1,260 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.SYBData +{ + + + public partial class ElectrostaticGrounding + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpProjectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProjectId; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpIsoId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpIsoId; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAdd; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// txtPipelineCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipelineCode; + + /// + /// txtConnectionType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtConnectionType; + + /// + /// txtBWSpecification 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBWSpecification; + + /// + /// txtBWMaterial 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBWMaterial; + + /// + /// txtBWResistance 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBWResistance; + + /// + /// txtGWSpecification 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtGWSpecification; + + /// + /// txtGWMaterial 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtGWMaterial; + + /// + /// txtGWResistance 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtGWResistance; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// WindowPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowPrint; + } +} diff --git a/HJGL_DS/FineUIPro.Web/SYBData/FinalitemList.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/FinalitemList.aspx.cs index 140b2f2..e23a84f 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/FinalitemList.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/SYBData/FinalitemList.aspx.cs @@ -12,6 +12,38 @@ namespace FineUIPro.Web.SYBData { public partial class FinalitemList : PageBase { + #region 定义项 + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 试压包号 + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + #endregion + #region 加载页面 /// /// 加载页面 @@ -32,8 +64,8 @@ namespace FineUIPro.Web.SYBData this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.BindGrid(); + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.BindGrid(); } } #endregion @@ -67,6 +99,19 @@ namespace FineUIPro.Web.SYBData rootProjectNode.ToolTip = item.ProjectName; rootProjectNode.CommandName = "项目名称"; rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } } } #endregion @@ -81,7 +126,17 @@ namespace FineUIPro.Web.SYBData { if (this.tvControlItem.SelectedNodeID != "0") { - this.BindGrid(); + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + this.TestPackageDivisionId = string.Empty; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.BindGrid(); + } } } #endregion @@ -93,13 +148,12 @@ namespace FineUIPro.Web.SYBData private void BindGrid() { this.txtIndividualProject.Text = string.Empty; - string projectId = this.tvControlItem.SelectedNodeID; string strSql = @"SELECT * from SYBData_FinalitemList where 1=1"; List listStr = new List(); - if (!string.IsNullOrEmpty(projectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - strSql += " AND ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", projectId)); + strSql += " AND TestPackageDivisionId = @TestPackageDivisionId"; + listStr.Add(new SqlParameter("@TestPackageDivisionId", this.TestPackageDivisionId)); } //if (!string.IsNullOrEmpty(this.txtPipeSectionNumberS.Text)) //{ @@ -201,9 +255,9 @@ namespace FineUIPro.Web.SYBData /// protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; this.InitTreeMenu(); - BindGrid(); + //BindGrid(); } /// @@ -225,16 +279,15 @@ namespace FineUIPro.Web.SYBData /// protected void btnPrint_Click(object sender, EventArgs e) { - string projectId = this.tvControlItem.SelectedNodeID; - if (projectId != null) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { string initTemplatePath = ""; string rootPath = Server.MapPath("~/"); BLL.Common.FastReportService.ResetData(); - string strSql = @"SELECT * from SYBData_FinalitemList where ProjectId = @ProjectId"; + string strSql = @"SELECT * from SYBData_FinalitemList where TestPackageDivisionId = @testPackageDivisionId"; List listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", projectId)); + listStr.Add(new SqlParameter("@testPackageDivisionId", this.TestPackageDivisionId)); //if (!string.IsNullOrEmpty(this.txtPipeSectionNumberS.Text)) //{ // strSql += " and PipeSectionNumber like @PipeSectionNumber"; @@ -303,22 +356,21 @@ namespace FineUIPro.Web.SYBData /// protected void btnAdd_Click(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + JArray teamGroupData = Grid1.GetMergedData(); + List list = new List(); + foreach (JObject teamGroupRow in teamGroupData) { - JArray teamGroupData = Grid1.GetMergedData(); - List list = new List(); - foreach (JObject teamGroupRow in teamGroupData) - { - JObject values = teamGroupRow.Value("values"); - list.Add(values); - } + JObject values = teamGroupRow.Value("values"); + list.Add(values); + } - JObject defaultObj = new JObject + JObject defaultObj = new JObject { { "FinalitemListId", Guid.NewGuid() }, - { "ProjectId", this.tvControlItem.SelectedNodeID }, + { "ProjectId", this.ProjectId }, + { "TestPackageDivisionId", this.TestPackageDivisionId }, { "PipeSectionCode", "" }, { "FinalItemContent", "" }, { "SD_ConUnit", "" }, @@ -330,15 +382,14 @@ namespace FineUIPro.Web.SYBData GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) } }; - list.Add(defaultObj); - Grid1.DataSource = list; - Grid1.DataBind(); - } - else - { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; - } + list.Add(defaultObj); + Grid1.DataSource = list; + Grid1.DataBind(); + } + else + { + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); + return; } } @@ -380,7 +431,7 @@ namespace FineUIPro.Web.SYBData void saveItem() { //FinalitemListService.DeleteFinalItemListByProjectId(this.tvControlItem.SelectedNodeID); - var q = (from x in Funs.DB.SYBData_FinalitemList where x.ProjectId == this.tvControlItem.SelectedNodeID select x).ToList(); + var q = (from x in Funs.DB.SYBData_FinalitemList where x.TestPackageDivisionId == this.TestPackageDivisionId select x).ToList(); if (q.Count > 0) { Funs.DB.SYBData_FinalitemList.DeleteAllOnSubmit(q); @@ -395,7 +446,8 @@ namespace FineUIPro.Web.SYBData Model.SYBData_FinalitemList newDetail = new Model.SYBData_FinalitemList { FinalitemListId = values.Value("FinalitemListId"), - ProjectId = this.tvControlItem.SelectedNodeID, + ProjectId = this.ProjectId, + TestPackageDivisionId=this.TestPackageDivisionId, IndividualProject = txtIndividualProject.Text.Trim(), PipeSectionCode = values.Value("PipeSectionCode"), FinalItemContent = values.Value("FinalItemContent"), diff --git a/HJGL_DS/FineUIPro.Web/SYBData/HeatTreatmentReport.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/HeatTreatmentReport.aspx.cs index 730bbd8..460a68b 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/HeatTreatmentReport.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/SYBData/HeatTreatmentReport.aspx.cs @@ -15,6 +15,38 @@ namespace FineUIPro.Web.SYBData { public partial class HeatTreatmentReport :PageBase { + #region 定义项 + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 试压包号 + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + #endregion + #region 加载页面 /// /// 加载页面 @@ -27,7 +59,7 @@ namespace FineUIPro.Web.SYBData { this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); - this.drpIsoNo.SelectedValue = BLL.Const._Null; + //this.drpIsoNo.SelectedValue = BLL.Const._Null; this.drpProjectId.DataTextField = "ProjectCode"; this.drpProjectId.DataValueField = "ProjectId"; this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); @@ -35,14 +67,14 @@ namespace FineUIPro.Web.SYBData Funs.FineUIPleaseSelect(this.drpProjectId); this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.drpIsoNo.DataTextField = "ISO_IsoNo"; - this.drpIsoNo.DataValueField = "ISO_ID"; - this.drpIsoNo.DataSource = from x in Funs.DB.HJGL_PW_IsoInfo where x.ProjectId == this.CurrUser.LoginProjectId select x; - this.drpIsoNo.DataBind(); - Funs.FineUIPleaseSelect(this.drpIsoNo); - BindGrid(); + //this.drpIsoNo.DataTextField = "ISO_IsoNo"; + //this.drpIsoNo.DataValueField = "ISO_ID"; + //this.drpIsoNo.DataSource = from x in Funs.DB.HJGL_PW_IsoInfo where x.ProjectId == this.CurrUser.LoginProjectId select x; + //this.drpIsoNo.DataBind(); + //Funs.FineUIPleaseSelect(this.drpIsoNo); + //BindGrid(); } } #endregion @@ -76,6 +108,19 @@ namespace FineUIPro.Web.SYBData rootUnitNode.CommandName = "项目名称"; rootUnitNode.EnableClickEvent = true; rootNode.Nodes.Add(rootUnitNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootUnitNode.Nodes.Add(newNode); + } } } #endregion @@ -88,13 +133,34 @@ namespace FineUIPro.Web.SYBData /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { - string projectId = tvControlItem.SelectedNodeID; - this.drpIsoNo.Items.Clear(); - this.drpIsoNo.DataSource = from x in Funs.DB.HJGL_PW_IsoInfo where x.ProjectId == projectId select x; - this.drpIsoNo.DataBind(); - Funs.FineUIPleaseSelect(this.drpIsoNo); - this.drpIsoNo.SelectedValue = BLL.Const._Null; - this.BindGrid(); + if (this.tvControlItem.SelectedNodeID != "0") + { + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + + this.drpIsoNo.Items.Clear(); + this.drpIsoNo.DataTextField = "ISO_IsoNo"; + this.drpIsoNo.DataValueField = "ISO_ID"; + this.drpIsoNo.DataSource = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + this.drpIsoNo.DataBind(); + this.drpIsoNo.SelectedIndex = 0; + + this.BindGrid(); + } + } + //string projectId = tvControlItem.SelectedNodeID; + //this.drpIsoNo.Items.Clear(); + //this.drpIsoNo.DataSource = from x in Funs.DB.HJGL_PW_IsoInfo where x.ProjectId == projectId select x; + //this.drpIsoNo.DataBind(); + //Funs.FineUIPleaseSelect(this.drpIsoNo); + //this.drpIsoNo.SelectedValue = BLL.Const._Null; + //this.BindGrid(); } #endregion @@ -102,7 +168,7 @@ namespace FineUIPro.Web.SYBData protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { this.InitTreeMenu(); - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; } /// @@ -112,10 +178,10 @@ namespace FineUIPro.Web.SYBData { string strSql = string.Empty; List listStr = new List(); - string projectId = this.tvControlItem.SelectedNodeID; - if (!string.IsNullOrEmpty(projectId)) + //string projectId = this.tvControlItem.SelectedNodeID; + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - strSql = @"SELECT JointInfo.ProjectId,JointInfo.JOT_ID,Project.ProjectCode,HotProessItem.PrintDate,Sort1,Sort2,Sort3,Sort4,Sort5, + strSql = @"SELECT JointInfo.ProjectId,isoList.TestPackageDivisionId,JointInfo.JOT_ID,Project.ProjectCode,HotProessItem.PrintDate,Sort1,Sort2,Sort3,Sort4,Sort5, JointInfo.JOT_ID+'1' as JOT_ID1, JointInfo.JOT_ID+'2' as JOT_ID2,JointInfo.JOT_ID+'3' as JOT_ID3,JointInfo.JOT_ID+'4' as JOT_ID4, (CASE WHEN v.RepairMark IS NOT NULL THEN (JointInfo.JOT_JointNo+v.RepairMark) ELSE JointInfo.JOT_JointNo END )+isnull((select Top 1 HardRepairMark from dbo.HJGL_CH_HotProessTrustItem a where a.JOT_ID=HotProessItem.JOT_ID and a.HotProessTrustId=HotProessItem.HotProessTrustId and a.ProessTypes=HotProessItem.ProessTypes),'') AS JOT_JointNo,IsoInfo.ISO_IsoNo,IsoInfo.ISO_ID, @@ -139,14 +205,17 @@ namespace FineUIPro.Web.SYBData LEFT JOIN dbo.Project_WorkArea AS WorkArea ON IsoInfo.BAW_ID = WorkArea.WorkAreaId LEFT JOIN dbo.HJGL_BS_Steel AS Steel ON JointInfo.STE_ID = Steel.STE_ID LEFT JOIN dbo.HJGL_BS_Steel AS Steel2 ON JointInfo.STE_ID2 = Steel2.STE_ID + left join SYBData_ToIsoList isoList on isoList.ISO_ID = IsoInfo.ISO_ID left join (select record.RepairMark,record.JOT_ID,h.HotProessItemId from dbo.HJGL_CH_HotProessTrustItem AS TrustItem left join dbo.HJGL_CH_RepairItemRecord AS record ON record.RepairItemRecordId=TrustItem.TrustItemID left join dbo.HJGL_HotProessItem h on h.JOT_ID=TrustItem.JOT_ID where h.JOT_ID = TrustItem.JOT_ID and h.HotProessTrustId=TrustItem.HotProessTrustId and h.ProessTypes=TrustItem.ProessTypes) v on v.JOT_ID=HotProessItem.JOT_ID and v.HotProessItemId=HotProessItem.HotProessItemId - WHERE JointInfo.ProjectId= @ProjectId "; - listStr.Add(new SqlParameter("@ProjectId", projectId)); - if (this.drpIsoNo.SelectedValue != BLL.Const._Null) + where EXISTS (SELECT 1 FROM SYBData_ToIsoList WHERE ISO_ID = IsoInfo.ISO_ID) + and JointInfo.ProjectId= @ProjectId and isoList.TestPackageDivisionId=@TestPackageDivisionId"; + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + listStr.Add(new SqlParameter("@TestPackageDivisionId", this.TestPackageDivisionId)); + if (this.drpIsoNo.SelectedValue != BLL.Const._Null&&!string.IsNullOrEmpty(this.drpIsoNo.SelectedValue)) { strSql += @" AND IsoInfo.ISO_ID = @ISO_ID"; listStr.Add(new SqlParameter("@ISO_ID", this.drpIsoNo.SelectedValue)); @@ -212,7 +281,7 @@ namespace FineUIPro.Web.SYBData protected void Tree_TextChanged(object sender, EventArgs e) { this.InitTreeMenu(); - this.BindGrid(); + //this.BindGrid(); } #endregion @@ -276,9 +345,9 @@ namespace FineUIPro.Web.SYBData } } string projectName = string.Empty; - if (this.tvControlItem.SelectedNode != null) + if (!string.IsNullOrEmpty(this.ProjectId)) { - Model.Base_Project selectProject = BLL.Base_ProjectService.GetProjectByProjectId(this.tvControlItem.SelectedNodeID); + Model.Base_Project selectProject = BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId); if (selectProject != null) { projectName = selectProject.ProjectName.Replace("/", ","); diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PipeWeldingWorkRecord.aspx b/HJGL_DS/FineUIPro.Web/SYBData/PipeWeldingWorkRecord.aspx new file mode 100644 index 0000000..9ecb8c6 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PipeWeldingWorkRecord.aspx @@ -0,0 +1,113 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PipeWeldingWorkRecord.aspx.cs" Inherits="FineUIPro.Web.SYBData.PipeWeldingWorkRecord" %> + + + + + + + 管道焊接工作记录 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PipeWeldingWorkRecord.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/PipeWeldingWorkRecord.aspx.cs new file mode 100644 index 0000000..fffc1be --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PipeWeldingWorkRecord.aspx.cs @@ -0,0 +1,372 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.SYBData +{ + public partial class PipeWeldingWorkRecord : PageBase + { + #region 定义项 + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 试压包号 + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + + this.drpProjectId.DataTextField = "ProjectCode"; + this.drpProjectId.DataValueField = "ProjectId"; + this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + this.drpProjectId.DataBind(); + Funs.FineUIPleaseSelect(this.drpProjectId); + Funs.FineUIPleaseSelect(this.drpIsoId); + + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + this.InitTreeMenu();//加载树 + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + + //this.Grid1.Items.Clear(); + //this.Grid1.DataBind(); + //this.drpIsoId.Items.Clear(); + //this.drpIsoId.DataTextField = "ISO_IsoNo"; + //this.drpIsoId.DataValueField = "ISO_ID"; + //this.drpIsoId.DataSource = (from x in Funs.DB.HJGL_PW_IsoInfo where x.ProjectId == this.tvControlItem.SelectedNodeID select x).ToList(); + //this.drpIsoId.DataBind(); + //Funs.FineUIPleaseSelect(this.drpIsoId); + //this.drpIsoId.SelectedIndex = 0; + + //this.BindGrid(); + } + } + #endregion + + #region 加载树项目 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "项目"; + rootNode.ToolTip = "项目"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode); + + List projects = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + if (this.drpProjectId.SelectedValue != BLL.Const._Null) + { + projects = projects.Where(e => e.ProjectId == this.drpProjectId.SelectedValue).ToList(); + } + foreach (var item in projects) + { + TreeNode rootProjectNode = new TreeNode();//定义根节点 + rootProjectNode.Text = item.ProjectCode; + rootProjectNode.NodeID = item.ProjectId; + rootProjectNode.EnableClickEvent = true; + rootProjectNode.Expanded = true; + rootProjectNode.ToolTip = item.ProjectName; + rootProjectNode.CommandName = "项目名称"; + rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } + } + } + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (this.tvControlItem.SelectedNodeID != "0") + { + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + this.TestPackageDivisionId = string.Empty; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + + ///加载管线下拉项 + this.drpIsoId.Items.Clear(); + this.drpIsoId.DataTextField = "ISO_IsoNo"; + this.drpIsoId.DataValueField = "ISO_ID"; + this.drpIsoId.DataSource = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + this.drpIsoId.DataBind(); + Funs.FineUIPleaseSelect(this.drpIsoId); + this.drpIsoId.SelectedIndex = 0; + BindGrid(); + } + } + } + #endregion + + #region 数据绑定 + /// + /// 数据绑定 + /// + private void BindGrid() + { + //if (this.drpIsoId.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIsoId.SelectedValue)) + //{ + List listStr = new List(); + if (this.drpIsoId.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIsoId.SelectedValue)) + { + listStr.Add(new SqlParameter("@IsoId", this.drpIsoId.SelectedValue)); + } + else + { + listStr.Add(new SqlParameter("@IsoId", null)); + } + listStr.Add(new SqlParameter("@projectId", this.ProjectId)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_rpt_spJointWorkRecordNew", parameter); + + DataView dv = tb.DefaultView;//获取表视图 + dv.Sort = "JOTY_Group,Sort1,Sort2,Sort3,Sort4,Sort5 ASC";//按照ID排序 + tb = dv.ToTable();//转为表 + + // 2.获取当前分页数据 + //var table = this.GetPagedDataTable(Grid1, tb1); + Grid1.RecordCount = tb.Rows.Count; + //this.Grid1.PageIndex = 0; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + //} + } + #endregion + + #region 分页排序 + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + #endregion + + #region 查询 + /// + ///查询 + /// + /// + /// + protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) + { + this.InitTreeMenu(); + + //this.Grid1.Items.Clear(); + //this.Grid1.DataBind(); + //this.drpIsoId.Items.Clear(); + //this.drpIsoId.DataTextField = "ISO_IsoNo"; + //this.drpIsoId.DataValueField = "ISO_ID"; + //this.drpIsoId.DataSource = (from x in Funs.DB.HJGL_PW_IsoInfo where x.ProjectId == this.tvControlItem.SelectedNodeID select x).ToList(); + //this.drpIsoId.DataBind(); + //Funs.FineUIPleaseSelect(this.drpIsoId); + //this.drpIsoId.SelectedIndex = 0; + } + + /// + /// 查询 + /// + /// + /// + //protected void TextBox_TextChanged(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + string isoId = string.Empty; + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + if (this.drpIsoId.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIsoId.SelectedValue)) + { + isoId = this.drpIsoId.SelectedValue; + } + //if (!string.IsNullOrEmpty(isoId)) + //{ + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + List listStr = new List(); + if (!string.IsNullOrEmpty(isoId)) + { + listStr.Add(new SqlParameter("@IsoId", isoId)); + } + else + { + listStr.Add(new SqlParameter("@IsoId", null)); + } + listStr.Add(new SqlParameter("@projectId",this.ProjectId)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_rpt_spJointWorkRecordNew", parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("JOT_JointNo"); + dt.Columns.Add("WED_Code"); + dt.Columns.Add("JOT_JointDesc"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("weldLocal"); + dt.Columns.Add("WME_Name"); + dt.Columns.Add("WMT_MatName"); + dt.Columns.Add("JOT_PrepareTemp"); + dt.Columns.Add("WeldDate"); + + DataView dv = tb.DefaultView;//获取表视图 + //dv.Sort = "ISO_IsoNo,JOTY_Group,Sort1,Sort2,Sort3,Sort4,Sort5 ASC";//按照ID排序 + tb = dv.ToTable();//转为表 + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRow = dt.NewRow(); + newRow["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRow["JOT_JointNo"] = row["JOT_JointNo"].ToString(); + newRow["WED_Code"] = row["WED_Code"].ToString(); + newRow["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); + newRow["STE_Code"] = row["STE_Code"].ToString(); + newRow["weldLocal"] = row["weldLocal"].ToString(); + newRow["WME_Name"] = row["WME_Name"].ToString(); + newRow["WMT_MatName"] = row["WMT_MatName"].ToString(); + newRow["JOT_PrepareTemp"] = row["JOT_PrepareTemp"].ToString(); + string WeldDate = string.Format("{0:yyyy-MM-dd}", row["WeldDate"]); + newRow["WeldDate"] = WeldDate; + dt.Rows.Add(newRow); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); + 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))); + } + //} + //else + //{ + // Alert.ShowInTop("请选择管线号!", MessageBoxIcon.Warning); + // return; + //} + } + else + { + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + protected void drpIsoId_SelectedIndexChanged(object sender, EventArgs e) + { + BindGrid(); + } + } +} \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PipeWeldingWorkRecord.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/SYBData/PipeWeldingWorkRecord.aspx.designer.cs new file mode 100644 index 0000000..01284f1 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PipeWeldingWorkRecord.aspx.designer.cs @@ -0,0 +1,170 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.SYBData +{ + + + public partial class PipeWeldingWorkRecord + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpProjectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProjectId; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpIsoId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpIsoId; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// WindowPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowPrint; + } +} diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx new file mode 100644 index 0000000..708c32d --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx @@ -0,0 +1,109 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PressureTestOfPipelineSystemConfirmationRecord.aspx.cs" Inherits="FineUIPro.Web.SYBData.PressureTestOfPipelineSystemConfirmationRecord" %> + + + + + + + 管道系统压力试验条件确认记录 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx.cs new file mode 100644 index 0000000..0138ef2 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx.cs @@ -0,0 +1,677 @@ +using Aspose.Words; +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.SYBData +{ + public partial class PressureTestOfPipelineSystemConfirmationRecord : PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string RecordId + { + get + { + return (string)ViewState["RecordId"]; + } + set + { + ViewState["RecordId"] = value; + } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 试压包划分id + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List itemLists = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.drpProjectId.DataTextField = "ProjectCode"; + this.drpProjectId.DataValueField = "ProjectId"; + this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + this.drpProjectId.DataBind(); + Funs.FineUIPleaseSelect(this.drpProjectId); + // 默认显示选中的项目 + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + //this.ProjectId = this.drpProjectId.SelectedValue; + } + this.InitTreeMenu();//加载树 + + //this.drpIsoNoS.Items.Clear(); + //this.drpIsoNoS.DataTextField = "ISO_IsoNo"; + //this.drpIsoNoS.DataValueField = "ISO_IsoNo"; + //this.drpIsoNoS.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + //this.drpIsoNoS.DataBind(); + + //var record = BLL.PressureTestOfPipelineSystemConfirmationRecordService.GetPressureTestOfPipelineSystemConfirmationRecordByProjectId(this.drpProjectId.SelectedValue); + //if (record != null) + //{ + // if (!string.IsNullOrEmpty(record.SystemCode)) + // { + // this.txtSystemCode.Text = record.SystemCode; + // } + // else + // { + // this.txtSystemCode.Text = "01"; + // } + // if (!string.IsNullOrEmpty(record.SystemName)) + // { + // this.txtSystemName.Text = record.SystemName; + // } + // else + // { + // this.txtSystemName.Text = "材质"; + // } + // this.txtRemark.Text = record.Remark; + // BindGrid(); + //} + //else + //{ + // InitData(); + //} + } + } + + private void InitData() + { + this.txtSystemCode.Text = "01"; + this.txtSystemName.Text = string.Empty; + this.txtRemark.Text = string.Empty; + itemLists.Clear(); + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem.ProjectId = this.ProjectId; + newItem.CheckItem1 = "01"; + newItem.CheckItem2 = "管道安装符合设计文件和规范要求"; + newItem.CheckItem3 = "合格"; + itemLists.Add(newItem); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem2 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem2.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem2.ProjectId = this.ProjectId; + newItem2.CheckItem1 = "02"; + newItem2.CheckItem2 = "管道组成件复验合格"; + newItem2.CheckItem3 = "合格"; + itemLists.Add(newItem2); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem3 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem3.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem3.ProjectId = this.ProjectId; + newItem3.CheckItem1 = "03"; + newItem3.CheckItem2 = "焊接工作记录齐全"; + newItem3.CheckItem3 = "合格"; + itemLists.Add(newItem3); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem4 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem4.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem4.ProjectId = this.ProjectId; + newItem4.CheckItem1 = "04"; + newItem4.CheckItem2 = "无损检测结果符合设计文件和规范要求"; + newItem4.CheckItem3 = "合格"; + itemLists.Add(newItem4); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem5 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem5.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem5.ProjectId = this.ProjectId; + newItem5.CheckItem1 = "05"; + newItem5.CheckItem2 = "热处理结果符合设计文件和规范要求"; + newItem5.CheckItem3 = "合格"; + itemLists.Add(newItem5); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem6 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem6.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem6.ProjectId = this.ProjectId; + newItem6.CheckItem1 = "06"; + newItem6.CheckItem2 = "支、吊架安装正确"; + newItem6.CheckItem3 = "合格"; + itemLists.Add(newItem6); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem7 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem7.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem7.ProjectId = this.ProjectId; + newItem7.CheckItem1 = "07"; + newItem7.CheckItem2 = "合金钢管道材质标记清楚"; + newItem7.CheckItem3 = "合格"; + itemLists.Add(newItem7); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem8 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem8.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem8.ProjectId = this.ProjectId; + newItem8.CheckItem1 = "08"; + newItem8.CheckItem2 = "不参与管道系统试验的安全附件、仪表已按规定拆除或隔离,参与试压的系统内的阀门全部开启"; + newItem8.CheckItem3 = "合格"; + itemLists.Add(newItem8); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem9 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem9.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem9.ProjectId = this.ProjectId; + newItem9.CheckItem1 = "09"; + newItem9.CheckItem2 = "临时加固措施、盲板位置与标识符合施工方案要求"; + newItem9.CheckItem3 = "合格"; + itemLists.Add(newItem9); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem10 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem10.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem10.ProjectId = this.ProjectId; + newItem10.CheckItem1 = "10"; + newItem10.CheckItem2 = "焊接接头及需要检验的部位未被覆盖"; + newItem10.CheckItem3 = "合格"; + itemLists.Add(newItem10); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem11 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem11.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem11.ProjectId = this.ProjectId; + newItem11.CheckItem1 = "11"; + newItem11.CheckItem2 = "试压用压力表量程、精度等级、检定状态符合规范要求"; + newItem11.CheckItem3 = "合格"; + itemLists.Add(newItem11); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem12 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem12.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem12.ProjectId = this.ProjectId; + newItem12.CheckItem1 = "12"; + newItem12.CheckItem2 = "不锈钢管道试验用水符合规范要求、附水质分析报告"; + newItem12.CheckItem3 = "合格"; + itemLists.Add(newItem12); + + this.Grid1.DataSource = itemLists; + this.Grid1.DataBind(); + } + #endregion + + #region 加载树项目 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "项目"; + rootNode.ToolTip = "项目"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode); + + List projects = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + + // 默认显示选中的项目 + string selectedProjectId = this.drpProjectId.SelectedValue; + if (!string.IsNullOrEmpty(selectedProjectId) && selectedProjectId != BLL.Const._Null) + { + projects = projects.Where(e => e.ProjectId == selectedProjectId).ToList(); + + // 如果项目存在,则选中该节点 + //if (projects.Any()) + //{ + // this.tvControlItem.SelectedNodeID = selectedProjectId; + //} + } + + if (this.drpProjectId.SelectedValue != BLL.Const._Null) + { + projects = projects.Where(e => e.ProjectId == this.drpProjectId.SelectedValue).ToList(); + } + foreach (var item in projects) + { + TreeNode rootProjectNode = new TreeNode();//定义根节点 + rootProjectNode.Text = item.ProjectCode; + rootProjectNode.NodeID = item.ProjectId; + rootProjectNode.EnableClickEvent = true; + rootProjectNode.Expanded = true; + rootProjectNode.ToolTip = item.ProjectName; + rootProjectNode.CommandName = "项目名称"; + rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } + } + + //if (this.tvControlItem.SelectedNodeID != "0") + //{ + // this.BindGrid(); + //} + } + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (this.tvControlItem.SelectedNodeID != "0") + { + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + this.TestPackageDivisionId = string.Empty; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + var record = BLL.PressureTestOfPipelineSystemConfirmationRecordService.GetPressureTestOfPipelineSystemConfirmationRecordByTestPackageDivisionId(this.TestPackageDivisionId); + if (record != null) + { + if (!string.IsNullOrEmpty(record.SystemCode)) + { + this.txtSystemCode.Text = record.SystemCode; + } + else + { + this.txtSystemCode.Text = "01"; + } + if (!string.IsNullOrEmpty(record.SystemName)) + { + this.txtSystemName.Text = record.SystemName; + } + else + { + this.txtSystemName.Text = "材质"; + } + this.txtRemark.Text = record.Remark; + this.BindGrid(); + } + else + { + InitData(); + } + this.drpIsoNoS.Items.Clear(); + this.drpIsoNoS.DataTextField = "ISO_IsoNo"; + this.drpIsoNoS.DataValueField = "ISO_ID"; + this.drpIsoNoS.DataSource = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + this.drpIsoNoS.DataBind(); + //Funs.FineUIPleaseSelect(this.drpIsoNoS); + //this.drpIsoNoS.SelectedIndex = 0; + } + } + } + #endregion + + #region 数据绑定 + /// + /// 数据绑定 + /// + private void BindGrid() + { + string strSql = @"SELECT * from JGZL_PressureTestOfPipelineSystemConfirmationRecord where 1=1"; + List listStr = new List(); + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + strSql += " AND TestPackageDivisionId = @testPackageDivisionId"; + listStr.Add(new SqlParameter("@testPackageDivisionId", this.TestPackageDivisionId)); + } + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 查询 + /// + ///查询 + /// + /// + /// + protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) + { + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + this.InitTreeMenu(); + //var record = BLL.PressureTestOfPipelineSystemConfirmationRecordService.GetPressureTestOfPipelineSystemConfirmationRecordByProjectId(this.tvControlItem.SelectedNodeID); + //if (record != null) + //{ + // this.BindGrid(); + //} + //else + //{ + // InitData(); + //} + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var report = (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemConfirmationRecord where x.TestPackageDivisionId == this.TestPackageDivisionId select x); + if (report.Count() > 0) + { + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); + keyValuePairs.Add("SystemName", this.txtSystemName.Text.Trim()); + keyValuePairs.Add("SystemCode", this.txtSystemCode.Text.Trim()); + keyValuePairs.Add("CheckItem1", report.Where(x => x.CheckItem1 == "01").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem2", report.Where(x => x.CheckItem1 == "02").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem3", report.Where(x => x.CheckItem1 == "03").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem4", report.Where(x => x.CheckItem1 == "04").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem5", report.Where(x => x.CheckItem1 == "05").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem6", report.Where(x => x.CheckItem1 == "06").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem7", report.Where(x => x.CheckItem1 == "07").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem8", report.Where(x => x.CheckItem1 == "08").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem9", report.Where(x => x.CheckItem1 == "09").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem10", report.Where(x => x.CheckItem1 == "10").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem11", report.Where(x => x.CheckItem1 == "11").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem12", report.Where(x => x.CheckItem1 == "12").FirstOrDefault().CheckItem3); + //keyValuePairs.Add("TestConclusion", report.TestConclusion); + keyValuePairs.Add("Remark", report.FirstOrDefault().Remark); + 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))); + } + } + else + { + Alert.ShowInTop("请先保存数据!", MessageBoxIcon.Warning); + return; + } + } + else + { + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, + Const.JGZL_PressureTestOfPipelineSystemConfirmationRecordMenuId, Const.BtnSave)) + { + saveItem(); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + + void saveItem() + { + itemLists.Clear(); + BLL.PressureTestOfPipelineSystemConfirmationRecordService.DeletePressureTestOfPipelineSystemConfirmationRecordByTestPackageDivisionId(this.TestPackageDivisionId); + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newDetail = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord + { + RecordId = values.Value("RecordId"), + ProjectId = this.ProjectId, + SystemName = this.txtSystemName.Text, + SystemCode = this.txtSystemCode.Text, + Remark = this.txtRemark.Text, + CheckItem1 = values.Value("CheckItem1"), + CheckItem2 = values.Value("CheckItem2"), + CheckItem3 = values.Value("CheckItem3"), + TestPackageDivisionId = this.TestPackageDivisionId + }; + itemLists.Add(newDetail); + } + try + { + if (itemLists.Count > 0) + { + Funs.DB.JGZL_PressureTestOfPipelineSystemConfirmationRecord.InsertAllOnSubmit(itemLists); + } + Funs.DB.SubmitChanges(); + } + catch (Exception) + { + return; + } + } + #endregion + + protected void drpIsoNoS_SelectedIndexChanged(object sender, EventArgs e) + { + this.txtSystemName.Text.Trim(); + string serName = string.Empty; + List serList = new List(); + foreach (var isoId in this.drpIsoNoS.SelectedValueArray) + { + var iso = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(isoId); + if (iso != null) + { + if (!string.IsNullOrEmpty(iso.SER_ID)) + { + serList.Add(BLL.HJGL_MediumService.GetServiceBySERID(iso.SER_ID).SER_Name); + } + } + } + if (serList.Count > 0) + { + foreach (var item in serList.Distinct()) + { + serName += item + "、"; + } + if (!string.IsNullOrEmpty(serName)) + { + serName = serName.Substring(0, serName.LastIndexOf('、')); + } + } + this.txtSystemName.Text = serName; + } + + #region 导出按钮 + /// 导出按钮 + ///
+ /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + string filePath = string.Empty; + + string projectId = this.tvControlItem.SelectedNodeID; + if (!string.IsNullOrEmpty(projectId)) + { + initTemplatePath = Const.JGZL_PressureTestOfPipelineSystemConfirmationRecordUrl; + uploadfilepath = rootPath + initTemplatePath; + + newUrl = uploadfilepath.Replace("管道系统压力试验条件确认记录导出模板", "管道系统压力试验条件确认记录"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + File.Copy(uploadfilepath, newUrl); + Document doc = new Aspose.Words.Document(uploadfilepath); + + var report = (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemConfirmationRecord where x.ProjectId == projectId select x); + if (report != null) + { + Bookmark projectName = doc.Range.Bookmarks["ProjectName"]; + if (projectName != null) + { + projectName.Text = BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName; + } + Bookmark systemName = doc.Range.Bookmarks["SystemName"]; + if (systemName != null) + { + systemName.Text = report.FirstOrDefault().SystemName; + } + Bookmark systemCode = doc.Range.Bookmarks["SystemCode"]; + if (systemCode != null) + { + systemCode.Text = report.FirstOrDefault().SystemCode; + } + Bookmark checkItem1 = doc.Range.Bookmarks["CheckItem1"]; + if (checkItem1 != null) + { + checkItem1.Text = report.Where(x => x.CheckItem1 == "01").FirstOrDefault().CheckItem3; + } + Bookmark checkItem2 = doc.Range.Bookmarks["CheckItem2"]; + if (checkItem2 != null) + { + checkItem2.Text = report.Where(x => x.CheckItem1 == "02").FirstOrDefault().CheckItem3; + } + Bookmark checkItem3 = doc.Range.Bookmarks["CheckItem3"]; + if (checkItem3 != null) + { + checkItem3.Text = report.Where(x => x.CheckItem1 == "03").FirstOrDefault().CheckItem3; + } + Bookmark checkItem4 = doc.Range.Bookmarks["CheckItem4"]; + if (checkItem4 != null) + { + checkItem4.Text = report.Where(x => x.CheckItem1 == "04").FirstOrDefault().CheckItem3; + } + Bookmark checkItem5 = doc.Range.Bookmarks["CheckItem5"]; + if (checkItem5 != null) + { + checkItem5.Text = report.Where(x => x.CheckItem1 == "05").FirstOrDefault().CheckItem3; + } + Bookmark checkItem6 = doc.Range.Bookmarks["CheckItem6"]; + if (checkItem6 != null) + { + checkItem6.Text = report.Where(x => x.CheckItem1 == "06").FirstOrDefault().CheckItem3; + } + Bookmark checkItem7 = doc.Range.Bookmarks["CheckItem7"]; + if (checkItem7 != null) + { + checkItem7.Text = report.Where(x => x.CheckItem1 == "07").FirstOrDefault().CheckItem3; + } + Bookmark checkItem8 = doc.Range.Bookmarks["CheckItem8"]; + if (checkItem8 != null) + { + checkItem8.Text = report.Where(x => x.CheckItem1 == "08").FirstOrDefault().CheckItem3; + } + Bookmark checkItem9 = doc.Range.Bookmarks["CheckItem9"]; + if (checkItem9 != null) + { + checkItem9.Text = report.Where(x => x.CheckItem1 == "09").FirstOrDefault().CheckItem3; + } + Bookmark checkItem10 = doc.Range.Bookmarks["CheckItem10"]; + if (checkItem10 != null) + { + checkItem10.Text = report.Where(x => x.CheckItem1 == "10").FirstOrDefault().CheckItem3; + } + Bookmark checkItem11 = doc.Range.Bookmarks["CheckItem11"]; + if (checkItem11 != null) + { + checkItem11.Text = report.Where(x => x.CheckItem1 == "11").FirstOrDefault().CheckItem3; + } + Bookmark checkItem12 = doc.Range.Bookmarks["CheckItem12"]; + if (checkItem12 != null) + { + checkItem12.Text = report.Where(x => x.CheckItem1 == "12").FirstOrDefault().CheckItem3; + } + } + doc.Save(newUrl); + + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + else + { + Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + return; + } + } + #endregion + } +} \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx.designer.cs new file mode 100644 index 0000000..f5505fd --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemConfirmationRecord.aspx.designer.cs @@ -0,0 +1,233 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.SYBData +{ + + + public partial class PressureTestOfPipelineSystemConfirmationRecord + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpProjectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProjectId; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpIsoNoS 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpIsoNoS; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// ToolbarFill3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill3; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// txtSystemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSystemName; + + /// + /// txtSystemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSystemCode; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// drpCheckItem3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCheckItem3; + + /// + /// WindowPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowPrint; + } +} diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemRecord.aspx b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemRecord.aspx new file mode 100644 index 0000000..a774cc5 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemRecord.aspx @@ -0,0 +1,163 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PressureTestOfPipelineSystemRecord.aspx.cs" Inherits="FineUIPro.Web.SYBData.PressureTestOfPipelineSystemRecord" %> + + + + + + + 管道系统压力试验记录 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemRecord.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemRecord.aspx.cs new file mode 100644 index 0000000..900a856 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemRecord.aspx.cs @@ -0,0 +1,564 @@ +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.SYBData +{ + public partial class PressureTestOfPipelineSystemRecord :PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string Id + { + get + { + return (string)ViewState["Id"]; + } + set + { + ViewState["Id"] = value; + } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 外键—RecordId + /// + public string RecordId + { + get + { + return (string)ViewState["RecordId"]; + } + set + { + ViewState["RecordId"] = value; + } + } + + /// + /// 试压包划分id + /// + public string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List itemLists = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.drpProjectId.DataTextField = "ProjectCode"; + this.drpProjectId.DataValueField = "ProjectId"; + this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + this.drpProjectId.DataBind(); + Funs.FineUIPleaseSelect(this.drpProjectId); + + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + this.InitTreeMenu();//加载树 + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.ProjectId = this.tvControlItem.SelectedNodeID; + + //this.drpIsoNoS.Items.Clear(); + //this.drpIsoNoS.DataTextField = "ISO_IsoNo"; + //this.drpIsoNoS.DataValueField = "ISO_IsoNo"; + //this.drpIsoNoS.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + //this.drpIsoNoS.DataBind(); + + //DataIsoInfo(); + } + } + + private void DataIsoInfo() + { + itemLists.Clear(); + this.txtSystemName.Text = string.Empty; + string serName = string.Empty; + this.txtSystemCode.Text = "01"; + if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue)) + { + List serList = new List(); + foreach (var isoId in this.drpIsoNoS.SelectedValueArray) + { + var iso = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(isoId); + if (iso != null) + { + if (!string.IsNullOrEmpty(iso.SER_ID)) + { + serList.Add(BLL.HJGL_MediumService.GetServiceBySERID(iso.SER_ID).SER_Name); + } + } + } + if (serList.Count > 0) + { + foreach (var item in serList.Distinct()) + { + serName += item + "、"; + } + if (!string.IsNullOrEmpty(serName)) + { + serName = serName.Substring(0, serName.LastIndexOf('、')); + } + } + this.txtSystemName.Text = serName; + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + var isoInfos = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + foreach (var item in isoInfos) + { + var record = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByTestPackageDivisionId(this.TestPackageDivisionId); + if (record != null) + { + this.RecordId = record.RecordId; + if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue)) + { + if (this.drpIsoNoS.SelectedValueArray.Contains(item.ISO_ID)) + { + var recordItems = BLL.PressureTestOfPipelineSystemRecordItemService.GetPressureTestOfPipelineSystemRecordByPipeLine(this.RecordId, item.ISO_IsoNo); + if (recordItems.Count > 0) + { + foreach (var recordItem in recordItems) + { + itemLists.Add(recordItem); + } + } + else + { + Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem = new JGZL_PressureTestOfPipelineSystemRecordItem(); + newItem.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); + newItem.PipelineNo = item.ISO_IsoNo; + newItem.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; + newItem.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; + newItem.TestMedium = "水"; + newItem.TestPressure = (item.ISO_DesignPress.Value * 1.5m).ToString("0.##") + "Mpa"; + newItem.VoltageStabilizationTime = "10min"; + itemLists.Add(newItem); + + Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem2 = new JGZL_PressureTestOfPipelineSystemRecordItem(); + newItem2.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); + newItem2.PipelineNo = item.ISO_IsoNo; + newItem2.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; + newItem2.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; + newItem2.TestMedium = "水"; + newItem2.TestPressure = newItem2.DesignPressure; + newItem2.VoltageStabilizationTime = "30min"; + itemLists.Add(newItem2); + } + } + } + } + else + { + if (this.drpIsoNoS.SelectedValueArray.Contains(item.ISO_ID)) + { + Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem = new JGZL_PressureTestOfPipelineSystemRecordItem(); + newItem.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); + newItem.PipelineNo = item.ISO_IsoNo; + newItem.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; + newItem.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; + newItem.TestMedium = "水"; + newItem.TestPressure = (item.ISO_DesignPress.Value * 1.5m).ToString("0.##") + "Mpa"; + newItem.VoltageStabilizationTime = "10min"; + itemLists.Add(newItem); + + Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem2 = new JGZL_PressureTestOfPipelineSystemRecordItem(); + newItem2.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); + newItem2.PipelineNo = item.ISO_IsoNo; + newItem2.DesignPressure = item.ISO_DesignPress.HasValue ? item.ISO_DesignPress.Value.ToString("0.##") + "Mpa" : ""; + newItem2.DesignTemperature = item.ISO_DesignTemperature.HasValue ? item.ISO_DesignTemperature.Value.ToString("0.##") + "℃" : ""; + newItem2.TestMedium = "水"; + newItem2.TestPressure = newItem2.DesignPressure; + newItem2.VoltageStabilizationTime = "30min"; + itemLists.Add(newItem2); + //} + } + } + } + itemLists.OrderBy(e => e.PipelineNo).OrderBy(e => e.VoltageStabilizationTime); + } + } + this.Grid1.DataSource = itemLists; + this.Grid1.DataBind(); + } + #endregion + + #region 加载树项目 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "项目"; + rootNode.ToolTip = "项目"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode); + + List projects = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + + // 默认显示选中的项目 + string selectedProjectId = this.drpProjectId.SelectedValue; + if (!string.IsNullOrEmpty(selectedProjectId) && selectedProjectId != BLL.Const._Null) + { + projects = projects.Where(e => e.ProjectId == selectedProjectId).ToList(); + + // 如果项目存在,则选中该节点 + //if (projects.Any()) + //{ + // this.tvControlItem.SelectedNodeID = selectedProjectId; + //} + } + + if (this.drpProjectId.SelectedValue != BLL.Const._Null) + { + projects = projects.Where(e => e.ProjectId == this.drpProjectId.SelectedValue).ToList(); + } + foreach (var item in projects) + { + TreeNode rootProjectNode = new TreeNode();//定义根节点 + rootProjectNode.Text = item.ProjectCode; + rootProjectNode.NodeID = item.ProjectId; + rootProjectNode.EnableClickEvent = true; + rootProjectNode.Expanded = true; + rootProjectNode.ToolTip = item.ProjectName; + rootProjectNode.CommandName = "项目名称"; + rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } + } + + //if (this.tvControlItem.SelectedNodeID != "0") + //{ + // this.BindGrid(); + //} + } + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (this.tvControlItem.SelectedNodeID != "0") + { + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + DataIsoInfo(); + + this.drpIsoNoS.Items.Clear(); + this.drpIsoNoS.DataTextField = "ISO_IsoNo"; + this.drpIsoNoS.DataValueField = "ISO_ID"; + this.drpIsoNoS.DataSource = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + this.drpIsoNoS.DataBind(); + } + //this.ProjectId = this.tvControlItem.SelectedNodeID; + //DataIsoInfo(); + } + } + #endregion + + #region 查询 + /// + ///查询 + /// + /// + /// + protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) + { + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + this.ProjectId = this.drpProjectId.SelectedValue; + this.InitTreeMenu(); + //this.BindGrid(); + //DataIsoInfo(); + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("PipelineNo"); + dt.Columns.Add("DesignPressure"); + dt.Columns.Add("DesignTemperature"); + dt.Columns.Add("TestTemperature"); + dt.Columns.Add("TestMedium"); + dt.Columns.Add("TestMediumTemperature"); + dt.Columns.Add("TestPressure"); + dt.Columns.Add("VoltageStabilizationTime"); + + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var newRow = dt.NewRow(); + newRow["PipelineNo"] = this.Grid1.Rows[i].Values[1].ToString(); + newRow["DesignPressure"] = this.Grid1.Rows[i].Values[2].ToString(); + newRow["DesignTemperature"] = this.Grid1.Rows[i].Values[3].ToString(); + newRow["TestTemperature"] = this.Grid1.Rows[i].Values[4].ToString(); + newRow["TestMedium"] = this.Grid1.Rows[i].Values[5].ToString(); + newRow["TestMediumTemperature"] = this.Grid1.Rows[i].Values[6].ToString(); + newRow["TestPressure"] = this.Grid1.Rows[i].Values[7].ToString(); + newRow["VoltageStabilizationTime"] = this.Grid1.Rows[i].Values[8].ToString(); + dt.Rows.Add(newRow); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); + keyValuePairs.Add("SystemName", this.txtSystemName.Text.Trim()); + keyValuePairs.Add("SystemCode", this.txtSystemCode.Text.Trim()); + 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))); + } + } + else + { + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 维护 + /// + /// 增加 + /// + /// + /// + protected void btnAdd_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + { + 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 + { + { "Id", Guid.NewGuid() }, + { "RecordId", this.RecordId }, + { "PipelineNo", "" }, + { "DesignPressure", "" }, + { "DesignTemperature", "" }, + { "TestTemperature", "" }, + { "TestMedium", "水" }, + { "TestMediumTemperature", "" }, + { "TestPressure", "" }, + { "VoltageStabilizationTime", "" }, + { + "Delete3", + String.Format("", + GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) + } + }; + list.Add(defaultObj); + Grid1.DataSource = list; + Grid1.DataBind(); + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemRecordEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); + } + else + { + Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + return; + } + } + + protected void Grid1_PreDataBound(object sender, EventArgs e) + { + // 设置LinkButtonField的点击客户端事件 + LinkButtonField deleteField = Grid1.FindColumn("Delete3") as LinkButtonField; + deleteField.OnClientClick = GetDeleteScriptGrid1(); + } + + /// + /// 删除提示 + /// + /// + private string GetDeleteScriptGrid1() + { + return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, + Grid1.GetDeleteSelectedRowsReference(), String.Empty); + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, + Const.JGZL_PressureTestOfPipelineSystemRecordMenuId, Const.BtnSave)) + { + Model.JGZL_PressureTestOfPipelineSystemRecord newRecord = new JGZL_PressureTestOfPipelineSystemRecord(); + newRecord.SystemCode = this.txtSystemCode.Text; + newRecord.SystemName = this.txtSystemName.Text; + if (!string.IsNullOrEmpty(this.RecordId)) + { + newRecord.RecordId = this.RecordId; + BLL.PressureTestOfPipelineSystemRecordService.UpdatePressureTestOfPipelineSystemRecord(newRecord); + } + else + { + newRecord.ProjectId = this.ProjectId; + newRecord.TestPackageDivisionId = this.TestPackageDivisionId; + newRecord.CompileMan = this.CurrUser.UserId; + newRecord.CompileDate = DateTime.Now; + newRecord.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecord)); + this.RecordId = newRecord.RecordId; + BLL.PressureTestOfPipelineSystemRecordService.AddPressureTestOfPipelineSystemRecord(newRecord); + } + saveItem(); + + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + DataIsoInfo(); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + + void saveItem() + { + itemLists.Clear(); + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + + //删除原有信息 + var item = BLL.PressureTestOfPipelineSystemRecordItemService.GetPressureTestOfPipelineSystemRecordByPipeLine(this.RecordId, values.Value("PipelineNo")); + if (item.Count > 0) + { + Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem.DeleteAllOnSubmit(item); + Funs.DB.SubmitChanges(); + } + + Model.JGZL_PressureTestOfPipelineSystemRecordItem newDetail = new Model.JGZL_PressureTestOfPipelineSystemRecordItem + { + Id = values.Value("Id"), + RecordId = this.RecordId, + PipelineNo = values.Value("PipelineNo"), + DesignPressure = values.Value("DesignPressure"), + DesignTemperature = values.Value("DesignTemperature"), + TestTemperature = values.Value("TestTemperature"), + TestMedium = values.Value("TestMedium"), + TestMediumTemperature = values.Value("TestMediumTemperature"), + TestPressure = values.Value("TestPressure"), + VoltageStabilizationTime = values.Value("VoltageStabilizationTime"), + }; + itemLists.Add(newDetail); + } + try + { + if (itemLists.Count > 0) + { + Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem.InsertAllOnSubmit(itemLists); + } + Funs.DB.SubmitChanges(); + } + catch (Exception) + { + return; + } + } + #endregion + + protected void drpIsoNoS_SelectedIndexChanged(object sender, EventArgs e) + { + DataIsoInfo(); + } + + } +} \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemRecord.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemRecord.aspx.designer.cs new file mode 100644 index 0000000..b44fab5 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestOfPipelineSystemRecord.aspx.designer.cs @@ -0,0 +1,269 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.SYBData +{ + + + public partial class PressureTestOfPipelineSystemRecord + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpProjectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProjectId; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpIsoNoS 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpIsoNoS; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAdd; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// txtSystemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSystemName; + + /// + /// txtSystemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSystemCode; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// txtPipelineNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipelineNo; + + /// + /// txtDesignPressure 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDesignPressure; + + /// + /// txtDesignTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDesignTemperature; + + /// + /// txtTestTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTestTemperature; + + /// + /// txtTestMedium 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTestMedium; + + /// + /// txtTestMediumTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTestMediumTemperature; + + /// + /// txtTestPressure 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTestPressure; + + /// + /// txtVoltageStabilizationTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtVoltageStabilizationTime; + + /// + /// WindowPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowPrint; + } +} diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx index bb2cd33..f7c4cc9 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx @@ -74,6 +74,9 @@ + diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.cs index 9d8692e..6c014d6 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.cs @@ -35,6 +35,15 @@ namespace FineUIPro.Web.SYBData set { ViewState["ProjectId"] = value; } } + /// + /// 试压包id + /// + private string TestPackageDivisionId + { + get { return (string)ViewState["TestPackageDivisionId"]; } + set { ViewState["TestPackageDivisionId"] = value; } + } + /// /// 定义集合 /// @@ -60,59 +69,56 @@ namespace FineUIPro.Web.SYBData Funs.FineUIPleaseSelect(this.drpProjectId); this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.ProjectId = this.tvControlItem.SelectedNodeID; + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.ProjectId = this.tvControlItem.SelectedNodeID; //管线 - this.drpIsoId.DataTextField = "ISO_IsoNo"; - this.drpIsoId.DataValueField = "ISO_IsoNo"; - this.drpIsoId.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); - this.drpIsoId.DataBind(); + //this.drpIsoId.DataTextField = "ISO_IsoNo"; + //this.drpIsoId.DataValueField = "ISO_IsoNo"; + //this.drpIsoId.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + //this.drpIsoId.DataBind(); - PageInfo(); + //PageInfo(); } } private void PageInfo() { items.Clear(); - if (!string.IsNullOrEmpty(this.ProjectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - var reportLists = BLL.PressureTestPackageListService.GetListsByProjectId(this.ProjectId); - if (reportLists.Count > 0) + var isoLists = BLL.ToIsoListService.GetToIsoListByTestPackageDivisionId(this.TestPackageDivisionId); + if (isoLists.Count > 0) { - var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); foreach (var item in isoLists) { - var iso = (from x in Funs.DB.SYBData_PressureTestPackageList where x.ProjectId == this.ProjectId && x.PipelineCode == item.ISO_IsoNo select x).FirstOrDefault(); - if (iso == null) + var iso = (from x in Funs.DB.SYBData_PressureTestPackageList where x.ToIsoId == item.ToIsoId select x).FirstOrDefault(); + if (iso == null)//无数据时 { Model.SYBData_PressureTestPackageList newReport = new Model.SYBData_PressureTestPackageList(); newReport.PressureTestPackageListId = SQLHelper.GetNewID(); newReport.ProjectId = this.ProjectId; - newReport.PipelineCode = item.ISO_IsoNo; - newReport.PressureTestPackageCode = ""; - reportLists.Add(newReport); + if(!string.IsNullOrEmpty(item.ISO_ID)) + { + newReport.PipelineCode = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(item.ISO_ID).ISO_IsoNo; + } + if (!string.IsNullOrEmpty(item.TestPackageDivisionId)) + { + newReport.PressureTestPackageCode = BLL.TestPackageDivisionService.GetTestPackageDivisionById(item.TestPackageDivisionId).TestPackageCode; + } + newReport.ToIsoId = item.ToIsoId; + items.Add(newReport); + } + else //有数据时 + { + Model.SYBData_PressureTestPackageList newReport = new Model.SYBData_PressureTestPackageList(); + newReport.PressureTestPackageListId = iso.PressureTestPackageListId; + newReport.ProjectId = iso.ProjectId; + newReport.PipelineCode = iso.PipelineCode; + newReport.PressureTestPackageCode = iso.PressureTestPackageCode; + newReport.ToIsoId = iso.ToIsoId; + items.Add(newReport); } - } - if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) - { - reportLists = reportLists.Where(x => x.PipelineCode.Contains(this.drpIsoId.SelectedValue)).ToList(); - } - this.Grid1.DataSource = reportLists; - this.Grid1.DataBind(); - } - else - { - var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); - foreach (var iso in isoLists) - { - Model.SYBData_PressureTestPackageList newReport = new Model.SYBData_PressureTestPackageList(); - newReport.PressureTestPackageListId = SQLHelper.GetNewID(); - newReport.ProjectId = this.ProjectId; - newReport.PipelineCode = iso.ISO_IsoNo; - newReport.PressureTestPackageCode = ""; - items.Add(newReport); } if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) { @@ -121,6 +127,25 @@ namespace FineUIPro.Web.SYBData this.Grid1.DataSource = items; this.Grid1.DataBind(); } + //else + //{ + //var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + //foreach (var iso in isoLists) + //{ + // Model.SYBData_PressureTestPackageList newReport = new Model.SYBData_PressureTestPackageList(); + // newReport.PressureTestPackageListId = SQLHelper.GetNewID(); + // newReport.ProjectId = this.ProjectId; + // newReport.PipelineCode = iso.ISO_IsoNo; + // newReport.PressureTestPackageCode = ""; + // items.Add(newReport); + //} + //if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) + //{ + // items = items.Where(x => x.PipelineCode.Contains(this.drpIsoId.SelectedValue)).ToList(); + //} + //this.Grid1.DataSource = items; + //this.Grid1.DataBind(); + //} } } #endregion @@ -148,10 +173,10 @@ namespace FineUIPro.Web.SYBData projects = projects.Where(e => e.ProjectId == selectedProjectId).ToList(); // 如果项目存在,则选中该节点 - if (projects.Any()) - { - this.tvControlItem.SelectedNodeID = selectedProjectId; - } + //if (projects.Any()) + //{ + // this.tvControlItem.SelectedNodeID = selectedProjectId; + //} } if (this.drpProjectId.SelectedValue != BLL.Const._Null) @@ -168,6 +193,19 @@ namespace FineUIPro.Web.SYBData rootProjectNode.ToolTip = item.ProjectName; rootProjectNode.CommandName = "项目名称"; rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } } } #endregion @@ -182,8 +220,27 @@ namespace FineUIPro.Web.SYBData { if (this.tvControlItem.SelectedNodeID != "0") { - this.ProjectId = this.tvControlItem.SelectedNodeID; - this.BindGrid(); + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + this.TestPackageDivisionId = string.Empty; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + + ///加载管线下拉项 + this.drpIsoId.Items.Clear(); + this.drpIsoId.DataTextField = "ISO_IsoNo"; + this.drpIsoId.DataValueField = "ISO_IsoNo"; + this.drpIsoId.DataSource = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + this.drpIsoId.DataBind(); + Funs.FineUIPleaseSelect(this.drpIsoId); + this.drpIsoId.SelectedIndex = 0; + + PageInfo(); + } } } #endregion @@ -194,9 +251,13 @@ namespace FineUIPro.Web.SYBData ///
private void BindGrid() { - string strSql = @"SELECT * FROM SYBData_PressureTestPackageList where ProjectId=@projectId"; + string strSql = @"select p.PressureTestPackageListId,p.ProjectId,p.SerialNumber,p.PipelineCode,p.PressureTestPackageCode,p.Remark,p.CompileMan,p.CompileDate,p.ToIsoId + from SYBData_PressureTestPackageList p + left join SYBData_ToIsoList t on t.ToIsoId = p.ToIsoId + left join SYBData_TestPackageDivision tp on tp.TestPackageDivisionId = t.TestPackageDivisionId + where tp.TestPackageDivisionId=@testPackageDivisionId"; List listStr = new List(); - listStr.Add(new SqlParameter("@projectId", this.ProjectId)); + listStr.Add(new SqlParameter("@testPackageDivisionId", this.TestPackageDivisionId)); SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); @@ -256,8 +317,8 @@ namespace FineUIPro.Web.SYBData { this.ProjectId = this.drpProjectId.SelectedValue; this.InitTreeMenu(); - this.tvControlItem.SelectedNodeID = this.ProjectId; - BindGrid(); + //this.tvControlItem.SelectedNodeID = this.ProjectId; + //BindGrid(); } /// @@ -265,10 +326,10 @@ namespace FineUIPro.Web.SYBData /// /// /// - protected void TextBox_TextChanged(object sender, EventArgs e) - { - this.BindGrid(); - } + //protected void TextBox_TextChanged(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} #endregion #region 打印 @@ -279,7 +340,7 @@ namespace FineUIPro.Web.SYBData /// protected void btnPrint_Click(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(this.ProjectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { string initTemplatePath = ""; string rootPath = Server.MapPath("~/"); @@ -288,7 +349,7 @@ namespace FineUIPro.Web.SYBData List listStr = new List(); if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) { - listStr.Add(new SqlParameter("@projectId", this.tvControlItem.SelectedNodeID)); + listStr.Add(new SqlParameter("@testPackageDivisionId", this.tvControlItem.SelectedNodeID)); } if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) { @@ -344,7 +405,7 @@ namespace FineUIPro.Web.SYBData } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); return; } } @@ -358,34 +419,38 @@ namespace FineUIPro.Web.SYBData /// protected void btnAdd_Click(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - JArray teamGroupData = Grid1.GetMergedData(); - List list = new List(); - foreach (JObject teamGroupRow in teamGroupData) + var testPackageDivision = BLL.TestPackageDivisionService.GetTestPackageDivisionById(this.TestPackageDivisionId); + if (testPackageDivision != null) { - JObject values = teamGroupRow.Value("values"); - list.Add(values); - } + 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 + JObject defaultObj = new JObject { { "PressureTestPackageListId", Guid.NewGuid() }, { "PipelineCode", "" }, - { "PressureTestPackageCode", "" }, + { "PressureTestPackageCode", testPackageDivision.TestPackageCode }, { "Delete3", String.Format("", GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) } }; - list.Add(defaultObj); - Grid1.DataSource = list; - Grid1.DataBind(); + list.Add(defaultObj); + Grid1.DataSource = list; + Grid1.DataBind(); + } } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); return; } } @@ -433,6 +498,7 @@ namespace FineUIPro.Web.SYBData SerialNumber = (i + 1).ToString(), PipelineCode = values.Value("PipelineCode"), PressureTestPackageCode = values.Value("PressureTestPackageCode"), + ToIsoId = values.Value("ToIsoId"), CompileMan = this.CurrUser.UserId, CompileDate = DateTime.Now }; diff --git a/HJGL_DS/FineUIPro.Web/SYBData/RTProportionConfirmation.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/RTProportionConfirmation.aspx.cs index d9529e1..2e0fc6f 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/RTProportionConfirmation.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/SYBData/RTProportionConfirmation.aspx.cs @@ -23,6 +23,16 @@ namespace FineUIPro.Web.SYBData set { ViewState["ProjectId"] = value; } } + /// + /// 试压包划分id + /// + private string TestPackageDivisionId + { + get { return (string)ViewState["TestPackageDivisionId"]; } + set { ViewState["TestPackageDivisionId"] = value; } + } + + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -34,11 +44,11 @@ namespace FineUIPro.Web.SYBData this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); this.drpProjectId.DataBind(); Funs.FineUIPleaseSelect(this.drpProjectId); - this.ProjectId = this.CurrUser.LoginProjectId; - this.drpProjectId.SelectedValue = this.ProjectId; + //this.ProjectId = this.CurrUser.LoginProjectId; + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - BindGrid(); + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //BindGrid(); } } @@ -72,6 +82,19 @@ namespace FineUIPro.Web.SYBData rootProjectNode.ToolTip = item.ProjectName; rootProjectNode.CommandName = "项目名称"; rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } } } #endregion @@ -86,8 +109,18 @@ namespace FineUIPro.Web.SYBData { if (this.tvControlItem.SelectedNodeID != "0") { - this.ProjectId = this.tvControlItem.SelectedNodeID; - this.BindGrid(); + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.BindGrid(); + } + //this.ProjectId = this.tvControlItem.SelectedNodeID; + //this.BindGrid(); } } #endregion @@ -98,12 +131,13 @@ namespace FineUIPro.Web.SYBData ///
private void BindGrid() { - if (!string.IsNullOrEmpty(this.ProjectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + listStr.Add(new SqlParameter("@TestPackageDivisionId", this.TestPackageDivisionId)); SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_RayCheckConfirmProject", parameter); + DataTable tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_SYBRayCheckConfirmProject", parameter); this.Grid1.RecordCount = tb.Rows.Count; var table = this.GetPagedDataTable(Grid1, tb); Grid1.DataSource = table; @@ -163,8 +197,8 @@ namespace FineUIPro.Web.SYBData { this.ProjectId = this.drpProjectId.SelectedValue; this.InitTreeMenu(); - this.tvControlItem.SelectedNodeID = this.ProjectId; - BindGrid(); + //this.tvControlItem.SelectedNodeID = this.ProjectId; + //BindGrid(); } #endregion @@ -288,65 +322,73 @@ namespace FineUIPro.Web.SYBData /// protected void btnPrint_Click(object sender, EventArgs e) { - string initTemplatePath = ""; - string rootPath = Server.MapPath("~/"); - BLL.Common.FastReportService.ResetData(); - - var listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); - SqlParameter[] parameter = listStr.ToArray(); - var tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_RayCheckConfirmProject", parameter); - - DataTable dt = new DataTable(); - dt.TableName = "Data"; - dt.Columns.Add("ISO_IsoNo"); - dt.Columns.Add("STE_Name"); - dt.Columns.Add("JOT_JointDesc"); - dt.Columns.Add("TotalJotNum"); - dt.Columns.Add("TotalJotGNum"); - dt.Columns.Add("WED_Code"); - dt.Columns.Add("WeldNum"); - dt.Columns.Add("CheckNum"); - dt.Columns.Add("CheckGNum"); - dt.Columns.Add("CheckRate"); - dt.Columns.Add("ReportCode"); - - DataView dv = tb.DefaultView;//获取表视图 - dv.Sort = "ISO_IsoNo ASC";//按照ID倒序排序 - tb = dv.ToTable();//转为表 - DataRow[] rows = tb.DefaultView.ToTable().Select(); - foreach (var row in rows) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - var newRows = dt.NewRow(); - newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); - newRows["STE_Name"] = ConvertSTE(row["STE_ID"].ToString()); - newRows["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); - newRows["TotalJotNum"] = row["TotalJotNum"].ToString(); - newRows["TotalJotGNum"] = row["TotalJotGNum"].ToString(); - newRows["WED_Code"] = row["WED_Code"].ToString(); - newRows["WeldNum"] = row["WeldNum"].ToString(); - newRows["CheckNum"] = row["CheckNum"].ToString(); - newRows["CheckGNum"] = row["CheckGNum"].ToString(); - newRows["CheckRate"] = row["CheckRate"].ToString(); - newRows["ReportCode"] = row["ReportCode"].ToString(); + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); - dt.Rows.Add(newRows); + var listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + listStr.Add(new SqlParameter("@TestPackageDivisionId", this.TestPackageDivisionId)); + SqlParameter[] parameter = listStr.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_SYBRayCheckConfirmProject", parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("STE_Name"); + dt.Columns.Add("JOT_JointDesc"); + dt.Columns.Add("TotalJotNum"); + dt.Columns.Add("TotalJotGNum"); + dt.Columns.Add("WED_Code"); + dt.Columns.Add("WeldNum"); + dt.Columns.Add("CheckNum"); + dt.Columns.Add("CheckGNum"); + dt.Columns.Add("CheckRate"); + dt.Columns.Add("ReportCode"); + + DataView dv = tb.DefaultView;//获取表视图 + dv.Sort = "ISO_IsoNo ASC";//按照ID倒序排序 + tb = dv.ToTable();//转为表 + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["STE_Name"] = ConvertSTE(row["STE_ID"].ToString()); + newRows["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); + newRows["TotalJotNum"] = row["TotalJotNum"].ToString(); + newRows["TotalJotGNum"] = row["TotalJotGNum"].ToString(); + newRows["WED_Code"] = row["WED_Code"].ToString(); + newRows["WeldNum"] = row["WeldNum"].ToString(); + newRows["CheckNum"] = row["CheckNum"].ToString(); + newRows["CheckGNum"] = row["CheckGNum"].ToString(); + newRows["CheckRate"] = row["CheckRate"].ToString(); + newRows["ReportCode"] = row["ReportCode"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + //传参 + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("projectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\管道焊接接头射线检测比例确认表(一).frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + } } - BLL.Common.FastReportService.AddFastreportTable(dt); - - //传参 - Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("projectName", BLL.Base_ProjectService.GetProjectByProjectId(this.tvControlItem.SelectedNodeID).ProjectName); - BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - - initTemplatePath = "File\\Fastreport\\管道焊接接头射线检测比例确认表(一).frx"; - - if (File.Exists(rootPath + initTemplatePath)) + else { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); - + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); + return; } - } #endregion } diff --git a/HJGL_DS/FineUIPro.Web/SYBData/SlidingFixed.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/SlidingFixed.aspx.cs index b99add0..051b42d 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/SlidingFixed.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/SYBData/SlidingFixed.aspx.cs @@ -32,6 +32,12 @@ namespace FineUIPro.Web.SYBData set { ViewState["ProjectId"] = value; } } + private string TestPackageDivisionId + { + get { return (string)ViewState["TestPackageDivisionId"]; } + set { ViewState["TestPackageDivisionId"] = value; } + } + /// /// 定义集合 /// @@ -56,36 +62,37 @@ namespace FineUIPro.Web.SYBData Funs.FineUIPleaseSelect(this.drpProjectId); this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.ProjectId = this.tvControlItem.SelectedNodeID; + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.ProjectId = this.tvControlItem.SelectedNodeID; //管线 - this.drpIsoNoS.DataTextField = "ISO_IsoNo"; - this.drpIsoNoS.DataValueField = "ISO_IsoNo"; - this.drpIsoNoS.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); - this.drpIsoNoS.DataBind(); + //this.drpIsoNoS.DataTextField = "ISO_IsoNo"; + //this.drpIsoNoS.DataValueField = "ISO_IsoNo"; + //this.drpIsoNoS.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + //this.drpIsoNoS.DataBind(); - DataIsoInfo(); + //DataIsoInfo(); } } private void DataIsoInfo() { items.Clear(); - if (!string.IsNullOrEmpty(this.ProjectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - var reportLists = BLL.SlidingFixedService.GetListsByProjectId(this.ProjectId); + var reportLists = BLL.SlidingFixedService.GetListsByTestPackageDivisionId(this.TestPackageDivisionId); if (reportLists.Count > 0) { - var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + var isoLists = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); foreach (var item in isoLists) { - var iso = (from x in Funs.DB.SYBData_SlidingFixed where x.ProjectId == this.ProjectId && x.PipelineCode == item.ISO_IsoNo select x).FirstOrDefault(); + var iso = (from x in Funs.DB.SYBData_SlidingFixed where x.TestPackageDivisionId == this.TestPackageDivisionId && x.PipelineCode == item.ISO_IsoNo select x).FirstOrDefault(); if (iso == null) { Model.SYBData_SlidingFixed newReport = new Model.SYBData_SlidingFixed(); newReport.SlidingFixedId = SQLHelper.GetNewID(); newReport.ProjectId = this.ProjectId; + newReport.TestPackageDivisionId = this.TestPackageDivisionId; newReport.PipelineCode = item.ISO_IsoNo; reportLists.Add(newReport); } @@ -99,12 +106,13 @@ namespace FineUIPro.Web.SYBData } else { - var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + var isoLists = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); foreach (var iso in isoLists) { Model.SYBData_SlidingFixed newReport = new Model.SYBData_SlidingFixed(); newReport.SlidingFixedId = SQLHelper.GetNewID(); newReport.ProjectId = this.ProjectId; + newReport.TestPackageDivisionId = this.TestPackageDivisionId; newReport.PipelineCode = iso.ISO_IsoNo; items.Add(newReport); } @@ -149,6 +157,19 @@ namespace FineUIPro.Web.SYBData rootProjectNode.ToolTip = item.ProjectName; rootProjectNode.CommandName = "项目名称"; rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } } } #endregion @@ -163,8 +184,22 @@ namespace FineUIPro.Web.SYBData { if (this.tvControlItem.SelectedNodeID != "0") { - this.ProjectId = this.tvControlItem.SelectedNodeID; - this.BindGrid(); + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.drpIsoNoS.DataTextField = "ISO_IsoNo"; + this.drpIsoNoS.DataValueField = "ISO_IsoNo"; + this.drpIsoNoS.DataSource = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + this.drpIsoNoS.DataBind(); + DataIsoInfo(); + } + //this.ProjectId = this.tvControlItem.SelectedNodeID; + //this.BindGrid(); } } #endregion @@ -175,13 +210,12 @@ namespace FineUIPro.Web.SYBData ///
private void BindGrid() { - string projectId = this.tvControlItem.SelectedNodeID; string strSql = @"SELECT * from SYBData_SlidingFixed where 1=1"; List listStr = new List(); - if (!string.IsNullOrEmpty(projectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - strSql += " AND ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", projectId)); + strSql += " AND TestPackageDivisionId = @TestPackageDivisionId"; + listStr.Add(new SqlParameter("@TestPackageDivisionId", this.TestPackageDivisionId)); } if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue)) { @@ -246,10 +280,10 @@ namespace FineUIPro.Web.SYBData /// protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.ProjectId = this.tvControlItem.SelectedNodeID; + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.ProjectId = this.tvControlItem.SelectedNodeID; this.InitTreeMenu(); - BindGrid(); + //BindGrid(); } /// @@ -271,16 +305,15 @@ namespace FineUIPro.Web.SYBData /// protected void btnPrint_Click(object sender, EventArgs e) { - string projectId = this.tvControlItem.SelectedNodeID; - if (projectId != null) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { string initTemplatePath = ""; string rootPath = Server.MapPath("~/"); BLL.Common.FastReportService.ResetData(); - string strSql = @"SELECT * from SYBData_SlidingFixed where ProjectId = @ProjectId"; + string strSql = @"SELECT * from SYBData_SlidingFixed where TestPackageDivisionId = @TestPackageDivisionId"; List listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", projectId)); + listStr.Add(new SqlParameter("@TestPackageDivisionId", this.TestPackageDivisionId)); if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue)) { strSql += " and PipelineCode like @PipelineCode"; @@ -318,7 +351,7 @@ namespace FineUIPro.Web.SYBData BLL.Common.FastReportService.AddFastreportTable(dt); Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); initTemplatePath = "File\\Fastreport\\SYBData\\滑动固定管托安装检验记录.frx"; @@ -335,7 +368,7 @@ namespace FineUIPro.Web.SYBData } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); return; } } @@ -349,22 +382,21 @@ namespace FineUIPro.Web.SYBData /// protected void btnAdd_Click(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + JArray teamGroupData = Grid1.GetMergedData(); + List list = new List(); + foreach (JObject teamGroupRow in teamGroupData) { - JArray teamGroupData = Grid1.GetMergedData(); - List list = new List(); - foreach (JObject teamGroupRow in teamGroupData) - { - JObject values = teamGroupRow.Value("values"); - list.Add(values); - } + JObject values = teamGroupRow.Value("values"); + list.Add(values); + } - JObject defaultObj = new JObject + JObject defaultObj = new JObject { { "SlidingFixedId", Guid.NewGuid() }, - { "ProjectId", this.tvControlItem.SelectedNodeID }, + { "ProjectId", this.ProjectId }, + { "TestPackageDivisionId", this.TestPackageDivisionId }, { "PipelineCode", "" }, { "PipeSupportCode", "" }, { "Types", "" }, @@ -378,15 +410,14 @@ namespace FineUIPro.Web.SYBData GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) } }; - list.Add(defaultObj); - Grid1.DataSource = list; - Grid1.DataBind(); - } - else - { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; - } + list.Add(defaultObj); + Grid1.DataSource = list; + Grid1.DataBind(); + } + else + { + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); + return; } } @@ -439,7 +470,7 @@ namespace FineUIPro.Web.SYBData void saveItem() { - BLL.SlidingFixedService.DeleteSlidingFixedByProjectId(this.tvControlItem.SelectedNodeID); + BLL.SlidingFixedService.DeleteSlidingFixedByTestPackageDivisionId(this.TestPackageDivisionId); List detailLists = new List(); JArray teamGroupData = Grid1.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -449,7 +480,8 @@ namespace FineUIPro.Web.SYBData Model.SYBData_SlidingFixed newDetail = new Model.SYBData_SlidingFixed { SlidingFixedId = values.Value("SlidingFixedId"), - ProjectId = this.tvControlItem.SelectedNodeID, + ProjectId = this.ProjectId, + TestPackageDivisionId=this.TestPackageDivisionId, PipelineCode = values.Value("PipelineCode"), PipeSupportCode = values.Value("PipeSupportCode"), Types = values.Value("Types"), diff --git a/HJGL_DS/FineUIPro.Web/SYBData/SpringSupportHangBracket.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/SpringSupportHangBracket.aspx.cs index de6211a..c4383d5 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/SpringSupportHangBracket.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/SYBData/SpringSupportHangBracket.aspx.cs @@ -33,6 +33,21 @@ namespace FineUIPro.Web.SYBData set { ViewState["ProjectId"] = value; } } + /// + /// 试压包号 + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + /// /// 定义集合 /// @@ -57,36 +72,37 @@ namespace FineUIPro.Web.SYBData Funs.FineUIPleaseSelect(this.drpProjectId); this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.ProjectId = this.tvControlItem.SelectedNodeID; + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.ProjectId = this.tvControlItem.SelectedNodeID; - //管线 - this.drpIsoNoS.DataTextField = "ISO_IsoNo"; - this.drpIsoNoS.DataValueField = "ISO_IsoNo"; - this.drpIsoNoS.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); - this.drpIsoNoS.DataBind(); + ////管线 + //this.drpIsoNoS.DataTextField = "ISO_IsoNo"; + //this.drpIsoNoS.DataValueField = "ISO_IsoNo"; + //this.drpIsoNoS.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + //this.drpIsoNoS.DataBind(); - DataIsoInfo(); + //DataIsoInfo(); } } private void DataIsoInfo() { items.Clear(); - if (!string.IsNullOrEmpty(this.ProjectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - var reportLists = BLL.SpringSupportHangBracketService.GetListByProjectId(this.ProjectId); + var reportLists = BLL.SpringSupportHangBracketService.GetListByTestPackageDivisionId(this.TestPackageDivisionId); if (reportLists.Count > 0) { - var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + var isoLists = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); foreach (var item in isoLists) { - var iso = (from x in Funs.DB.SYBData_SpringSupportHangBracket where x.ProjectId == this.ProjectId && x.PipelineCode == item.ISO_IsoNo select x).FirstOrDefault(); + var iso = (from x in Funs.DB.SYBData_SpringSupportHangBracket where x.TestPackageDivisionId == this.TestPackageDivisionId && x.PipelineCode == item.ISO_IsoNo select x).FirstOrDefault(); if (iso == null) { Model.SYBData_SpringSupportHangBracket newReport = new Model.SYBData_SpringSupportHangBracket(); newReport.SpringSupportHangBracketId = SQLHelper.GetNewID(); newReport.ProjectId = this.ProjectId; + newReport.TestPackageDivisionId = this.TestPackageDivisionId; newReport.PipelineCode = item.ISO_IsoNo; reportLists.Add(newReport); } @@ -100,12 +116,13 @@ namespace FineUIPro.Web.SYBData } else { - var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + var isoLists = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); foreach (var iso in isoLists) { Model.SYBData_SpringSupportHangBracket newReport = new Model.SYBData_SpringSupportHangBracket(); newReport.SpringSupportHangBracketId = SQLHelper.GetNewID(); newReport.ProjectId = this.ProjectId; + newReport.TestPackageDivisionId = this.TestPackageDivisionId; newReport.PipelineCode = iso.ISO_IsoNo; items.Add(newReport); } @@ -150,6 +167,19 @@ namespace FineUIPro.Web.SYBData rootProjectNode.ToolTip = item.ProjectName; rootProjectNode.CommandName = "项目名称"; rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } } } #endregion @@ -164,8 +194,24 @@ namespace FineUIPro.Web.SYBData { if (this.tvControlItem.SelectedNodeID != "0") { - this.ProjectId = this.tvControlItem.SelectedNodeID; - this.BindGrid(); + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + this.TestPackageDivisionId = string.Empty; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + + this.drpIsoNoS.DataTextField = "ISO_IsoNo"; + this.drpIsoNoS.DataValueField = "ISO_IsoNo"; + this.drpIsoNoS.DataSource = BLL.ToIsoListService.GetIsoInfoByTestPackageDivisionId(this.TestPackageDivisionId); + this.drpIsoNoS.DataBind(); + + DataIsoInfo(); + //this.BindGrid(); + } } } #endregion @@ -176,13 +222,13 @@ namespace FineUIPro.Web.SYBData /// private void BindGrid() { - string projectId = this.tvControlItem.SelectedNodeID; + //string projectId = this.tvControlItem.SelectedNodeID; string strSql = @"SELECT * from SYBData_SpringSupportHangBracket where 1=1"; List listStr = new List(); - if (!string.IsNullOrEmpty(projectId)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { - strSql += " AND ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", projectId)); + strSql += " AND TestPackageDivisionId = @TestPackageDivisionId"; + listStr.Add(new SqlParameter("@TestPackageDivisionId", this.TestPackageDivisionId)); } if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue)) { @@ -247,10 +293,10 @@ namespace FineUIPro.Web.SYBData /// protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.ProjectId = this.tvControlItem.SelectedNodeID; + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.ProjectId = this.tvControlItem.SelectedNodeID; this.InitTreeMenu(); - BindGrid(); + //BindGrid(); } /// @@ -272,16 +318,15 @@ namespace FineUIPro.Web.SYBData /// protected void btnPrint_Click(object sender, EventArgs e) { - string projectId = this.tvControlItem.SelectedNodeID; - if (projectId != null) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { string initTemplatePath = ""; string rootPath = Server.MapPath("~/"); BLL.Common.FastReportService.ResetData(); - string strSql = @"SELECT * from SYBData_SpringSupportHangBracket where ProjectId = @ProjectId"; + string strSql = @"SELECT * from SYBData_SpringSupportHangBracket where TestPackageDivisionId = @TestPackageDivisionId"; List listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", projectId)); + listStr.Add(new SqlParameter("@TestPackageDivisionId", TestPackageDivisionId)); if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue)) { strSql += " and PipelineCode like @PipelineCode"; @@ -319,7 +364,7 @@ namespace FineUIPro.Web.SYBData BLL.Common.FastReportService.AddFastreportTable(dt); Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); initTemplatePath = "File\\Fastreport\\SYBData\\弹簧支吊架安装检验记录.frx"; @@ -336,7 +381,7 @@ namespace FineUIPro.Web.SYBData } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); return; } } @@ -350,9 +395,7 @@ namespace FineUIPro.Web.SYBData /// protected void btnAdd_Click(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) { JArray teamGroupData = Grid1.GetMergedData(); List list = new List(); @@ -365,7 +408,8 @@ namespace FineUIPro.Web.SYBData JObject defaultObj = new JObject { { "SpringSupportHangBracketId", Guid.NewGuid() }, - { "ProjectId", this.tvControlItem.SelectedNodeID }, + { "ProjectId", this.ProjectId }, + { "TestPackageDivisionId", this.TestPackageDivisionId }, { "PipelineCode", "" }, { "PositionNum", "" }, { "StructuralType", "" }, @@ -385,10 +429,9 @@ namespace FineUIPro.Web.SYBData } else { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); return; } - } } protected void Grid1_PreDataBound(object sender, EventArgs e) @@ -440,7 +483,7 @@ namespace FineUIPro.Web.SYBData void saveItem() { - BLL.SpringSupportHangBracketService.DeleteSpringSupportHangBracketByProjectId(this.tvControlItem.SelectedNodeID); + BLL.SpringSupportHangBracketService.DeleteSpringSupportHangBracketByTestPackageDivisionId(this.TestPackageDivisionId); List detailLists = new List(); JArray teamGroupData = Grid1.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -450,7 +493,8 @@ namespace FineUIPro.Web.SYBData Model.SYBData_SpringSupportHangBracket newDetail = new Model.SYBData_SpringSupportHangBracket { SpringSupportHangBracketId = values.Value("SpringSupportHangBracketId"), - ProjectId = this.tvControlItem.SelectedNodeID, + ProjectId = this.ProjectId, + TestPackageDivisionId = this.TestPackageDivisionId, PipelineCode = values.Value("PipelineCode"), PositionNum = values.Value("PositionNum"), StructuralType = values.Value("StructuralType"), @@ -458,8 +502,8 @@ namespace FineUIPro.Web.SYBData DesignLoadValue = values.Value("DesignLoadValue"), InstallationLoadValue = values.Value("InstallationLoadValue"), CheckResults = values.Value("CheckResults"), - CompileMan =this.CurrUser.UserId, - CompileDate=DateTime.Now + CompileMan = this.CurrUser.UserId, + CompileDate = DateTime.Now }; detailLists.Add(newDetail); } diff --git a/HJGL_DS/FineUIPro.Web/SYBData/TestPackageDivision.aspx b/HJGL_DS/FineUIPro.Web/SYBData/TestPackageDivision.aspx index 9aeb7e3..49650dc 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/TestPackageDivision.aspx +++ b/HJGL_DS/FineUIPro.Web/SYBData/TestPackageDivision.aspx @@ -19,7 +19,7 @@ - + diff --git a/HJGL_DS/FineUIPro.Web/SYBData/TestPackageDivision.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/TestPackageDivision.aspx.cs index 05ccb54..edc410d 100644 --- a/HJGL_DS/FineUIPro.Web/SYBData/TestPackageDivision.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/SYBData/TestPackageDivision.aspx.cs @@ -155,6 +155,14 @@ namespace FineUIPro.Web.SYBData } BindGrid(); } + + protected void drpIsoId_SelectedIndexChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) + { + BindGrid(); + } + } #endregion #region 保存 @@ -260,5 +268,6 @@ namespace FineUIPro.Web.SYBData } } #endregion + } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/SYBData/TestQuantityStatistics.aspx b/HJGL_DS/FineUIPro.Web/SYBData/TestQuantityStatistics.aspx new file mode 100644 index 0000000..3c32bd7 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/TestQuantityStatistics.aspx @@ -0,0 +1,143 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestQuantityStatistics.aspx.cs" Inherits="FineUIPro.Web.SYBData.TestQuantityStatistics" %> + + + + + + + 管道无损检测数量统计表 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/SYBData/TestQuantityStatistics.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/TestQuantityStatistics.aspx.cs new file mode 100644 index 0000000..3feb716 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/TestQuantityStatistics.aspx.cs @@ -0,0 +1,581 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.SYBData +{ + public partial class TestQuantityStatistics : PageBase + { + #region 定义变量 + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 试压包号 + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + + this.drpProjectId.DataTextField = "ProjectCode"; + this.drpProjectId.DataValueField = "ProjectId"; + this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + this.drpProjectId.DataBind(); + Funs.FineUIPleaseSelect(this.drpProjectId); + + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + this.InitTreeMenu();//加载树 + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.BindGrid(); + } + } + #endregion + + #region 加载树 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "项目"; + rootNode.ToolTip = "项目"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode); + + List projects = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + if (this.drpProjectId.SelectedValue != null && this.drpProjectId.SelectedValue != "null") + { + projects = projects.Where(x => x.ProjectId == this.drpProjectId.SelectedValue).ToList(); + } + + foreach (var item in projects) + { + TreeNode rootProjectNode = new TreeNode();//定义根节点 + rootProjectNode.Text = item.ProjectCode; + rootProjectNode.NodeID = item.ProjectId; + rootProjectNode.EnableExpandEvent = true; + rootProjectNode.Expanded = true; + rootProjectNode.ToolTip = item.ProjectName; + rootProjectNode.CommandName = "项目名称"; + rootNode.Nodes.Add(rootProjectNode); + + //TreeNode tn = new TreeNode(); + //tn.NodeID = "temp"; + //tn.Text = "正在加载..."; + + //rootProjectNode.Nodes.Add(tn); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } + } + } + + /// + /// 节点展开事件 + /// + /// + /// + protected void tvControlItem_NodeExpand(object sender, TreeNodeEventArgs e) + { + //if (e.Node.Nodes != null) + //{ + // e.Node.Nodes.Clear(); + //} + //List list = (from x in Funs.DB.Project_Installation where x.ProjectId == e.NodeID select x).ToList(); + + //this.BindNodes(e.Node, list); + } + + /// + /// 绑定树节点 + /// + /// + //private void BindNodes(TreeNode node, List treeLists) + //{ + // if (node.CommandName == "施工号") + // { + // var lists = (from x in treeLists orderby x.InstallationCode descending select x).Distinct(); + // foreach (var item in lists) + // { + // TreeNode newNode = new TreeNode(); + // newNode.Text = item.InstallationCode; + // newNode.NodeID = item.InstallationId; + // newNode.ToolTip = item.InstallationName; + // newNode.CommandName = "装置"; + // newNode.EnableClickEvent = true; + // node.Nodes.Add(newNode); + // } + // } + //} + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (this.tvControlItem.SelectedNodeID != "0") + { + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + BindPage(); + BindGrid(); + } + } + } + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + if (!string.IsNullOrEmpty(this.TestPackageDivisionId) && !string.IsNullOrEmpty(this.ProjectId)) + { + string strSql = @"SELECT * FROM HJGL_View_TrustNumSummary_SYB WHERE ProjectId = @ProjectId ";//AND InstallationId = @InstallationId"; + List listStr = new List(); + + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + //listStr.Add(new SqlParameter("@InstallationId", this.tvControlItem.SelectedNodeID)); + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + DataRow[] rows = tb.Select("TestPackageDivisionId='" +this.TestPackageDivisionId + "'"); + // 2.获取当前分页数据 + //var table = this.GetPagedDataTable(Grid1, tb1); + Grid1.RecordCount = rows.Count(); + //tb = GetFilteredTable(Grid1.FilteredData, tb); + //var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = rows; + Grid1.DataBind(); + } + } + + private void BindPage() + { + if (!string.IsNullOrEmpty(this.TestPackageDivisionId) && !string.IsNullOrEmpty(this.ProjectId)) + { + //var ins = BLL.Project_InstallationService.GetInstallationByInstallationId(this.tvControlItem.SelectedNodeID); + //if (ins != null) + //{ + // this.txtWorkAreaCode.Text = ins.InstallationCode; + //} + this.txtTestingStandard.Text = "NB/T47013-2015"; + } + else + { + this.txtWorkAreaCode.Text = string.Empty; + } + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + #endregion + + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + + #region 项目下拉选择事件 + /// + /// 项目下拉选择事件 + /// + /// + /// + protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) + { + this.InitTreeMenu(); + this.BindGrid(); + } + #endregion + + #region 导出按钮 + /// 导出按钮 + ///
+ /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("管道无损检测数量统计表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + + FineUIPro.Web.HJGL.WeldingManage.PipelineManageOut2.MultiHeaderTable mht = new FineUIPro.Web.HJGL.WeldingManage.PipelineManageOut2.MultiHeaderTable(); + mht.ResolveMultiHeaderTable(Grid1.Columns); + + sb.Append(""); + sb.Append(""); + + foreach (List rows in mht.MultiTable) + { + sb.Append(""); + foreach (object[] cell in rows) + { + int rowspan = Convert.ToInt32(cell[0]); + int colspan = Convert.ToInt32(cell[1]); + GridColumn column = cell[2] as GridColumn; + + sb.AppendFormat("{3}", + rowspan != 1 ? " rowspan=\"" + rowspan + "\"" : "", + colspan != 1 ? " colspan=\"" + colspan + "\"" : "", + colspan != 1 ? " style=\"text-align:center;\"" : "", + column.HeaderText); + } + sb.Append(""); + } + + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + + foreach (GridColumn column in mht.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + + //if (column.ColumnID == "tfNumber") + //{ + // html = (row.FindControl("spanNumber") as System.Web.UI.HtmlControls.HtmlGenericControl).InnerText; + //} + //else if (column.ColumnID == "tfGender") + //{ + // html = (row.FindControl("labGender") as AspNet.Label).Text; + //} + sb.AppendFormat("", html); + } + sb.Append(""); + } + sb.Append("
{0}
"); + return sb.ToString(); + } + #endregion + + #region 多表头处理 + /// + /// 处理多表头的类 + /// + public class MultiHeaderTable + { + // 包含 rowspan,colspan 的多表头,方便生成 HTML 的 table 标签 + public List> MultiTable = new List>(); + // 最终渲染的列数组 + public List Columns = new List(); + + public void ResolveMultiHeaderTable(GridColumnCollection columns) + { + List row = new List(); + foreach (GridColumn column in columns) + { + object[] cell = new object[4]; + cell[0] = 1; // rowspan + cell[1] = 1; // colspan + cell[2] = column; + cell[3] = null; + + row.Add(cell); + } + ResolveMultiTable(row, 0); + ResolveColumns(row); + } + + private void ResolveColumns(List row) + { + foreach (object[] cell in row) + { + GroupField groupField = cell[2] as GroupField; + if (groupField != null && groupField.Columns.Count > 0) + { + List subrow = new List(); + foreach (GridColumn column in groupField.Columns) + { + subrow.Add(new object[] + { + 1, + 1, + column, + groupField + }); + } + ResolveColumns(subrow); + } + else + { + Columns.Add(cell[2] as GridColumn); + } + } + } + + private void ResolveMultiTable(List row, int level) + { + List nextrow = new List(); + + foreach (object[] cell in row) + { + GroupField groupField = cell[2] as GroupField; + if (groupField != null && groupField.Columns.Count > 0) + { + // 如果当前列包含子列,则更改当前列的 colspan,以及增加父列(向上递归)的colspan + cell[1] = Convert.ToInt32(groupField.Columns.Count); + PlusColspan(level - 1, cell[3] as GridColumn, groupField.Columns.Count - 1); + + foreach (GridColumn column in groupField.Columns) + { + nextrow.Add(new object[] + { + 1, + 1, + column, + groupField + }); + } + } + } + + MultiTable.Add(row); + + // 如果当前下一行,则增加上一行(向上递归)中没有子列的列的 rowspan + if (nextrow.Count > 0) + { + PlusRowspan(level); + + ResolveMultiTable(nextrow, level + 1); + } + } + + private void PlusRowspan(int level) + { + if (level < 0) + { + return; + } + foreach (object[] cells in MultiTable[level]) + { + GroupField groupField = cells[2] as GroupField; + if (groupField != null && groupField.Columns.Count > 0) + { + // ... + } + else + { + cells[0] = Convert.ToInt32(cells[0]) + 1; + } + } + PlusRowspan(level - 1); + } + + private void PlusColspan(int level, GridColumn parent, int plusCount) + { + if (level < 0) + { + return; + } + + foreach (object[] cells in MultiTable[level]) + { + GridColumn column = cells[2] as GridColumn; + if (column == parent) + { + cells[1] = Convert.ToInt32(cells[1]) + plusCount; + + PlusColspan(level - 1, cells[3] as GridColumn, plusCount); + } + } + } + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + if (!string.IsNullOrEmpty(this.ProjectId) && !string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + string strSql = @"SELECT * FROM HJGL_View_TrustNumSummary_SYB WHERE ProjectId = @ProjectId "; + List listStr = new List(); + + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + DataRow[] rows = tb.Select("TestPackageDivisionId='" + this.TestPackageDivisionId + "'"); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("IsoNo"); + dt.Columns.Add("NDTR_Name"); + dt.Columns.Add("TotalNum1"); + dt.Columns.Add("Rt1Num"); + dt.Columns.Add("Ut1Num"); + dt.Columns.Add("Mt1Num"); + dt.Columns.Add("Pt1Num"); + dt.Columns.Add("TotalNum2"); + dt.Columns.Add("Mt2Num"); + dt.Columns.Add("Pt2Num"); + dt.Columns.Add("TotalNum3"); + dt.Columns.Add("Rt3Num"); + dt.Columns.Add("Ut3Num"); + dt.Columns.Add("Mt3Num"); + dt.Columns.Add("Pt3Num"); + + //DataView dv = tb.DefaultView;//获取表视图 + //dv.Sort = "ISO_IsoNo ASC";//按照ID倒序排序 + //tb = dv.ToTable();//转为表 + //DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["IsoNo"] = row["IsoNo"].ToString(); + newRows["NDTR_Name"] = row["NDTR_Name"].ToString(); + newRows["TotalNum1"] = row["TotalNum1"].ToString(); + newRows["Rt1Num"] = row["Rt1Num"].ToString(); + newRows["Ut1Num"] = row["Ut1Num"].ToString(); + newRows["Mt1Num"] = row["Mt1Num"].ToString(); + newRows["Pt1Num"] = row["Pt1Num"].ToString(); + newRows["TotalNum2"] = row["TotalNum2"].ToString(); + newRows["Mt2Num"] = row["Mt2Num"].ToString(); + newRows["Pt2Num"] = row["Pt2Num"].ToString(); + newRows["TotalNum3"] = row["TotalNum3"].ToString(); + newRows["Rt3Num"] = row["Rt3Num"].ToString(); + newRows["Ut3Num"] = row["Ut3Num"].ToString(); + newRows["Mt3Num"] = row["Mt3Num"].ToString(); + newRows["Pt3Num"] = row["Pt3Num"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + //传参 + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("projectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); + keyValuePairs.Add("workAreaCode", txtWorkAreaCode.Text.Trim()); + keyValuePairs.Add("testCategoryNumber", txtTestCategoryNumber.Text.Trim()); + keyValuePairs.Add("acceptanceCriteria", txtAcceptanceCriteria.Text.Trim()); + keyValuePairs.Add("testingStandard", txtTestingStandard.Text.Trim()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\JGZL\\管道无损检测数量统计表.frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/SYBData/TestQuantityStatistics.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/SYBData/TestQuantityStatistics.aspx.designer.cs new file mode 100644 index 0000000..c7cd3e5 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/TestQuantityStatistics.aspx.designer.cs @@ -0,0 +1,206 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.SYBData +{ + + + public partial class TestQuantityStatistics + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// drpProjectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProjectId; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtWorkAreaCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtWorkAreaCode; + + /// + /// txtTestCategoryNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtTestCategoryNumber; + + /// + /// txtAcceptanceCriteria 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtAcceptanceCriteria; + + /// + /// txtTestingStandard 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtTestingStandard; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/HJGL_DS/FineUIPro.Web/SYBData/TestResultsSummary.aspx b/HJGL_DS/FineUIPro.Web/SYBData/TestResultsSummary.aspx new file mode 100644 index 0000000..eca5cf6 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/TestResultsSummary.aspx @@ -0,0 +1,101 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestResultsSummary.aspx.cs" Inherits="FineUIPro.Web.SYBData.TestResultsSummary" %> + + + + + + + 管道无损检测结果汇总表 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + --%> + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/SYBData/TestResultsSummary.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/TestResultsSummary.aspx.cs new file mode 100644 index 0000000..58526c6 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/TestResultsSummary.aspx.cs @@ -0,0 +1,661 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.SYBData +{ + public partial class TestResultsSummary : PageBase + { + #region 定义变量 + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 试压包号 + /// + private string TestPackageDivisionId + { + get + { + return (string)ViewState["TestPackageDivisionId"]; + } + set + { + ViewState["TestPackageDivisionId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.drpProjectId.DataTextField = "ProjectCode"; + this.drpProjectId.DataValueField = "ProjectId"; + this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + this.drpProjectId.DataBind(); + Funs.FineUIPleaseSelect(this.drpProjectId); + + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + this.InitTreeMenu();//加载树 + //this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + //this.BindGrid(); + } + } + #endregion + + #region 加载树项目 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "项目"; + rootNode.ToolTip = "项目"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode); + + List projects = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + if (this.drpProjectId.SelectedValue != BLL.Const._Null) + { + projects = projects.Where(e => e.ProjectId == this.drpProjectId.SelectedValue).ToList(); + } + foreach (var item in projects) + { + TreeNode rootProjectNode = new TreeNode();//定义根节点 + rootProjectNode.Text = item.ProjectCode; + rootProjectNode.NodeID = item.ProjectId; + rootProjectNode.EnableClickEvent = true; + rootProjectNode.Expanded = true; + rootProjectNode.ToolTip = item.ProjectName; + rootProjectNode.CommandName = "项目名称"; + rootNode.Nodes.Add(rootProjectNode); + + var testpackageList = BLL.TestPackageDivisionService.GetTestPackageDivisionListByProjectId(item.ProjectId); + foreach (var tp in testpackageList) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = tp.TestPackageCode; + newNode.NodeID = tp.TestPackageDivisionId; + newNode.EnableClickEvent = true; + newNode.Expanded = true; + newNode.ToolTip = tp.TestPackageCode; + newNode.CommandName = "试压包号"; + rootProjectNode.Nodes.Add(newNode); + } + } + } + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (this.tvControlItem.SelectedNodeID != "0") + { + if (this.tvControlItem.SelectedNode.CommandName == "项目名称") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + } + else if (this.tvControlItem.SelectedNode.CommandName == "试压包号") + { + this.TestPackageDivisionId = this.tvControlItem.SelectedNodeID; + this.ProjectId = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.BindGrid(); + } + } + } + #endregion + + #region 数据绑定 + /// + /// 数据绑定 + /// + private void BindGrid() + { + List summaryLists = new List(); + List list = (from x in Funs.DB.View_SYB_CheckResultsSummaryTree where x.TestPackageDivisionId == this.TestPackageDivisionId select x).ToList(); + foreach (var item in list) + { + var pipeIds = item.PipeId.Split('|').ToList(); + string isoClassId = pipeIds[0];//管道等级 + string serviceId = pipeIds[1];//介质 + string steId = pipeIds[2];//材质 + Model.JGZL_CheckResultsSummary newSummary = new Model.JGZL_CheckResultsSummary(); + newSummary.ISO_ID = item.PipeId; + newSummary.ProjectId = item.ProjectId; + newSummary.ISO_IsoNo = item.PipeCode; + newSummary.ISC_IsoName = BLL.HJGL_PipingClassService.GetPipingClassByPipingClassId(isoClassId).ISC_IsoName; + newSummary.TestingStandard = "NB/T47013-2015"; + var installationCode = (from x in Funs.DB.Project_Installation where x.ProjectId == this.ProjectId select x.InstallationCode).FirstOrDefault(); + if (!string.IsNullOrEmpty(installationCode)) + { + newSummary.WorkAreaCode = installationCode; + } + summaryLists.Add(newSummary); + } + Grid1.DataSource = summaryLists; + Grid1.DataBind(); + } + #endregion + + #region 分页排序 + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + #endregion + + #region 查询 + /// + ///查询 + /// + /// + /// + protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) + { + this.InitTreeMenu(); + //this.BindGrid(); + } + + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.TestPackageDivisionId)) + { + if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var checkResultSummary = (from x in Funs.DB.View_SYB_CheckResultsSummaryTree where x.TestPackageDivisionId == this.TestPackageDivisionId && x.PipeId == this.Grid1.SelectedRowID select x).FirstOrDefault(); + if (checkResultSummary != null) + { + this.hdIsoNo.Text = checkResultSummary.PipeCode;//管道编号 + } + + var pipeIds = this.Grid1.SelectedRowID.Split('|').ToList(); + if (pipeIds != null) + { + string isoClassId = pipeIds[0];//管道等级 + string serviceId = pipeIds[1];//介质 + string steId = pipeIds[2];//材质 + + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + listStr.Add(new SqlParameter("@ISC_ID", isoClassId)); + listStr.Add(new SqlParameter("@SER_ID", serviceId)); + listStr.Add(new SqlParameter("@STE_ID", steId)); + listStr.Add(new SqlParameter("@TestPackageDivisionId",this.TestPackageDivisionId)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_SYB_CheckResultSummary", parameter); + + if (tb.Rows.Count > 0) + { + 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"); + + DataView dv = tb.DefaultView;//获取表视图 + dv.Sort = "ISO_IsoNo,Sort1,Sort2,Sort3,Sort4,Sort5 asc";//按照ID排序 + tb = dv.ToTable();//转为表 + DataRow[] rows = tb.DefaultView.ToTable().Select(); + + foreach (var row in rows) + { + var newRow = dt.NewRow(); + newRow["SingleName"] = row["ISO_IsoNo"].ToString(); + newRow["WeldJointCode"] = row["JOT_JointNo"].ToString(); + newRow["WelderCode"] = row["WED_Code"].ToString(); + newRow["PointBatchCode"] = "/"; + newRow["RTUTResult"] = row["RTUTResult"].ToString(); + newRow["RTUTCheckNo"] = row["RTUTReport"].ToString(); + newRow["MTPTResult"] = row["MTPTResult"].ToString(); + newRow["MTPTCheckNo"] = row["MTPTReport"].ToString(); + //newRow["CHT_Remark"] = row["CHT_Remark"].ToString(); + dt.Rows.Add(newRow); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + } + + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); + //监理单位 + var project = BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId); + if (!string.IsNullOrEmpty(project.WatchUnit)) + { + keyValuePairs.Add("UnitName1", project.WatchUnit);//监理单位 + } + keyValuePairs.Add("UnitName2", "浙江鼎盛石化工程有限公司");//施工单位 + keyValuePairs.Add("CH_NDTCriteria", "NB/T47013-2015");//检测标准 + keyValuePairs.Add("ISOLevel", BLL.HJGL_PipingClassService.GetPipingClassByPipingClassId(isoClassId).ISC_IsoName);//管道级别 + var installationCode = (from x in Funs.DB.Project_Installation where x.ProjectId == this.ProjectId select x.InstallationCode).FirstOrDefault(); + if (!string.IsNullOrEmpty(installationCode)) + { + keyValuePairs.Add("WorkAreaCode", installationCode);//区号 + } + keyValuePairs.Add("UnitWorkName", "/");//检测类别号 + keyValuePairs.Add("isoCode", this.hdIsoNo.Text.Trim());//管道编号 + + var result = from x in Funs.DB.HJGL_View_SYB_CheckResult + where x.ProjectId == this.ProjectId + && x.TestPackageDivisionId == this.TestPackageDivisionId + && x.ISC_ID == isoClassId && x.STE_ID == steId + && x.SER_ID == serviceId + select x; + //RT对焊接头 + string RT1 = string.Empty; + var rt1 = from x in result where x.JOTY_Group == "1" && x.States == "2" && x.SysType == "射线检测" select x; + if (rt1.Count() > 0) + { + var q1 = from x in Funs.DB.HJGL_BO_QualityRating where rt1.Select(y => y.CH_TrustItemID).Contains(x.CH_TrustItemID) select x; + var q2 = from x in Funs.DB.HJGL_BO_QualityRatingRepair where rt1.Select(y => y.JOT_ID).Contains(x.JOT_ID) select x; + + string rt1Num = rt1.Count().ToString(); + string rt1FileNum = (q1.Count() + q2.Count()).ToString(); + RT1 = rt1Num + "/" + rt1FileNum;//RT对焊接头 + } + else + { + RT1 = "/"; + } + keyValuePairs.Add("RTBW", RT1); + keyValuePairs.Add("RTFW", "-"); + + //RT 支管连接接头 + string RT3 = string.Empty; + var rt3 = from x in result where x.JOTY_Group == "3" && x.States == "2" && x.SysType == "射线检测" select x; + if (rt3.Count() > 0) + { + var q3 = from x in Funs.DB.HJGL_BO_QualityRating where rt3.Select(y => y.CH_TrustItemID).Contains(x.CH_TrustItemID) select x; + var q4 = from x in Funs.DB.HJGL_BO_QualityRatingRepair where rt3.Select(y => y.JOT_ID).Contains(x.JOT_ID) select x; + + string rt3Num = rt3.Count().ToString(); + string rt3FileNum = (q3.Count() + q4.Count()).ToString(); + RT3 = rt3Num + "/" + rt3FileNum;//RT支管连接接头 + } + else + { + RT3 = "/"; + } + keyValuePairs.Add("RTDW", RT3); + + //RT对焊接头 + string unRT1Count = string.Empty; + var unRT1 = from x in result where x.JOTY_Group == "1" && x.States == "4" && x.SysType == "射线检测" select x; + if (unRT1.Count() > 0) + { + var q1 = from x in Funs.DB.HJGL_BO_QualityRating where x.IsPass == "不合格" && unRT1.Select(y => y.CH_TrustItemID).Contains(x.CH_TrustItemID) select x; + + string unRT1Num = unRT1.Count().ToString(); + string unRT1FileNum = q1.Count().ToString(); + unRT1Count = unRT1Num + "/" + unRT1FileNum;//RT对焊接头 + } + else + { + unRT1Count = "/"; + } + keyValuePairs.Add("RTNoPassBW", unRT1Count); + keyValuePairs.Add("RTNoPassFW", "-"); + + // RT支管连接接头 + string unRT3Count = string.Empty; + var unRT3 = from x in result where x.JOTY_Group == "3" && x.States == "4" && x.SysType == "射线检测" select x; + if (unRT3.Count() > 0) + { + var q1 = from x in Funs.DB.HJGL_BO_QualityRating where x.IsPass == "不合格" && unRT3.Select(y => y.CH_TrustItemID).Contains(x.CH_TrustItemID) select x; + + string unRT3Num = unRT3.Count().ToString(); + string unRT3FileNum = q1.Count().ToString(); + unRT3Count = unRT3Num + "/" + unRT3FileNum;//RT支管连接接头 + } + else + { + unRT3Count = "/"; + } + keyValuePairs.Add("RTNoPassDW", unRT3Count); + + //UT对焊接头 + string ut1Count = string.Empty; + var ut1 = from x in result where x.JOTY_Group == "1" && x.States == "2" && x.SysType == "超声波检测" select x; + if (ut1.Count() > 0) + { + string ut1Num = ut1.Count().ToString(); + string ut1FileNum = (Convert.ToDouble(ut1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + ut1Count = ut1Num + "/" + ut1FileNum;//UT对焊接头 + } + else + { + ut1Count = "/"; + } + keyValuePairs.Add("UTBW", ut1Count); + keyValuePairs.Add("UTFW", "-"); + //UT 支管连接接头 + string ut3Count = string.Empty; + var ut3 = from x in result where x.JOTY_Group == "3" && x.States == "2" && x.SysType == "超声波检测" select x; + if (ut3.Count() > 0) + { + string ut3Num = ut3.Count().ToString(); + string ut3FileNum = (Convert.ToDouble(ut3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + ut3Count = ut3Num + "/" + ut3FileNum;//UT支管连接接头 + } + else + { + ut3Count = "/"; + } + keyValuePairs.Add("UTDW", ut3Count); + + //UT对焊接头 + string unUT1Count = string.Empty; + var unUT1 = from x in result where x.JOTY_Group == "1" && x.States == "4" && x.SysType == "超声波检测" select x; + if (unUT1.Count() > 0) + { + string unUT1Num = unUT1.Count().ToString(); + string unUT1FileNum = (Convert.ToDouble(unUT1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + unUT1Count = unUT1Num + "/" + unUT1FileNum;//UT对焊接头 + } + else + { + unUT1Count = "/"; + } + keyValuePairs.Add("UTNoPassBW", unUT1Count); + keyValuePairs.Add("UTNoPassFW", "-"); + // UT支管连接接头 + string unUT3Count = string.Empty; + var unUT3 = from x in result where x.JOTY_Group == "3" && x.States == "4" && x.SysType == "超声波检测" select x; + if (unUT3.Count() > 0) + { + string unUT3Num = unUT3.Count().ToString(); + string unUT3FileNum = (Convert.ToDouble(unUT3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + unUT3Count = unUT3Num + "/" + unUT3FileNum;//UT支管连接接头 + } + else + { + unUT3Count = "/"; + } + keyValuePairs.Add("UTNoPassDW", unUT3Count); + //MT对焊接头 + string mt1Count = string.Empty; + var mt1 = from x in result where x.JOTY_Group == "1" && x.States == "2" && x.SysType == "磁粉检测" select x; + if (mt1.Count() > 0) + { + string mt1Num = mt1.Count().ToString(); + string mt1FileNum = (Convert.ToDouble(mt1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + mt1Count = mt1Num + "/" + mt1FileNum;//MT对焊接头 + } + else + { + mt1Count = "/"; + } + keyValuePairs.Add("MTBW", mt1Count); + //MT角焊接头 + string mt2Count = string.Empty; + var mt2 = from x in result where x.JOTY_Group == "2" && x.States == "2" && x.SysType == "磁粉检测" select x; + if (mt2.Count() > 0) + { + string mt2Num = mt2.Count().ToString(); + string mt2FileNum = (Convert.ToDouble(mt2.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + mt2Count = mt2Num + "/" + mt2FileNum;//MT角焊接头 + } + else + { + mt2Count = "/"; + } + keyValuePairs.Add("MTFW", mt2Count); + //MT 支管连接接头 + string mt3Count = string.Empty; + var mt3 = from x in result where x.JOTY_Group == "3" && x.States == "2" && x.SysType == "磁粉检测" select x; + if (mt3.Count() > 0) + { + string mt3Num = mt3.Count().ToString(); + string mt3FileNum = (Convert.ToDouble(mt3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + mt3Count = mt3Num + "/" + mt3FileNum;//MT支管连接接头 + } + else + { + mt3Count = "/"; + } + keyValuePairs.Add("MTDW", mt3Count); + // MT对焊接头 + string unMT1Count = string.Empty; + var unMT1 = from x in result where x.JOTY_Group == "1" && x.States == "4" && x.SysType == "磁粉检测" select x; + if (unMT1.Count() > 0) + { + string unMT1Num = unMT1.Count().ToString(); + string unMT1FileNum = (Convert.ToDouble(unMT1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + unMT1Count = unMT1Num + "/" + unMT1FileNum;//MT对焊接头 + } + else + { + unMT1Count = "/"; + } + keyValuePairs.Add("MTNoPassBW", unMT1Count); + // MT角焊接头 + string unMT2Count = string.Empty; + var unMT2 = from x in result where x.JOTY_Group == "2" && x.States == "4" && x.SysType == "磁粉检测" select x; + if (unMT2.Count() > 0) + { + string unMT2Num = unMT2.Count().ToString(); + string unMT2FileNum = (Convert.ToDouble(unMT2.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + unMT2Count = unMT2Num + "/" + unMT2FileNum;//MT对焊接头 + } + else + { + unMT2Count = "/"; + } + keyValuePairs.Add("MTNoPassFW", unMT2Count); + + // MT支管连接接头 + string unMT3Count = string.Empty; + var unMT3 = from x in result where x.JOTY_Group == "3" && x.States == "4" && x.SysType == "磁粉检测" select x; + if (unMT3.Count() > 0) + { + string unMT3Num = unMT3.Count().ToString(); + string unMT3FileNum = (Convert.ToDouble(unMT3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + unMT3Count = unMT3Num + "/" + unMT3FileNum;//MT支管连接接头 + } + else + { + unMT3Count = "/"; + } + keyValuePairs.Add("MTNoPassDW", unMT3Count); + //PT对焊接头 + string pt1Count = string.Empty; + var pt1 = from x in result where x.JOTY_Group == "1" && x.States == "2" && x.SysType == "渗透检测" select x; + if (pt1.Count() > 0) + { + string pt1Num = pt1.Count().ToString(); + string pt1FileNum = (Convert.ToDouble(pt1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + pt1Count = pt1Num + "/" + pt1FileNum;//PT对焊接头 + } + else + { + pt1Count = "/"; + } + keyValuePairs.Add("PTBW", pt1Count); + //PT角焊接头 + string pt2Count = string.Empty; + var pt2 = from x in result where x.JOTY_Group == "2" && x.States == "2" && x.SysType == "渗透检测" select x; + if (pt2.Count() > 0) + { + string pt2Num = pt2.Count().ToString(); + string pt2FileNum = (Convert.ToDouble(pt2.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + pt2Count = pt2Num + "/" + pt2FileNum;//PT角焊接头 + } + else + { + pt2Count = "/"; + } + keyValuePairs.Add("PTFW", pt2Count); + //PT 支管连接接头 + string pt3Count = string.Empty; + var pt3 = from x in result where x.JOTY_Group == "3" && x.States == "2" && x.SysType == "渗透检测" select x; + if (pt3.Count() > 0) + { + string pt3Num = pt3.Count().ToString(); + string pt3FileNum = (Convert.ToDouble(pt3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + pt3Count = pt3Num + "/" + pt3FileNum;//PT支管连接接头 + } + else + { + pt3Count = "/"; + } + keyValuePairs.Add("PTDW", pt3Count); + // PT对焊接头 + string unPT1Count = string.Empty; + var unPT1 = from x in result where x.JOTY_Group == "1" && x.States == "4" && x.SysType == "渗透检测" select x; + if (unPT1.Count() > 0) + { + string unPT1Num = unPT1.Count().ToString(); + string unPT1FileNum = (Convert.ToDouble(unPT1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + unPT1Count = unPT1Num + "/" + unPT1FileNum;//PT对焊接头 + } + else + { + unPT1Count = "/"; + } + keyValuePairs.Add("PTNoPassBW", unPT1Count); + // PT角焊接头 + string unPT2Count = string.Empty; + var unPT2 = from x in result where x.JOTY_Group == "2" && x.States == "4" && x.SysType == "渗透检测" select x; + if (unPT2.Count() > 0) + { + string unPT2Num = unPT2.Count().ToString(); + string unPT2FileNum = (Convert.ToDouble(unPT2.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + unPT2Count = unPT2Num + "/" + unPT2FileNum;//PT对焊接头 + } + else + { + unPT2Count = "/"; + } + keyValuePairs.Add("PTNoPassFW", unPT2Count); + // PT支管连接接头 + string unPT3Count = string.Empty; + var unPT3 = from x in result where x.JOTY_Group == "3" && x.States == "4" && x.SysType == "渗透检测" select x; + if (unPT3.Count() > 0) + { + string unPT3Num = unPT3.Count().ToString(); + string unPT3FileNum = (Convert.ToDouble(unPT3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000"); + unPT3Count = unPT3Num + "/" + unPT3FileNum;//PT支管连接接头 + } + else + { + unPT3Count = "/"; + } + keyValuePairs.Add("PTNoPassDW", unPT3Count); + + 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))); + + } + } + } + else + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + } + else + { + Alert.ShowInTop("请选择试压包号!", MessageBoxIcon.Warning); + return; + } + } + #endregion + } +} \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/SYBData/TestResultsSummary.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/SYBData/TestResultsSummary.aspx.designer.cs new file mode 100644 index 0000000..01d78f9 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/TestResultsSummary.aspx.designer.cs @@ -0,0 +1,170 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.SYBData +{ + + + public partial class TestResultsSummary + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpProjectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProjectId; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdIsoNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdIsoNo; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// WindowPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowPrint; + } +} diff --git a/HJGL_DS/FineUIPro.Web/Web.config b/HJGL_DS/FineUIPro.Web/Web.config index 3c98f31..557f12f 100644 --- a/HJGL_DS/FineUIPro.Web/Web.config +++ b/HJGL_DS/FineUIPro.Web/Web.config @@ -67,7 +67,7 @@ - + diff --git a/HJGL_DS/Model/Model.cs b/HJGL_DS/Model/Model.cs index 6d60ea3..1ab3f9a 100644 --- a/HJGL_DS/Model/Model.cs +++ b/HJGL_DS/Model/Model.cs @@ -1795,6 +1795,30 @@ namespace Model } } + public System.Data.Linq.Table HJGL_View_SYB_CheckResult + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table HJGL_View_SYB_CheckResultSummary + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table HJGL_View_SYB_CheckResultSummary1 + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table HJGL_View_TrustNumSummary { get @@ -1803,6 +1827,14 @@ namespace Model } } + public System.Data.Linq.Table HJGL_View_TrustNumSummary_SYB + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table HJGL_View_WeldingProcedure { get @@ -2883,6 +2915,14 @@ namespace Model } } + public System.Data.Linq.Table View_SYB_CheckResultsSummaryTree + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table View_TestingReportPrint { get @@ -69614,6 +69654,1149 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_View_SYB_CheckResult")] + public partial class HJGL_View_SYB_CheckResult + { + + private string _CH_TrustItemID; + + private string _ProjectId; + + private string _BatchId; + + private string _ISC_ID; + + private string _SER_ID; + + private string _STE_ID; + + private string _JOTY_Group; + + private string _States; + + private string _SysType; + + private string _JOT_ID; + + private System.Nullable _JOT_Dia; + + private string _TestPackageDivisionId; + + public HJGL_View_SYB_CheckResult() + { + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CH_TrustItemID", DbType="VarChar(50) NOT NULL", CanBeNull=false)] + public string CH_TrustItemID + { + get + { + return this._CH_TrustItemID; + } + set + { + if ((this._CH_TrustItemID != value)) + { + this._CH_TrustItemID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this._ProjectId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BatchId", DbType="NVarChar(50)")] + public string BatchId + { + get + { + return this._BatchId; + } + set + { + if ((this._BatchId != value)) + { + this._BatchId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ISC_ID", DbType="VarChar(50)")] + public string ISC_ID + { + get + { + return this._ISC_ID; + } + set + { + if ((this._ISC_ID != value)) + { + this._ISC_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SER_ID", DbType="VarChar(50)")] + public string SER_ID + { + get + { + return this._SER_ID; + } + set + { + if ((this._SER_ID != value)) + { + this._SER_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_STE_ID", DbType="VarChar(50)")] + public string STE_ID + { + get + { + return this._STE_ID; + } + set + { + if ((this._STE_ID != value)) + { + this._STE_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOTY_Group", DbType="NChar(1)")] + public string JOTY_Group + { + get + { + return this._JOTY_Group; + } + set + { + if ((this._JOTY_Group != value)) + { + this._JOTY_Group = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_States", DbType="NChar(1)")] + public string States + { + get + { + return this._States; + } + set + { + if ((this._States != value)) + { + this._States = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SysType", DbType="VarChar(50)")] + public string SysType + { + get + { + return this._SysType; + } + set + { + if ((this._SysType != value)) + { + this._SysType = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOT_ID", DbType="VarChar(50)")] + public string JOT_ID + { + get + { + return this._JOT_ID; + } + set + { + if ((this._JOT_ID != value)) + { + this._JOT_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOT_Dia", DbType="Decimal(18,4)")] + public System.Nullable JOT_Dia + { + get + { + return this._JOT_Dia; + } + set + { + if ((this._JOT_Dia != value)) + { + this._JOT_Dia = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + this._TestPackageDivisionId = value; + } + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_View_SYB_CheckResultSummary")] + public partial class HJGL_View_SYB_CheckResultSummary + { + + private string _BatchDetailId; + + private string _ProjectId; + + private string _BatchCode; + + private string _ISO_IsoNo; + + private string _JOT_JointNo; + + private string _Sort1; + + private System.Nullable _Sort2; + + private string _Sort3; + + private System.Nullable _Sort4; + + private System.Nullable _Sort5; + + private string _ISO_ID; + + private string _JOT_JointDesc; + + private string _BatchId; + + private string _NDT; + + private string _WED_Code; + + private string _ISC_ID; + + private string _SER_ID; + + private string _STE_ID; + + private string _JOTY_Group; + + private System.Nullable _JOT_Dia; + + private string _TestPackageDivisionId; + + private string _RTReport; + + private string _RT; + + private string _UTReport; + + private string _UT; + + private string _MTReport; + + private string _MT; + + private string _PTReport; + + private string _PT; + + public HJGL_View_SYB_CheckResultSummary() + { + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BatchDetailId", DbType="VarChar(50) NOT NULL", CanBeNull=false)] + public string BatchDetailId + { + get + { + return this._BatchDetailId; + } + set + { + if ((this._BatchDetailId != value)) + { + this._BatchDetailId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this._ProjectId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BatchCode", DbType="NVarChar(100)")] + public string BatchCode + { + get + { + return this._BatchCode; + } + set + { + if ((this._BatchCode != value)) + { + this._BatchCode = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ISO_IsoNo", DbType="VarChar(50)")] + public string ISO_IsoNo + { + get + { + return this._ISO_IsoNo; + } + set + { + if ((this._ISO_IsoNo != value)) + { + this._ISO_IsoNo = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOT_JointNo", DbType="VarChar(50)")] + public string JOT_JointNo + { + get + { + return this._JOT_JointNo; + } + set + { + if ((this._JOT_JointNo != value)) + { + this._JOT_JointNo = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort1", DbType="VarChar(10)")] + public string Sort1 + { + get + { + return this._Sort1; + } + set + { + if ((this._Sort1 != value)) + { + this._Sort1 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort2", DbType="Int")] + public System.Nullable Sort2 + { + get + { + return this._Sort2; + } + set + { + if ((this._Sort2 != value)) + { + this._Sort2 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort3", DbType="VarChar(10)")] + public string Sort3 + { + get + { + return this._Sort3; + } + set + { + if ((this._Sort3 != value)) + { + this._Sort3 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort4", DbType="Int")] + public System.Nullable Sort4 + { + get + { + return this._Sort4; + } + set + { + if ((this._Sort4 != value)) + { + this._Sort4 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort5", DbType="Int")] + public System.Nullable Sort5 + { + get + { + return this._Sort5; + } + set + { + if ((this._Sort5 != value)) + { + this._Sort5 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ISO_ID", DbType="VarChar(50)")] + public string ISO_ID + { + get + { + return this._ISO_ID; + } + set + { + if ((this._ISO_ID != value)) + { + this._ISO_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOT_JointDesc", DbType="VarChar(100)")] + public string JOT_JointDesc + { + get + { + return this._JOT_JointDesc; + } + set + { + if ((this._JOT_JointDesc != value)) + { + this._JOT_JointDesc = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BatchId", DbType="NVarChar(50)")] + public string BatchId + { + get + { + return this._BatchId; + } + set + { + if ((this._BatchId != value)) + { + this._BatchId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NDT", DbType="NVarChar(300)")] + public string NDT + { + get + { + return this._NDT; + } + set + { + if ((this._NDT != value)) + { + this._NDT = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WED_Code", DbType="VarChar(41)")] + public string WED_Code + { + get + { + return this._WED_Code; + } + set + { + if ((this._WED_Code != value)) + { + this._WED_Code = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ISC_ID", DbType="VarChar(50)")] + public string ISC_ID + { + get + { + return this._ISC_ID; + } + set + { + if ((this._ISC_ID != value)) + { + this._ISC_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SER_ID", DbType="VarChar(50)")] + public string SER_ID + { + get + { + return this._SER_ID; + } + set + { + if ((this._SER_ID != value)) + { + this._SER_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_STE_ID", DbType="VarChar(50)")] + public string STE_ID + { + get + { + return this._STE_ID; + } + set + { + if ((this._STE_ID != value)) + { + this._STE_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOTY_Group", DbType="NChar(1)")] + public string JOTY_Group + { + get + { + return this._JOTY_Group; + } + set + { + if ((this._JOTY_Group != value)) + { + this._JOTY_Group = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOT_Dia", DbType="Decimal(18,4)")] + public System.Nullable JOT_Dia + { + get + { + return this._JOT_Dia; + } + set + { + if ((this._JOT_Dia != value)) + { + this._JOT_Dia = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + this._TestPackageDivisionId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RTReport", DbType="NVarChar(100)")] + public string RTReport + { + get + { + return this._RTReport; + } + set + { + if ((this._RTReport != value)) + { + this._RTReport = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RT", DbType="NChar(1)")] + public string RT + { + get + { + return this._RT; + } + set + { + if ((this._RT != value)) + { + this._RT = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UTReport", DbType="NVarChar(100)")] + public string UTReport + { + get + { + return this._UTReport; + } + set + { + if ((this._UTReport != value)) + { + this._UTReport = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UT", DbType="NChar(1)")] + public string UT + { + get + { + return this._UT; + } + set + { + if ((this._UT != value)) + { + this._UT = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MTReport", DbType="NVarChar(100)")] + public string MTReport + { + get + { + return this._MTReport; + } + set + { + if ((this._MTReport != value)) + { + this._MTReport = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MT", DbType="NChar(1)")] + public string MT + { + get + { + return this._MT; + } + set + { + if ((this._MT != value)) + { + this._MT = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PTReport", DbType="NVarChar(100)")] + public string PTReport + { + get + { + return this._PTReport; + } + set + { + if ((this._PTReport != value)) + { + this._PTReport = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PT", DbType="NChar(1)")] + public string PT + { + get + { + return this._PT; + } + set + { + if ((this._PT != value)) + { + this._PT = value; + } + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_View_SYB_CheckResultSummary1")] + public partial class HJGL_View_SYB_CheckResultSummary1 + { + + private string _BatchDetailId; + + private string _ProjectId; + + private string _BatchCode; + + private string _ISO_IsoNo; + + private string _JOT_JointNo; + + private string _Sort1; + + private System.Nullable _Sort2; + + private string _Sort3; + + private System.Nullable _Sort4; + + private System.Nullable _Sort5; + + private string _ISO_ID; + + private string _JOT_JointDesc; + + private string _BatchId; + + private string _NDT; + + private string _WED_Code; + + private string _ISC_ID; + + private string _SER_ID; + + private string _STE_ID; + + private string _JOTY_Group; + + private System.Nullable _JOT_Dia; + + private string _TestPackageDivisionId; + + public HJGL_View_SYB_CheckResultSummary1() + { + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BatchDetailId", DbType="VarChar(50) NOT NULL", CanBeNull=false)] + public string BatchDetailId + { + get + { + return this._BatchDetailId; + } + set + { + if ((this._BatchDetailId != value)) + { + this._BatchDetailId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this._ProjectId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BatchCode", DbType="NVarChar(100)")] + public string BatchCode + { + get + { + return this._BatchCode; + } + set + { + if ((this._BatchCode != value)) + { + this._BatchCode = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ISO_IsoNo", DbType="VarChar(50)")] + public string ISO_IsoNo + { + get + { + return this._ISO_IsoNo; + } + set + { + if ((this._ISO_IsoNo != value)) + { + this._ISO_IsoNo = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOT_JointNo", DbType="VarChar(50)")] + public string JOT_JointNo + { + get + { + return this._JOT_JointNo; + } + set + { + if ((this._JOT_JointNo != value)) + { + this._JOT_JointNo = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort1", DbType="VarChar(10)")] + public string Sort1 + { + get + { + return this._Sort1; + } + set + { + if ((this._Sort1 != value)) + { + this._Sort1 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort2", DbType="Int")] + public System.Nullable Sort2 + { + get + { + return this._Sort2; + } + set + { + if ((this._Sort2 != value)) + { + this._Sort2 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort3", DbType="VarChar(10)")] + public string Sort3 + { + get + { + return this._Sort3; + } + set + { + if ((this._Sort3 != value)) + { + this._Sort3 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort4", DbType="Int")] + public System.Nullable Sort4 + { + get + { + return this._Sort4; + } + set + { + if ((this._Sort4 != value)) + { + this._Sort4 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort5", DbType="Int")] + public System.Nullable Sort5 + { + get + { + return this._Sort5; + } + set + { + if ((this._Sort5 != value)) + { + this._Sort5 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ISO_ID", DbType="VarChar(50)")] + public string ISO_ID + { + get + { + return this._ISO_ID; + } + set + { + if ((this._ISO_ID != value)) + { + this._ISO_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOT_JointDesc", DbType="VarChar(100)")] + public string JOT_JointDesc + { + get + { + return this._JOT_JointDesc; + } + set + { + if ((this._JOT_JointDesc != value)) + { + this._JOT_JointDesc = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BatchId", DbType="NVarChar(50)")] + public string BatchId + { + get + { + return this._BatchId; + } + set + { + if ((this._BatchId != value)) + { + this._BatchId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NDT", DbType="NVarChar(300)")] + public string NDT + { + get + { + return this._NDT; + } + set + { + if ((this._NDT != value)) + { + this._NDT = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WED_Code", DbType="VarChar(41)")] + public string WED_Code + { + get + { + return this._WED_Code; + } + set + { + if ((this._WED_Code != value)) + { + this._WED_Code = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ISC_ID", DbType="VarChar(50)")] + public string ISC_ID + { + get + { + return this._ISC_ID; + } + set + { + if ((this._ISC_ID != value)) + { + this._ISC_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SER_ID", DbType="VarChar(50)")] + public string SER_ID + { + get + { + return this._SER_ID; + } + set + { + if ((this._SER_ID != value)) + { + this._SER_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_STE_ID", DbType="VarChar(50)")] + public string STE_ID + { + get + { + return this._STE_ID; + } + set + { + if ((this._STE_ID != value)) + { + this._STE_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOTY_Group", DbType="NChar(1)")] + public string JOTY_Group + { + get + { + return this._JOTY_Group; + } + set + { + if ((this._JOTY_Group != value)) + { + this._JOTY_Group = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JOT_Dia", DbType="Decimal(18,4)")] + public System.Nullable JOT_Dia + { + get + { + return this._JOT_Dia; + } + set + { + if ((this._JOT_Dia != value)) + { + this._JOT_Dia = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + this._TestPackageDivisionId = value; + } + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_View_TrustNumSummary")] public partial class HJGL_View_TrustNumSummary { @@ -69929,6 +71112,339 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_View_TrustNumSummary_SYB")] + public partial class HJGL_View_TrustNumSummary_SYB + { + + private string _ProjectId; + + private string _InstallationId; + + private string _TestPackageDivisionId; + + private string _IsoNo; + + private string _NDTR_Name; + + private int _Rt1Num; + + private int _Ut1Num; + + private int _Mt1Num; + + private int _Pt1Num; + + private System.Nullable _TotalNum1; + + private int _Mt2Num; + + private int _Pt2Num; + + private System.Nullable _TotalNum2; + + private int _Rt3Num; + + private int _Ut3Num; + + private int _Mt3Num; + + private int _Pt3Num; + + private System.Nullable _TotalNum3; + + public HJGL_View_TrustNumSummary_SYB() + { + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this._ProjectId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InstallationId", DbType="NVarChar(50)")] + public string InstallationId + { + get + { + return this._InstallationId; + } + set + { + if ((this._InstallationId != value)) + { + this._InstallationId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + this._TestPackageDivisionId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsoNo", DbType="VarChar(50)")] + public string IsoNo + { + get + { + return this._IsoNo; + } + set + { + if ((this._IsoNo != value)) + { + this._IsoNo = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NDTR_Name", DbType="VarChar(50)")] + public string NDTR_Name + { + get + { + return this._NDTR_Name; + } + set + { + if ((this._NDTR_Name != value)) + { + this._NDTR_Name = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rt1Num", DbType="Int NOT NULL")] + public int Rt1Num + { + get + { + return this._Rt1Num; + } + set + { + if ((this._Rt1Num != value)) + { + this._Rt1Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ut1Num", DbType="Int NOT NULL")] + public int Ut1Num + { + get + { + return this._Ut1Num; + } + set + { + if ((this._Ut1Num != value)) + { + this._Ut1Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Mt1Num", DbType="Int NOT NULL")] + public int Mt1Num + { + get + { + return this._Mt1Num; + } + set + { + if ((this._Mt1Num != value)) + { + this._Mt1Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Pt1Num", DbType="Int NOT NULL")] + public int Pt1Num + { + get + { + return this._Pt1Num; + } + set + { + if ((this._Pt1Num != value)) + { + this._Pt1Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalNum1", DbType="Int")] + public System.Nullable TotalNum1 + { + get + { + return this._TotalNum1; + } + set + { + if ((this._TotalNum1 != value)) + { + this._TotalNum1 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Mt2Num", DbType="Int NOT NULL")] + public int Mt2Num + { + get + { + return this._Mt2Num; + } + set + { + if ((this._Mt2Num != value)) + { + this._Mt2Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Pt2Num", DbType="Int NOT NULL")] + public int Pt2Num + { + get + { + return this._Pt2Num; + } + set + { + if ((this._Pt2Num != value)) + { + this._Pt2Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalNum2", DbType="Int")] + public System.Nullable TotalNum2 + { + get + { + return this._TotalNum2; + } + set + { + if ((this._TotalNum2 != value)) + { + this._TotalNum2 = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rt3Num", DbType="Int NOT NULL")] + public int Rt3Num + { + get + { + return this._Rt3Num; + } + set + { + if ((this._Rt3Num != value)) + { + this._Rt3Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ut3Num", DbType="Int NOT NULL")] + public int Ut3Num + { + get + { + return this._Ut3Num; + } + set + { + if ((this._Ut3Num != value)) + { + this._Ut3Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Mt3Num", DbType="Int NOT NULL")] + public int Mt3Num + { + get + { + return this._Mt3Num; + } + set + { + if ((this._Mt3Num != value)) + { + this._Mt3Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Pt3Num", DbType="Int NOT NULL")] + public int Pt3Num + { + get + { + return this._Pt3Num; + } + set + { + if ((this._Pt3Num != value)) + { + this._Pt3Num = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalNum3", DbType="Int")] + public System.Nullable TotalNum3 + { + get + { + return this._TotalNum3; + } + set + { + if ((this._TotalNum3 != value)) + { + this._TotalNum3 = value; + } + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_View_WeldingProcedure")] public partial class HJGL_View_WeldingProcedure { @@ -85768,8 +87284,12 @@ namespace Model private System.Nullable _CompileDate; + private string _TestPackageDivisionId; + private EntityRef _Base_Project; + private EntityRef _SYBData_TestPackageDivision; + private EntityRef _Sys_User; #region 可扩展性方法定义 @@ -85800,11 +87320,14 @@ namespace Model partial void OnCompileManChanged(); partial void OnCompileDateChanging(System.Nullable value); partial void OnCompileDateChanged(); + partial void OnTestPackageDivisionIdChanging(string value); + partial void OnTestPackageDivisionIdChanged(); #endregion public JGZL_ElectrostaticGrounding() { this._Base_Project = default(EntityRef); + this._SYBData_TestPackageDivision = default(EntityRef); this._Sys_User = default(EntityRef); OnCreated(); } @@ -86057,6 +87580,30 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + if (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnTestPackageDivisionIdChanging(value); + this.SendPropertyChanging(); + this._TestPackageDivisionId = value; + this.SendPropertyChanged("TestPackageDivisionId"); + this.OnTestPackageDivisionIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_ElectrostaticGrounding_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -86091,6 +87638,40 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_ElectrostaticGrounding_SYBData_TestPackageDivision", Storage="_SYBData_TestPackageDivision", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", IsForeignKey=true)] + public SYBData_TestPackageDivision SYBData_TestPackageDivision + { + get + { + return this._SYBData_TestPackageDivision.Entity; + } + set + { + SYBData_TestPackageDivision previousValue = this._SYBData_TestPackageDivision.Entity; + if (((previousValue != value) + || (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._SYBData_TestPackageDivision.Entity = null; + previousValue.JGZL_ElectrostaticGrounding.Remove(this); + } + this._SYBData_TestPackageDivision.Entity = value; + if ((value != null)) + { + value.JGZL_ElectrostaticGrounding.Add(this); + this._TestPackageDivisionId = value.TestPackageDivisionId; + } + else + { + this._TestPackageDivisionId = default(string); + } + this.SendPropertyChanged("SYBData_TestPackageDivision"); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_ElectrostaticGrounding_Sys_User", Storage="_Sys_User", ThisKey="CompileMan", OtherKey="UserId", IsForeignKey=true)] public Sys_User Sys_User { @@ -92634,8 +94215,12 @@ namespace Model private System.Nullable _RevieweDate; + private string _TestPackageDivisionId; + private EntityRef _Base_Project; + private EntityRef _SYBData_TestPackageDivision; + private EntityRef _Sys_User; #region 可扩展性方法定义 @@ -92684,11 +94269,14 @@ namespace Model partial void OnReviewerChanged(); partial void OnRevieweDateChanging(System.Nullable value); partial void OnRevieweDateChanged(); + partial void OnTestPackageDivisionIdChanging(string value); + partial void OnTestPackageDivisionIdChanged(); #endregion public JGZL_PressureTestOfPipelineSystemConfirmationRecord() { this._Base_Project = default(EntityRef); + this._SYBData_TestPackageDivision = default(EntityRef); this._Sys_User = default(EntityRef); OnCreated(); } @@ -93121,6 +94709,30 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + if (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnTestPackageDivisionIdChanging(value); + this.SendPropertyChanging(); + this._TestPackageDivisionId = value; + this.SendPropertyChanged("TestPackageDivisionId"); + this.OnTestPackageDivisionIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_PressureTestOfPipelineSystemConfirmationRecord_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -93155,6 +94767,41 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_PressureTestOfPipelineSystemConfirmationRecord_SYBData_TestPackageDivisio" + + "n", Storage="_SYBData_TestPackageDivision", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", IsForeignKey=true)] + public SYBData_TestPackageDivision SYBData_TestPackageDivision + { + get + { + return this._SYBData_TestPackageDivision.Entity; + } + set + { + SYBData_TestPackageDivision previousValue = this._SYBData_TestPackageDivision.Entity; + if (((previousValue != value) + || (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._SYBData_TestPackageDivision.Entity = null; + previousValue.JGZL_PressureTestOfPipelineSystemConfirmationRecord.Remove(this); + } + this._SYBData_TestPackageDivision.Entity = value; + if ((value != null)) + { + value.JGZL_PressureTestOfPipelineSystemConfirmationRecord.Add(this); + this._TestPackageDivisionId = value.TestPackageDivisionId; + } + else + { + this._TestPackageDivisionId = default(string); + } + this.SendPropertyChanged("SYBData_TestPackageDivision"); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_PressureTestOfPipelineSystemConfirmationRecord_Sys_User", Storage="_Sys_User", ThisKey="CompileMan", OtherKey="UserId", IsForeignKey=true)] public Sys_User Sys_User { @@ -93236,8 +94883,12 @@ namespace Model private System.Nullable _RevieweDate; + private string _TestPackageDivisionId; + private EntityRef _Base_Project; + private EntityRef _SYBData_TestPackageDivision; + private EntityRef _Sys_User; #region 可扩展性方法定义 @@ -93264,11 +94915,14 @@ namespace Model partial void OnReviewerChanged(); partial void OnRevieweDateChanging(System.Nullable value); partial void OnRevieweDateChanged(); + partial void OnTestPackageDivisionIdChanging(string value); + partial void OnTestPackageDivisionIdChanged(); #endregion public JGZL_PressureTestOfPipelineSystemRecord() { this._Base_Project = default(EntityRef); + this._SYBData_TestPackageDivision = default(EntityRef); this._Sys_User = default(EntityRef); OnCreated(); } @@ -93481,6 +95135,30 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + if (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnTestPackageDivisionIdChanging(value); + this.SendPropertyChanging(); + this._TestPackageDivisionId = value; + this.SendPropertyChanged("TestPackageDivisionId"); + this.OnTestPackageDivisionIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_PressureTestOfPipelineSystemRecord_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -93515,6 +95193,40 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_PressureTestOfPipelineSystemRecord_SYBData_TestPackageDivision", Storage="_SYBData_TestPackageDivision", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", IsForeignKey=true)] + public SYBData_TestPackageDivision SYBData_TestPackageDivision + { + get + { + return this._SYBData_TestPackageDivision.Entity; + } + set + { + SYBData_TestPackageDivision previousValue = this._SYBData_TestPackageDivision.Entity; + if (((previousValue != value) + || (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._SYBData_TestPackageDivision.Entity = null; + previousValue.JGZL_PressureTestOfPipelineSystemRecord.Remove(this); + } + this._SYBData_TestPackageDivision.Entity = value; + if ((value != null)) + { + value.JGZL_PressureTestOfPipelineSystemRecord.Add(this); + this._TestPackageDivisionId = value.TestPackageDivisionId; + } + else + { + this._TestPackageDivisionId = default(string); + } + this.SendPropertyChanged("SYBData_TestPackageDivision"); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_PressureTestOfPipelineSystemRecord_Sys_User", Storage="_Sys_User", ThisKey="CompileMan", OtherKey="UserId", IsForeignKey=true)] public Sys_User Sys_User { @@ -117505,8 +119217,12 @@ namespace Model private System.Nullable _ApplicationDate; + private string _TestPackageDivisionId; + private EntityRef _Base_Project; + private EntityRef _SYBData_TestPackageDivision; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -117525,11 +119241,14 @@ namespace Model partial void OnProfessionalEngineerChanged(); partial void OnApplicationDateChanging(System.Nullable value); partial void OnApplicationDateChanged(); + partial void OnTestPackageDivisionIdChanging(string value); + partial void OnTestPackageDivisionIdChanged(); #endregion public SYBData_ApplicationForm() { this._Base_Project = default(EntityRef); + this._SYBData_TestPackageDivision = default(EntityRef); OnCreated(); } @@ -117677,6 +119396,30 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + if (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnTestPackageDivisionIdChanging(value); + this.SendPropertyChanging(); + this._TestPackageDivisionId = value; + this.SendPropertyChanged("TestPackageDivisionId"); + this.OnTestPackageDivisionIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_ApplicationForm_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -117711,6 +119454,40 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_ApplicationForm_SYBData_TestPackageDivision", Storage="_SYBData_TestPackageDivision", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", IsForeignKey=true)] + public SYBData_TestPackageDivision SYBData_TestPackageDivision + { + get + { + return this._SYBData_TestPackageDivision.Entity; + } + set + { + SYBData_TestPackageDivision previousValue = this._SYBData_TestPackageDivision.Entity; + if (((previousValue != value) + || (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._SYBData_TestPackageDivision.Entity = null; + previousValue.SYBData_ApplicationForm.Remove(this); + } + this._SYBData_TestPackageDivision.Entity = value; + if ((value != null)) + { + value.SYBData_ApplicationForm.Add(this); + this._TestPackageDivisionId = value.TestPackageDivisionId; + } + else + { + this._TestPackageDivisionId = default(string); + } + this.SendPropertyChanged("SYBData_TestPackageDivision"); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -117760,8 +119537,12 @@ namespace Model private string _DemolitionSupervision; + private string _TestPackageDivisionId; + private EntityRef _Base_Project; + private EntityRef _SYBData_TestPackageDivision; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -117788,11 +119569,14 @@ namespace Model partial void OnDemolitionGeneralChanged(); partial void OnDemolitionSupervisionChanging(string value); partial void OnDemolitionSupervisionChanged(); + partial void OnTestPackageDivisionIdChanging(string value); + partial void OnTestPackageDivisionIdChanged(); #endregion public SYBData_BlindFlangeInstallationAndRemoval() { this._Base_Project = default(EntityRef); + this._SYBData_TestPackageDivision = default(EntityRef); OnCreated(); } @@ -118020,6 +119804,30 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + if (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnTestPackageDivisionIdChanging(value); + this.SendPropertyChanging(); + this._TestPackageDivisionId = value; + this.SendPropertyChanged("TestPackageDivisionId"); + this.OnTestPackageDivisionIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_BlindFlangeInstallationAndRemoval_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -118054,6 +119862,40 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_BlindFlangeInstallationAndRemoval_SYBData_TestPackageDivision", Storage="_SYBData_TestPackageDivision", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", IsForeignKey=true)] + public SYBData_TestPackageDivision SYBData_TestPackageDivision + { + get + { + return this._SYBData_TestPackageDivision.Entity; + } + set + { + SYBData_TestPackageDivision previousValue = this._SYBData_TestPackageDivision.Entity; + if (((previousValue != value) + || (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._SYBData_TestPackageDivision.Entity = null; + previousValue.SYBData_BlindFlangeInstallationAndRemoval.Remove(this); + } + this._SYBData_TestPackageDivision.Entity = value; + if ((value != null)) + { + value.SYBData_BlindFlangeInstallationAndRemoval.Add(this); + this._TestPackageDivisionId = value.TestPackageDivisionId; + } + else + { + this._TestPackageDivisionId = default(string); + } + this.SendPropertyChanged("SYBData_TestPackageDivision"); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -118608,8 +120450,12 @@ namespace Model private string _SD_OwnerUnit; + private string _TestPackageDivisionId; + private EntityRef _Base_Project; + private EntityRef _SYBData_TestPackageDivision; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -118630,11 +120476,14 @@ namespace Model partial void OnSD_SupervisionUnitChanged(); partial void OnSD_OwnerUnitChanging(string value); partial void OnSD_OwnerUnitChanged(); + partial void OnTestPackageDivisionIdChanging(string value); + partial void OnTestPackageDivisionIdChanged(); #endregion public SYBData_FinalitemList() { this._Base_Project = default(EntityRef); + this._SYBData_TestPackageDivision = default(EntityRef); OnCreated(); } @@ -118802,6 +120651,30 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + if (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnTestPackageDivisionIdChanging(value); + this.SendPropertyChanging(); + this._TestPackageDivisionId = value; + this.SendPropertyChanged("TestPackageDivisionId"); + this.OnTestPackageDivisionIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_FinalitemList_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -118836,6 +120709,40 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_FinalitemList_SYBData_TestPackageDivision", Storage="_SYBData_TestPackageDivision", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", IsForeignKey=true)] + public SYBData_TestPackageDivision SYBData_TestPackageDivision + { + get + { + return this._SYBData_TestPackageDivision.Entity; + } + set + { + SYBData_TestPackageDivision previousValue = this._SYBData_TestPackageDivision.Entity; + if (((previousValue != value) + || (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._SYBData_TestPackageDivision.Entity = null; + previousValue.SYBData_FinalitemList.Remove(this); + } + this._SYBData_TestPackageDivision.Entity = value; + if ((value != null)) + { + value.SYBData_FinalitemList.Add(this); + this._TestPackageDivisionId = value.TestPackageDivisionId; + } + else + { + this._TestPackageDivisionId = default(string); + } + this.SendPropertyChanged("SYBData_TestPackageDivision"); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -118879,8 +120786,12 @@ namespace Model private System.Nullable _CompileDate; + private string _ToIsoId; + private EntityRef _Base_Project; + private EntityRef _SYBData_ToIsoList; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -118901,11 +120812,14 @@ namespace Model partial void OnCompileManChanged(); partial void OnCompileDateChanging(System.Nullable value); partial void OnCompileDateChanged(); + partial void OnToIsoIdChanging(string value); + partial void OnToIsoIdChanged(); #endregion public SYBData_PressureTestPackageList() { this._Base_Project = default(EntityRef); + this._SYBData_ToIsoList = default(EntityRef); OnCreated(); } @@ -119073,6 +120987,30 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ToIsoId", DbType="NVarChar(50)")] + public string ToIsoId + { + get + { + return this._ToIsoId; + } + set + { + if ((this._ToIsoId != value)) + { + if (this._SYBData_ToIsoList.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnToIsoIdChanging(value); + this.SendPropertyChanging(); + this._ToIsoId = value; + this.SendPropertyChanged("ToIsoId"); + this.OnToIsoIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_PressureTestPackageList_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -119107,6 +121045,40 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_PressureTestPackageList_SYBData_ToIsoList", Storage="_SYBData_ToIsoList", ThisKey="ToIsoId", OtherKey="ToIsoId", IsForeignKey=true)] + public SYBData_ToIsoList SYBData_ToIsoList + { + get + { + return this._SYBData_ToIsoList.Entity; + } + set + { + SYBData_ToIsoList previousValue = this._SYBData_ToIsoList.Entity; + if (((previousValue != value) + || (this._SYBData_ToIsoList.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._SYBData_ToIsoList.Entity = null; + previousValue.SYBData_PressureTestPackageList.Remove(this); + } + this._SYBData_ToIsoList.Entity = value; + if ((value != null)) + { + value.SYBData_PressureTestPackageList.Add(this); + this._ToIsoId = value.ToIsoId; + } + else + { + this._ToIsoId = default(string); + } + this.SendPropertyChanged("SYBData_ToIsoList"); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -119156,8 +121128,12 @@ namespace Model private System.Nullable _CompileDate; + private string _TestPackageDivisionId; + private EntityRef _Base_Project; + private EntityRef _SYBData_TestPackageDivision; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -119184,11 +121160,14 @@ namespace Model partial void OnCompileManChanged(); partial void OnCompileDateChanging(System.Nullable value); partial void OnCompileDateChanged(); + partial void OnTestPackageDivisionIdChanging(string value); + partial void OnTestPackageDivisionIdChanged(); #endregion public SYBData_SlidingFixed() { this._Base_Project = default(EntityRef); + this._SYBData_TestPackageDivision = default(EntityRef); OnCreated(); } @@ -119416,6 +121395,30 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + if (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnTestPackageDivisionIdChanging(value); + this.SendPropertyChanging(); + this._TestPackageDivisionId = value; + this.SendPropertyChanged("TestPackageDivisionId"); + this.OnTestPackageDivisionIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_SlidingFixed_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -119450,6 +121453,40 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_SlidingFixed_SYBData_TestPackageDivision", Storage="_SYBData_TestPackageDivision", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", IsForeignKey=true)] + public SYBData_TestPackageDivision SYBData_TestPackageDivision + { + get + { + return this._SYBData_TestPackageDivision.Entity; + } + set + { + SYBData_TestPackageDivision previousValue = this._SYBData_TestPackageDivision.Entity; + if (((previousValue != value) + || (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._SYBData_TestPackageDivision.Entity = null; + previousValue.SYBData_SlidingFixed.Remove(this); + } + this._SYBData_TestPackageDivision.Entity = value; + if ((value != null)) + { + value.SYBData_SlidingFixed.Add(this); + this._TestPackageDivisionId = value.TestPackageDivisionId; + } + else + { + this._TestPackageDivisionId = default(string); + } + this.SendPropertyChanged("SYBData_TestPackageDivision"); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -119499,8 +121536,12 @@ namespace Model private System.Nullable _CompileDate; + private string _TestPackageDivisionId; + private EntityRef _Base_Project; + private EntityRef _SYBData_TestPackageDivision; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -119527,11 +121568,14 @@ namespace Model partial void OnCompileManChanged(); partial void OnCompileDateChanging(System.Nullable value); partial void OnCompileDateChanged(); + partial void OnTestPackageDivisionIdChanging(string value); + partial void OnTestPackageDivisionIdChanged(); #endregion public SYBData_SpringSupportHangBracket() { this._Base_Project = default(EntityRef); + this._SYBData_TestPackageDivision = default(EntityRef); OnCreated(); } @@ -119759,6 +121803,30 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + if (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnTestPackageDivisionIdChanging(value); + this.SendPropertyChanging(); + this._TestPackageDivisionId = value; + this.SendPropertyChanged("TestPackageDivisionId"); + this.OnTestPackageDivisionIdChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_SpringSupportHangBracket_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -119793,6 +121861,40 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_SpringSupportHangBracket_SYBData_TestPackageDivision", Storage="_SYBData_TestPackageDivision", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", IsForeignKey=true)] + public SYBData_TestPackageDivision SYBData_TestPackageDivision + { + get + { + return this._SYBData_TestPackageDivision.Entity; + } + set + { + SYBData_TestPackageDivision previousValue = this._SYBData_TestPackageDivision.Entity; + if (((previousValue != value) + || (this._SYBData_TestPackageDivision.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._SYBData_TestPackageDivision.Entity = null; + previousValue.SYBData_SpringSupportHangBracket.Remove(this); + } + this._SYBData_TestPackageDivision.Entity = value; + if ((value != null)) + { + value.SYBData_SpringSupportHangBracket.Add(this); + this._TestPackageDivisionId = value.TestPackageDivisionId; + } + else + { + this._TestPackageDivisionId = default(string); + } + this.SendPropertyChanged("SYBData_TestPackageDivision"); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -119830,8 +121932,24 @@ namespace Model private System.Nullable _CompileDate; + private EntitySet _JGZL_ElectrostaticGrounding; + + private EntitySet _JGZL_PressureTestOfPipelineSystemConfirmationRecord; + + private EntitySet _JGZL_PressureTestOfPipelineSystemRecord; + + private EntitySet _SYBData_ApplicationForm; + + private EntitySet _SYBData_BlindFlangeInstallationAndRemoval; + private EntitySet _SYBData_Cover; + private EntitySet _SYBData_FinalitemList; + + private EntitySet _SYBData_SlidingFixed; + + private EntitySet _SYBData_SpringSupportHangBracket; + private EntityRef _Base_Project; private EntityRef _Sys_User; @@ -119856,7 +121974,15 @@ namespace Model public SYBData_TestPackageDivision() { + this._JGZL_ElectrostaticGrounding = new EntitySet(new Action(this.attach_JGZL_ElectrostaticGrounding), new Action(this.detach_JGZL_ElectrostaticGrounding)); + this._JGZL_PressureTestOfPipelineSystemConfirmationRecord = new EntitySet(new Action(this.attach_JGZL_PressureTestOfPipelineSystemConfirmationRecord), new Action(this.detach_JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + this._JGZL_PressureTestOfPipelineSystemRecord = new EntitySet(new Action(this.attach_JGZL_PressureTestOfPipelineSystemRecord), new Action(this.detach_JGZL_PressureTestOfPipelineSystemRecord)); + this._SYBData_ApplicationForm = new EntitySet(new Action(this.attach_SYBData_ApplicationForm), new Action(this.detach_SYBData_ApplicationForm)); + this._SYBData_BlindFlangeInstallationAndRemoval = new EntitySet(new Action(this.attach_SYBData_BlindFlangeInstallationAndRemoval), new Action(this.detach_SYBData_BlindFlangeInstallationAndRemoval)); this._SYBData_Cover = new EntitySet(new Action(this.attach_SYBData_Cover), new Action(this.detach_SYBData_Cover)); + this._SYBData_FinalitemList = new EntitySet(new Action(this.attach_SYBData_FinalitemList), new Action(this.detach_SYBData_FinalitemList)); + this._SYBData_SlidingFixed = new EntitySet(new Action(this.attach_SYBData_SlidingFixed), new Action(this.detach_SYBData_SlidingFixed)); + this._SYBData_SpringSupportHangBracket = new EntitySet(new Action(this.attach_SYBData_SpringSupportHangBracket), new Action(this.detach_SYBData_SpringSupportHangBracket)); this._Base_Project = default(EntityRef); this._Sys_User = default(EntityRef); this._SYBData_ToIsoList = new EntitySet(new Action(this.attach_SYBData_ToIsoList), new Action(this.detach_SYBData_ToIsoList)); @@ -119971,6 +122097,72 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_ElectrostaticGrounding_SYBData_TestPackageDivision", Storage="_JGZL_ElectrostaticGrounding", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", DeleteRule="NO ACTION")] + public EntitySet JGZL_ElectrostaticGrounding + { + get + { + return this._JGZL_ElectrostaticGrounding; + } + set + { + this._JGZL_ElectrostaticGrounding.Assign(value); + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_PressureTestOfPipelineSystemConfirmationRecord_SYBData_TestPackageDivisio" + + "n", Storage="_JGZL_PressureTestOfPipelineSystemConfirmationRecord", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", DeleteRule="NO ACTION")] + public EntitySet JGZL_PressureTestOfPipelineSystemConfirmationRecord + { + get + { + return this._JGZL_PressureTestOfPipelineSystemConfirmationRecord; + } + set + { + this._JGZL_PressureTestOfPipelineSystemConfirmationRecord.Assign(value); + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_PressureTestOfPipelineSystemRecord_SYBData_TestPackageDivision", Storage="_JGZL_PressureTestOfPipelineSystemRecord", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", DeleteRule="NO ACTION")] + public EntitySet JGZL_PressureTestOfPipelineSystemRecord + { + get + { + return this._JGZL_PressureTestOfPipelineSystemRecord; + } + set + { + this._JGZL_PressureTestOfPipelineSystemRecord.Assign(value); + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_ApplicationForm_SYBData_TestPackageDivision", Storage="_SYBData_ApplicationForm", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", DeleteRule="NO ACTION")] + public EntitySet SYBData_ApplicationForm + { + get + { + return this._SYBData_ApplicationForm; + } + set + { + this._SYBData_ApplicationForm.Assign(value); + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_BlindFlangeInstallationAndRemoval_SYBData_TestPackageDivision", Storage="_SYBData_BlindFlangeInstallationAndRemoval", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", DeleteRule="NO ACTION")] + public EntitySet SYBData_BlindFlangeInstallationAndRemoval + { + get + { + return this._SYBData_BlindFlangeInstallationAndRemoval; + } + set + { + this._SYBData_BlindFlangeInstallationAndRemoval.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_Cover_SYBData_TestPackageDivision", Storage="_SYBData_Cover", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", DeleteRule="NO ACTION")] public EntitySet SYBData_Cover { @@ -119984,6 +122176,45 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_FinalitemList_SYBData_TestPackageDivision", Storage="_SYBData_FinalitemList", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", DeleteRule="NO ACTION")] + public EntitySet SYBData_FinalitemList + { + get + { + return this._SYBData_FinalitemList; + } + set + { + this._SYBData_FinalitemList.Assign(value); + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_SlidingFixed_SYBData_TestPackageDivision", Storage="_SYBData_SlidingFixed", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", DeleteRule="NO ACTION")] + public EntitySet SYBData_SlidingFixed + { + get + { + return this._SYBData_SlidingFixed; + } + set + { + this._SYBData_SlidingFixed.Assign(value); + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_SpringSupportHangBracket_SYBData_TestPackageDivision", Storage="_SYBData_SpringSupportHangBracket", ThisKey="TestPackageDivisionId", OtherKey="TestPackageDivisionId", DeleteRule="NO ACTION")] + public EntitySet SYBData_SpringSupportHangBracket + { + get + { + return this._SYBData_SpringSupportHangBracket; + } + set + { + this._SYBData_SpringSupportHangBracket.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_TestPackageDivision_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -120085,6 +122316,66 @@ namespace Model } } + private void attach_JGZL_ElectrostaticGrounding(JGZL_ElectrostaticGrounding entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = this; + } + + private void detach_JGZL_ElectrostaticGrounding(JGZL_ElectrostaticGrounding entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = null; + } + + private void attach_JGZL_PressureTestOfPipelineSystemConfirmationRecord(JGZL_PressureTestOfPipelineSystemConfirmationRecord entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = this; + } + + private void detach_JGZL_PressureTestOfPipelineSystemConfirmationRecord(JGZL_PressureTestOfPipelineSystemConfirmationRecord entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = null; + } + + private void attach_JGZL_PressureTestOfPipelineSystemRecord(JGZL_PressureTestOfPipelineSystemRecord entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = this; + } + + private void detach_JGZL_PressureTestOfPipelineSystemRecord(JGZL_PressureTestOfPipelineSystemRecord entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = null; + } + + private void attach_SYBData_ApplicationForm(SYBData_ApplicationForm entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = this; + } + + private void detach_SYBData_ApplicationForm(SYBData_ApplicationForm entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = null; + } + + private void attach_SYBData_BlindFlangeInstallationAndRemoval(SYBData_BlindFlangeInstallationAndRemoval entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = this; + } + + private void detach_SYBData_BlindFlangeInstallationAndRemoval(SYBData_BlindFlangeInstallationAndRemoval entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = null; + } + private void attach_SYBData_Cover(SYBData_Cover entity) { this.SendPropertyChanging(); @@ -120097,6 +122388,42 @@ namespace Model entity.SYBData_TestPackageDivision = null; } + private void attach_SYBData_FinalitemList(SYBData_FinalitemList entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = this; + } + + private void detach_SYBData_FinalitemList(SYBData_FinalitemList entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = null; + } + + private void attach_SYBData_SlidingFixed(SYBData_SlidingFixed entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = this; + } + + private void detach_SYBData_SlidingFixed(SYBData_SlidingFixed entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = null; + } + + private void attach_SYBData_SpringSupportHangBracket(SYBData_SpringSupportHangBracket entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = this; + } + + private void detach_SYBData_SpringSupportHangBracket(SYBData_SpringSupportHangBracket entity) + { + this.SendPropertyChanging(); + entity.SYBData_TestPackageDivision = null; + } + private void attach_SYBData_ToIsoList(SYBData_ToIsoList entity) { this.SendPropertyChanging(); @@ -120122,6 +122449,8 @@ namespace Model private string _ISO_ID; + private EntitySet _SYBData_PressureTestPackageList; + private EntityRef _HJGL_PW_IsoInfo; private EntityRef _SYBData_TestPackageDivision; @@ -120140,6 +122469,7 @@ namespace Model public SYBData_ToIsoList() { + this._SYBData_PressureTestPackageList = new EntitySet(new Action(this.attach_SYBData_PressureTestPackageList), new Action(this.detach_SYBData_PressureTestPackageList)); this._HJGL_PW_IsoInfo = default(EntityRef); this._SYBData_TestPackageDivision = default(EntityRef); OnCreated(); @@ -120213,6 +122543,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_PressureTestPackageList_SYBData_ToIsoList", Storage="_SYBData_PressureTestPackageList", ThisKey="ToIsoId", OtherKey="ToIsoId", DeleteRule="NO ACTION")] + public EntitySet SYBData_PressureTestPackageList + { + get + { + return this._SYBData_PressureTestPackageList; + } + set + { + this._SYBData_PressureTestPackageList.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_ToIsoList_HJGL_PW_IsoInfo", Storage="_HJGL_PW_IsoInfo", ThisKey="ISO_ID", OtherKey="ISO_ID", IsForeignKey=true)] public HJGL_PW_IsoInfo HJGL_PW_IsoInfo { @@ -120300,6 +122643,18 @@ namespace Model this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } + + private void attach_SYBData_PressureTestPackageList(SYBData_PressureTestPackageList entity) + { + this.SendPropertyChanging(); + entity.SYBData_ToIsoList = this; + } + + private void detach_SYBData_PressureTestPackageList(SYBData_PressureTestPackageList entity) + { + this.SendPropertyChanging(); + entity.SYBData_ToIsoList = null; + } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Sys_ButtonPower")] @@ -131827,6 +134182,87 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_SYB_CheckResultsSummaryTree")] + public partial class View_SYB_CheckResultsSummaryTree + { + + private string _ProjectId; + + private string _PipeId; + + private string _PipeCode; + + private string _TestPackageDivisionId; + + public View_SYB_CheckResultsSummaryTree() + { + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this._ProjectId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipeId", DbType="VarChar(152)")] + public string PipeId + { + get + { + return this._PipeId; + } + set + { + if ((this._PipeId != value)) + { + this._PipeId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipeCode", DbType="NVarChar(144)")] + public string PipeCode + { + get + { + return this._PipeCode; + } + set + { + if ((this._PipeCode != value)) + { + this._PipeCode = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageDivisionId", DbType="NVarChar(50)")] + public string TestPackageDivisionId + { + get + { + return this._TestPackageDivisionId; + } + set + { + if ((this._TestPackageDivisionId != value)) + { + this._TestPackageDivisionId = value; + } + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_TestingReportPrint")] public partial class View_TestingReportPrint { diff --git a/HJGL_DS/WebAPI/WebAPI.csproj.user b/HJGL_DS/WebAPI/WebAPI.csproj.user index 8cd7f1f..ef14066 100644 --- a/HJGL_DS/WebAPI/WebAPI.csproj.user +++ b/HJGL_DS/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@ - Release|Any CPU + Debug|Any CPU FolderProfile true