diff --git a/DataBase/版本日志/SGGLDB_V2023-03-30_gaofei.sql b/DataBase/版本日志/SGGLDB_V2023-03-30_gaofei.sql new file mode 100644 index 00000000..dc2d10bd --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-03-30_gaofei.sql @@ -0,0 +1,3000 @@ + drop table [Environmental_ArchitectureReportItem] +drop view [View_Environmental_ArchitectureReport] +drop table Environmental_ArchitectureReport + + INSERT sys_menu (MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES ( N'ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14',N'ҵԴԼ̬ܱ',N'ZHGL/Environmental/ChemicalReport.aspx',120,N'ERDXV53M-09B1-6UIO-3EFM-5DVZDF329001',N'Menu_ZHGL',1,1,1) + go + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'46920D17-DBED-49FC-AE0C-7FB67ECEB489',N'ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14',N'',1) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'55E6ABFD-302A-4069-BFB3-0CA4A8A2378B',N'ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14',N'޸',2) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'D00DEFA7-5B40-4DBF-8B9E-A9EAAE45A32B',N'ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14',N'ɾ',3) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'848805D2-91A1-4D20-9D04-108D44B08860',N'ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14',N'',4) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'D0B18467-8D51-4D4A-A446-3BB140FF29A7',N'ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14',N'沢ϱ',5) + go + +CREATE TABLE [dbo].[Environmental_ChemicalReport]( + [ChemicalReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Month] [int] NULL, + [FillingMan] [nvarchar](50) NULL, + [FillingDate] [datetime] NULL, + [DutyPerson] [nvarchar](50) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Environmental_ChemicalReport] PRIMARY KEY CLUSTERED +( + [ChemicalReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Environmental_ChemicalReport] WITH CHECK ADD CONSTRAINT [FK_Environmental_ChemicalReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Environmental_ChemicalReport] CHECK CONSTRAINT [FK_Environmental_ChemicalReport_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReport', @level2type=N'COLUMN',@level2name=N'ChemicalReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReport', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'·' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReport', @level2type=N'COLUMN',@level2name=N'Month' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReport', @level2type=N'COLUMN',@level2name=N'FillingMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReport', @level2type=N'COLUMN',@level2name=N'FillingDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReport', @level2type=N'COLUMN',@level2name=N'DutyPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵԴԼ̬ܱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReport' +GO + + + +CREATE TABLE [dbo].[Environmental_ChemicalReportItem]( + [ChemicalReportItemId] [nvarchar](50) NOT NULL, + [ChemicalReportId] [nvarchar](50) NULL, + [SortIndex] [nvarchar](50) NULL, + [LastYearValue] [nvarchar](50) NULL, + [ThisYearValue] [nvarchar](50) NULL, + [Rate] [nvarchar](50) NULL, + CONSTRAINT [PK_Environmental_ChemicalReportItem] PRIMARY KEY CLUSTERED +( + [ChemicalReportItemId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[Environmental_ChemicalReportItem] WITH CHECK ADD CONSTRAINT [FK_Environmental_ChemicalReportItem_Environmental_ChemicalReport] FOREIGN KEY([ChemicalReportId]) +REFERENCES [dbo].[Environmental_ChemicalReport] ([ChemicalReportId]) +GO + +ALTER TABLE [dbo].[Environmental_ChemicalReportItem] CHECK CONSTRAINT [FK_Environmental_ChemicalReportItem_Environmental_ChemicalReport] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReportItem', @level2type=N'COLUMN',@level2name=N'ChemicalReportItemId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReportItem', @level2type=N'COLUMN',@level2name=N'ChemicalReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼֵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReportItem', @level2type=N'COLUMN',@level2name=N'LastYearValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼֵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReportItem', @level2type=N'COLUMN',@level2name=N'ThisYearValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͬڱȽ(%)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReportItem', @level2type=N'COLUMN',@level2name=N'Rate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵԴԼ̬ϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ChemicalReportItem' +GO + + + +/*************ҵԴԼ̬ܱ**************/ +CREATE VIEW [dbo].[View_Environmental_ChemicalReport] +AS +SELECT +Report.ChemicalReportId, +Report.UnitId, +Report.FillingDate, +(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0009.ConstText,'-')) AS ReportDate, +Group_0008.ConstText as YearStr, +Group_0009.ConstText as MonthStr, +U.UnitName, +Report.Year, +Report.Month, +Report.UpState, +Report.DutyPerson +FROM dbo.Environmental_ChemicalReport AS Report +LEFT JOIN Base_Unit AS U ON U.UnitId=Report.UnitId +LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year] +LEFT JOIN Sys_Const AS Group_0009 ON Group_0009.GroupId='0009' AND Group_0009.ConstValue =Report.[Month] + + + + + + +GO + + INSERT sys_menu (MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES ( N'7C47F078-D4C9-40D9-BEEF-E657EAFEC650',N'ҵԴԼ̬ܱ',N'ZHGL/Environmental/ArchitectureReport.aspx',110,N'ERDXV53M-09B1-6UIO-3EFM-5DVZDF329001',N'Menu_ZHGL',1,1,1) + go + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'18E91EB6-C21B-46ED-9F98-438C8EABD1BE',N'7C47F078-D4C9-40D9-BEEF-E657EAFEC650',N'',1) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'B42F1CA0-A07C-4B02-98B5-602820C550D5',N'7C47F078-D4C9-40D9-BEEF-E657EAFEC650',N'޸',2) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'8B675F10-97BC-4D6D-B675-2C1DCD91C691',N'7C47F078-D4C9-40D9-BEEF-E657EAFEC650',N'ɾ',3) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'1B762DE4-5B26-42B2-AAFD-4ED2F6505A26',N'7C47F078-D4C9-40D9-BEEF-E657EAFEC650',N'',4) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'EF3CB7FF-3B65-485C-8414-D2955B7C7BFB',N'7C47F078-D4C9-40D9-BEEF-E657EAFEC650',N'沢ϱ',5) + go + +CREATE TABLE [dbo].[Environmental_ArchitectureReport]( + [ArchitectureReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Month] [int] NULL, + [FillingMan] [nvarchar](50) NULL, + [FillingDate] [datetime] NULL, + [DutyPerson] [nvarchar](50) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Environmental_ArchitectureReport] PRIMARY KEY CLUSTERED +( + [ArchitectureReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Environmental_ArchitectureReport] WITH CHECK ADD CONSTRAINT [FK_Environmental_ArchitectureReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Environmental_ArchitectureReport] CHECK CONSTRAINT [FK_Environmental_ArchitectureReport_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReport', @level2type=N'COLUMN',@level2name=N'ArchitectureReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReport', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'·' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReport', @level2type=N'COLUMN',@level2name=N'Month' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReport', @level2type=N'COLUMN',@level2name=N'FillingMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReport', @level2type=N'COLUMN',@level2name=N'FillingDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReport', @level2type=N'COLUMN',@level2name=N'DutyPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵԴԼ̬ܱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReport' +GO + + + +CREATE TABLE [dbo].[Environmental_ArchitectureReportItem]( + [ArchitectureReportItemId] [nvarchar](50) NOT NULL, + [ArchitectureReportId] [nvarchar](50) NULL, + [SortIndex] [nvarchar](50) NULL, + [LastYearValue] [nvarchar](50) NULL, + [ThisYearValue] [nvarchar](50) NULL, + [Rate] [nvarchar](50) NULL, + CONSTRAINT [PK_Environmental_ArchitectureReportItem] PRIMARY KEY CLUSTERED +( + [ArchitectureReportItemId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[Environmental_ArchitectureReportItem] WITH CHECK ADD CONSTRAINT [FK_Environmental_ArchitectureReportItem_Environmental_ArchitectureReport] FOREIGN KEY([ArchitectureReportId]) +REFERENCES [dbo].[Environmental_ArchitectureReport] ([ArchitectureReportId]) +GO + +ALTER TABLE [dbo].[Environmental_ArchitectureReportItem] CHECK CONSTRAINT [FK_Environmental_ArchitectureReportItem_Environmental_ArchitectureReport] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'ArchitectureReportItemId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'ArchitectureReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼֵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'LastYearValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼֵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'ThisYearValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͬڱȽ(%)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'Rate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵԴԼ̬ϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ArchitectureReportItem' +GO + + + + +/*************ҵԴԼ̬ܱ**************/ +CREATE VIEW [dbo].[View_Environmental_ArchitectureReport] +AS +SELECT +Report.ArchitectureReportId, +Report.UnitId, +Report.FillingDate, +(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0009.ConstText,'-')) AS ReportDate, +Group_0008.ConstText as YearStr, +Group_0009.ConstText as MonthStr, +U.UnitName, +Report.Year, +Report.Month, +Report.UpState, +Report.DutyPerson +FROM dbo.Environmental_ArchitectureReport AS Report +LEFT JOIN Base_Unit AS U ON U.UnitId=Report.UnitId +LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year] +LEFT JOIN Sys_Const AS Group_0009 ON Group_0009.GroupId='0009' AND Group_0009.ConstValue =Report.[Month] + + + + + + +GO + + + + + + insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('07FEEC9D-09C1-4C19-9269-62F69532086C','ȫܽᱨ','ZHGL/Information/WorkSummaryReport.aspx',90,'ERDXV53M-09B1-6UIO-3EFM-5DVZDF329001','Menu_ZHGL',1,1,1) +go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('FD088090-FD25-4548-9B7F-49247A8F601B','07FEEC9D-09C1-4C19-9269-62F69532086C','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('8ADC4E94-8182-4AE7-8D69-CEF3004B6AAE','07FEEC9D-09C1-4C19-9269-62F69532086C','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('7A3C8A43-9585-4E27-BDE2-F66FEE9435BD','07FEEC9D-09C1-4C19-9269-62F69532086C','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('AD4FB77C-2B53-4970-87F3-3DF8B675C9A8','07FEEC9D-09C1-4C19-9269-62F69532086C','',4) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('2F222D01-838E-4BE6-9212-4C6AE0B0BC6A','07FEEC9D-09C1-4C19-9269-62F69532086C','沢ϱ',5) + go + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('12941594-2171-411A-8CC8-32E3BD9FCDDF','ܽᱨ','ZHGL/Information/QualityWorkSummaryReport.aspx',100,'ERDXV53M-09B1-6UIO-3EFM-5DVZDF329001','Menu_ZHGL',1,1,1) +go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('EC9D2B2F-E61B-4E87-8F38-26ED0D7F3F10','12941594-2171-411A-8CC8-32E3BD9FCDDF','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('A1F10A53-693D-4AA8-A28D-A60151828325','12941594-2171-411A-8CC8-32E3BD9FCDDF','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('0948549B-7CAC-4810-8113-66843F4C4969','12941594-2171-411A-8CC8-32E3BD9FCDDF','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('254F6A15-4A4B-4BF3-929B-FBC9174B4FC5','12941594-2171-411A-8CC8-32E3BD9FCDDF','',4) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('817CF1AA-4F75-41A4-A8F6-E30448D62FFC','12941594-2171-411A-8CC8-32E3BD9FCDDF','沢ϱ',5) + go + + + +CREATE TABLE [dbo].[Information_WorkSummaryReport]( + [WorkSummaryReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [ResponsiblePersonTel] [nvarchar](50) NULL, + [ContactPerson] [nvarchar](50) NULL, + [ContactPersonTel] [nvarchar](50) NULL, + [ReportDate] [datetime] NULL, + [SafeLaborTime] [decimal](18, 2) NULL, + [SafetyObjectives] [nvarchar](max) NULL, + [AccidentSituation] [nvarchar](max) NULL, + [Awards] [nvarchar](max) NULL, + [WorkDevelopment] [nvarchar](max) NULL, + [PersonnelTraining] [nvarchar](max) NULL, + [GovernanceSituation] [nvarchar](max) NULL, + [ManagementActivity] [nvarchar](max) NULL, + [WorkExperience] [nvarchar](max) NULL, + [Countermeasures] [nvarchar](max) NULL, + [NextYearWorkPlan] [nvarchar](max) NULL, + [JobSuggestion] [nvarchar](max) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Information_WorkSummaryReport] PRIMARY KEY CLUSTERED +( + [WorkSummaryReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Information_WorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_Information_WorkSummaryReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Information_WorkSummaryReport] CHECK CONSTRAINT [FK_Information_WorkSummaryReport_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'YearId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ˹ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'SafeLaborTime' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫĿ꼰Ӧݽܽᣩ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'SafetyObjectives' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'AccidentSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Awards' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ص㹤չ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkDevelopment' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Աѵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'PersonnelTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'֯չȫල顢Ų' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'GovernanceSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ¡ְҵܵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ManagementActivity' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ鼰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkExperience' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ⼰ӦԴʩ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Countermeasures' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һȹƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'NextYearWorkPlan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ԼŹ˾Ĺ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'JobSuggestion' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫܽᱨ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport' +GO + + + + + +CREATE TABLE [dbo].[Information_QualityWorkSummaryReport]( + [QualityWorkSummaryReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [ResponsiblePersonTel] [nvarchar](50) NULL, + [ContactPerson] [nvarchar](50) NULL, + [ContactPersonTel] [nvarchar](50) NULL, + [ReportDate] [datetime] NULL, + [Performance] [nvarchar](max) NULL, + [AccidentSituation] [nvarchar](max) NULL, + [Awards] [nvarchar](max) NULL, + [WorkDevelopment] [nvarchar](max) NULL, + [PersonnelTraining] [nvarchar](max) NULL, + [CheckSituation] [nvarchar](max) NULL, + [ManagementActivity] [nvarchar](max) NULL, + [WorkExperience] [nvarchar](max) NULL, + [Countermeasures] [nvarchar](max) NULL, + [NextYearWorkPlan] [nvarchar](max) NULL, + [JobSuggestion] [nvarchar](max) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Information_QualityWorkSummaryReport] PRIMARY KEY CLUSTERED +( + [QualityWorkSummaryReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Information_QualityWorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_Information_QualityWorkSummaryReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Information_QualityWorkSummaryReport] CHECK CONSTRAINT [FK_Information_QualityWorkSummaryReport_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'YearId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Чλ״ȣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Performance' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'AccidentSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Awards' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ж׼ص㹤չ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkDevelopment' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Աѵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'PersonnelTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'֯չල' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'CheckSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'µ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ManagementActivity' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ鼰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkExperience' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ⼰ӦԴʩ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Countermeasures' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һȹƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'NextYearWorkPlan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ԼŹ˾Ĺ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'JobSuggestion' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܽᱨ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport' +GO + + + + +alter table [dbo].[Environmental_ChemicalReportItem] add BaseNumber nvarchar(50) null +GO +alter table [dbo].[Environmental_ArchitectureReportItem] add BaseNumber nvarchar(50) null +GO + + +CREATE TABLE [dbo].[Environmental_ProjectChemicalReport]( + [ChemicalReportId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Month] [int] NULL, + [FillingMan] [nvarchar](50) NULL, + [FillingDate] [datetime] NULL, + [DutyPerson] [nvarchar](50) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Environmental_ProjectChemicalReport] PRIMARY KEY CLUSTERED +( + [ChemicalReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Environmental_ProjectChemicalReport] WITH CHECK ADD CONSTRAINT [FK_Environmental_ProjectChemicalReport_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[Environmental_ProjectChemicalReport] CHECK CONSTRAINT [FK_Environmental_ProjectChemicalReport_Base_Project] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReport', @level2type=N'COLUMN',@level2name=N'ChemicalReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReport', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReport', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'·' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReport', @level2type=N'COLUMN',@level2name=N'Month' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReport', @level2type=N'COLUMN',@level2name=N'FillingMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReport', @level2type=N'COLUMN',@level2name=N'FillingDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReport', @level2type=N'COLUMN',@level2name=N'DutyPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵԴԼ̬ܱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReport' +GO + + + +CREATE TABLE [dbo].[Environmental_ProjectChemicalReportItem]( + [ChemicalReportItemId] [nvarchar](50) NOT NULL, + [ChemicalReportId] [nvarchar](50) NULL, + [SortIndex] [nvarchar](50) NULL, + [LastYearValue] [nvarchar](50) NULL, + [ThisYearValue] [nvarchar](50) NULL, + [Rate] [nvarchar](50) NULL, + [BaseNumber] [nvarchar](50) NULL, + CONSTRAINT [PK_Environmental_ProjectChemicalReportItem] PRIMARY KEY CLUSTERED +( + [ChemicalReportItemId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[Environmental_ProjectChemicalReportItem] WITH CHECK ADD CONSTRAINT [FK_Environmental_ProjectChemicalReportItem_Environmental_ProjectChemicalReport] FOREIGN KEY([ChemicalReportId]) +REFERENCES [dbo].[Environmental_ProjectChemicalReport] ([ChemicalReportId]) +GO + +ALTER TABLE [dbo].[Environmental_ProjectChemicalReportItem] CHECK CONSTRAINT [FK_Environmental_ProjectChemicalReportItem_Environmental_ProjectChemicalReport] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReportItem', @level2type=N'COLUMN',@level2name=N'ChemicalReportItemId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReportItem', @level2type=N'COLUMN',@level2name=N'ChemicalReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼֵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReportItem', @level2type=N'COLUMN',@level2name=N'LastYearValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼֵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReportItem', @level2type=N'COLUMN',@level2name=N'ThisYearValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͬڱȽ(%)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReportItem', @level2type=N'COLUMN',@level2name=N'Rate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵԴԼ̬ϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectChemicalReportItem' +GO + + +/*************ҵԴԼ̬ܱ**************/ +CREATE VIEW [dbo].[View_Environmental_ProjectChemicalReport] +AS +SELECT +Report.ChemicalReportId, +Report.ProjectId, +Report.FillingDate, +(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0009.ConstText,'-')) AS ReportDate, +Group_0008.ConstText as YearStr, +Group_0009.ConstText as MonthStr, +U.ProjectName, +Report.Year, +Report.Month, +Report.UpState, +Report.DutyPerson +FROM dbo.Environmental_ProjectChemicalReport AS Report +LEFT JOIN Base_Project AS U ON U.ProjectId=Report.ProjectId +LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year] +LEFT JOIN Sys_Const AS Group_0009 ON Group_0009.GroupId='0009' AND Group_0009.ConstValue =Report.[Month] + + + + + + + +GO + + + + + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('A44E98F6-E9FE-43F8-8349-C166263BF608','ҵԴԼ̬ܱ','ZHGL/Environmental/ProjectChemicalReport.aspx',60,'C554E471-B740-4559-B543-E00F247289FD','Menu_HSSE',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('61C72BD2-4B76-4595-BFBF-0E9FEB6A7B80','A44E98F6-E9FE-43F8-8349-C166263BF608','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('504F9B5D-88F7-4ED7-B5F4-48AC089AABBF','A44E98F6-E9FE-43F8-8349-C166263BF608','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('5208AF92-6632-4226-BC28-2392D3BF43FD','A44E98F6-E9FE-43F8-8349-C166263BF608','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('58B8415B-61C8-4D23-9AEE-1290E7FF8F2B','A44E98F6-E9FE-43F8-8349-C166263BF608','',4) + GO + + +CREATE TABLE [dbo].[Environmental_ProjectArchitectureReport]( + [ArchitectureReportId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Quarters] [int] NULL, + [FillingMan] [nvarchar](50) NULL, + [FillingDate] [datetime] NULL, + [DutyPerson] [nvarchar](50) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Environmental_ProjectArchitectureReport] PRIMARY KEY CLUSTERED +( + [ArchitectureReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Environmental_ProjectArchitectureReport] WITH CHECK ADD CONSTRAINT [FK_Environmental_ProjectArchitectureReport_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[Environmental_ProjectArchitectureReport] CHECK CONSTRAINT [FK_Environmental_ProjectArchitectureReport_Base_Project] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReport', @level2type=N'COLUMN',@level2name=N'ArchitectureReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReport', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReport', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'·' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReport', @level2type=N'COLUMN',@level2name=N'Quarters' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReport', @level2type=N'COLUMN',@level2name=N'FillingMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReport', @level2type=N'COLUMN',@level2name=N'FillingDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReport', @level2type=N'COLUMN',@level2name=N'DutyPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵԴԼ̬ܱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReport' +GO + + + +CREATE TABLE [dbo].[Environmental_ProjectArchitectureReportItem]( + [ArchitectureReportItemId] [nvarchar](50) NOT NULL, + [ArchitectureReportId] [nvarchar](50) NULL, + [SortIndex] [nvarchar](50) NULL, + [LastYearValue] [nvarchar](50) NULL, + [ThisYearValue] [nvarchar](50) NULL, + [Rate] [nvarchar](50) NULL, + [BaseNumber] [nvarchar](50) NULL, + CONSTRAINT [PK_Environmental_ProjectArchitectureReportItem] PRIMARY KEY CLUSTERED +( + [ArchitectureReportItemId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[Environmental_ProjectArchitectureReportItem] WITH CHECK ADD CONSTRAINT [FK_Environmental_ProjectArchitectureReportItem_Environmental_ProjectArchitectureReport] FOREIGN KEY([ArchitectureReportId]) +REFERENCES [dbo].[Environmental_ProjectArchitectureReport] ([ArchitectureReportId]) +GO + +ALTER TABLE [dbo].[Environmental_ProjectArchitectureReportItem] CHECK CONSTRAINT [FK_Environmental_ProjectArchitectureReportItem_Environmental_ProjectArchitectureReport] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'ArchitectureReportItemId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'ArchitectureReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼֵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'LastYearValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼֵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'ThisYearValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͬڱȽ(%)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReportItem', @level2type=N'COLUMN',@level2name=N'Rate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵԴԼ̬ϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectArchitectureReportItem' +GO + + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('25CE6894-2840-4DC4-AD2E-D72292849CEE','ҵԴԼ̬ܱ','ZHGL/Environmental/ProjectArchitectureReport.aspx',70,'C554E471-B740-4559-B543-E00F247289FD','Menu_HSSE',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('5CDC4DA8-D6CE-49F8-962B-5A24A7A2CE66','25CE6894-2840-4DC4-AD2E-D72292849CEE','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('3066BA22-F86B-4B98-8FA1-914DDB95FB52','25CE6894-2840-4DC4-AD2E-D72292849CEE','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('0B96AAC4-4E76-484F-932A-806BF910791D','25CE6894-2840-4DC4-AD2E-D72292849CEE','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('11C043C8-B557-4DDD-9E0A-64BC44BD3D7B','25CE6894-2840-4DC4-AD2E-D72292849CEE','',4) + GO + + +/*************ҵԴԼ̬ܱ**************/ +CREATE VIEW [dbo].[View_Environmental_ProjectArchitectureReport] +AS +SELECT +Report.ArchitectureReportId, +Report.ProjectId, +Report.FillingDate, +(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0011.ConstText,'-')) AS ReportDate, +Group_0008.ConstText as YearStr, +Group_0011.ConstText as QuartersStr, +U.ProjectName, +Report.Year, +Report.Quarters, +Report.UpState, +Report.DutyPerson +FROM dbo.Environmental_ProjectArchitectureReport AS Report +LEFT JOIN Base_Project AS U ON U.ProjectId=Report.ProjectId +LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year] +LEFT JOIN Sys_Const AS Group_0011 ON Group_0011.GroupId='0011' AND Group_0011.ConstValue =Report.[Quarters] + + + + + + + +GO + + +alter table [dbo].[Information_MillionsMonthlyReportItem] add DeathAccidentNum int null +GO +alter table [dbo].[Information_MillionsMonthlyReportItem] add DeathAccidentPersonNum int null +GO +alter table [dbo].[Information_MillionsMonthlyReportItem] add DeathAccidentLossHour int null +GO +alter table [dbo].[Information_MillionsMonthlyReportItem] add EnvironmenNum int null +GO + +alter table [dbo].[InformationProject_MillionsMonthlyReport] add DeathAccidentNum int null +GO +alter table [dbo].[InformationProject_MillionsMonthlyReport] add DeathAccidentPersonNum int null +GO +alter table [dbo].[InformationProject_MillionsMonthlyReport] add DeathAccidentLossHour int null +GO +alter table [dbo].[InformationProject_MillionsMonthlyReport] add EnvironmenNum int null +GO + +alter table Information_MillionsMonthlyReport add InputCosts decimal(18,4) null +alter table Information_MillionsMonthlyReport add TrainNum int null +alter table Information_MillionsMonthlyReport add GeneralHazardNum int null +alter table Information_MillionsMonthlyReport add MajorHazardNum int null +alter table Information_MillionsMonthlyReport add NotProofLargeProjectNum int null +alter table Information_MillionsMonthlyReport add ProofLargeProjectNum int null +alter table Information_MillionsMonthlyReport add FireLicenseNum int null +alter table Information_MillionsMonthlyReport add LimitLicenseNum int null +alter table Information_MillionsMonthlyReport add HighLicenseNum int null +alter table Information_MillionsMonthlyReport add HoistingLicenseNum int null +alter table Information_MillionsMonthlyReport add BreakGroundLicenseNum int null +alter table Information_MillionsMonthlyReport add ElectricityLicenseNum int null +alter table Information_MillionsMonthlyReport add RTLicenseNum int null +alter table Information_MillionsMonthlyReport add NightLicenseNum int null +alter table Information_MillionsMonthlyReport add CommissionerNum int null +alter table Information_MillionsMonthlyReport add SoleDutyNum int null +GO + +alter table InformationProject_MillionsMonthlyReport add InputCosts decimal(18,4) null +alter table InformationProject_MillionsMonthlyReport add TrainNum int null +alter table InformationProject_MillionsMonthlyReport add GeneralHazardNum int null +alter table InformationProject_MillionsMonthlyReport add MajorHazardNum int null +alter table InformationProject_MillionsMonthlyReport add NotProofLargeProjectNum int null +alter table InformationProject_MillionsMonthlyReport add ProofLargeProjectNum int null +alter table InformationProject_MillionsMonthlyReport add FireLicenseNum int null +alter table InformationProject_MillionsMonthlyReport add LimitLicenseNum int null +alter table InformationProject_MillionsMonthlyReport add HighLicenseNum int null +alter table InformationProject_MillionsMonthlyReport add HoistingLicenseNum int null +alter table InformationProject_MillionsMonthlyReport add BreakGroundLicenseNum int null +alter table InformationProject_MillionsMonthlyReport add ElectricityLicenseNum int null +alter table InformationProject_MillionsMonthlyReport add RTLicenseNum int null +alter table InformationProject_MillionsMonthlyReport add NightLicenseNum int null +alter table InformationProject_MillionsMonthlyReport add CommissionerNum int null +alter table InformationProject_MillionsMonthlyReport add SoleDutyNum int null +GO + +update [Sys_Menu] set [MenuName]='ҵȫͳ±' where MenuId='3156A9F0-276D-4AD4-BF84-45CF6DFC215C' +update [Sys_Menu] set [MenuName]='ҵȫͳ±' where MenuId='6E7DC075-A7AF-4E42-8F8B-0174EFDD54A1' +GO + +delete from Sys_ButtonToMenu where MenuId='8B17DC64-A4B9-4283-B7A1-D2E944205FA5' +delete from [Sys_Menu] where MenuId='8B17DC64-A4B9-4283-B7A1-D2E944205FA5' +delete from Sys_ButtonToMenu where MenuId='A3894BAD-3F4A-4BB4-98CF-A76C588AE53F' +delete from [Sys_Menu] where MenuId='A3894BAD-3F4A-4BB4-98CF-A76C588AE53F' +GO + + INSERT sys_menu (MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES ( N'7652D239-1897-4886-8DF2-B71E3B060D21',N'ҵܻҵҵ;Ӫ',N'ZHGL/Environmental/OperationReport.aspx',200,N'ERDXV53M-09B1-6UIO-3EFM-5DVZDF329001',N'Menu_ZHGL',1,1,1) + go + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'6FF2A6A9-797D-4581-B3A6-4B0F55E40DA0',N'7652D239-1897-4886-8DF2-B71E3B060D21',N'',1) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'20C8D28A-51FC-4AE4-9545-A8D2C9C61CBB',N'7652D239-1897-4886-8DF2-B71E3B060D21',N'޸',2) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'0E3A8AA4-0E0E-4A47-9B70-74503ACAB056',N'7652D239-1897-4886-8DF2-B71E3B060D21',N'ɾ',3) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'84A185EC-13CD-4C09-A415-F666138877AC',N'7652D239-1897-4886-8DF2-B71E3B060D21',N'',4) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'87F2FE97-0CCA-4F42-B297-43DC026334FF',N'7652D239-1897-4886-8DF2-B71E3B060D21',N'沢ϱ',5) + go + + + + +CREATE TABLE [dbo].[Environmental_OperationReport]( + [BusinessReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Quarters] [int] NULL, + [Code] [nvarchar](50) NULL, + [UnitLevel] [nvarchar](50) NULL, + [CreateDate] [datetime] NULL, + [Place] [nvarchar](200) NULL, + [PersonNum] [int] NULL, + [TotalAssets] [decimal](18, 4) NULL, + [TotalValue] [decimal](18, 4) NULL, + [NewInvestment] [decimal](18, 4) NULL, + [FillingMan] [nvarchar](50) NULL, + [FillingDate] [datetime] NULL, + [StatisticsDutyPerson] [nvarchar](50) NULL, + [UnitDutyPerson] [nvarchar](50) NULL, + [Remark] [nvarchar](500) NULL, + CONSTRAINT [PK_Environmental_OperationReport] PRIMARY KEY CLUSTERED +( + [BusinessReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[Environmental_OperationReport] WITH CHECK ADD CONSTRAINT [FK_Environmental_OperationReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Environmental_OperationReport] CHECK CONSTRAINT [FK_Environmental_OperationReport_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'BusinessReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'Quarters' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'Code' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵ㼶' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'UnitLevel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'CreateDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ڵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'Place' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ְ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'PersonNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʲܶ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'TotalAssets' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ֵܲ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'TotalValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ͷ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'NewInvestment' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'FillingMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'FillingDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͳƸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'StatisticsDutyPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'UnitDutyPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport', @level2type=N'COLUMN',@level2name=N'Remark' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵܻҵҵ;Ӫ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReport' +GO + + + + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('EFA6E45F-1267-4804-BEE7-41E0C5461204','ҵܻҵҵ;Ӫ','ZHGL/Environmental/ProjectOperationReport.aspx',170,'C554E471-B740-4559-B543-E00F247289FD','Menu_HSSE',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('D8F40684-8EE9-4E79-B18E-FFA339E3B441','EFA6E45F-1267-4804-BEE7-41E0C5461204','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('9BF9DDC9-66C5-4FB2-8AA6-B0B748F41F56','EFA6E45F-1267-4804-BEE7-41E0C5461204','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('DD2E36DE-C736-4D96-9972-D686C8A1ED23','EFA6E45F-1267-4804-BEE7-41E0C5461204','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('220E0F3B-1254-46DA-AF9A-9C21CA3EFEF8','EFA6E45F-1267-4804-BEE7-41E0C5461204','',4) + GO + + + +CREATE TABLE [dbo].[Environmental_ProjectOperationReport]( + [BusinessReportId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Quarters] [int] NULL, + [Code] [nvarchar](50) NULL, + [PersonNum] [int] NULL, + [TotalAssets] [decimal](18, 4) NULL, + [TotalValue] [decimal](18, 4) NULL, + [NewInvestment] [decimal](18, 4) NULL, + [FillingMan] [nvarchar](50) NULL, + [FillingDate] [datetime] NULL, + [StatisticsDutyPerson] [nvarchar](50) NULL, + [Remark] [nvarchar](500) NULL, + CONSTRAINT [PK_Environmental_ProjectOperationReport] PRIMARY KEY CLUSTERED +( + [BusinessReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[Environmental_ProjectOperationReport] WITH CHECK ADD CONSTRAINT [FK_Environmental_ProjectOperationReport_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[Environmental_ProjectOperationReport] CHECK CONSTRAINT [FK_Environmental_ProjectOperationReport_Base_Project] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'BusinessReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'Quarters' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'Code' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ְ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'PersonNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʲܶ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'TotalAssets' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ֵܲ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'TotalValue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ͷ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'NewInvestment' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'FillingMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'FillingDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͳƸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'StatisticsDutyPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport', @level2type=N'COLUMN',@level2name=N'Remark' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ŀҵܻҵҵ;Ӫ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectOperationReport' +GO + + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('FB174DD6-CBAE-43AF-9356-B098A17B719D','ȫܽᱨ','HSSE/InformationProject/WorkSummaryReport.aspx',60,'C554E471-B740-4559-B543-E00F247289FD','Menu_HSSE',0,1,1) +go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('22B517A8-7267-483D-8D25-DC46DA4781A2','FB174DD6-CBAE-43AF-9356-B098A17B719D','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('0118B4F5-C954-4FD7-9D63-6BF46BD63555','FB174DD6-CBAE-43AF-9356-B098A17B719D','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('2A952B21-96B8-4647-BBFD-5C9F8A71FF96','FB174DD6-CBAE-43AF-9356-B098A17B719D','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('A3D4C846-E1AE-4EBC-A13E-6565EBCD8921','FB174DD6-CBAE-43AF-9356-B098A17B719D','',4) + go + insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + values('7ecf0229-8a0b-40ce-8b04-e556f7bd3394','','',130,'0','Menu_CQMS',0,0,1) +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('1443C901-A9C3-4CCC-B858-55512DE8C5CA','ܽᱨ','CQMS/ManageReport/QualityWorkSummaryReport.aspx',20,'7ecf0229-8a0b-40ce-8b04-e556f7bd3394','Menu_CQMS',0,1,1) + go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('7A6247ED-5953-4A97-8C9A-25D592B19D9E','1443C901-A9C3-4CCC-B858-55512DE8C5CA','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('C87345B5-882C-4F02-86F1-65B53CBEAA79','1443C901-A9C3-4CCC-B858-55512DE8C5CA','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('95349CD9-4EC8-47BA-8B6D-2A5AD8D48234','1443C901-A9C3-4CCC-B858-55512DE8C5CA','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('DF651BA5-4F8E-469F-ADF2-0538C37445EC','1443C901-A9C3-4CCC-B858-55512DE8C5CA','',4) + go + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('267064F1-88F7-4468-998A-49A1A2F25BB8','ȹĿϢ','CQMS/ManageReport/QuarterlyProjectQuality.aspx',30,'7ecf0229-8a0b-40ce-8b04-e556f7bd3394','Menu_CQMS',0,1,1) + go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('E826DFE2-76B9-4C39-82E4-5E8541F1A603','267064F1-88F7-4468-998A-49A1A2F25BB8','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('47653071-D7D5-4BC7-8351-479FB7C49840','267064F1-88F7-4468-998A-49A1A2F25BB8','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('F4CE6F86-AB36-4AED-B449-2E8DA69B5278','267064F1-88F7-4468-998A-49A1A2F25BB8','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('8E5ABEC0-1D1B-4479-99F0-FB778BBE43E4','267064F1-88F7-4468-998A-49A1A2F25BB8','',4) + go + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('86F71934-7149-470E-BEAB-FFDC5BF3C0F2','ʵҵȫ','SHIYE/InformationProject/SafetyBriefing.aspx',10,'C554E471-B740-4559-B543-E00F247289FD','Menu_HSSE',1,1,1) +go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('90297D4C-047D-4E24-8FCB-3B216846B94E','86F71934-7149-470E-BEAB-FFDC5BF3C0F2','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('A7F2EF10-6EE2-468F-93E4-BAE3051920C0','86F71934-7149-470E-BEAB-FFDC5BF3C0F2','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('08156CE2-51A2-42A7-BDCF-5840D514445B','86F71934-7149-470E-BEAB-FFDC5BF3C0F2','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('1AED7984-B050-4EAF-9CD5-D25CF500B61F','86F71934-7149-470E-BEAB-FFDC5BF3C0F2','',4) + go + + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('AAC7C263-6E25-49DC-985B-DC3FA7AAF3A1','ʵҵȫ','ZHGL/Information/SafetyBriefing.aspx',110,'ERDXV53M-09B1-6UIO-3EFM-5DVZDF329001','Menu_ZHGL',1,1,1) +go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('135DC125-8594-4AEF-AF99-F98890ACCA28','AAC7C263-6E25-49DC-985B-DC3FA7AAF3A1','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('6EC0B8E7-4612-4D41-8274-8CAA884A23C5','AAC7C263-6E25-49DC-985B-DC3FA7AAF3A1','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('C610B07D-5AC7-4135-97C8-F926AD8AD6D1','AAC7C263-6E25-49DC-985B-DC3FA7AAF3A1','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('FBA6A803-B81B-4415-BAF3-B998BE113AA6','AAC7C263-6E25-49DC-985B-DC3FA7AAF3A1','',4) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('C4ACDB39-C54D-48FF-8612-1E805E023B3D','AAC7C263-6E25-49DC-985B-DC3FA7AAF3A1','沢ϱ',5) + go + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('CF9C1F00-34B8-42E5-B2D1-704094169CA3','ȹĿϢ','ZHGL/Information/QuarterlyProjectQuality.aspx',120,'ERDXV53M-09B1-6UIO-3EFM-5DVZDF329001','Menu_ZHGL',1,1,1) +go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('FA8D2BB9-0C94-420A-BD04-96A6CE473552','CF9C1F00-34B8-42E5-B2D1-704094169CA3','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('8D88009F-F4DB-4D91-82DD-936FC68690F1','CF9C1F00-34B8-42E5-B2D1-704094169CA3','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('E9DE1C73-803B-45DC-8F76-517521183EEA','CF9C1F00-34B8-42E5-B2D1-704094169CA3','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('DA437AA6-0728-444E-9A42-D48443606475','CF9C1F00-34B8-42E5-B2D1-704094169CA3','',4) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('A5156A57-B748-4F59-955B-1B37444694CF','CF9C1F00-34B8-42E5-B2D1-704094169CA3','沢ϱ',5) + go + + +CREATE TABLE [dbo].[InformationProject_WorkSummaryReport]( + [WorkSummaryReportId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [ResponsiblePersonTel] [nvarchar](50) NULL, + [ContactPerson] [nvarchar](50) NULL, + [ContactPersonTel] [nvarchar](50) NULL, + [ReportDate] [datetime] NULL, + [SafeLaborTime] [decimal](18, 2) NULL, + [SafetyObjectives] [nvarchar](500) NULL, + [AccidentSituation] [nvarchar](500) NULL, + [Awards] [nvarchar](500) NULL, + [WorkDevelopment] [nvarchar](500) NULL, + [PersonnelTraining] [nvarchar](500) NULL, + [GovernanceSituation] [nvarchar](500) NULL, + [ManagementActivity] [nvarchar](500) NULL, + [WorkExperience] [nvarchar](500) NULL, + [Countermeasures] [nvarchar](500) NULL, + [NextYearWorkPlan] [nvarchar](500) NULL, + [JobSuggestion] [nvarchar](500) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + CONSTRAINT [PK_InformationProject_WorkSummaryReport] PRIMARY KEY CLUSTERED +( + [WorkSummaryReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[InformationProject_WorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_InformationProject_WorkSummaryReport_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[InformationProject_WorkSummaryReport] CHECK CONSTRAINT [FK_InformationProject_WorkSummaryReport_Base_Project] +GO + +ALTER TABLE [dbo].[InformationProject_WorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_InformationProject_WorkSummaryReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[InformationProject_WorkSummaryReport] CHECK CONSTRAINT [FK_InformationProject_WorkSummaryReport_Base_Unit] +GO + +ALTER TABLE [dbo].[InformationProject_WorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_InformationProject_WorkSummaryReport_Sys_User] FOREIGN KEY([CompileMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[InformationProject_WorkSummaryReport] CHECK CONSTRAINT [FK_InformationProject_WorkSummaryReport_Sys_User] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'YearId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ˹ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'SafeLaborTime' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫĿ꼰Ӧݽܽᣩ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'SafetyObjectives' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'AccidentSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Awards' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ص㹤չ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkDevelopment' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Աѵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'PersonnelTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'֯չȫල顢Ų' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'GovernanceSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ¡ְҵܵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ManagementActivity' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ鼰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkExperience' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ⼰ӦԴʩ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Countermeasures' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һȹƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'NextYearWorkPlan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ԼŹ˾Ĺ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'JobSuggestion' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'CompileMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'CompileDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫܽᱨ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_WorkSummaryReport' +GO + + +CREATE TABLE [dbo].[InformationProject_QualityWorkSummaryReport]( + [QualityWorkSummaryReportId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [ResponsiblePersonTel] [nvarchar](50) NULL, + [ContactPerson] [nvarchar](50) NULL, + [ContactPersonTel] [nvarchar](50) NULL, + [ReportDate] [datetime] NULL, + [Performance] [nvarchar](500) NULL, + [AccidentSituation] [nvarchar](500) NULL, + [Awards] [nvarchar](500) NULL, + [WorkDevelopment] [nvarchar](500) NULL, + [PersonnelTraining] [nvarchar](500) NULL, + [CheckSituation] [nvarchar](500) NULL, + [ManagementActivity] [nvarchar](500) NULL, + [WorkExperience] [nvarchar](500) NULL, + [Countermeasures] [nvarchar](500) NULL, + [NextYearWorkPlan] [nvarchar](500) NULL, + [JobSuggestion] [nvarchar](500) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + CONSTRAINT [PK_InformationProject_QualityWorkSummaryReport] PRIMARY KEY CLUSTERED +( + [QualityWorkSummaryReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[InformationProject_QualityWorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_InformationProject_QualityWorkSummaryReport_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[InformationProject_QualityWorkSummaryReport] CHECK CONSTRAINT [FK_InformationProject_QualityWorkSummaryReport_Base_Project] +GO + +ALTER TABLE [dbo].[InformationProject_QualityWorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_InformationProject_QualityWorkSummaryReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[InformationProject_QualityWorkSummaryReport] CHECK CONSTRAINT [FK_InformationProject_QualityWorkSummaryReport_Base_Unit] +GO + +ALTER TABLE [dbo].[InformationProject_QualityWorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_InformationProject_QualityWorkSummaryReport_Sys_User] FOREIGN KEY([CompileMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[InformationProject_QualityWorkSummaryReport] CHECK CONSTRAINT [FK_InformationProject_QualityWorkSummaryReport_Sys_User] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'YearId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Чλ״ȣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Performance' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'AccidentSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Awards' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ж׼ص㹤չ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkDevelopment' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Աѵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'PersonnelTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'֯չල' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'CheckSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'µ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ManagementActivity' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ鼰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkExperience' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ⼰ӦԴʩ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Countermeasures' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һȹƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'NextYearWorkPlan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ԼŹ˾Ĺ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'JobSuggestion' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'CompileMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϱʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'CompileDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܽᱨ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QualityWorkSummaryReport' +GO + + +CREATE TABLE [dbo].[InformationProject_SafetyBriefing]( + [SafetyBriefingId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [Month] [int] NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + [Auditor] [nvarchar](50) NULL, + [Approver] [nvarchar](50) NULL, + [MainWork] [nvarchar](500) NULL, + [HazardRecording] [nvarchar](500) NULL, + [SafetyAccident] [nvarchar](50) NULL, + [EPAccident] [nvarchar](50) NULL, + [OHAccident] [nvarchar](50) NULL, + [WorkPermitNum] [nvarchar](500) NULL, + [HiddenDangerDetection] [nvarchar](500) NULL, + [RectificationSituation] [nvarchar](500) NULL, + [CheckProblemsRectification] [nvarchar](500) NULL, + [PendingProject] [nvarchar](500) NULL, + [ContractorManagement] [nvarchar](500) NULL, + [EnvironmentalEmissions] [nvarchar](500) NULL, + [NextMonthWorkPlan] [nvarchar](500) NULL, + CONSTRAINT [PK_InfomationProject_SafetyBriefing] PRIMARY KEY CLUSTERED +( + [SafetyBriefingId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[InformationProject_SafetyBriefing] WITH CHECK ADD CONSTRAINT [FK_InfomationProject_SafetyBriefing_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[InformationProject_SafetyBriefing] CHECK CONSTRAINT [FK_InfomationProject_SafetyBriefing_Base_Project] +GO + +ALTER TABLE [dbo].[InformationProject_SafetyBriefing] WITH CHECK ADD CONSTRAINT [FK_InfomationProject_SafetyBriefing_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[InformationProject_SafetyBriefing] CHECK CONSTRAINT [FK_InfomationProject_SafetyBriefing_Base_Unit] +GO + +ALTER TABLE [dbo].[InformationProject_SafetyBriefing] WITH CHECK ADD CONSTRAINT [FK_InfomationProject_SafetyBriefing_Sys_User] FOREIGN KEY([CompileMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[InformationProject_SafetyBriefing] CHECK CONSTRAINT [FK_InfomationProject_SafetyBriefing_Sys_User] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'SafetyBriefingId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'YearId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'Month' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'CompileMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϱʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'CompileDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'Auditor' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'Approver' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'MainWork' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'شΣԴ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'HazardRecording' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'SafetyAccident' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'EPAccident' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ְҵ¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'OHAccident' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵ֤ͳ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'WorkPermitNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ŲĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'HiddenDangerDetection' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'RectificationSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ż' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'CheckProblemsRectification' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ɵĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'PendingProject' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'а̹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'ContractorManagement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ŷ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'EnvironmentalEmissions' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'°ȫƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'NextMonthWorkPlan' +GO + + +CREATE TABLE [dbo].[Information_SafetyBriefing]( + [SafetyBriefingId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [Month] [int] NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + [Auditor] [nvarchar](50) NULL, + [Approver] [nvarchar](50) NULL, + [MainWork] [nvarchar](max) NULL, + [HazardRecording] [nvarchar](max) NULL, + [SafetyAccident] [nvarchar](max) NULL, + [EPAccident] [nvarchar](max) NULL, + [OHAccident] [nvarchar](max) NULL, + [WorkPermitNum] [nvarchar](max) NULL, + [HiddenDangerDetection] [nvarchar](max) NULL, + [RectificationSituation] [nvarchar](max) NULL, + [CheckProblemsRectification] [nvarchar](max) NULL, + [PendingProject] [nvarchar](max) NULL, + [ContractorManagement] [nvarchar](max) NULL, + [EnvironmentalEmissions] [nvarchar](max) NULL, + [NextMonthWorkPlan] [nvarchar](max) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Infomation_SafetyBriefing] PRIMARY KEY CLUSTERED +( + [SafetyBriefingId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Information_SafetyBriefing] WITH CHECK ADD CONSTRAINT [FK_Information_SafetyBriefing_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Information_SafetyBriefing] CHECK CONSTRAINT [FK_Information_SafetyBriefing_Base_Unit] +GO + +ALTER TABLE [dbo].[Information_SafetyBriefing] WITH CHECK ADD CONSTRAINT [FK_Information_SafetyBriefing_Sys_User] FOREIGN KEY([CompileMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[Information_SafetyBriefing] CHECK CONSTRAINT [FK_Information_SafetyBriefing_Sys_User] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'SafetyBriefingId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'YearId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'Month' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'CompileMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϱʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'CompileDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'Auditor' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'Approver' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'MainWork' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'شΣԴ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'HazardRecording' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'SafetyAccident' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'EPAccident' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ְҵ¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'OHAccident' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵ֤ͳ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'WorkPermitNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ŲĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'HiddenDangerDetection' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'RectificationSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ż' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'CheckProblemsRectification' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ɵĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'PendingProject' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'а̹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'ContractorManagement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ŷ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'EnvironmentalEmissions' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'°ȫƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_SafetyBriefing', @level2type=N'COLUMN',@level2name=N'NextMonthWorkPlan' +GO + + + +CREATE TABLE [dbo].[InformationProject_QuarterlyProjectQuality]( + [QuarterlyProjectQualityId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [UnitId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Quarter] [int] NULL, + [QualityManagePersonNum] [int] NULL, + [AdvancedTitlePersonNum] [int] NULL, + [IntermediateTitlePersonNum] [int] NULL, + [BeImplementedProjectNum] [int] NULL, + [StartImplementedProjectNum] [int] NULL, + [AccumulativeStartImplemented] [int] NULL, + [CompleteProjectNum] [int] NULL, + [YearCompleteProjectNum] [int] NULL, + [QuarterTotal] [int] NULL, + [QuarterFirstPassNum] [int] NULL, + [QuarterFirstPassRate] [decimal](18, 2) NULL, + [YearTotal] [int] NULL, + [YearFirstPassNum] [int] NULL, + [YearFirstPassRate] [decimal](18, 2) NULL, + [QuaterCheckSuperviseNum] [int] NULL, + [QuaterCorrectiveNoticeNum] [int] NULL, + [QuaterQualityProblemNum] [int] NULL, + [QuaterClosedQualityProblemNum] [int] NULL, + [YearCheckSuperviseNum] [int] NULL, + [YearCorrectiveNoticeNum] [int] NULL, + [YearQualityProblemNum] [int] NULL, + [YearClosedQualityProblemNum] [int] NULL, + [QuaterQualityAccidentNum] [int] NULL, + [QuaterDirectEconomicLoss] [decimal](18, 2) NULL, + [YearQualityAccidentNum] [int] NULL, + [YearDirectEconomicLoss] [decimal](18, 2) NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + [Tel] [nvarchar](50) NULL, + CONSTRAINT [PK_InformationProject_QuarterlyProjectQuality] PRIMARY KEY CLUSTERED +( + [QuarterlyProjectQualityId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[InformationProject_QuarterlyProjectQuality] WITH CHECK ADD CONSTRAINT [FK_InformationProject_QuarterlyProjectQuality_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[InformationProject_QuarterlyProjectQuality] CHECK CONSTRAINT [FK_InformationProject_QuarterlyProjectQuality_Base_Project] +GO + +ALTER TABLE [dbo].[InformationProject_QuarterlyProjectQuality] WITH CHECK ADD CONSTRAINT [FK_InformationProject_QuarterlyProjectQuality_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[InformationProject_QuarterlyProjectQuality] CHECK CONSTRAINT [FK_InformationProject_QuarterlyProjectQuality_Base_Unit] +GO + +ALTER TABLE [dbo].[InformationProject_QuarterlyProjectQuality] WITH CHECK ADD CONSTRAINT [FK_InformationProject_QuarterlyProjectQuality_Sys_User] FOREIGN KEY([CompileMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[InformationProject_QuarterlyProjectQuality] CHECK CONSTRAINT [FK_InformationProject_QuarterlyProjectQuality_Sys_User] +GO + +ALTER TABLE [dbo].[InformationProject_QuarterlyProjectQuality] WITH CHECK ADD CONSTRAINT [FK_InformationProject_QuarterlyProjectQuality_Sys_User1] FOREIGN KEY([ResponsiblePerson]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[InformationProject_QuarterlyProjectQuality] CHECK CONSTRAINT [FK_InformationProject_QuarterlyProjectQuality_Sys_User1] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuarterlyProjectQualityId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'Quarter' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'רְԱˣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QualityManagePersonNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ои߼ְˣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'AdvancedTitlePersonNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'омְˣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'IntermediateTitlePersonNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵʩĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'BeImplementedProjectNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȿʼʵʩĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'StartImplementedProjectNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼƿʼʵʩĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'AccumulativeStartImplemented' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ɣĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'CompleteProjectNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼɣĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearCompleteProjectNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuarterTotal' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һκϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuarterFirstPassNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һκϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuarterFirstPassRate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearTotal' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼһκϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearFirstPassNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼһκϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearFirstPassRate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȿչලΣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterCheckSuperviseNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȷ֪ͨݣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterCorrectiveNoticeNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'漰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterQualityProblemNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ѹر' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterClosedQualityProblemNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼɿչලΣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearCheckSuperviseNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼɷ֪ͨݣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearCorrectiveNoticeNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼ漰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearQualityProblemNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼѹر' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearClosedQualityProblemNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϴ¹--' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterQualityAccidentNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϴ¹--ֱӾʧԪ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterDirectEconomicLoss' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϴ¹--' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearQualityAccidentNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϴ¹--ֱӾʧԪ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearDirectEconomicLoss' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N' ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'CompileMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'CompileDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'Tel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȹĿϢ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'InformationProject_QuarterlyProjectQuality' +GO + +--drop table Information_QuarterlyProjectQuality + +CREATE TABLE [dbo].[Information_QuarterlyProjectQuality]( + [QuarterlyProjectQualityId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Quarter] [int] NULL, + [QualityManagePersonNum] [int] NULL, + [AdvancedTitlePersonNum] [int] NULL, + [IntermediateTitlePersonNum] [int] NULL, + [BeImplementedProjectNum] [int] NULL, + [StartImplementedProjectNum] [int] NULL, + [AccumulativeStartImplemented] [int] NULL, + [CompleteProjectNum] [int] NULL, + [YearCompleteProjectNum] [int] NULL, + [QuarterTotal] [int] NULL, + [QuarterFirstPassNum] [int] NULL, + [QuarterFirstPassRate] [decimal](18, 2) NULL, + [YearTotal] [int] NULL, + [YearFirstPassNum] [int] NULL, + [YearFirstPassRate] [decimal](18, 2) NULL, + [QuaterCheckSuperviseNum] [int] NULL, + [QuaterCorrectiveNoticeNum] [int] NULL, + [QuaterQualityProblemNum] [int] NULL, + [QuaterClosedQualityProblemNum] [int] NULL, + [YearCheckSuperviseNum] [int] NULL, + [YearCorrectiveNoticeNum] [int] NULL, + [YearQualityProblemNum] [int] NULL, + [YearClosedQualityProblemNum] [int] NULL, + [QuaterQualityAccidentNum] [int] NULL, + [QuaterDirectEconomicLoss] [decimal](18, 2) NULL, + [YearQualityAccidentNum] [int] NULL, + [YearDirectEconomicLoss] [decimal](18, 2) NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + [Tel] [nvarchar](50) NULL, + [UpState] [nvarchar](50) NULL, + CONSTRAINT [PK_Information_QuarterlyProjectQuality] PRIMARY KEY CLUSTERED +( + [QuarterlyProjectQualityId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[Information_QuarterlyProjectQuality] WITH CHECK ADD CONSTRAINT [FK_Information_QuarterlyProjectQuality_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Information_QuarterlyProjectQuality] CHECK CONSTRAINT [FK_Information_QuarterlyProjectQuality_Base_Unit] +GO + +ALTER TABLE [dbo].[Information_QuarterlyProjectQuality] WITH CHECK ADD CONSTRAINT [FK_Information_QuarterlyProjectQuality_Sys_User] FOREIGN KEY([CompileMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[Information_QuarterlyProjectQuality] CHECK CONSTRAINT [FK_Information_QuarterlyProjectQuality_Sys_User] +GO + +ALTER TABLE [dbo].[Information_QuarterlyProjectQuality] WITH CHECK ADD CONSTRAINT [FK_Information_QuarterlyProjectQuality_Sys_User1] FOREIGN KEY([ResponsiblePerson]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[Information_QuarterlyProjectQuality] CHECK CONSTRAINT [FK_Information_QuarterlyProjectQuality_Sys_User1] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuarterlyProjectQualityId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'Quarter' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'רְԱˣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QualityManagePersonNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ои߼ְˣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'AdvancedTitlePersonNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'омְˣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'IntermediateTitlePersonNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵʩĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'BeImplementedProjectNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȿʼʵʩĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'StartImplementedProjectNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼƿʼʵʩĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'AccumulativeStartImplemented' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ɣĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'CompleteProjectNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼɣĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearCompleteProjectNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuarterTotal' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һκϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuarterFirstPassNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һκϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuarterFirstPassRate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearTotal' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼһκϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearFirstPassNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼһκϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearFirstPassRate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȿչලΣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterCheckSuperviseNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȷ֪ͨݣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterCorrectiveNoticeNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'漰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterQualityProblemNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ѹر' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterClosedQualityProblemNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼɿչලΣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearCheckSuperviseNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼɷ֪ͨݣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearCorrectiveNoticeNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼ漰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearQualityProblemNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼѹر' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearClosedQualityProblemNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϴ¹--' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterQualityAccidentNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϴ¹--ֱӾʧԪ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'QuaterDirectEconomicLoss' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϴ¹--' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearQualityAccidentNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϴ¹--ֱӾʧԪ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'YearDirectEconomicLoss' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N' ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'CompileMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'CompileDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality', @level2type=N'COLUMN',@level2name=N'Tel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȹĿϢ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QuarterlyProjectQuality' +GO + + + + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'JobSuggestion' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'NextYearWorkPlan' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Countermeasures' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkExperience' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ManagementActivity' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'GovernanceSituation' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'PersonnelTraining' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkDevelopment' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Awards' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'AccidentSituation' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'SafetyObjectives' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'SafeLaborTime' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ReportDate' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPersonTel' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPerson' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePersonTel' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'YearId' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'UnitId' + +GO + +ALTER TABLE [dbo].[Information_WorkSummaryReport] DROP CONSTRAINT [FK_Information_WorkSummaryReport_Base_Unit] +GO + +/****** Object: Table [dbo].[Information_WorkSummaryReport] Script Date: 2023/3/25 22:34:19 ******/ +DROP TABLE [dbo].[Information_WorkSummaryReport] +GO + +/****** Object: Table [dbo].[Information_WorkSummaryReport] Script Date: 2023/3/25 22:34:19 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +SET ANSI_PADDING ON +GO + +CREATE TABLE [dbo].[Information_WorkSummaryReport]( + [WorkSummaryReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [ResponsiblePersonTel] [nvarchar](50) NULL, + [ContactPerson] [nvarchar](50) NULL, + [ContactPersonTel] [nvarchar](50) NULL, + [ReportDate] [datetime] NULL, + [SafeLaborTime] [decimal](18, 2) NULL, + [SafetyObjectives] [nvarchar](max) NULL, + [AccidentSituation] [nvarchar](max) NULL, + [Awards] [nvarchar](max) NULL, + [WorkDevelopment] [nvarchar](max) NULL, + [PersonnelTraining] [nvarchar](max) NULL, + [GovernanceSituation] [nvarchar](max) NULL, + [ManagementActivity] [nvarchar](max) NULL, + [WorkExperience] [nvarchar](max) NULL, + [Countermeasures] [nvarchar](max) NULL, + [NextYearWorkPlan] [nvarchar](max) NULL, + [JobSuggestion] [nvarchar](max) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Information_WorkSummaryReport] PRIMARY KEY CLUSTERED +( + [WorkSummaryReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Information_WorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_Information_WorkSummaryReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Information_WorkSummaryReport] CHECK CONSTRAINT [FK_Information_WorkSummaryReport_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'YearId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ˹ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'SafeLaborTime' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫĿ꼰Ӧݽܽᣩ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'SafetyObjectives' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'AccidentSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Awards' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ص㹤չ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkDevelopment' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Աѵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'PersonnelTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'֯չȫල顢Ų' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'GovernanceSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ¡ְҵܵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ManagementActivity' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ鼰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkExperience' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ⼰ӦԴʩ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Countermeasures' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һȹƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'NextYearWorkPlan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ԼŹ˾Ĺ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport', @level2type=N'COLUMN',@level2name=N'JobSuggestion' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫܽᱨ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_WorkSummaryReport' +GO + + + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'JobSuggestion' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'NextYearWorkPlan' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Countermeasures' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkExperience' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ManagementActivity' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'CheckSituation' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'PersonnelTraining' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkDevelopment' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Awards' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'AccidentSituation' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Performance' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ReportDate' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPersonTel' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPerson' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePersonTel' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'YearId' + +GO + +EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'UnitId' + +GO + +ALTER TABLE [dbo].[Information_QualityWorkSummaryReport] DROP CONSTRAINT [FK_Information_QualityWorkSummaryReport_Base_Unit] +GO + +/****** Object: Table [dbo].[Information_QualityWorkSummaryReport] Script Date: 2023/3/25 22:34:49 ******/ +DROP TABLE [dbo].[Information_QualityWorkSummaryReport] +GO + +/****** Object: Table [dbo].[Information_QualityWorkSummaryReport] Script Date: 2023/3/25 22:34:49 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +SET ANSI_PADDING ON +GO + +CREATE TABLE [dbo].[Information_QualityWorkSummaryReport]( + [QualityWorkSummaryReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [ResponsiblePersonTel] [nvarchar](50) NULL, + [ContactPerson] [nvarchar](50) NULL, + [ContactPersonTel] [nvarchar](50) NULL, + [ReportDate] [datetime] NULL, + [Performance] [nvarchar](max) NULL, + [AccidentSituation] [nvarchar](max) NULL, + [Awards] [nvarchar](max) NULL, + [WorkDevelopment] [nvarchar](max) NULL, + [PersonnelTraining] [nvarchar](max) NULL, + [CheckSituation] [nvarchar](max) NULL, + [ManagementActivity] [nvarchar](max) NULL, + [WorkExperience] [nvarchar](max) NULL, + [Countermeasures] [nvarchar](max) NULL, + [NextYearWorkPlan] [nvarchar](max) NULL, + [JobSuggestion] [nvarchar](max) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Information_QualityWorkSummaryReport] PRIMARY KEY CLUSTERED +( + [QualityWorkSummaryReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Information_QualityWorkSummaryReport] WITH CHECK ADD CONSTRAINT [FK_Information_QualityWorkSummaryReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Information_QualityWorkSummaryReport] CHECK CONSTRAINT [FK_Information_QualityWorkSummaryReport_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'YearId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ResponsiblePersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϵ˵绰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ContactPersonTel' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Чλ״ȣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Performance' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'AccidentSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Awards' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ж׼ص㹤չ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkDevelopment' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Աѵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'PersonnelTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'֯չල' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'CheckSituation' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'µ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'ManagementActivity' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ鼰' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'WorkExperience' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ҫ⼰ӦԴʩ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'Countermeasures' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һȹƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'NextYearWorkPlan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ԼŹ˾Ĺ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport', @level2type=N'COLUMN',@level2name=N'JobSuggestion' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܽᱨ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Information_QualityWorkSummaryReport' +GO + + + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('FD572EFA-8E87-43D1-B514-25A39768106F','̬ܽᱨ','HSSE/InformationProject/EPSummaryReport.aspx',90,'C554E471-B740-4559-B543-E00F247289FD','Menu_HSSE',0,1,1) +go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('CB232557-CC35-459B-AFFE-F5F8F7C1D920','FD572EFA-8E87-43D1-B514-25A39768106F','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('E45E505D-B790-45DC-AFC3-81D1AE987B89','FD572EFA-8E87-43D1-B514-25A39768106F','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('9E6C0E2C-E432-41FF-B07C-D959440AEDC6','FD572EFA-8E87-43D1-B514-25A39768106F','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('23F57663-B49D-4FA8-BBBD-BB7155F661CE','FD572EFA-8E87-43D1-B514-25A39768106F','',4) + go + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('5B344750-79DD-40AA-8AA7-34B04E41FA72','̬ܽᱨ','ZHGL/Information/EPSummaryReport.aspx',130,'ERDXV53M-09B1-6UIO-3EFM-5DVZDF329001','Menu_ZHGL',1,1,1) +go + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('DEA42323-22EE-47EB-9C32-204674F359E8','5B344750-79DD-40AA-8AA7-34B04E41FA72','',1) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('E5E41ADA-782B-441D-A340-DE61A6812C10','5B344750-79DD-40AA-8AA7-34B04E41FA72','޸',2) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('D7CB0313-02BD-4457-99F2-F39DA70EC0B2','5B344750-79DD-40AA-8AA7-34B04E41FA72','ɾ',3) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('E04D28D4-04BB-457B-A05E-3A886B2E132C','5B344750-79DD-40AA-8AA7-34B04E41FA72','',4) + insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + values('F8DCA6D5-7B75-4903-96A1-39899DC32689','5B344750-79DD-40AA-8AA7-34B04E41FA72','沢ϱ',5) + go + + +CREATE TABLE [dbo].[InformationProject_EPSummaryReport]( + [EPSummaryReportId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [ResponsiblePersonTel] [nvarchar](50) NULL, + [ContactPerson] [nvarchar](50) NULL, + [ContactPersonTel] [nvarchar](50) NULL, + [ReportDate] [datetime] NULL, + [Description1] [nvarchar](500) NULL, + [Description2] [nvarchar](500) NULL, + [Description3] [nvarchar](500) NULL, + [Description4] [nvarchar](500) NULL, + [Description5] [nvarchar](500) NULL, + [Description6] [nvarchar](500) NULL, + [Description7] [nvarchar](500) NULL, + [Description8] [nvarchar](500) NULL, + [Description9] [nvarchar](500) NULL, + CONSTRAINT [PK_InformationProject_EPSummaryReport] PRIMARY KEY CLUSTERED +( + [EPSummaryReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[InformationProject_EPSummaryReport] WITH CHECK ADD CONSTRAINT [FK_InformationProject_EPSummaryReport_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[InformationProject_EPSummaryReport] CHECK CONSTRAINT [FK_InformationProject_EPSummaryReport_Base_Project] +GO + +ALTER TABLE [dbo].[InformationProject_EPSummaryReport] WITH CHECK ADD CONSTRAINT [FK_InformationProject_EPSummaryReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[InformationProject_EPSummaryReport] CHECK CONSTRAINT [FK_InformationProject_EPSummaryReport_Base_Unit] +GO + + +CREATE TABLE [dbo].[Information_EPSummaryReport]( + [EPSummaryReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [YearId] [int] NULL, + [ResponsiblePerson] [nvarchar](50) NULL, + [ResponsiblePersonTel] [nvarchar](50) NULL, + [ContactPerson] [nvarchar](50) NULL, + [ContactPersonTel] [nvarchar](50) NULL, + [ReportDate] [datetime] NULL, + [Description1] [nvarchar](max) NULL, + [Description2] [nvarchar](max) NULL, + [Description3] [nvarchar](max) NULL, + [Description4] [nvarchar](max) NULL, + [Description5] [nvarchar](max) NULL, + [Description6] [nvarchar](max) NULL, + [Description7] [nvarchar](max) NULL, + [Description8] [nvarchar](max) NULL, + [Description9] [nvarchar](max) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Information_EPSummaryReport] PRIMARY KEY CLUSTERED +( + [EPSummaryReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Information_EPSummaryReport] WITH CHECK ADD CONSTRAINT [FK_Information_EPSummaryReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Information_EPSummaryReport] CHECK CONSTRAINT [FK_Information_EPSummaryReport_Base_Unit] +GO + + + + + +ALTER TABLE dbo.Environmental_OperationReport ADD + UpState char(1) NULL +GO +DECLARE @v sql_variant +SET @v = N'ϱ״̬' +EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'Environmental_OperationReport', N'COLUMN', N'UpState' +GO + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('30579BFE-AB4B-49A7-A73D-B7CE902A8B69','ҵܻҵҵͷҵ','ZHGL/Environmental/EnergyReport.aspx',90,'ERDXV53M-09B1-6UIO-3EFM-5DVZDF329001','Menu_ZHGL',1,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('B13C617B-C152-4B09-92C6-C14E3B7F9150','30579BFE-AB4B-49A7-A73D-B7CE902A8B69','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('35C3D2C5-F980-4160-A0B5-95733DE0D41E','30579BFE-AB4B-49A7-A73D-B7CE902A8B69','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('56F9E8D7-E218-48CC-A06A-93FD8B8C57AC','30579BFE-AB4B-49A7-A73D-B7CE902A8B69','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('2702BC5C-0D02-4C3F-8C75-57955AD0D170','30579BFE-AB4B-49A7-A73D-B7CE902A8B69','',4) + GO + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('9DE996D9-A2CF-40C8-86D3-6A472AB30E5D','ҵܻҵҵͷҵ','ZHGL/Environmental/ProjectEnergyReport.aspx',70,'C554E471-B740-4559-B543-E00F247289FD','Menu_HSSE',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('B7E38639-4E7A-47D3-A7F0-218921B80AD1','9DE996D9-A2CF-40C8-86D3-6A472AB30E5D','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('E443CE17-ACED-4C3A-9D42-A068E5EC3BFF','9DE996D9-A2CF-40C8-86D3-6A472AB30E5D','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('2B161A21-9CE8-4470-B772-715865E17AB3','9DE996D9-A2CF-40C8-86D3-6A472AB30E5D','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('8CA53BDE-A127-40C0-8D1E-28FAB9E8A0C6','9DE996D9-A2CF-40C8-86D3-6A472AB30E5D','',4) + GO + +/****** Object: Table [dbo].[Environmental_EnergyReport] Script Date: 2023/3/26 18:01:46 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +SET ANSI_PADDING ON +GO + +CREATE TABLE [dbo].[Environmental_EnergyReport]( + [EnergyReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Quarters] [int] NULL, + [FillingMan] [nvarchar](50) NULL, + [FillingDate] [datetime] NULL, + [DutyPerson] [nvarchar](50) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Environmental_EnergyReport] PRIMARY KEY CLUSTERED +( + [EnergyReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Environmental_EnergyReport] WITH CHECK ADD CONSTRAINT [FK_Environmental_EnergyReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Environmental_EnergyReport] CHECK CONSTRAINT [FK_Environmental_EnergyReport_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReport', @level2type=N'COLUMN',@level2name=N'EnergyReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReport', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReport', @level2type=N'COLUMN',@level2name=N'Quarters' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReport', @level2type=N'COLUMN',@level2name=N'FillingMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReport', @level2type=N'COLUMN',@level2name=N'FillingDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReport', @level2type=N'COLUMN',@level2name=N'DutyPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵܻҵҵͷҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReport' +GO + + +/****** Object: Table [dbo].[Environmental_EnergyReportItem] Script Date: 2023/3/26 18:28:21 ******/ +GO +CREATE TABLE [dbo].[Environmental_EnergyReportItem]( + [EnergyReportItemId] [nvarchar](50) NOT NULL, + [EnergyReportId] [nvarchar](50) NULL, + [SortIndex] [nvarchar](50) NULL, + [BusinessCategory] [nvarchar](50) NULL, + [Throughput_BasePeriod] [nvarchar](50) NULL, + [Throughput_LastPeriod] [nvarchar](50) NULL, + [Throughput_ThisPeriod] [nvarchar](50) NULL, + [Throughput_UnitOfMeasurement] [nvarchar](50) NULL, + [Yield_BasePeriod] [nvarchar](50) NULL, + [Yield_LastPeriod] [nvarchar](50) NULL, + [Yield_ThisPeriod] [nvarchar](50) NULL, + [Yield_UnitOfMeasurement] [nvarchar](50) NULL, + [OutputValue_BasePeriod] [nvarchar](50) NULL, + [OutputValue_LastYear] [nvarchar](50) NULL, + [OutputValue_ThisYear] [nvarchar](50) NULL, + [OperationScale_BasePeriod] [nvarchar](50) NULL, + [OperationScale_LastYear] [nvarchar](50) NULL, + [OperationScale_ThisYear] [nvarchar](50) NULL, + [OperationScale_UnitOfMeasurement] [nvarchar](50) NULL, + [ServiceOperatingIncome_BasePeriod] [nvarchar](50) NULL, + [ServiceOperatingIncome_LastYear] [nvarchar](50) NULL, + [ServiceOperatingIncome_ThisYear] [nvarchar](50) NULL, + CONSTRAINT [PK_Environmental_EnergyReportItem] PRIMARY KEY CLUSTERED +( + [EnergyReportItemId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'BusinessCategory' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'Throughput_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'Throughput_LastPeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'Throughput_ThisPeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'Throughput_UnitOfMeasurement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'Yield_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'Yield_LastPeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'Yield_ThisPeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'Yield_UnitOfMeasurement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ֵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'OutputValue_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ֵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'OutputValue_LastYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ֵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'OutputValue_ThisYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫģ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'OperationScale_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫģ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'OperationScale_LastYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫģ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'OperationScale_ThisYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫģ-λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'OperationScale_UnitOfMeasurement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫҵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'ServiceOperatingIncome_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫҵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'ServiceOperatingIncome_LastYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫҵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem', @level2type=N'COLUMN',@level2name=N'ServiceOperatingIncome_ThisYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵܻҵҵͷҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_EnergyReportItem' + +/****** Object: View [dbo].[View_Environmental_ChemicalReport] Script Date: 2023/3/26 18:33:36 ******/ +GO + + +/*************ҵܻҵҵͷҵ**************/ +CREATE VIEW [dbo].[View_Environmental_EnergyReport] +AS +SELECT +Report.EnergyReportId, +Report.UnitId, +Report.FillingDate, +(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0011.ConstText,'-')) AS ReportDate, +Group_0008.ConstText as YearStr, +Group_0011.ConstText as QuartersStr, +U.UnitName, +Report.Year, +Report.Quarters, +Report.UpState, +Report.DutyPerson +FROM dbo.Environmental_EnergyReport AS Report +LEFT JOIN Base_Unit AS U ON U.UnitId=Report.UnitId +LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year] +LEFT JOIN Sys_Const AS Group_0011 ON Group_0011.GroupId='0011' AND Group_0011.ConstValue =Report.[Quarters] + +GO + + + + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template','ϼ','01') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 1.ܲҵ','02') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 1ܼװƷ','03') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ܹ¯/Ҥ¯','04') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' Чϵͳ','05') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' Ч','06') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 豸Ϳյ','07') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ҵװúDZ','08') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ͼҵ','09') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ɫ','10') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 豸','11') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' װ/Ʒ','12') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 2ܷ','13') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ͬԴ','14') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','15') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 2.ҵ','16') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 1Ⱦ','17') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','18') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' CVOCs','19') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','20') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 2ˮȾ','21') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ˮ','22') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ũˮ','23') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ˮ','24') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ҵˮ','25') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ˮۺ','26') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','27') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 3̷ϴ','28') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','29') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ͳﴦ','30') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' Σշﴦ','31') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ദ','32') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','33') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 4̬޸','34') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ޸','35') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ɽ޸','36') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ˮ޸','37') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','38') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 5','39') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ͼ','40') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ѯ','41') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ʩ','42') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','43') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 3.Դѭòҵ','44') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 1ڹҵ̷','45') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 2β','46') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 3ƷͷϾɽ','47') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 4ֵ','48') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 5ũַ','49') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 6Ʒַ','50') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 7ˮԴۺ','51') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 8','52') + insert into Environmental_EnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 9 ','53') + + CREATE TABLE [dbo].[Environmental_ProjectEnergyReport]( + [EnergyReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [ProjectId] [nvarchar](50) NULL, + [Year] [int] NULL, + [Quarters] [int] NULL, + [FillingMan] [nvarchar](50) NULL, + [FillingDate] [datetime] NULL, + [DutyPerson] [nvarchar](50) NULL, + [UpState] [char](1) NULL, + CONSTRAINT [PK_Environmental_ProjectEnergyReport] PRIMARY KEY CLUSTERED +( + [EnergyReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[Environmental_ProjectEnergyReport] WITH CHECK ADD CONSTRAINT [FK_Environmental_ProjectEnergyReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Environmental_ProjectEnergyReport] CHECK CONSTRAINT [FK_Environmental_ProjectEnergyReport_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReport', @level2type=N'COLUMN',@level2name=N'EnergyReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReport', @level2type=N'COLUMN',@level2name=N'Year' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReport', @level2type=N'COLUMN',@level2name=N'Quarters' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReport', @level2type=N'COLUMN',@level2name=N'FillingMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReport', @level2type=N'COLUMN',@level2name=N'FillingDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReport', @level2type=N'COLUMN',@level2name=N'DutyPerson' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵܻҵҵͷҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReport' +GO + + +/****** Object: Table [dbo].[Environmental_ProjectEnergyReportItem] Script Date: 2023/3/26 18:28:21 ******/ +GO +CREATE TABLE [dbo].[Environmental_ProjectEnergyReportItem]( + [EnergyReportItemId] [nvarchar](50) NOT NULL, + [EnergyReportId] [nvarchar](50) NULL, + [SortIndex] [nvarchar](50) NULL, + [BusinessCategory] [nvarchar](50) NULL, + [Throughput_BasePeriod] [nvarchar](50) NULL, + [Throughput_LastPeriod] [nvarchar](50) NULL, + [Throughput_ThisPeriod] [nvarchar](50) NULL, + [Throughput_UnitOfMeasurement] [nvarchar](50) NULL, + [Yield_BasePeriod] [nvarchar](50) NULL, + [Yield_LastPeriod] [nvarchar](50) NULL, + [Yield_ThisPeriod] [nvarchar](50) NULL, + [Yield_UnitOfMeasurement] [nvarchar](50) NULL, + [OutputValue_BasePeriod] [nvarchar](50) NULL, + [OutputValue_LastYear] [nvarchar](50) NULL, + [OutputValue_ThisYear] [nvarchar](50) NULL, + [OperationScale_BasePeriod] [nvarchar](50) NULL, + [OperationScale_LastYear] [nvarchar](50) NULL, + [OperationScale_ThisYear] [nvarchar](50) NULL, + [OperationScale_UnitOfMeasurement] [nvarchar](50) NULL, + [ServiceOperatingIncome_BasePeriod] [nvarchar](50) NULL, + [ServiceOperatingIncome_LastYear] [nvarchar](50) NULL, + [ServiceOperatingIncome_ThisYear] [nvarchar](50) NULL, + CONSTRAINT [PK_Environmental_ProjectEnergyReportItem] PRIMARY KEY CLUSTERED +( + [EnergyReportItemId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'BusinessCategory' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'Throughput_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'Throughput_LastPeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'Throughput_ThisPeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'Throughput_UnitOfMeasurement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'Yield_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'Yield_LastPeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'Yield_ThisPeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'Yield_UnitOfMeasurement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ֵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'OutputValue_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ֵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'OutputValue_LastYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ֵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'OutputValue_ThisYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫģ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'OperationScale_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫģ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'OperationScale_LastYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫģ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'OperationScale_ThisYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫģ-λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'OperationScale_UnitOfMeasurement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫҵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'ServiceOperatingIncome_BasePeriod' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫҵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'ServiceOperatingIncome_LastYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӫҵ-' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem', @level2type=N'COLUMN',@level2name=N'ServiceOperatingIncome_ThisYear' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵܻҵҵͷҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_ProjectEnergyReportItem' + +/****** Object: View [dbo].[View_Environmental_ChemicalReport] Script Date: 2023/3/26 18:33:36 ******/ +GO + + +/*************ҵܻҵҵͷҵ**************/ +CREATE VIEW [dbo].[View_Environmental_ProjectEnergyReport] +AS +SELECT +Report.EnergyReportId, +Report.ProjectId, +Report.FillingDate, +(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0011.ConstText,'-')) AS ReportDate, +Group_0008.ConstText as YearStr, +Group_0011.ConstText as QuartersStr, +U.ProjectName, +Report.Year, +Report.Quarters, +Report.UpState, +Report.DutyPerson +FROM dbo.Environmental_ProjectEnergyReport AS Report +LEFT JOIN Base_Project AS U ON U.ProjectId=Report.ProjectId +LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year] +LEFT JOIN Sys_Const AS Group_0011 ON Group_0011.GroupId='0011' AND Group_0011.ConstValue =Report.[Quarters] + + +GO + + + + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template','ϼ','01') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 1.ܲҵ','02') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 1ܼװƷ','03') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ܹ¯/Ҥ¯','04') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' Чϵͳ','05') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' Ч','06') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 豸Ϳյ','07') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ҵװúDZ','08') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ͼҵ','09') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ɫ','10') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 豸','11') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' װ/Ʒ','12') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 2ܷ','13') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ͬԴ','14') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','15') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 2.ҵ','16') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 1Ⱦ','17') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','18') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' CVOCs','19') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','20') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 2ˮȾ','21') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ˮ','22') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ũˮ','23') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ˮ','24') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ҵˮ','25') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ˮۺ','26') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','27') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 3̷ϴ','28') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','29') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ͳﴦ','30') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' Σշﴦ','31') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ദ','32') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','33') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 4̬޸','34') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ޸','35') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ɽ޸','36') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ˮ޸','37') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','38') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 5','39') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ͼ','40') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ѯ','41') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ʩ','42') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' ','43') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 3.Դѭòҵ','44') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 1ڹҵ̷','45') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 2β','46') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 3ƷͷϾɽ','47') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 4ֵ','48') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 5ũַ','49') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 6Ʒַ','50') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 7ˮԴۺ','51') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 8','52') + insert into Environmental_ProjectEnergyReportItem (EnergyReportItemId,EnergyReportId,BusinessCategory,SortIndex) values(NEWID(),'Template',' 9 ','53') + GO + + + update [Sys_Menu] set SortIndex=60 where [MenuId]='AAC7C263-6E25-49DC-985B-DC3FA7AAF3A1' +update [Sys_Menu] set SortIndex=70 where [MenuId]='07FEEC9D-09C1-4C19-9269-62F69532086C' +update [Sys_Menu] set SortIndex=80 where [MenuId]='CF9C1F00-34B8-42E5-B2D1-704094169CA3' +update [Sys_Menu] set SortIndex=90 where [MenuId]='12941594-2171-411A-8CC8-32E3BD9FCDDF' +update [Sys_Menu] set SortIndex=100 where [MenuId]='5B344750-79DD-40AA-8AA7-34B04E41FA72' +update [Sys_Menu] set SortIndex=110 where [MenuId]='7C47F078-D4C9-40D9-BEEF-E657EAFEC650' +update [Sys_Menu] set SortIndex=120 where [MenuId]='ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14' +update [Sys_Menu] set SortIndex=130 where [MenuId]='7652D239-1897-4886-8DF2-B71E3B060D21' +update [Sys_Menu] set SortIndex=140 where [MenuId]='30579BFE-AB4B-49A7-A73D-B7CE902A8B69' +GO + +update [Sys_Menu] set SortIndex=100 where [MenuId]='25CE6894-2840-4DC4-AD2E-D72292849CEE' +update [Sys_Menu] set SortIndex=110 where [MenuId]='A44E98F6-E9FE-43F8-8349-C166263BF608' +update [Sys_Menu] set SortIndex=180 where [MenuId]='9DE996D9-A2CF-40C8-86D3-6A472AB30E5D' +update [Sys_Menu] set SortIndex=55 where [MenuId]='86F71934-7149-470E-BEAB-FFDC5BF3C0F2' +GO + +EXEC sp_rename '[Environmental_ArchitectureReport].[Month]','Quarters' +GO + + +/*************ҵԴԼ̬ܱ**************/ +ALTER VIEW [dbo].[View_Environmental_ArchitectureReport] +AS +SELECT +Report.ArchitectureReportId, +Report.UnitId, +Report.FillingDate, +(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0011.ConstText,'-')) AS ReportDate, +Group_0008.ConstText as YearStr, +Group_0011.ConstText as QuartersStr, +U.UnitName, +Report.Year, +Report.Quarters, +Report.UpState, +Report.DutyPerson +FROM dbo.Environmental_ArchitectureReport AS Report +LEFT JOIN Base_Unit AS U ON U.UnitId=Report.UnitId +LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.[Year] +LEFT JOIN Sys_Const AS Group_0011 ON Group_0011.GroupId='0011' AND Group_0011.ConstValue =Report.[Quarters] + + + + + + +GO diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index db8f62f1..9dbb9981 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -319,6 +319,8 @@ + + @@ -509,10 +511,12 @@ + + @@ -699,6 +703,7 @@ + @@ -786,6 +791,18 @@ + + + + + + + + + + + + @@ -796,10 +813,15 @@ + + + + + diff --git a/SGGL/BLL/CQMS/ManageReport/ProjectQualityWorkSummaryReportService.cs b/SGGL/BLL/CQMS/ManageReport/ProjectQualityWorkSummaryReportService.cs new file mode 100644 index 00000000..22b6c60c --- /dev/null +++ b/SGGL/BLL/CQMS/ManageReport/ProjectQualityWorkSummaryReportService.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 质量管理工作总结报告 + /// + public static class ProjectQualityWorkSummaryReportService + { + /// + /// 根据主键获取质量管理工作总结报告 + /// + /// + /// + public static Model.InformationProject_QualityWorkSummaryReport GetQualityWorkSummaryReportById(string qualityWorkSummaryReportId) + { + return Funs.DB.InformationProject_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == qualityWorkSummaryReportId); + } + + /// + /// 质量管理工作总结报告 + /// + /// 单位Id + /// 年度 + /// 质量管理工作总结报告 + public static Model.InformationProject_QualityWorkSummaryReport GetQualityWorkSummaryReportByUnitIdAndYear(string unitId, int year) + { + return Funs.DB.InformationProject_QualityWorkSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == year); + } + + /// + /// 添加质量管理工作总结报告 + /// + /// + public static void AddQualityWorkSummaryReport(Model.InformationProject_QualityWorkSummaryReport qualityWorkSummaryReport) + { + Model.InformationProject_QualityWorkSummaryReport newQualityWorkSummaryReport = new Model.InformationProject_QualityWorkSummaryReport + { + QualityWorkSummaryReportId = qualityWorkSummaryReport.QualityWorkSummaryReportId, + ProjectId = qualityWorkSummaryReport.ProjectId, + YearId = qualityWorkSummaryReport.YearId, + UnitId = qualityWorkSummaryReport.UnitId, + ResponsiblePerson = qualityWorkSummaryReport.ResponsiblePerson, + ResponsiblePersonTel = qualityWorkSummaryReport.ResponsiblePersonTel, + ContactPerson = qualityWorkSummaryReport.ContactPerson, + ContactPersonTel = qualityWorkSummaryReport.ContactPersonTel, + ReportDate = qualityWorkSummaryReport.ReportDate, + Performance = qualityWorkSummaryReport.Performance, + AccidentSituation = qualityWorkSummaryReport.AccidentSituation, + Awards = qualityWorkSummaryReport.Awards, + WorkDevelopment = qualityWorkSummaryReport.WorkDevelopment, + PersonnelTraining = qualityWorkSummaryReport.PersonnelTraining, + CheckSituation = qualityWorkSummaryReport.CheckSituation, + ManagementActivity = qualityWorkSummaryReport.ManagementActivity, + WorkExperience = qualityWorkSummaryReport.WorkExperience, + Countermeasures = qualityWorkSummaryReport.Countermeasures, + NextYearWorkPlan = qualityWorkSummaryReport.NextYearWorkPlan, + JobSuggestion = qualityWorkSummaryReport.JobSuggestion, + CompileMan = qualityWorkSummaryReport.CompileMan, + CompileDate = qualityWorkSummaryReport.CompileDate + }; + Funs.DB.InformationProject_QualityWorkSummaryReport.InsertOnSubmit(newQualityWorkSummaryReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改质量管理工作总结报告 + /// + /// + public static void UpdateQualityWorkSummaryReport(Model.InformationProject_QualityWorkSummaryReport qualityWorkSummaryReport) + { + Model.InformationProject_QualityWorkSummaryReport newQualityWorkSummaryReport = Funs.DB.InformationProject_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == qualityWorkSummaryReport.QualityWorkSummaryReportId); + if (newQualityWorkSummaryReport != null) + { + newQualityWorkSummaryReport.UnitId = qualityWorkSummaryReport.UnitId; + newQualityWorkSummaryReport.YearId = qualityWorkSummaryReport.YearId; + newQualityWorkSummaryReport.ResponsiblePerson = qualityWorkSummaryReport.ResponsiblePerson; + newQualityWorkSummaryReport.ResponsiblePersonTel = qualityWorkSummaryReport.ResponsiblePersonTel; + newQualityWorkSummaryReport.ContactPerson = qualityWorkSummaryReport.ContactPerson; + newQualityWorkSummaryReport.ContactPersonTel = qualityWorkSummaryReport.ContactPersonTel; + newQualityWorkSummaryReport.ReportDate = qualityWorkSummaryReport.ReportDate; + newQualityWorkSummaryReport.Performance = qualityWorkSummaryReport.Performance; + newQualityWorkSummaryReport.AccidentSituation = qualityWorkSummaryReport.AccidentSituation; + newQualityWorkSummaryReport.Awards = qualityWorkSummaryReport.Awards; + newQualityWorkSummaryReport.WorkDevelopment = qualityWorkSummaryReport.WorkDevelopment; + newQualityWorkSummaryReport.PersonnelTraining = qualityWorkSummaryReport.PersonnelTraining; + newQualityWorkSummaryReport.CheckSituation = qualityWorkSummaryReport.CheckSituation; + newQualityWorkSummaryReport.ManagementActivity = qualityWorkSummaryReport.ManagementActivity; + newQualityWorkSummaryReport.WorkExperience = qualityWorkSummaryReport.WorkExperience; + newQualityWorkSummaryReport.Countermeasures = qualityWorkSummaryReport.Countermeasures; + newQualityWorkSummaryReport.NextYearWorkPlan = qualityWorkSummaryReport.NextYearWorkPlan; + newQualityWorkSummaryReport.JobSuggestion = qualityWorkSummaryReport.JobSuggestion; + newQualityWorkSummaryReport.CompileMan = qualityWorkSummaryReport.CompileMan; + newQualityWorkSummaryReport.CompileDate = qualityWorkSummaryReport.CompileDate; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除质量管理工作总结报告 + /// + /// + public static void DeleteQualityWorkSummaryReportById(string QualityWorkSummaryReportId) + { + Model.InformationProject_QualityWorkSummaryReport qualityWorkSummaryReport = Funs.DB.InformationProject_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == QualityWorkSummaryReportId); + if (qualityWorkSummaryReport != null) + { + Funs.DB.InformationProject_QualityWorkSummaryReport.DeleteOnSubmit(qualityWorkSummaryReport); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/CQMS/ManageReport/ProjectQuarterlyProjectQualityService.cs b/SGGL/BLL/CQMS/ManageReport/ProjectQuarterlyProjectQualityService.cs new file mode 100644 index 00000000..7983d795 --- /dev/null +++ b/SGGL/BLL/CQMS/ManageReport/ProjectQuarterlyProjectQualityService.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 季度工程项目质量信息表 + /// + public static class ProjectQuarterlyProjectQualityService + { + /// + /// 根据主键获取季度工程项目质量信息表 + /// + /// + /// + public static Model.InformationProject_QuarterlyProjectQuality GetQuarterlyProjectQualityById(string quarterlyProjectQualityId) + { + return Funs.DB.InformationProject_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQualityId); + } + + /// + /// 季度工程项目质量信息表 + /// + /// 单位Id + /// 年度 + /// 季度工程项目质量信息表 + public static Model.InformationProject_QuarterlyProjectQuality GetQuarterlyProjectQualityByUnitIdAndYearAndQuarter(string unitId, int year,int quarter) + { + return Funs.DB.InformationProject_QuarterlyProjectQuality.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Quarter == quarter); + } + + /// + /// 添加季度工程项目质量信息表 + /// + /// + public static void AddQuarterlyProjectQuality(Model.InformationProject_QuarterlyProjectQuality quarterlyProjectQuality) + { + Model.InformationProject_QuarterlyProjectQuality newQuarterlyProjectQuality = new Model.InformationProject_QuarterlyProjectQuality + { + QuarterlyProjectQualityId = quarterlyProjectQuality.QuarterlyProjectQualityId, + ProjectId = quarterlyProjectQuality.ProjectId, + UnitId = quarterlyProjectQuality.UnitId, + Year=quarterlyProjectQuality.Year, + Quarter = quarterlyProjectQuality.Quarter, + QualityManagePersonNum=quarterlyProjectQuality.QualityManagePersonNum, + AdvancedTitlePersonNum=quarterlyProjectQuality.AdvancedTitlePersonNum, + IntermediateTitlePersonNum=quarterlyProjectQuality.IntermediateTitlePersonNum, + BeImplementedProjectNum=quarterlyProjectQuality.BeImplementedProjectNum, + StartImplementedProjectNum=quarterlyProjectQuality.StartImplementedProjectNum, + AccumulativeStartImplemented=quarterlyProjectQuality.AccumulativeStartImplemented, + CompleteProjectNum=quarterlyProjectQuality.CompleteProjectNum, + YearCompleteProjectNum = quarterlyProjectQuality.YearCompleteProjectNum, + QuarterTotal= quarterlyProjectQuality.QuarterTotal, + QuarterFirstPassNum=quarterlyProjectQuality.QuarterFirstPassNum, + QuarterFirstPassRate=quarterlyProjectQuality.QuarterFirstPassRate, + YearTotal=quarterlyProjectQuality.YearTotal, + YearFirstPassNum=quarterlyProjectQuality.YearFirstPassNum, + YearFirstPassRate=quarterlyProjectQuality.YearFirstPassRate, + QuaterCheckSuperviseNum=quarterlyProjectQuality.QuaterCheckSuperviseNum, + QuaterCorrectiveNoticeNum=quarterlyProjectQuality.QuaterCorrectiveNoticeNum, + QuaterQualityProblemNum=quarterlyProjectQuality.QuaterQualityProblemNum, + QuaterClosedQualityProblemNum=quarterlyProjectQuality.QuaterClosedQualityProblemNum, + YearCheckSuperviseNum = quarterlyProjectQuality.YearCheckSuperviseNum, + YearCorrectiveNoticeNum=quarterlyProjectQuality.YearCorrectiveNoticeNum, + YearQualityProblemNum = quarterlyProjectQuality.YearQualityProblemNum, + YearClosedQualityProblemNum=quarterlyProjectQuality.YearClosedQualityProblemNum, + QuaterQualityAccidentNum = quarterlyProjectQuality.QuaterQualityAccidentNum, + QuaterDirectEconomicLoss = quarterlyProjectQuality.QuaterDirectEconomicLoss, + YearQualityAccidentNum = quarterlyProjectQuality.YearQualityAccidentNum, + YearDirectEconomicLoss=quarterlyProjectQuality.YearDirectEconomicLoss, + ResponsiblePerson=quarterlyProjectQuality.ResponsiblePerson, + CompileMan = quarterlyProjectQuality.CompileMan, + CompileDate = quarterlyProjectQuality.CompileDate, + Tel=quarterlyProjectQuality.Tel + }; + Funs.DB.InformationProject_QuarterlyProjectQuality.InsertOnSubmit(newQuarterlyProjectQuality); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改季度工程项目质量信息表 + /// + /// + public static void UpdateQuarterlyProjectQuality(Model.InformationProject_QuarterlyProjectQuality quarterlyProjectQuality) + { + Model.InformationProject_QuarterlyProjectQuality newQuarterlyProjectQuality = Funs.DB.InformationProject_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQuality.QuarterlyProjectQualityId); + if (newQuarterlyProjectQuality != null) + { + newQuarterlyProjectQuality.UnitId = quarterlyProjectQuality.UnitId; + newQuarterlyProjectQuality.Year = quarterlyProjectQuality.Year; + newQuarterlyProjectQuality.Quarter = quarterlyProjectQuality.Quarter; + newQuarterlyProjectQuality.QualityManagePersonNum = quarterlyProjectQuality.QualityManagePersonNum; + newQuarterlyProjectQuality.AdvancedTitlePersonNum = quarterlyProjectQuality.AdvancedTitlePersonNum; + newQuarterlyProjectQuality.IntermediateTitlePersonNum = quarterlyProjectQuality.IntermediateTitlePersonNum; + newQuarterlyProjectQuality.BeImplementedProjectNum = quarterlyProjectQuality.BeImplementedProjectNum; + newQuarterlyProjectQuality.StartImplementedProjectNum = quarterlyProjectQuality.StartImplementedProjectNum; + newQuarterlyProjectQuality.AccumulativeStartImplemented = quarterlyProjectQuality.AccumulativeStartImplemented; + newQuarterlyProjectQuality.CompleteProjectNum = quarterlyProjectQuality.CompleteProjectNum; + newQuarterlyProjectQuality.YearCompleteProjectNum = quarterlyProjectQuality.YearCompleteProjectNum; + newQuarterlyProjectQuality.QuarterTotal = quarterlyProjectQuality.QuarterTotal; + newQuarterlyProjectQuality.QuarterFirstPassNum = quarterlyProjectQuality.QuarterFirstPassNum; + newQuarterlyProjectQuality.QuarterFirstPassRate = quarterlyProjectQuality.QuarterFirstPassRate; + newQuarterlyProjectQuality.YearTotal = quarterlyProjectQuality.YearTotal; + newQuarterlyProjectQuality.YearFirstPassNum = quarterlyProjectQuality.YearFirstPassNum; + newQuarterlyProjectQuality.YearFirstPassRate = quarterlyProjectQuality.YearFirstPassRate; + newQuarterlyProjectQuality.QuaterCheckSuperviseNum = quarterlyProjectQuality.QuaterCheckSuperviseNum; + newQuarterlyProjectQuality.QuaterCorrectiveNoticeNum = quarterlyProjectQuality.QuaterCorrectiveNoticeNum; + newQuarterlyProjectQuality.QuaterQualityProblemNum = quarterlyProjectQuality.QuaterQualityProblemNum; + newQuarterlyProjectQuality.QuaterClosedQualityProblemNum = quarterlyProjectQuality.QuaterClosedQualityProblemNum; + newQuarterlyProjectQuality.YearCheckSuperviseNum = quarterlyProjectQuality.YearCheckSuperviseNum; + newQuarterlyProjectQuality.YearCorrectiveNoticeNum = quarterlyProjectQuality.YearCorrectiveNoticeNum; + newQuarterlyProjectQuality.YearQualityProblemNum = quarterlyProjectQuality.YearQualityProblemNum; + newQuarterlyProjectQuality.YearClosedQualityProblemNum = quarterlyProjectQuality.YearClosedQualityProblemNum; + newQuarterlyProjectQuality.QuaterQualityAccidentNum = quarterlyProjectQuality.QuaterQualityAccidentNum; + newQuarterlyProjectQuality.QuaterDirectEconomicLoss = quarterlyProjectQuality.QuaterDirectEconomicLoss; + newQuarterlyProjectQuality.YearQualityAccidentNum = quarterlyProjectQuality.YearQualityAccidentNum; + newQuarterlyProjectQuality.YearDirectEconomicLoss = quarterlyProjectQuality.YearDirectEconomicLoss; + newQuarterlyProjectQuality.ResponsiblePerson = quarterlyProjectQuality.ResponsiblePerson; + newQuarterlyProjectQuality.CompileMan = quarterlyProjectQuality.CompileMan; + newQuarterlyProjectQuality.CompileDate = quarterlyProjectQuality.CompileDate; + newQuarterlyProjectQuality.Tel = quarterlyProjectQuality.Tel; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除季度工程项目质量信息表 + /// + /// + public static void DeleteQuarterlyProjectQualityById(string QuarterlyProjectQualityId) + { + Model.InformationProject_QuarterlyProjectQuality quarterlyProjectQuality = Funs.DB.InformationProject_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == QuarterlyProjectQualityId); + if (quarterlyProjectQuality != null) + { + Funs.DB.InformationProject_QuarterlyProjectQuality.DeleteOnSubmit(quarterlyProjectQuality); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index af45da18..c0847a3d 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3253,6 +3253,115 @@ namespace BLL /// 同步记录 /// public const string RealNameSynchroRecordMenuId = "F36E6C54-E39F-4032-874D-548EE090A35B"; + /// + /// 安全管理工作总结报告 + /// + public const string ReportType_6 = "11"; + + /// + /// 质量管理工作总结报告 + /// + public const string ReportType_7 = "12"; + + /// + /// 实业安全简报 + /// + public const string ReportType_8 = "13"; + + /// + /// 季度工程项目质量信息表 + /// + public const string ReportType_9 = "14"; + + /// + /// 生态环保工作总结报告 + /// + public const string ReportType_10 = "15"; + + + /// + /// 化工行业能源节约与生态环境保护汇总表 + /// + public const string ChemicalReportMenuId = "ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14"; + + /// + /// 建筑行业能源节约与生态环境保护汇总表 + /// + public const string ArchitectureReportMenuId = "7C47F078-D4C9-40D9-BEEF-E657EAFEC650"; + + public const string ProjectOperationReportMenuId = "EFA6E45F-1267-4804-BEE7-41E0C5461204"; + public const string OperationReportMenuId = "7652D239-1897-4886-8DF2-B71E3B060D21"; + + /// + /// 节能环保产业企业生产和服务业务情况报表 + /// + public const string EnergyReportMenuId = "30579BFE-AB4B-49A7-A73D-B7CE902A8B69"; + + /// + /// 安全管理工作总结报告 + /// + public const string WorkSummaryReportMenuId = "07FEEC9D-09C1-4C19-9269-62F69532086C"; + + /// + /// 质量管理工作总结报告 + /// + public const string QualityWorkSummaryReportMenuId = "12941594-2171-411A-8CC8-32E3BD9FCDDF"; + + /// + /// 实业安全简报 + /// + public const string SafetyBriefingMenuId = "AAC7C263-6E25-49DC-985B-DC3FA7AAF3A1"; + + /// + /// 季度工程项目质量信息表 + /// + public const string QuarterlyProjectQualityMenuId = "CF9C1F00-34B8-42E5-B2D1-704094169CA3"; + + /// + /// 生态环保工作总结报告 + /// + public const string EPSummaryReportMenuId = "5B344750-79DD-40AA-8AA7-34B04E41FA72"; + + + /// + /// 安全管理工作总结报告 + /// + public const string ProjectWorkSummaryReportMenuId = "FB174DD6-CBAE-43AF-9356-B098A17B719D"; + + /// + /// 质量管理工作总结报告 + /// + public const string ProjectQualitySummaryReportMenuId = "1443C901-A9C3-4CCC-B858-55512DE8C5CA"; + + /// + /// 季度工程项目质量信息表 + /// + public const string ProjectQuarterlyProjectQualityMenuId = "267064F1-88F7-4468-998A-49A1A2F25BB8"; + + /// + /// 实业安全简报 + /// + public const string ProjectSafetyBriefingMenuId = "86F71934-7149-470E-BEAB-FFDC5BF3C0F2"; + + /// 化工行业能源节约与生态环境保护汇总表 + /// + public const string ProjectChemicalReportMenuId = "A44E98F6-E9FE-43F8-8349-C166263BF608"; + + /// + /// 建筑行业能源节约与生态环境保护汇总表 + /// + public const string ProjectArchitectureReportMenuId = "25CE6894-2840-4DC4-AD2E-D72292849CEE"; + + /// + /// 生态环保工作总结报告 + /// + public const string ProjectEPSummaryReportMenuId = "FD572EFA-8E87-43D1-B514-25A39768106F"; + + /// + /// 节能环保产业企业生产和服务业务情况报表(项目级) + /// + public const string ProjectEnergyReportMenuId = "9DE996D9-A2CF-40C8-86D3-6A472AB30E5D"; + #endregion #region 劳务实名制 diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectEPSummaryReportService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectEPSummaryReportService.cs new file mode 100644 index 00000000..54b63751 --- /dev/null +++ b/SGGL/BLL/HSSE/InformationProject/ProjectEPSummaryReportService.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 生态环保工作总结报告 + /// + public static class ProjectEPSummaryReportService + { + /// + /// 根据主键获取生态环保工作总结报告 + /// + /// + /// + public static Model.InformationProject_EPSummaryReport GetEPSummaryReportById(string ePSummaryReportId) + { + return Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReportId); + } + + /// + /// 添加生态环保工作总结报告 + /// + /// + public static void AddEPSummaryReport(Model.InformationProject_EPSummaryReport ePSummaryReport) + { + Model.InformationProject_EPSummaryReport newReport = new Model.InformationProject_EPSummaryReport + { + EPSummaryReportId = ePSummaryReport.EPSummaryReportId, + ProjectId = ePSummaryReport.ProjectId, + UnitId = ePSummaryReport.UnitId, + YearId = ePSummaryReport.YearId, + ResponsiblePerson = ePSummaryReport.ResponsiblePerson, + ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel, + ContactPerson = ePSummaryReport.ContactPerson, + ContactPersonTel = ePSummaryReport.ContactPersonTel, + ReportDate = ePSummaryReport.ReportDate, + Description1 = ePSummaryReport.Description1, + Description2 = ePSummaryReport.Description2, + Description3 = ePSummaryReport.Description3, + Description4 = ePSummaryReport.Description4, + Description5 = ePSummaryReport.Description5, + Description6 = ePSummaryReport.Description6, + Description7 = ePSummaryReport.Description7, + Description8 = ePSummaryReport.Description8, + Description9 = ePSummaryReport.Description9 + }; + Funs.DB.InformationProject_EPSummaryReport.InsertOnSubmit(newReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改生态环保工作总结报告 + /// + /// + public static void UpdateEPSummaryReport(Model.InformationProject_EPSummaryReport ePSummaryReport) + { + Model.InformationProject_EPSummaryReport newReport = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReport.EPSummaryReportId); + if (newReport != null) + { + newReport.UnitId = ePSummaryReport.UnitId; + newReport.YearId = ePSummaryReport.YearId; + newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson; + newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel; + newReport.ContactPerson = ePSummaryReport.ContactPerson; + newReport.ContactPersonTel = ePSummaryReport.ContactPersonTel; + newReport.ReportDate = ePSummaryReport.ReportDate; + newReport.Description1 = ePSummaryReport.Description1; + newReport.Description2 = ePSummaryReport.Description2; + newReport.Description3 = ePSummaryReport.Description3; + newReport.Description4 = ePSummaryReport.Description4; + newReport.Description5 = ePSummaryReport.Description5; + newReport.Description6 = ePSummaryReport.Description6; + newReport.Description7 = ePSummaryReport.Description7; + newReport.Description8 = ePSummaryReport.Description8; + newReport.Description9 = ePSummaryReport.Description9; + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除生态环保工作总结报告 + /// + /// + public static void DeleteEPSummaryReportById(string ePSummaryReportId) + { + Model.InformationProject_EPSummaryReport ePSummaryReport = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReportId); + if (ePSummaryReport != null) + { + Funs.DB.InformationProject_EPSummaryReport.DeleteOnSubmit(ePSummaryReport); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectMillionsMonthlyReportService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectMillionsMonthlyReportService.cs index f6aac3c5..71110758 100644 --- a/SGGL/BLL/HSSE/InformationProject/ProjectMillionsMonthlyReportService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ProjectMillionsMonthlyReportService.cs @@ -6,14 +6,14 @@ using System.Text; namespace BLL { /// - /// 百万工时安全统计月报 + /// 企业安全数据统计月报 /// public static class ProjectMillionsMonthlyReportService { public static Model.SGGLDB db = Funs.DB; /// - /// 根据主键获取百万工时安全统计月报 + /// 根据主键获取企业安全数据统计月报 /// /// /// @@ -23,7 +23,7 @@ namespace BLL } /// - /// 添加百万工时安全统计月报 + /// 添加企业安全数据统计月报 /// /// public static void AddMillionsMonthlyReport(Model.InformationProject_MillionsMonthlyReport millionsMonthlyReport) @@ -45,6 +45,9 @@ namespace BLL ContractorNum = millionsMonthlyReport.ContractorNum, SumPersonNum = millionsMonthlyReport.SumPersonNum, TotalWorkNum = millionsMonthlyReport.TotalWorkNum, + DeathAccidentNum = millionsMonthlyReport.DeathAccidentNum, + DeathAccidentPersonNum = millionsMonthlyReport.DeathAccidentPersonNum, + DeathAccidentLossHour = millionsMonthlyReport.DeathAccidentLossHour, SeriousInjuriesNum = millionsMonthlyReport.SeriousInjuriesNum, SeriousInjuriesPersonNum = millionsMonthlyReport.SeriousInjuriesPersonNum, SeriousInjuriesLossHour = millionsMonthlyReport.SeriousInjuriesLossHour, @@ -60,20 +63,37 @@ namespace BLL MedicalTreatmentLossHour = millionsMonthlyReport.MedicalTreatmentLossHour, FireNum = millionsMonthlyReport.FireNum, ExplosionNum = millionsMonthlyReport.ExplosionNum, + EnvironmenNum = millionsMonthlyReport.EnvironmenNum, TrafficNum = millionsMonthlyReport.TrafficNum, EquipmentNum = millionsMonthlyReport.EquipmentNum, QualityNum = millionsMonthlyReport.QualityNum, OtherNum = millionsMonthlyReport.OtherNum, FirstAidDressingsNum = millionsMonthlyReport.FirstAidDressingsNum, AttemptedEventNum = millionsMonthlyReport.AttemptedEventNum, - LossDayNum = millionsMonthlyReport.LossDayNum + LossDayNum = millionsMonthlyReport.LossDayNum, + InputCosts = millionsMonthlyReport.InputCosts, + TrainNum = millionsMonthlyReport.TrainNum, + GeneralHazardNum = millionsMonthlyReport.GeneralHazardNum, + MajorHazardNum = millionsMonthlyReport.MajorHazardNum, + NotProofLargeProjectNum = millionsMonthlyReport.NotProofLargeProjectNum, + ProofLargeProjectNum = millionsMonthlyReport.ProofLargeProjectNum, + FireLicenseNum = millionsMonthlyReport.FireLicenseNum, + LimitLicenseNum = millionsMonthlyReport.LimitLicenseNum, + HighLicenseNum = millionsMonthlyReport.HighLicenseNum, + HoistingLicenseNum = millionsMonthlyReport.HoistingLicenseNum, + BreakGroundLicenseNum = millionsMonthlyReport.BreakGroundLicenseNum, + ElectricityLicenseNum = millionsMonthlyReport.ElectricityLicenseNum, + RTLicenseNum = millionsMonthlyReport.RTLicenseNum, + NightLicenseNum = millionsMonthlyReport.NightLicenseNum, + CommissionerNum = millionsMonthlyReport.CommissionerNum, + SoleDutyNum = millionsMonthlyReport.SoleDutyNum, }; db.InformationProject_MillionsMonthlyReport.InsertOnSubmit(newMillionsMonthlyReport); db.SubmitChanges(); } /// - /// 修改百万工时安全统计月报 + /// 修改企业安全数据统计月报 /// /// public static void UpdateMillionsMonthlyReport(Model.InformationProject_MillionsMonthlyReport millionsMonthlyReport) @@ -95,6 +115,9 @@ namespace BLL newMillionsMonthlyReport.ContractorNum = millionsMonthlyReport.ContractorNum; newMillionsMonthlyReport.SumPersonNum = millionsMonthlyReport.SumPersonNum; newMillionsMonthlyReport.TotalWorkNum = millionsMonthlyReport.TotalWorkNum; + newMillionsMonthlyReport.DeathAccidentNum = millionsMonthlyReport.DeathAccidentNum; + newMillionsMonthlyReport.DeathAccidentPersonNum = millionsMonthlyReport.DeathAccidentPersonNum; + newMillionsMonthlyReport.DeathAccidentLossHour = millionsMonthlyReport.DeathAccidentLossHour; newMillionsMonthlyReport.SeriousInjuriesNum = millionsMonthlyReport.SeriousInjuriesNum; newMillionsMonthlyReport.SeriousInjuriesPersonNum = millionsMonthlyReport.SeriousInjuriesPersonNum; newMillionsMonthlyReport.SeriousInjuriesLossHour = millionsMonthlyReport.SeriousInjuriesLossHour; @@ -110,6 +133,7 @@ namespace BLL newMillionsMonthlyReport.MedicalTreatmentLossHour = millionsMonthlyReport.MedicalTreatmentLossHour; newMillionsMonthlyReport.FireNum = millionsMonthlyReport.FireNum; newMillionsMonthlyReport.ExplosionNum = millionsMonthlyReport.ExplosionNum; + newMillionsMonthlyReport.EnvironmenNum = millionsMonthlyReport.EnvironmenNum; newMillionsMonthlyReport.TrafficNum = millionsMonthlyReport.TrafficNum; newMillionsMonthlyReport.EquipmentNum = millionsMonthlyReport.EquipmentNum; newMillionsMonthlyReport.QualityNum = millionsMonthlyReport.QualityNum; @@ -117,12 +141,29 @@ namespace BLL newMillionsMonthlyReport.FirstAidDressingsNum = millionsMonthlyReport.FirstAidDressingsNum; newMillionsMonthlyReport.AttemptedEventNum = millionsMonthlyReport.AttemptedEventNum; newMillionsMonthlyReport.LossDayNum = millionsMonthlyReport.LossDayNum; + newMillionsMonthlyReport.InputCosts = millionsMonthlyReport.InputCosts; + newMillionsMonthlyReport.TrainNum = millionsMonthlyReport.TrainNum; + newMillionsMonthlyReport.GeneralHazardNum = millionsMonthlyReport.GeneralHazardNum; + newMillionsMonthlyReport.MajorHazardNum = millionsMonthlyReport.MajorHazardNum; + newMillionsMonthlyReport.NotProofLargeProjectNum = millionsMonthlyReport.NotProofLargeProjectNum; + newMillionsMonthlyReport.ProofLargeProjectNum = millionsMonthlyReport.ProofLargeProjectNum; + newMillionsMonthlyReport.FireLicenseNum = millionsMonthlyReport.FireLicenseNum; + newMillionsMonthlyReport.LimitLicenseNum = millionsMonthlyReport.LimitLicenseNum; + newMillionsMonthlyReport.HighLicenseNum = millionsMonthlyReport.HighLicenseNum; + newMillionsMonthlyReport.HoistingLicenseNum = millionsMonthlyReport.HoistingLicenseNum; + newMillionsMonthlyReport.BreakGroundLicenseNum = millionsMonthlyReport.BreakGroundLicenseNum; + newMillionsMonthlyReport.ElectricityLicenseNum = millionsMonthlyReport.ElectricityLicenseNum; + newMillionsMonthlyReport.RTLicenseNum = millionsMonthlyReport.RTLicenseNum; + newMillionsMonthlyReport.NightLicenseNum = millionsMonthlyReport.NightLicenseNum; + newMillionsMonthlyReport.CommissionerNum = millionsMonthlyReport.CommissionerNum; + newMillionsMonthlyReport.SoleDutyNum = millionsMonthlyReport.SoleDutyNum; + db.SubmitChanges(); } } /// - /// 根据主键删除百万工时安全统计月报 + /// 根据主键删除企业安全数据统计月报 /// /// public static void DeleteMillionsMonthlyReportById(string millionsMonthlyReportId) diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectWorkSummaryReportService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectWorkSummaryReportService.cs new file mode 100644 index 00000000..694e8156 --- /dev/null +++ b/SGGL/BLL/HSSE/InformationProject/ProjectWorkSummaryReportService.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 安全管理工作总结报告 + /// + public static class ProjectWorkSummaryReportService + { + /// + /// 根据主键获取安全管理工作总结报告 + /// + /// + /// + public static Model.InformationProject_WorkSummaryReport GetWorkSummaryReportById(string workSummaryReportId) + { + return Funs.DB.InformationProject_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId); + } + + /// + /// 添加安全管理工作总结报告 + /// + /// + public static void AddWorkSummaryReport(Model.InformationProject_WorkSummaryReport workSummaryReport) + { + Model.InformationProject_WorkSummaryReport newWorkSummaryReport = new Model.InformationProject_WorkSummaryReport + { + WorkSummaryReportId = workSummaryReport.WorkSummaryReportId, + ProjectId=workSummaryReport.ProjectId, + YearId = workSummaryReport.YearId, + UnitId = workSummaryReport.UnitId, + ResponsiblePerson = workSummaryReport.ResponsiblePerson, + ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel, + ContactPerson = workSummaryReport.ContactPerson, + ContactPersonTel = workSummaryReport.ContactPersonTel, + ReportDate = workSummaryReport.ReportDate, + SafeLaborTime = workSummaryReport.SafeLaborTime, + SafetyObjectives = workSummaryReport.SafetyObjectives, + AccidentSituation = workSummaryReport.AccidentSituation, + Awards = workSummaryReport.Awards, + WorkDevelopment = workSummaryReport.WorkDevelopment, + PersonnelTraining = workSummaryReport.PersonnelTraining, + GovernanceSituation = workSummaryReport.GovernanceSituation, + ManagementActivity = workSummaryReport.ManagementActivity, + WorkExperience = workSummaryReport.WorkExperience, + Countermeasures = workSummaryReport.Countermeasures, + NextYearWorkPlan = workSummaryReport.NextYearWorkPlan, + JobSuggestion = workSummaryReport.JobSuggestion, + CompileMan=workSummaryReport.CompileMan, + CompileDate=workSummaryReport.CompileDate + }; + Funs.DB.InformationProject_WorkSummaryReport.InsertOnSubmit(newWorkSummaryReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改安全管理工作总结报告 + /// + /// + public static void UpdateWorkSummaryReport(Model.InformationProject_WorkSummaryReport workSummaryReport) + { + Model.InformationProject_WorkSummaryReport newWorkSummaryReport = Funs.DB.InformationProject_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReport.WorkSummaryReportId); + if (newWorkSummaryReport != null) + { + newWorkSummaryReport.UnitId = workSummaryReport.UnitId; + newWorkSummaryReport.YearId = workSummaryReport.YearId; + newWorkSummaryReport.ResponsiblePerson = workSummaryReport.ResponsiblePerson; + newWorkSummaryReport.ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel; + newWorkSummaryReport.ContactPerson = workSummaryReport.ContactPerson; + newWorkSummaryReport.ContactPersonTel = workSummaryReport.ContactPersonTel; + newWorkSummaryReport.ReportDate = workSummaryReport.ReportDate; + newWorkSummaryReport.SafeLaborTime = workSummaryReport.SafeLaborTime; + newWorkSummaryReport.SafetyObjectives = workSummaryReport.SafetyObjectives; + newWorkSummaryReport.AccidentSituation = workSummaryReport.AccidentSituation; + newWorkSummaryReport.Awards = workSummaryReport.Awards; + newWorkSummaryReport.WorkDevelopment = workSummaryReport.WorkDevelopment; + newWorkSummaryReport.PersonnelTraining = workSummaryReport.PersonnelTraining; + newWorkSummaryReport.GovernanceSituation = workSummaryReport.GovernanceSituation; + newWorkSummaryReport.ManagementActivity = workSummaryReport.ManagementActivity; + newWorkSummaryReport.WorkExperience = workSummaryReport.WorkExperience; + newWorkSummaryReport.Countermeasures = workSummaryReport.Countermeasures; + newWorkSummaryReport.NextYearWorkPlan = workSummaryReport.NextYearWorkPlan; + newWorkSummaryReport.JobSuggestion = workSummaryReport.JobSuggestion; + newWorkSummaryReport.CompileMan = workSummaryReport.CompileMan; + newWorkSummaryReport.CompileDate = workSummaryReport.CompileDate; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除安全管理工作总结报告 + /// + /// + public static void DeleteWorkSummaryReportById(string workSummaryReportId) + { + Model.InformationProject_WorkSummaryReport workSummaryReport = Funs.DB.InformationProject_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId); + if (workSummaryReport != null) + { + Funs.DB.InformationProject_WorkSummaryReport.DeleteOnSubmit(workSummaryReport); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/SHIYE/InformationProject_SafetyBriefingService.cs b/SGGL/BLL/SHIYE/InformationProject_SafetyBriefingService.cs new file mode 100644 index 00000000..931e9d00 --- /dev/null +++ b/SGGL/BLL/SHIYE/InformationProject_SafetyBriefingService.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 实业安全简报 + /// + public static class InformationProject_SafetyBriefingService + { + + /// + /// 根据主键获取实业安全简报 + /// + /// + /// + public static Model.InformationProject_SafetyBriefing GetSafetyBriefingById(string safetyBriefingId) + { + return Funs.DB.InformationProject_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefingId); + } + + /// + /// 添加实业安全简报 + /// + /// + public static void AddSafetyBriefing(Model.InformationProject_SafetyBriefing safetyBriefing) + { + Model.InformationProject_SafetyBriefing newSafetyBriefing = new Model.InformationProject_SafetyBriefing + { + SafetyBriefingId = safetyBriefing.SafetyBriefingId, + ProjectId = safetyBriefing.ProjectId, + UnitId = safetyBriefing.UnitId, + YearId = safetyBriefing.YearId, + Month = safetyBriefing.Month, + CompileMan = safetyBriefing.CompileMan, + CompileDate = safetyBriefing.CompileDate, + Auditor = safetyBriefing.Auditor, + Approver = safetyBriefing.Approver, + MainWork = safetyBriefing.MainWork, + HazardRecording = safetyBriefing.HazardRecording, + SafetyAccident = safetyBriefing.SafetyAccident, + EPAccident = safetyBriefing.EPAccident, + OHAccident = safetyBriefing.OHAccident, + WorkPermitNum = safetyBriefing.WorkPermitNum, + HiddenDangerDetection = safetyBriefing.HiddenDangerDetection, + RectificationSituation = safetyBriefing.RectificationSituation, + CheckProblemsRectification = safetyBriefing.CheckProblemsRectification, + PendingProject = safetyBriefing.PendingProject, + ContractorManagement = safetyBriefing.ContractorManagement, + EnvironmentalEmissions = safetyBriefing.EnvironmentalEmissions, + NextMonthWorkPlan = safetyBriefing.NextMonthWorkPlan + }; + Funs.DB.InformationProject_SafetyBriefing.InsertOnSubmit(newSafetyBriefing); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改实业安全简报 + /// + /// + public static void UpdateSafetyBriefing(Model.InformationProject_SafetyBriefing safetyBriefing) + { + Model.InformationProject_SafetyBriefing newSafetyBriefing = Funs.DB.InformationProject_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefing.SafetyBriefingId); + if (newSafetyBriefing != null) + { + newSafetyBriefing.UnitId = safetyBriefing.UnitId; + newSafetyBriefing.YearId = safetyBriefing.YearId; + newSafetyBriefing.Month = safetyBriefing.Month; + newSafetyBriefing.CompileMan = safetyBriefing.CompileMan; + newSafetyBriefing.CompileDate = safetyBriefing.CompileDate; + newSafetyBriefing.Auditor = safetyBriefing.Auditor; + newSafetyBriefing.Approver = safetyBriefing.Approver; + newSafetyBriefing.MainWork = safetyBriefing.MainWork; + newSafetyBriefing.HazardRecording = safetyBriefing.HazardRecording; + newSafetyBriefing.SafetyAccident = safetyBriefing.SafetyAccident; + newSafetyBriefing.EPAccident = safetyBriefing.EPAccident; + newSafetyBriefing.OHAccident = safetyBriefing.OHAccident; + newSafetyBriefing.WorkPermitNum = safetyBriefing.WorkPermitNum; + newSafetyBriefing.HiddenDangerDetection = safetyBriefing.HiddenDangerDetection; + newSafetyBriefing.RectificationSituation = safetyBriefing.RectificationSituation; + newSafetyBriefing.CheckProblemsRectification = safetyBriefing.CheckProblemsRectification; + newSafetyBriefing.PendingProject = safetyBriefing.PendingProject; + newSafetyBriefing.ContractorManagement = safetyBriefing.ContractorManagement; + newSafetyBriefing.EnvironmentalEmissions = safetyBriefing.EnvironmentalEmissions; + newSafetyBriefing.NextMonthWorkPlan = safetyBriefing.NextMonthWorkPlan; + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除实业安全简报 + /// + /// + public static void DeleteSafetyBriefingById(string safetyBriefingId) + { + Model.InformationProject_SafetyBriefing safetyBriefing = Funs.DB.InformationProject_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefingId); + if (safetyBriefing != null) + { + Funs.DB.InformationProject_SafetyBriefing.DeleteOnSubmit(safetyBriefing); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/WebService/CNCECHSSEWebService.cs b/SGGL/BLL/WebService/CNCECHSSEWebService.cs index 84922eaf..7ecb05fc 100644 --- a/SGGL/BLL/WebService/CNCECHSSEWebService.cs +++ b/SGGL/BLL/WebService/CNCECHSSEWebService.cs @@ -1,16 +1,81 @@ namespace BLL { - - using Model; + using Apache.NMS.ActiveMQ.Commands; using Newtonsoft.Json; using NPOI.POIFS.Crypt.Dsig; using System; using System.Collections.Generic; using System.Data; + using System.IO; using System.Linq; + //using System.Net.Http.Headers; + //using System.Net.Http; + using System.Web; + using RestSharp; + using System.Net; public static class CNCECHSSEWebService { + public static void upFile() + { + //int l = HttpContext.Current.Request.Files["testdoc"].ContentLength; + //byte[] buffer = new byte[l]; + //Stream s = HttpContext.Current.Request.Files["testdoc"].InputStream; + //HttpClient client = new HttpClient(); + //MultipartFormDataContent form = new MultipartFormDataContent(); + //StreamContent fileContent = new StreamContent(s); + //fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + //fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data"); + //fileContent.Headers.ContentDisposition.FileName = s.filename; + //form.Add(fileContent); + //HttpResponseMessage res = client.PostAsync("http://192.168.8.9/llb/api/FileUpload/PostFile", form).Result; + //var msg = res.Content.ReadAsStringAsync().Result; + //if (msg.ToString() != "true") + //{ + // return Content(msg); + //} + + } + public static string UploadFile(string file) + { + string result = string.Empty; + try + { + string CNCECPath = SysConstSetService.CNCECPath; + string baseurl = CNCECPath + "/api/FileUpload/Post"; + var client = new RestClient(baseurl); + client.Timeout = -1; + var request = new RestRequest(Method.POST); + request.AddHeader("Content-Type", "multipart/form-data");//注意头部必须是form-data + // client.UserAgent = "apifox/1.0.0 (https://www.apifox.cn)"; + //request.AddFile("file", @"E:\微信\WeChat\WeChat Files\wxid_9140361403112\FileStorage\File\2022-08\焊接管理尾项20220809.docx"); + var filelist = file.Split(','); + foreach (var item in filelist) + { + + if (File.Exists(item)) + { + request.AddFile("file", item); + } + } + + request.AddParameter("typeName", "SafetyQuarterlyReport"); + var tokenItem = BLL.ServerService.GetToken(); + request.AddHeader("token", tokenItem.Token); + IRestResponse response = client.Execute(request); + var contentPost = response.Content.Replace('"', ' '); + result = contentPost; + } + catch (System.Exception) + { + result = ""; + + + } + return result; + + } + #region 上报数据到集团 #region 百万工时上报 /// @@ -23,10 +88,9 @@ { try { - //CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient(); var upReport = from x in db.Information_MillionsMonthlyReport where x.MillionsMonthlyReportId == millionsMonthlyReportId - select new Model.HSSE.Information_MillionsMonthlyReport + select new Information_MillionsMonthlyReport { MillionsMonthlyReportId = x.MillionsMonthlyReportId, UnitId = x.UnitId, @@ -40,11 +104,27 @@ LostTimeInjuryRate = x.LostTimeInjuryRate, DeathAccidentFrequency = x.DeathAccidentFrequency, AccidentMortality = x.AccidentMortality, + InputCosts = x.InputCosts, + TrainNum = x.TrainNum, + GeneralHazardNum = x.GeneralHazardNum, + MajorHazardNum = x.MajorHazardNum, + NotProofLargeProjectNum = x.NotProofLargeProjectNum, + ProofLargeProjectNum = x.ProofLargeProjectNum, + FireLicenseNum = x.FireLicenseNum, + LimitLicenseNum = x.LimitLicenseNum, + HighLicenseNum = x.HighLicenseNum, + HoistingLicenseNum = x.HoistingLicenseNum, + BreakGroundLicenseNum = x.BreakGroundLicenseNum, + ElectricityLicenseNum = x.ElectricityLicenseNum, + RTLicenseNum = x.RTLicenseNum, + NightLicenseNum = x.NightLicenseNum, + CommissionerNum = x.CommissionerNum, + SoleDutyNum = x.SoleDutyNum, }; var upReportItem = from x in db.Information_MillionsMonthlyReportItem where x.MillionsMonthlyReportId == millionsMonthlyReportId - select new Model.HSSE.Information_MillionsMonthlyReportItem + select new Information_MillionsMonthlyReportItem { MillionsMonthlyReportItemId = x.MillionsMonthlyReportItemId, MillionsMonthlyReportId = x.MillionsMonthlyReportId, @@ -62,15 +142,15 @@ MinorAccidentNum = x.MinorAccidentNum, MinorAccidentPersonNum = x.MinorAccidentPersonNum, MinorAccidentLossHour = x.MinorAccidentLossHour, - OtherAccidentNum = x.OtherAccidentNum, - OtherAccidentPersonNum = x.OtherAccidentPersonNum, - OtherAccidentLossHour = x.OtherAccidentLossHour, + OtherAccidentNum = x.DeathAccidentNum, + OtherAccidentPersonNum = x.DeathAccidentPersonNum, + OtherAccidentLossHour = x.DeathAccidentLossHour, RestrictedWorkPersonNum = x.RestrictedWorkPersonNum, RestrictedWorkLossHour = x.RestrictedWorkLossHour, MedicalTreatmentPersonNum = x.MedicalTreatmentPersonNum, MedicalTreatmentLossHour = x.MedicalTreatmentLossHour, FireNum = x.FireNum, - ExplosionNum = x.ExplosionNum, + ExplosionNum = x.EnvironmenNum, TrafficNum = x.TrafficNum, EquipmentNum = x.EquipmentNum, QualityNum = x.QualityNum, @@ -99,17 +179,17 @@ UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Month.ToString()); } } - LogService.AddSys_Log(CurrUser, "【百万工时安全统计月报表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources); + LogService.AddSys_Log(CurrUser, "【企业安全数据统计月报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources); } else { - LogService.AddSys_Log(CurrUser, "【百万工时安全统计月报表】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources); + LogService.AddSys_Log(CurrUser, "【企业安全数据统计月报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources); } } catch (Exception ex) { - ErrLogInfo.WriteLog("【百万工时安全统计月报表】上传到服务器", ex); - LogService.AddSys_Log(CurrUser, "【百万工时安全统计月报表】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources); + ErrLogInfo.WriteLog("【企业安全数据统计月报】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【企业安全数据统计月报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources); } return code; } @@ -120,7 +200,7 @@ /// 主表 /// 明细表 /// - private static int UpApiMillionsMonthlyReport(IQueryable upReport, IQueryable upReportItem) + private static int UpApiMillionsMonthlyReport(IQueryable upReport, IQueryable upReportItem) { string baseurl = "/api/InformationData/SaveMillionsMonthlyReport"; //合并 @@ -144,10 +224,9 @@ { try { - //CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient(); var upReport = from x in db.Information_AccidentCauseReport where x.AccidentCauseReportId == accidentCauseReportId - select new Model.HSSE.Information_AccidentCauseReport + select new Information_AccidentCauseReport { AccidentCauseReportId = x.AccidentCauseReportId, UnitId = x.UnitId, @@ -177,7 +256,7 @@ var upReportItem = from x in db.Information_AccidentCauseReportItem where x.AccidentCauseReportId == accidentCauseReportId - select new Model.HSSE.Information_AccidentCauseReportItem + select new Information_AccidentCauseReportItem { AccidentCauseReportItemId = x.AccidentCauseReportItemId, AccidentCauseReportId = x.AccidentCauseReportId, @@ -261,7 +340,7 @@ /// 主表 /// 明细表 /// - private static int UpApiAccidentCauseReport(IQueryable upReport, IQueryable upReportItem) + private static int UpApiAccidentCauseReport(IQueryable upReport, IQueryable upReportItem) { string baseurl = "/api/InformationData/SaveAccidentCauseReport"; //合并 @@ -286,10 +365,10 @@ { try { - //CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient(); + // var upReport = from x in db.Information_SafetyQuarterlyReport where x.SafetyQuarterlyReportId == safetyQuarterlyReportId - select new Model.HSSE.Information_SafetyQuarterlyReport + select new Information_SafetyQuarterlyReport { SafetyQuarterlyReportId = x.SafetyQuarterlyReportId, UnitId = x.UnitId, @@ -361,8 +440,8 @@ Remarks = x.Remarks, CompileMan = x.CompileMan, ////附件转为字节传送 - FullTimeManAttachUrlFileContext = BLL.FileStructService.GetFileStructByAttachUrl(x.FullTimeManAttachUrl), - PMManAttachUrlFileContext = BLL.FileStructService.GetFileStructByAttachUrl(x.PMManAttachUrl), + //FullTimeManAttachUrlFileContext = FileStructService.GetFileStructByAttachUrl(x.FullTimeManAttachUrl), + // PMManAttachUrlFileContext = FileStructService.GetFileStructByAttachUrl(x.PMManAttachUrl), KeyEquipmentTotal = x.KeyEquipmentTotal, KeyEquipmentTotalRemark = x.KeyEquipmentTotalRemark, KeyEquipmentReportCount = x.KeyEquipmentReportCount, @@ -377,7 +456,100 @@ //老接口Serveice // var getR = hsseC.DataInsertInformation_SafetyQuarterlyReportTable(upReport.ToList()); //新接口Api + string FullTimeManAttachUrl = string.Empty; + string PMManAttachUrl = string.Empty; + string physicalpath = Funs.RootPath; + FullTimeManAttachUrl = physicalpath + upReport.FirstOrDefault().FullTimeManAttachUrl; + PMManAttachUrl = physicalpath + upReport.FirstOrDefault().PMManAttachUrl; + FullTimeManAttachUrl = UploadFile(FullTimeManAttachUrl); + PMManAttachUrl = UploadFile(PMManAttachUrl); + upReport = from x in upReport + select new Information_SafetyQuarterlyReport + { + SafetyQuarterlyReportId = x.SafetyQuarterlyReportId, + UnitId = x.UnitId, + YearId = x.YearId, + Quarters = x.Quarters, + TotalInWorkHours = x.TotalInWorkHours, + TotalInWorkHoursRemark = x.TotalInWorkHoursRemark, + TotalOutWorkHours = x.TotalOutWorkHours, + TotalOutWorkHoursRemark = x.TotalOutWorkHoursRemark, + WorkHoursLossRate = x.WorkHoursLossRate, + WorkHoursLossRateRemark = x.WorkHoursLossRateRemark, + WorkHoursAccuracy = x.WorkHoursAccuracy, + WorkHoursAccuracyRemark = x.WorkHoursAccuracyRemark, + MainBusinessIncome = x.MainBusinessIncome, + MainBusinessIncomeRemark = x.MainBusinessIncomeRemark, + FillingDate = x.FillingDate, + ConstructionRevenue = x.ConstructionRevenue, + ConstructionRevenueRemark = x.ConstructionRevenueRemark, + UnitTimeIncome = x.UnitTimeIncome, + UnitTimeIncomeRemark = x.UnitTimeIncomeRemark, + BillionsOutputMortality = x.BillionsOutputMortality, + BillionsOutputMortalityRemark = x.BillionsOutputMortalityRemark, + MajorFireAccident = x.MajorFireAccident, + MajorFireAccidentRemark = x.MajorFireAccidentRemark, + MajorEquipAccident = x.MajorEquipAccident, + MajorEquipAccidentRemark = x.MajorEquipAccidentRemark, + AccidentFrequency = x.AccidentFrequency, + AccidentFrequencyRemark = x.AccidentFrequencyRemark, + SeriousInjuryAccident = x.SeriousInjuryAccident, + SeriousInjuryAccidentRemark = x.SeriousInjuryAccidentRemark, + FireAccident = x.FireAccident, + FireAccidentRemark = x.FireAccidentRemark, + EquipmentAccident = x.EquipmentAccident, + EquipmentAccidentRemark = x.EquipmentAccidentRemark, + PoisoningAndInjuries = x.PoisoningAndInjuries, + PoisoningAndInjuriesRemark = x.PoisoningAndInjuriesRemark, + ProductionSafetyInTotal = x.ProductionSafetyInTotal, + ProductionSafetyInTotalRemark = x.ProductionSafetyInTotalRemark, + ProtectionInput = x.ProtectionInput, + ProtectionInputRemark = x.ProtectionInputRemark, + LaboAndHealthIn = x.LaboAndHealthIn, + LaborAndHealthInRemark = x.LaborAndHealthInRemark, + TechnologyProgressIn = x.TechnologyProgressIn, + TechnologyProgressInRemark = x.TechnologyProgressInRemark, + EducationTrainIn = x.EducationTrainIn, + EducationTrainInRemark = x.EducationTrainInRemark, + ProjectCostRate = x.ProjectCostRate, + ProjectCostRateRemark = x.ProjectCostRateRemark, + ProductionInput = x.ProductionInput, + ProductionInputRemark = x.ProductionInputRemark, + Revenue = x.Revenue, + RevenueRemark = x.RevenueRemark, + FullTimeMan = x.FullTimeMan, + FullTimeManRemark = x.FullTimeManRemark, + FullTimeManAttachUrl = FullTimeManAttachUrl, + PMMan = x.PMMan, + PMManRemark = x.PMManRemark, + PMManAttachUrl = PMManAttachUrl, + CorporateDirectorEdu = x.CorporateDirectorEdu, + CorporateDirectorEduRemark = x.CorporateDirectorEduRemark, + ProjectLeaderEdu = x.ProjectLeaderEdu, + ProjectLeaderEduRemark = x.ProjectLeaderEduRemark, + FullTimeEdu = x.FullTimeEdu, + FullTimeEduRemark = x.FullTimeEduRemark, + ThreeKidsEduRate = x.ThreeKidsEduRate, + ThreeKidsEduRateRemark = x.ThreeKidsEduRateRemark, + UplinReportRate = x.UplinReportRate, + UplinReportRateRemark = x.UplinReportRateRemark, + Remarks = x.Remarks, + CompileMan = x.CompileMan, + KeyEquipmentTotal = x.KeyEquipmentTotal, + KeyEquipmentTotalRemark = x.KeyEquipmentTotalRemark, + KeyEquipmentReportCount = x.KeyEquipmentReportCount, + KeyEquipmentReportCountRemark = x.KeyEquipmentReportCountRemark, + ChemicalAreaProjectCount = x.ChemicalAreaProjectCount, + ChemicalAreaProjectCountRemark = x.ChemicalAreaProjectCountRemark, + HarmfulMediumCoverCount = x.HarmfulMediumCoverCount, + HarmfulMediumCoverCountRemark = x.HarmfulMediumCoverCountRemark, + HarmfulMediumCoverRate = x.HarmfulMediumCoverRate, + HarmfulMediumCoverRateRemark = x.HarmfulMediumCoverRateRemark + }; code = UpApiSaveSafetyQuarterlyReport(upReport).ToString(); + + + ; LogService.AddSys_Log(CurrUser, "【安全生产数据季报上报】上传", code, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources); if (code == "1") { foreach (var item in upReport.Select(p => p.SafetyQuarterlyReportId)) @@ -404,7 +576,7 @@ catch (Exception ex) { ErrLogInfo.WriteLog("【安全生产数据季报上报】上传到服务器", ex); - LogService.AddSys_Log(CurrUser, "【安全生产数据季报上报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources); + LogService.AddSys_Log(CurrUser, "【安全生产数据季报上报】上传到服务器失败err;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources); } return code; } @@ -415,10 +587,11 @@ /// 主表 /// 明细表 /// - private static int UpApiSaveSafetyQuarterlyReport(IQueryable upReport) + private static int UpApiSaveSafetyQuarterlyReport(IQueryable upReport) { string baseurl = "/api/InformationData/SaveSafetyQuarterlyReport"; var resultJson = JsonConvert.SerializeObject(new { InformationDataItems = upReport }); + APICommonService.SaveSysHttpLog("api_In", baseurl, resultJson); var responeData = BLL.ServerService.PushCNCEC(resultJson, baseurl); return responeData.code; @@ -436,10 +609,9 @@ { try { - //CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient(); var upReport = from x in db.Information_DrillConductedQuarterlyReport where x.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId - select new Model.HSSE.Information_DrillConductedQuarterlyReport + select new Information_DrillConductedQuarterlyReport { DrillConductedQuarterlyReportId = x.DrillConductedQuarterlyReportId, UnitId = x.UnitId, @@ -451,7 +623,7 @@ var upReportItem = from x in db.Information_DrillConductedQuarterlyReportItem where x.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId - select new Model.HSSE.Information_DrillConductedQuarterlyReportItem + select new Information_DrillConductedQuarterlyReportItem { DrillConductedQuarterlyReportItemId = x.DrillConductedQuarterlyReportItemId, DrillConductedQuarterlyReportId = x.DrillConductedQuarterlyReportId, @@ -514,7 +686,7 @@ /// 主表 /// 明细表 /// - private static int UpApiSaveDrillConductedQuarterlyReport(IQueryable upReport, IQueryable upReportItem) + private static int UpApiSaveDrillConductedQuarterlyReport(IQueryable upReport, IQueryable upReportItem) { string baseurl = "/api/InformationData/SaveDrillConductedQuarterlyReport"; //合并 @@ -538,10 +710,9 @@ { try { - ///CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient(); var upReport = from x in db.Information_DrillPlanHalfYearReport where x.DrillPlanHalfYearReportId == drillPlanHalfYearReportId - select new Model.HSSE.Information_DrillPlanHalfYearReport + select new Information_DrillPlanHalfYearReport { DrillPlanHalfYearReportId = x.DrillPlanHalfYearReportId, UnitId = x.UnitId, @@ -554,7 +725,7 @@ var upReportItem = from x in db.Information_DrillPlanHalfYearReportItem where x.DrillPlanHalfYearReportId == drillPlanHalfYearReportId - select new Model.HSSE.Information_DrillPlanHalfYearReportItem + select new Information_DrillPlanHalfYearReportItem { DrillPlanHalfYearReportItemId = x.DrillPlanHalfYearReportItemId, DrillPlanHalfYearReportId = x.DrillPlanHalfYearReportId, @@ -607,7 +778,7 @@ /// 主表 /// 明细表 /// - private static int UpApiDrillPlanHalfYearReport(IQueryable upReport, IQueryable upReportItem) + private static int UpApiDrillPlanHalfYearReport(IQueryable upReport, IQueryable upReportItem) { string baseurl = "/api/InformationData/SaveDrillPlanHalfYearReport"; //合并 @@ -620,8 +791,6005 @@ return responeData.code; } #endregion - + + #region 化工行业能源节约与生态环境保护汇总表上报 + /// + /// 化工行业能源节约与生态环境保护汇总表上报 + /// + public static string UpChemicalReport(string chemicalReportId, Model.Sys_User CurrUser) + { + string code = "0"; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + try + { + + var upReport = from x in db.Environmental_ChemicalReport + where x.ChemicalReportId == chemicalReportId + select new Model.ChemicalReport + { + ChemicalReportId = x.ChemicalReportId, + UnitId = x.UnitId, + Year = x.Year, + Month = x.Month, + FillingMan = x.FillingMan, + FillingDate = x.FillingDate, + DutyPerson = x.DutyPerson, + + }; + + var upReportItem = from x in db.Environmental_ChemicalReportItem + where x.ChemicalReportId == chemicalReportId + select new Model.ChemicalReportItem + { + ChemicalReportItemId = x.ChemicalReportItemId, + ChemicalReportId = x.ChemicalReportId, + SortIndex = x.SortIndex, + BaseNumber = x.BaseNumber, + LastYearValue = x.LastYearValue, + ThisYearValue = x.ThisYearValue, + Rate = x.Rate, + }; + + //老接口Serveice + //var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList()); + //新接口Api + code = UpApiChemicalReport(upReport, upReportItem).ToString(); + if (code == "1") + { + foreach (var item in upReport.Select(p => p.ChemicalReportId)) + { + var report = db.Environmental_ChemicalReport.FirstOrDefault(e => e.ChemicalReportId == item); + if (report != null) + { + report.UpState = BLL.Const.UpState_3; + db.SubmitChanges(); + ////更新 当前人要处理的意见 + ProjectDataFlowSetService.CloseFlowOperate(Const.ChemicalReportMenuId, item, string.Empty); + // //更新催报信息 + UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Month.ToString()); + } + } + LogService.AddSys_Log(CurrUser, "【化工行业能源节约与生态环境保护汇总表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.ChemicalReportMenuId, BLL.Const.BtnUploadResources); + } + else + { + LogService.AddSys_Log(CurrUser, "【化工行业能源节约与生态环境保护汇总表】上传到服务器失败;", null, BLL.Const.ChemicalReportMenuId, BLL.Const.BtnUploadResources); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("【化工行业能源节约与生态环境保护汇总表】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【化工行业能源节约与生态环境保护汇总表】上传到服务器失败;", null, BLL.Const.ChemicalReportMenuId, BLL.Const.BtnUploadResources); + } + return code; + } + } + /// + /// UpApiChemicalReportApi调用 + /// + /// 主表 + /// 明细表 + /// + private static int UpApiChemicalReport(IQueryable upReport, IQueryable upReportItem) + { + string baseurl = "/api/InformationData/SaveChemicalReport"; + //合并 + //var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem }); + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + var resultJsonReportItem = JsonConvert.SerializeObject(new { ChemicalReportItem = upReportItem }); + resultJsonReport = "{\"InformationDataItems\":[" + (resultJsonReport + resultJsonReportItem).Replace("}{", ",") + "]}"; + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } #endregion + + #region 中央企业环保产业企业基本情况和经营情况汇总表 + + public static string UpOperationReport(string businessReportId, Model.Sys_User CurrUser) + { + string code = "0"; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + try + { + var upReport = from x in db.Environmental_OperationReport + where x.BusinessReportId == businessReportId + select new Model.OperationReportDto + { + BusinessReportId = x.BusinessReportId, + UnitId = x.UnitId, + Year = x.Year, + Quarters = x.Quarters, + Code = x.Code, + UnitLevel = x.UnitLevel, + CreateDate = x.CreateDate, + Place = x.Place, + PersonNum = x.PersonNum, + TotalAssets = x.TotalAssets, + TotalValue = x.TotalValue, + NewInvestment = x.NewInvestment, + FillingMan = x.FillingMan, + FillingDate = x.FillingDate, + StatisticsDutyPerson = x.StatisticsDutyPerson, + UnitDutyPerson = x.UnitDutyPerson, + Remark = x.Remark + }; + + //新接口Api + code = UpApiOperationReport(upReport).ToString(); + if (code == "1") + { + var report = db.Environmental_OperationReport.FirstOrDefault(e => e.BusinessReportId == businessReportId); + if (report != null) + { + report.UpState = BLL.Const.UpState_3; + db.SubmitChanges(); + } + LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources); + } + else + { + LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources); + } + return code; + } + + } + + private static int UpApiOperationReport(IQueryable upReport) + { + string baseurl = "/api/InformationData/SaveOperationReport"; + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } + + + #endregion + + #region 中央企业节能环保产业企业生产和服务业务情况报表上报 + /// + /// 中央企业节能环保产业企业生产和服务业务情况报表上报 + /// + public static string UpEnergyReport(string energyReportId, Model.Sys_User CurrUser) + { + string code = "0"; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + try + { + + var upReport = from x in db.Environmental_EnergyReport + where x.EnergyReportId == energyReportId + select new Model.EnergyReport + { + EnergyReportId = x.EnergyReportId, + UnitId = x.UnitId, + Year = x.Year, + Quarters = x.Quarters, + FillingMan = x.FillingMan, + FillingDate = x.FillingDate, + DutyPerson = x.DutyPerson, + + }; + + var upReportItem = from x in db.Environmental_EnergyReportItem + where x.EnergyReportId == energyReportId + select new Model.EnergyReportItem + { + EnergyReportItemId = x.EnergyReportItemId, + EnergyReportId = x.EnergyReportId, + SortIndex = x.SortIndex, + BusinessCategory = x.BusinessCategory, + Throughput_BasePeriod = x.Throughput_BasePeriod, + Throughput_LastPeriod = x.Throughput_LastPeriod, + Throughput_ThisPeriod = x.Throughput_ThisPeriod, + Throughput_UnitOfMeasurement = x.Throughput_UnitOfMeasurement, + Yield_BasePeriod = x.Yield_BasePeriod, + Yield_LastPeriod = x.Yield_LastPeriod, + Yield_ThisPeriod = x.Yield_ThisPeriod, + Yield_UnitOfMeasurement = x.Yield_UnitOfMeasurement, + OutputValue_BasePeriod = x.OutputValue_BasePeriod, + OutputValue_LastYear = x.OutputValue_LastYear, + OutputValue_ThisYear = x.OutputValue_ThisYear, + OperationScale_BasePeriod = x.OperationScale_BasePeriod, + OperationScale_LastYear = x.OperationScale_LastYear, + OperationScale_ThisYear = x.OperationScale_ThisYear, + OperationScale_UnitOfMeasurement = x.OperationScale_UnitOfMeasurement, + ServiceOperatingIncome_BasePeriod = x.ServiceOperatingIncome_BasePeriod, + ServiceOperatingIncome_LastYear = x.ServiceOperatingIncome_LastYear, + ServiceOperatingIncome_ThisYear = x.ServiceOperatingIncome_ThisYear, + }; + + //老接口Serveice + //var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList()); + //新接口Api + code = UpApiEnergyReport(upReport, upReportItem).ToString(); + if (code == "1") + { + foreach (var item in upReport.Select(p => p.EnergyReportId)) + { + var report = db.Environmental_EnergyReport.FirstOrDefault(e => e.EnergyReportId == item); + if (report != null) + { + report.UpState = BLL.Const.UpState_3; + db.SubmitChanges(); + ////更新 当前人要处理的意见 + //ProjectDataFlowSetService.CloseFlowOperate(Const.ChemicalReportMenuId, item, string.Empty); + // //更新催报信息 + //UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Quarters.ToString()); + } + } + LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources); + } + else + { + LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources); + } + return code; + } + } + /// + /// UpApiChemicalReportApi调用 + /// + /// 主表 + /// 明细表 + /// + private static int UpApiEnergyReport(IQueryable upReport, IQueryable upReportItem) + { + string baseurl = "/api/InformationData/SaveEnergyReport"; + //合并 + //var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem }); + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + var resultJsonReportItem = JsonConvert.SerializeObject(new { EnergyReportItem = upReportItem }); + resultJsonReport = "{\"InformationDataItems\":[" + (resultJsonReport + resultJsonReportItem).Replace("}{", ",") + "]}"; + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } + #endregion + + #region 建筑行业能源节约与生态环境保护汇总表上报 + /// + /// 建筑行业能源节约与生态环境保护汇总表上报 + /// + public static string UpArchitectureReport(string chemicalReportId, Model.Sys_User CurrUser) + { + string code = "0"; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + try + { + + var upReport = from x in db.Environmental_ArchitectureReport + where x.ArchitectureReportId == chemicalReportId + select new Model.ArchitectureReport + { + ArchitectureReportId = x.ArchitectureReportId, + UnitId = x.UnitId, + Year = x.Year, + Quarters = x.Quarters, + FillingMan = x.FillingMan, + FillingDate = x.FillingDate, + DutyPerson = x.DutyPerson, + + }; + + var upReportItem = from x in db.Environmental_ArchitectureReportItem + where x.ArchitectureReportId == chemicalReportId + select new Model.ArchitectureReportItem + { + ArchitectureReportItemId = x.ArchitectureReportItemId, + ArchitectureReportId = x.ArchitectureReportId, + BaseNumber = x.BaseNumber, + SortIndex = x.SortIndex, + LastYearValue = x.LastYearValue, + ThisYearValue = x.ThisYearValue, + Rate = x.Rate, + }; + + //老接口Serveice + //var getR = hsseC.DataInsertInformation_ArchitectureReportTable(upReport.ToList(), upReportItem.ToList()); + //新接口Api + code = UpApiArchitectureReport(upReport, upReportItem).ToString(); + if (code == "1") + { + foreach (var item in upReport.Select(p => p.ArchitectureReportId)) + { + var report = db.Environmental_ArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == item); + if (report != null) + { + report.UpState = BLL.Const.UpState_3; + db.SubmitChanges(); + ////更新 当前人要处理的意见 + ProjectDataFlowSetService.CloseFlowOperate(Const.ArchitectureReportMenuId, item, string.Empty); + // //更新催报信息 + UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Quarters.ToString()); + } + } + LogService.AddSys_Log(CurrUser, "【建筑行业能源节约与生态环境保护汇总表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnUploadResources); + } + else + { + LogService.AddSys_Log(CurrUser, "【建筑行业能源节约与生态环境保护汇总表】上传到服务器失败;", null, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnUploadResources); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("【建筑行业能源节约与生态环境保护汇总表】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【建筑行业能源节约与生态环境保护汇总表】上传到服务器失败;", null, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnUploadResources); + } + return code; + } + } + /// + /// UpApiArchitectureReportApi调用 + /// + /// 主表 + /// 明细表 + /// + private static int UpApiArchitectureReport(IQueryable upReport, IQueryable upReportItem) + { + string baseurl = "/api/InformationData/SaveArchitectureReport"; + //合并 + //var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem }); + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + var resultJsonReportItem = JsonConvert.SerializeObject(new { ArchitectureReportItem = upReportItem }); + resultJsonReport = "{\"InformationDataItems\":[" + (resultJsonReport + resultJsonReportItem).Replace("}{", ",") + "]}"; + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } + #endregion + + + #region 安全管理工作总结报告 + /// + /// 安全管理工作总结报告 + /// + /// + /// + /// + public static string UpWorkSummaryReport(string workSummaryReportId, Model.Sys_User CurrUser) + { + string code = "0"; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + try + { + + var upReport = from x in db.Information_WorkSummaryReport + where x.WorkSummaryReportId == workSummaryReportId + select new Model.WorkSummaryReport + { + WorkSummaryReportId = x.WorkSummaryReportId, + UnitId = x.UnitId, + YearId = x.YearId, + ResponsiblePerson = x.ResponsiblePerson, + ResponsiblePersonTel = x.ResponsiblePersonTel, + ContactPerson = x.ContactPerson, + ContactPersonTel = x.ContactPersonTel, + ReportDate = x.ReportDate, + SafeLaborTime = x.SafeLaborTime, + SafetyObjectives = x.SafetyObjectives, + AccidentSituation = x.AccidentSituation, + Awards = x.Awards, + WorkDevelopment = x.WorkDevelopment, + PersonnelTraining = x.PersonnelTraining, + GovernanceSituation = x.GovernanceSituation, + ManagementActivity = x.ManagementActivity, + WorkExperience = x.WorkExperience, + Countermeasures = x.Countermeasures, + NextYearWorkPlan = x.NextYearWorkPlan, + JobSuggestion = x.JobSuggestion + }; + + //老接口Serveice + //var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList()); + //新接口Api + code = UpApiWorkSummaryReport(upReport).ToString(); + if (code == "1") + { + foreach (var item in upReport.Select(p => p.WorkSummaryReportId)) + { + var report = db.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == item); + if (report != null) + { + report.UpState = BLL.Const.UpState_3; + db.SubmitChanges(); + ////更新 当前人要处理的意见 + ProjectDataFlowSetService.CloseFlowOperate(Const.WorkSummaryReportMenuId, item, string.Empty); + // //更新催报信息 + UrgeReportService.SetComplete(report.UnitId, Const.ReportType_6, report.YearId.ToString(), string.Empty); + } + } + LogService.AddSys_Log(CurrUser, "【安全管理工作总结报告】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.WorkSummaryReportMenuId, BLL.Const.BtnUploadResources); + } + else + { + LogService.AddSys_Log(CurrUser, "【安全管理工作总结报告】上传到服务器失败;", null, BLL.Const.WorkSummaryReportMenuId, BLL.Const.BtnUploadResources); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("【安全管理工作总结报告】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【安全管理工作总结报告】上传到服务器失败;", null, BLL.Const.WorkSummaryReportMenuId, BLL.Const.BtnUploadResources); + } + return code; + } + } + /// + /// UpApiWorkSummaryReportApi调用 + /// + /// 主表 + /// + private static int UpApiWorkSummaryReport(IQueryable upReport) + { + string baseurl = "/api/InformationData/SaveWorkSummaryReport"; + + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + //var resultJsonReportItem = JsonConvert.SerializeObject(new { ChemicalReportItem = upReportItem }); + resultJsonReport = "{\"InformationDataItems\":[" + resultJsonReport.Replace("}{", ",") + "]}"; + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } + #endregion + + #region 质量管理工作总结报告 + /// + /// 质量管理工作总结报告 + /// + /// + /// + /// + public static string UpQualityWorkSummaryReport(string qualityWorkSummaryReportId, Model.Sys_User CurrUser) + { + string code = "0"; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + try + { + + var upReport = from x in db.Information_QualityWorkSummaryReport + where x.QualityWorkSummaryReportId == qualityWorkSummaryReportId + select new Model.QualityWorkSummaryReport + { + QualityWorkSummaryReportId = x.QualityWorkSummaryReportId, + UnitId = x.UnitId, + YearId = x.YearId, + ResponsiblePerson = x.ResponsiblePerson, + ResponsiblePersonTel = x.ResponsiblePersonTel, + ContactPerson = x.ContactPerson, + ContactPersonTel = x.ContactPersonTel, + ReportDate = x.ReportDate, + Performance = x.Performance, + AccidentSituation = x.AccidentSituation, + Awards = x.Awards, + WorkDevelopment = x.WorkDevelopment, + PersonnelTraining = x.PersonnelTraining, + CheckSituation = x.CheckSituation, + ManagementActivity = x.ManagementActivity, + WorkExperience = x.WorkExperience, + Countermeasures = x.Countermeasures, + NextYearWorkPlan = x.NextYearWorkPlan, + JobSuggestion = x.JobSuggestion + }; + + //老接口Serveice + //var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList()); + //新接口Api + code = UpApiQualityWorkSummaryReport(upReport).ToString(); + if (code == "1") + { + foreach (var item in upReport.Select(p => p.QualityWorkSummaryReportId)) + { + var report = db.Information_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == item); + if (report != null) + { + report.UpState = BLL.Const.UpState_3; + db.SubmitChanges(); + ////更新 当前人要处理的意见 + ProjectDataFlowSetService.CloseFlowOperate(Const.QualityWorkSummaryReportMenuId, item, string.Empty); + // //更新催报信息 + UrgeReportService.SetComplete(report.UnitId, Const.ReportType_7, report.YearId.ToString(), string.Empty); + } + } + LogService.AddSys_Log(CurrUser, "【质量管理工作总结报告】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.QualityWorkSummaryReportMenuId, BLL.Const.BtnUploadResources); + } + else + { + LogService.AddSys_Log(CurrUser, "【质量管理工作总结报告】上传到服务器失败;", null, BLL.Const.QualityWorkSummaryReportMenuId, BLL.Const.BtnUploadResources); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("【质量管理工作总结报告】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【质量管理工作总结报告】上传到服务器失败;", null, BLL.Const.QualityWorkSummaryReportMenuId, BLL.Const.BtnUploadResources); + } + return code; + } + } + /// + /// UpApiQualityWorkSummaryReport + /// + /// 主表 + /// + private static int UpApiQualityWorkSummaryReport(IQueryable upReport) + { + string baseurl = "/api/InformationData/SaveQualityWorkSummaryReport"; + + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + //var resultJsonReportItem = JsonConvert.SerializeObject(new { ChemicalReportItem = upReportItem }); + resultJsonReport = "{\"InformationDataItems\":[" + resultJsonReport.Replace("}{", ",") + "]}"; + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } + #endregion + + #region 实业安全简报 + /// + /// 实业安全简报 + /// + /// + /// + /// + public static string UpSafetyBriefing(string safetyBriefingId, Model.Sys_User CurrUser) + { + string code = "0"; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + try + { + + var upReport = from x in db.Information_SafetyBriefing + where x.SafetyBriefingId == safetyBriefingId + select new Model.SafetyBriefing + { + SafetyBriefingId = x.SafetyBriefingId, + UnitId = x.UnitId, + YearId = x.YearId, + Month = x.Month, + CompileMan = BLL.UserService.GetUserNameByUserId(x.CompileMan), + CompileDate = x.CompileDate, + Auditor = x.Auditor, + Approver = x.Approver, + MainWork = x.MainWork, + HazardRecording = x.HazardRecording, + SafetyAccident = x.SafetyAccident, + EPAccident = x.EPAccident, + OHAccident = x.OHAccident, + WorkPermitNum = x.WorkPermitNum, + HiddenDangerDetection = x.HiddenDangerDetection, + RectificationSituation = x.RectificationSituation, + CheckProblemsRectification = x.CheckProblemsRectification, + PendingProject = x.PendingProject, + ContractorManagement = x.ContractorManagement, + EnvironmentalEmissions = x.EnvironmentalEmissions, + NextMonthWorkPlan = x.NextMonthWorkPlan + }; + + //老接口Serveice + //var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList()); + //新接口Api + code = UpApiSafetyBriefing(upReport).ToString(); + if (code == "1") + { + foreach (var item in upReport.Select(p => p.SafetyBriefingId)) + { + var report = db.Information_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == item); + if (report != null) + { + report.UpState = BLL.Const.UpState_3; + db.SubmitChanges(); + ////更新 当前人要处理的意见 + ProjectDataFlowSetService.CloseFlowOperate(Const.SafetyBriefingMenuId, item, string.Empty); + // //更新催报信息 + UrgeReportService.SetComplete(report.UnitId, Const.ReportType_7, report.YearId.ToString(), report.Month.ToString()); + } + } + LogService.AddSys_Log(CurrUser, "【实业安全简报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.SafetyBriefingMenuId, BLL.Const.BtnUploadResources); + } + else + { + LogService.AddSys_Log(CurrUser, "【实业安全简报】上传到服务器失败;", null, BLL.Const.SafetyBriefingMenuId, BLL.Const.BtnUploadResources); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("【实业安全简报】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【实业安全简报】上传到服务器失败;", null, BLL.Const.SafetyBriefingMenuId, BLL.Const.BtnUploadResources); + } + return code; + } + } + /// + /// UpApiSafetyBriefing + /// + /// 主表 + /// + private static int UpApiSafetyBriefing(IQueryable upReport) + { + string baseurl = "/api/InformationData/SaveSafetyBriefing"; + + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + //var resultJsonReportItem = JsonConvert.SerializeObject(new { ChemicalReportItem = upReportItem }); + resultJsonReport = "{\"InformationDataItems\":[" + resultJsonReport.Replace("}{", ",") + "]}"; + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } + #endregion + + #region 季度工程项目质量信息表 + /// + /// 季度工程项目质量信息表 + /// + /// + /// + /// + public static string UpQuarterlyProjectQuality(string quarterlyProjectQualityId, Model.Sys_User CurrUser) + { + string code = "0"; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + try + { + + var upReport = from x in db.Information_QuarterlyProjectQuality + where x.QuarterlyProjectQualityId == quarterlyProjectQualityId + select new Model.QuarterlyProjectQuality + { + QuarterlyProjectQualityId = x.QuarterlyProjectQualityId, + UnitId = x.UnitId, + Year = x.Year, + Quarter = x.Quarter, + QualityManagePersonNum = x.QualityManagePersonNum, + AdvancedTitlePersonNum = x.AdvancedTitlePersonNum, + IntermediateTitlePersonNum = x.IntermediateTitlePersonNum, + BeImplementedProjectNum = x.BeImplementedProjectNum, + StartImplementedProjectNum = x.StartImplementedProjectNum, + AccumulativeStartImplemented = x.AccumulativeStartImplemented, + CompleteProjectNum = x.CompleteProjectNum, + YearCompleteProjectNum = x.YearCompleteProjectNum, + QuarterTotal = x.QuarterTotal, + QuarterFirstPassNum = x.QuarterFirstPassNum, + QuarterFirstPassRate = x.QuarterFirstPassRate, + YearTotal = x.YearTotal, + YearFirstPassNum = x.YearFirstPassNum, + YearFirstPassRate = x.YearFirstPassRate, + QuaterCheckSuperviseNum = x.QuaterCheckSuperviseNum, + QuaterCorrectiveNoticeNum = x.QuaterCorrectiveNoticeNum, + QuaterQualityProblemNum = x.QuaterQualityProblemNum, + QuaterClosedQualityProblemNum = x.QuaterClosedQualityProblemNum, + YearCheckSuperviseNum = x.YearCheckSuperviseNum, + YearCorrectiveNoticeNum = x.YearCorrectiveNoticeNum, + YearQualityProblemNum = x.YearQualityProblemNum, + YearClosedQualityProblemNum = x.YearClosedQualityProblemNum, + QuaterQualityAccidentNum = x.QuaterQualityAccidentNum, + QuaterDirectEconomicLoss = x.QuaterDirectEconomicLoss, + YearQualityAccidentNum = x.YearQualityAccidentNum, + YearDirectEconomicLoss = x.YearDirectEconomicLoss, + ResponsiblePerson = BLL.UserService.GetUserNameByUserId(x.ResponsiblePerson), + CompileMan = BLL.UserService.GetUserNameByUserId(x.CompileMan), + CompileDate = x.CompileDate, + Tel = x.Tel + }; + + //老接口Serveice + //var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList()); + //新接口Api + code = UpApiQuarterlyProjectQuality(upReport).ToString(); + if (code == "1") + { + foreach (var item in upReport.Select(p => p.QuarterlyProjectQualityId)) + { + var report = db.Information_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == item); + if (report != null) + { + report.UpState = BLL.Const.UpState_3; + db.SubmitChanges(); + ////更新 当前人要处理的意见 + ProjectDataFlowSetService.CloseFlowOperate(Const.QuarterlyProjectQualityMenuId, item, string.Empty); + // //更新催报信息 + UrgeReportService.SetComplete(report.UnitId, Const.ReportType_9, report.Year.ToString(), report.Quarter.ToString()); + } + } + LogService.AddSys_Log(CurrUser, "【季度工程项目质量信息表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.QuarterlyProjectQualityMenuId, BLL.Const.BtnUploadResources); + } + else + { + LogService.AddSys_Log(CurrUser, "【季度工程项目质量信息表】上传到服务器失败;", null, BLL.Const.QuarterlyProjectQualityMenuId, BLL.Const.BtnUploadResources); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("【季度工程项目质量信息表】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【季度工程项目质量信息表】上传到服务器失败;", null, BLL.Const.QuarterlyProjectQualityMenuId, BLL.Const.BtnUploadResources); + } + return code; + } + } + /// + /// UpApiSafetyBriefing + /// + /// 主表 + /// + private static int UpApiQuarterlyProjectQuality(IQueryable upReport) + { + string baseurl = "/api/InformationData/SaveQuarterlyProjectQuality"; + + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + //var resultJsonReportItem = JsonConvert.SerializeObject(new { ChemicalReportItem = upReportItem }); + resultJsonReport = "{\"InformationDataItems\":[" + resultJsonReport.Replace("}{", ",") + "]}"; + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } + #endregion + + #region 生态环保工作总结报告 + /// + /// 生态环保工作总结报告 + /// + /// + /// + /// + public static string UpEPSummaryReport(string ePSummaryReportId, Model.Sys_User CurrUser) + { + string code = "0"; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + try + { + + var upReport = from x in db.Information_EPSummaryReport + where x.EPSummaryReportId == ePSummaryReportId + select new Model.EPSummaryReport + { + EPSummaryReportId = x.EPSummaryReportId, + UnitId = x.UnitId, + YearId = x.YearId, + ResponsiblePerson = x.ResponsiblePerson, + ResponsiblePersonTel = x.ResponsiblePersonTel, + ContactPerson = x.ContactPerson, + ContactPersonTel = x.ContactPersonTel, + ReportDate = x.ReportDate, + Description1 = x.Description1, + Description2 = x.Description2, + Description3 = x.Description3, + Description4 = x.Description4, + Description5 = x.Description5, + Description6 = x.Description6, + Description7 = x.Description7, + Description8 = x.Description8, + Description9 = x.Description9 + }; + + //老接口Serveice + //var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList()); + //新接口Api + code = UpApiEPSummaryReport(upReport).ToString(); + if (code == "1") + { + foreach (var item in upReport.Select(p => p.EPSummaryReportId)) + { + var report = db.Information_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == item); + if (report != null) + { + report.UpState = BLL.Const.UpState_3; + db.SubmitChanges(); + ////更新 当前人要处理的意见 + ProjectDataFlowSetService.CloseFlowOperate(Const.EPSummaryReportMenuId, item, string.Empty); + // //更新催报信息 + UrgeReportService.SetComplete(report.UnitId, Const.ReportType_10, report.YearId.ToString(), string.Empty); + } + } + LogService.AddSys_Log(CurrUser, "【生态环保工作总结报告】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.EPSummaryReportMenuId, BLL.Const.BtnUploadResources); + } + else + { + LogService.AddSys_Log(CurrUser, "【生态环保工作总结报告】上传到服务器失败;", null, BLL.Const.EPSummaryReportMenuId, BLL.Const.BtnUploadResources); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("【生态环保工作总结报告】上传到服务器", ex); + LogService.AddSys_Log(CurrUser, "【生态环保工作总结报告】上传到服务器失败;", null, BLL.Const.EPSummaryReportMenuId, BLL.Const.BtnUploadResources); + } + return code; + } + } + /// + /// UpApiEPSummaryReport + /// + /// 主表 + /// + private static int UpApiEPSummaryReport(IQueryable upReport) + { + string baseurl = "/api/InformationData/SaveEPSummaryReport"; + + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + //var resultJsonReportItem = JsonConvert.SerializeObject(new { ChemicalReportItem = upReportItem }); + resultJsonReport = "{\"InformationDataItems\":[" + resultJsonReport.Replace("}{", ",") + "]}"; + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } + #endregion + + #endregion + + + public partial class Information_MillionsMonthlyReport : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable AccidentMortalityField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable DeathAccidentFrequencyField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DutyPersonField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable FillingDateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string FillingManField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable LostTimeInjuryRateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable LostTimeRateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string MillionsMonthlyReportIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MonthField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable RecordableIncidentRateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string UnitIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable YearField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable InputCostsField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TrainNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable GeneralHazardNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MajorHazardNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable NotProofLargeProjectNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ProofLargeProjectNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable FireLicenseNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable LimitLicenseNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable HighLicenseNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable HoistingLicenseNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable BreakGroundLicenseNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ElectricityLicenseNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable RTLicenseNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable NightLicenseNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable CommissionerNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SoleDutyNumField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SoleDutyNum + { + get + { + return this.SoleDutyNumField; + } + set + { + if ((this.SoleDutyNumField.Equals(value) != true)) + { + this.SoleDutyNumField = value; + this.RaisePropertyChanged("SoleDutyNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable CommissionerNum + { + get + { + return this.CommissionerNumField; + } + set + { + if ((this.CommissionerNumField.Equals(value) != true)) + { + this.CommissionerNumField = value; + this.RaisePropertyChanged("CommissionerNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable NightLicenseNum + { + get + { + return this.NightLicenseNumField; + } + set + { + if ((this.NightLicenseNumField.Equals(value) != true)) + { + this.NightLicenseNumField = value; + this.RaisePropertyChanged("NightLicenseNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable RTLicenseNum + { + get + { + return this.RTLicenseNumField; + } + set + { + if ((this.RTLicenseNumField.Equals(value) != true)) + { + this.RTLicenseNumField = value; + this.RaisePropertyChanged("RTLicenseNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ElectricityLicenseNum + { + get + { + return this.ElectricityLicenseNumField; + } + set + { + if ((this.ElectricityLicenseNumField.Equals(value) != true)) + { + this.ElectricityLicenseNumField = value; + this.RaisePropertyChanged("ElectricityLicenseNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable BreakGroundLicenseNum + { + get + { + return this.BreakGroundLicenseNumField; + } + set + { + if ((this.BreakGroundLicenseNumField.Equals(value) != true)) + { + this.BreakGroundLicenseNumField = value; + this.RaisePropertyChanged("BreakGroundLicenseNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable HoistingLicenseNum + { + get + { + return this.HoistingLicenseNumField; + } + set + { + if ((this.HoistingLicenseNumField.Equals(value) != true)) + { + this.HoistingLicenseNumField = value; + this.RaisePropertyChanged("HoistingLicenseNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable HighLicenseNum + { + get + { + return this.HighLicenseNumField; + } + set + { + if ((this.HighLicenseNumField.Equals(value) != true)) + { + this.HighLicenseNumField = value; + this.RaisePropertyChanged("HighLicenseNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable LimitLicenseNum + { + get + { + return this.LimitLicenseNumField; + } + set + { + if ((this.LimitLicenseNumField.Equals(value) != true)) + { + this.LimitLicenseNumField = value; + this.RaisePropertyChanged("LimitLicenseNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable FireLicenseNum + { + get + { + return this.FireLicenseNumField; + } + set + { + if ((this.FireLicenseNumField.Equals(value) != true)) + { + this.FireLicenseNumField = value; + this.RaisePropertyChanged("FireLicenseNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ProofLargeProjectNum + { + get + { + return this.ProofLargeProjectNumField; + } + set + { + if ((this.ProofLargeProjectNumField.Equals(value) != true)) + { + this.ProofLargeProjectNumField = value; + this.RaisePropertyChanged("ProofLargeProjectNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable NotProofLargeProjectNum + { + get + { + return this.NotProofLargeProjectNumField; + } + set + { + if ((this.NotProofLargeProjectNumField.Equals(value) != true)) + { + this.NotProofLargeProjectNumField = value; + this.RaisePropertyChanged("NotProofLargeProjectNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MajorHazardNum + { + get + { + return this.MajorHazardNumField; + } + set + { + if ((this.MajorHazardNumField.Equals(value) != true)) + { + this.MajorHazardNumField = value; + this.RaisePropertyChanged("MajorHazardNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable GeneralHazardNum + { + get + { + return this.GeneralHazardNumField; + } + set + { + if ((this.GeneralHazardNumField.Equals(value) != true)) + { + this.GeneralHazardNumField = value; + this.RaisePropertyChanged("GeneralHazardNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TrainNum + { + get + { + return this.TrainNumField; + } + set + { + if ((this.TrainNumField.Equals(value) != true)) + { + this.TrainNumField = value; + this.RaisePropertyChanged("TrainNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable InputCosts + { + get + { + return this.InputCostsField; + } + set + { + if ((this.InputCostsField.Equals(value) != true)) + { + this.InputCostsField = value; + this.RaisePropertyChanged("InputCosts"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + + public System.Runtime.Serialization.ExtensionDataObject ExtensionData + { + get + { + return this.extensionDataField; + } + set + { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable AccidentMortality + { + get + { + return this.AccidentMortalityField; + } + set + { + if ((this.AccidentMortalityField.Equals(value) != true)) + { + this.AccidentMortalityField = value; + this.RaisePropertyChanged("AccidentMortality"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable DeathAccidentFrequency + { + get + { + return this.DeathAccidentFrequencyField; + } + set + { + if ((this.DeathAccidentFrequencyField.Equals(value) != true)) + { + this.DeathAccidentFrequencyField = value; + this.RaisePropertyChanged("DeathAccidentFrequency"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string DutyPerson + { + get + { + return this.DutyPersonField; + } + set + { + if ((object.ReferenceEquals(this.DutyPersonField, value) != true)) + { + this.DutyPersonField = value; + this.RaisePropertyChanged("DutyPerson"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable FillingDate + { + get + { + return this.FillingDateField; + } + set + { + if ((this.FillingDateField.Equals(value) != true)) + { + this.FillingDateField = value; + this.RaisePropertyChanged("FillingDate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string FillingMan + { + get + { + return this.FillingManField; + } + set + { + if ((object.ReferenceEquals(this.FillingManField, value) != true)) + { + this.FillingManField = value; + this.RaisePropertyChanged("FillingMan"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable LostTimeInjuryRate + { + get + { + return this.LostTimeInjuryRateField; + } + set + { + if ((this.LostTimeInjuryRateField.Equals(value) != true)) + { + this.LostTimeInjuryRateField = value; + this.RaisePropertyChanged("LostTimeInjuryRate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable LostTimeRate + { + get + { + return this.LostTimeRateField; + } + set + { + if ((this.LostTimeRateField.Equals(value) != true)) + { + this.LostTimeRateField = value; + this.RaisePropertyChanged("LostTimeRate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string MillionsMonthlyReportId + { + get + { + return this.MillionsMonthlyReportIdField; + } + set + { + if ((object.ReferenceEquals(this.MillionsMonthlyReportIdField, value) != true)) + { + this.MillionsMonthlyReportIdField = value; + this.RaisePropertyChanged("MillionsMonthlyReportId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Month + { + get + { + return this.MonthField; + } + set + { + if ((this.MonthField.Equals(value) != true)) + { + this.MonthField = value; + this.RaisePropertyChanged("Month"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable RecordableIncidentRate + { + get + { + return this.RecordableIncidentRateField; + } + set + { + if ((this.RecordableIncidentRateField.Equals(value) != true)) + { + this.RecordableIncidentRateField = value; + this.RaisePropertyChanged("RecordableIncidentRate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string UnitId + { + get + { + return this.UnitIdField; + } + set + { + if ((object.ReferenceEquals(this.UnitIdField, value) != true)) + { + this.UnitIdField = value; + this.RaisePropertyChanged("UnitId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Year + { + get + { + return this.YearField; + } + set + { + if ((this.YearField.Equals(value) != true)) + { + this.YearField = value; + this.RaisePropertyChanged("Year"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) + { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) + { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + public partial class Information_MillionsMonthlyReportItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string AffiliationField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable AttemptedEventNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ContractorNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable EquipmentNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ExplosionNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable FireNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable FirstAidDressingsNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable LossDayNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MedicalTreatmentLossHourField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MedicalTreatmentPersonNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string MillionsMonthlyReportIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string MillionsMonthlyReportItemIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorAccidentLossHourField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorAccidentNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorAccidentPersonNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string NameField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable OtherAccidentLossHourField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable OtherAccidentNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable OtherAccidentPersonNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable OtherNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable PostPersonNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable QualityNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable RestrictedWorkLossHourField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable RestrictedWorkPersonNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SeriousInjuriesLossHourField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SeriousInjuriesNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SeriousInjuriesPersonNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SnapPersonNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SortIndexField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SumPersonNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalWorkNumField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TrafficNumField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData + { + get + { + return this.extensionDataField; + } + set + { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string Affiliation + { + get + { + return this.AffiliationField; + } + set + { + if ((object.ReferenceEquals(this.AffiliationField, value) != true)) + { + this.AffiliationField = value; + this.RaisePropertyChanged("Affiliation"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable AttemptedEventNum + { + get + { + return this.AttemptedEventNumField; + } + set + { + if ((this.AttemptedEventNumField.Equals(value) != true)) + { + this.AttemptedEventNumField = value; + this.RaisePropertyChanged("AttemptedEventNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ContractorNum + { + get + { + return this.ContractorNumField; + } + set + { + if ((this.ContractorNumField.Equals(value) != true)) + { + this.ContractorNumField = value; + this.RaisePropertyChanged("ContractorNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable EquipmentNum + { + get + { + return this.EquipmentNumField; + } + set + { + if ((this.EquipmentNumField.Equals(value) != true)) + { + this.EquipmentNumField = value; + this.RaisePropertyChanged("EquipmentNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ExplosionNum + { + get + { + return this.ExplosionNumField; + } + set + { + if ((this.ExplosionNumField.Equals(value) != true)) + { + this.ExplosionNumField = value; + this.RaisePropertyChanged("ExplosionNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable FireNum + { + get + { + return this.FireNumField; + } + set + { + if ((this.FireNumField.Equals(value) != true)) + { + this.FireNumField = value; + this.RaisePropertyChanged("FireNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable FirstAidDressingsNum + { + get + { + return this.FirstAidDressingsNumField; + } + set + { + if ((this.FirstAidDressingsNumField.Equals(value) != true)) + { + this.FirstAidDressingsNumField = value; + this.RaisePropertyChanged("FirstAidDressingsNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable LossDayNum + { + get + { + return this.LossDayNumField; + } + set + { + if ((this.LossDayNumField.Equals(value) != true)) + { + this.LossDayNumField = value; + this.RaisePropertyChanged("LossDayNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MedicalTreatmentLossHour + { + get + { + return this.MedicalTreatmentLossHourField; + } + set + { + if ((this.MedicalTreatmentLossHourField.Equals(value) != true)) + { + this.MedicalTreatmentLossHourField = value; + this.RaisePropertyChanged("MedicalTreatmentLossHour"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MedicalTreatmentPersonNum + { + get + { + return this.MedicalTreatmentPersonNumField; + } + set + { + if ((this.MedicalTreatmentPersonNumField.Equals(value) != true)) + { + this.MedicalTreatmentPersonNumField = value; + this.RaisePropertyChanged("MedicalTreatmentPersonNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string MillionsMonthlyReportId + { + get + { + return this.MillionsMonthlyReportIdField; + } + set + { + if ((object.ReferenceEquals(this.MillionsMonthlyReportIdField, value) != true)) + { + this.MillionsMonthlyReportIdField = value; + this.RaisePropertyChanged("MillionsMonthlyReportId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string MillionsMonthlyReportItemId + { + get + { + return this.MillionsMonthlyReportItemIdField; + } + set + { + if ((object.ReferenceEquals(this.MillionsMonthlyReportItemIdField, value) != true)) + { + this.MillionsMonthlyReportItemIdField = value; + this.RaisePropertyChanged("MillionsMonthlyReportItemId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorAccidentLossHour + { + get + { + return this.MinorAccidentLossHourField; + } + set + { + if ((this.MinorAccidentLossHourField.Equals(value) != true)) + { + this.MinorAccidentLossHourField = value; + this.RaisePropertyChanged("MinorAccidentLossHour"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorAccidentNum + { + get + { + return this.MinorAccidentNumField; + } + set + { + if ((this.MinorAccidentNumField.Equals(value) != true)) + { + this.MinorAccidentNumField = value; + this.RaisePropertyChanged("MinorAccidentNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorAccidentPersonNum + { + get + { + return this.MinorAccidentPersonNumField; + } + set + { + if ((this.MinorAccidentPersonNumField.Equals(value) != true)) + { + this.MinorAccidentPersonNumField = value; + this.RaisePropertyChanged("MinorAccidentPersonNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string Name + { + get + { + return this.NameField; + } + set + { + if ((object.ReferenceEquals(this.NameField, value) != true)) + { + this.NameField = value; + this.RaisePropertyChanged("Name"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable OtherAccidentLossHour + { + get + { + return this.OtherAccidentLossHourField; + } + set + { + if ((this.OtherAccidentLossHourField.Equals(value) != true)) + { + this.OtherAccidentLossHourField = value; + this.RaisePropertyChanged("OtherAccidentLossHour"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable OtherAccidentNum + { + get + { + return this.OtherAccidentNumField; + } + set + { + if ((this.OtherAccidentNumField.Equals(value) != true)) + { + this.OtherAccidentNumField = value; + this.RaisePropertyChanged("OtherAccidentNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable OtherAccidentPersonNum + { + get + { + return this.OtherAccidentPersonNumField; + } + set + { + if ((this.OtherAccidentPersonNumField.Equals(value) != true)) + { + this.OtherAccidentPersonNumField = value; + this.RaisePropertyChanged("OtherAccidentPersonNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable OtherNum + { + get + { + return this.OtherNumField; + } + set + { + if ((this.OtherNumField.Equals(value) != true)) + { + this.OtherNumField = value; + this.RaisePropertyChanged("OtherNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable PostPersonNum + { + get + { + return this.PostPersonNumField; + } + set + { + if ((this.PostPersonNumField.Equals(value) != true)) + { + this.PostPersonNumField = value; + this.RaisePropertyChanged("PostPersonNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable QualityNum + { + get + { + return this.QualityNumField; + } + set + { + if ((this.QualityNumField.Equals(value) != true)) + { + this.QualityNumField = value; + this.RaisePropertyChanged("QualityNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable RestrictedWorkLossHour + { + get + { + return this.RestrictedWorkLossHourField; + } + set + { + if ((this.RestrictedWorkLossHourField.Equals(value) != true)) + { + this.RestrictedWorkLossHourField = value; + this.RaisePropertyChanged("RestrictedWorkLossHour"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable RestrictedWorkPersonNum + { + get + { + return this.RestrictedWorkPersonNumField; + } + set + { + if ((this.RestrictedWorkPersonNumField.Equals(value) != true)) + { + this.RestrictedWorkPersonNumField = value; + this.RaisePropertyChanged("RestrictedWorkPersonNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SeriousInjuriesLossHour + { + get + { + return this.SeriousInjuriesLossHourField; + } + set + { + if ((this.SeriousInjuriesLossHourField.Equals(value) != true)) + { + this.SeriousInjuriesLossHourField = value; + this.RaisePropertyChanged("SeriousInjuriesLossHour"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SeriousInjuriesNum + { + get + { + return this.SeriousInjuriesNumField; + } + set + { + if ((this.SeriousInjuriesNumField.Equals(value) != true)) + { + this.SeriousInjuriesNumField = value; + this.RaisePropertyChanged("SeriousInjuriesNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SeriousInjuriesPersonNum + { + get + { + return this.SeriousInjuriesPersonNumField; + } + set + { + if ((this.SeriousInjuriesPersonNumField.Equals(value) != true)) + { + this.SeriousInjuriesPersonNumField = value; + this.RaisePropertyChanged("SeriousInjuriesPersonNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SnapPersonNum + { + get + { + return this.SnapPersonNumField; + } + set + { + if ((this.SnapPersonNumField.Equals(value) != true)) + { + this.SnapPersonNumField = value; + this.RaisePropertyChanged("SnapPersonNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SortIndex + { + get + { + return this.SortIndexField; + } + set + { + if ((this.SortIndexField.Equals(value) != true)) + { + this.SortIndexField = value; + this.RaisePropertyChanged("SortIndex"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SumPersonNum + { + get + { + return this.SumPersonNumField; + } + set + { + if ((this.SumPersonNumField.Equals(value) != true)) + { + this.SumPersonNumField = value; + this.RaisePropertyChanged("SumPersonNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalWorkNum + { + get + { + return this.TotalWorkNumField; + } + set + { + if ((this.TotalWorkNumField.Equals(value) != true)) + { + this.TotalWorkNumField = value; + this.RaisePropertyChanged("TotalWorkNum"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TrafficNum + { + get + { + return this.TrafficNumField; + } + set + { + if ((this.TrafficNumField.Equals(value) != true)) + { + this.TrafficNumField = value; + this.RaisePropertyChanged("TrafficNum"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) + { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) + { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + public partial class Information_AccidentCauseReport : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string AccidentCauseReportCodeField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string AccidentCauseReportIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string AuditPersonField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable AverageManHoursField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable AverageTotalHoursField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable DeathAccidentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable DeathTollField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable DirectLossField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string FillCompanyPersonChargeField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable FillingDateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable IndirectLossesField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable InjuredAccidentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable InjuredTollField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable KnockOffTotalField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable LastMonthLossHoursTotalField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorWoundAccidentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorWoundTollField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MonthField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string TabPeopleField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalLossField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalLossManField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalLossTimeField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string UnitIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable YearField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData + { + get + { + return this.extensionDataField; + } + set + { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string AccidentCauseReportCode + { + get + { + return this.AccidentCauseReportCodeField; + } + set + { + if ((object.ReferenceEquals(this.AccidentCauseReportCodeField, value) != true)) + { + this.AccidentCauseReportCodeField = value; + this.RaisePropertyChanged("AccidentCauseReportCode"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string AccidentCauseReportId + { + get + { + return this.AccidentCauseReportIdField; + } + set + { + if ((object.ReferenceEquals(this.AccidentCauseReportIdField, value) != true)) + { + this.AccidentCauseReportIdField = value; + this.RaisePropertyChanged("AccidentCauseReportId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string AuditPerson + { + get + { + return this.AuditPersonField; + } + set + { + if ((object.ReferenceEquals(this.AuditPersonField, value) != true)) + { + this.AuditPersonField = value; + this.RaisePropertyChanged("AuditPerson"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable AverageManHours + { + get + { + return this.AverageManHoursField; + } + set + { + if ((this.AverageManHoursField.Equals(value) != true)) + { + this.AverageManHoursField = value; + this.RaisePropertyChanged("AverageManHours"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable AverageTotalHours + { + get + { + return this.AverageTotalHoursField; + } + set + { + if ((this.AverageTotalHoursField.Equals(value) != true)) + { + this.AverageTotalHoursField = value; + this.RaisePropertyChanged("AverageTotalHours"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable DeathAccident + { + get + { + return this.DeathAccidentField; + } + set + { + if ((this.DeathAccidentField.Equals(value) != true)) + { + this.DeathAccidentField = value; + this.RaisePropertyChanged("DeathAccident"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable DeathToll + { + get + { + return this.DeathTollField; + } + set + { + if ((this.DeathTollField.Equals(value) != true)) + { + this.DeathTollField = value; + this.RaisePropertyChanged("DeathToll"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable DirectLoss + { + get + { + return this.DirectLossField; + } + set + { + if ((this.DirectLossField.Equals(value) != true)) + { + this.DirectLossField = value; + this.RaisePropertyChanged("DirectLoss"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string FillCompanyPersonCharge + { + get + { + return this.FillCompanyPersonChargeField; + } + set + { + if ((object.ReferenceEquals(this.FillCompanyPersonChargeField, value) != true)) + { + this.FillCompanyPersonChargeField = value; + this.RaisePropertyChanged("FillCompanyPersonCharge"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable FillingDate + { + get + { + return this.FillingDateField; + } + set + { + if ((this.FillingDateField.Equals(value) != true)) + { + this.FillingDateField = value; + this.RaisePropertyChanged("FillingDate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable IndirectLosses + { + get + { + return this.IndirectLossesField; + } + set + { + if ((this.IndirectLossesField.Equals(value) != true)) + { + this.IndirectLossesField = value; + this.RaisePropertyChanged("IndirectLosses"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable InjuredAccident + { + get + { + return this.InjuredAccidentField; + } + set + { + if ((this.InjuredAccidentField.Equals(value) != true)) + { + this.InjuredAccidentField = value; + this.RaisePropertyChanged("InjuredAccident"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable InjuredToll + { + get + { + return this.InjuredTollField; + } + set + { + if ((this.InjuredTollField.Equals(value) != true)) + { + this.InjuredTollField = value; + this.RaisePropertyChanged("InjuredToll"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable KnockOffTotal + { + get + { + return this.KnockOffTotalField; + } + set + { + if ((this.KnockOffTotalField.Equals(value) != true)) + { + this.KnockOffTotalField = value; + this.RaisePropertyChanged("KnockOffTotal"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable LastMonthLossHoursTotal + { + get + { + return this.LastMonthLossHoursTotalField; + } + set + { + if ((this.LastMonthLossHoursTotalField.Equals(value) != true)) + { + this.LastMonthLossHoursTotalField = value; + this.RaisePropertyChanged("LastMonthLossHoursTotal"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorWoundAccident + { + get + { + return this.MinorWoundAccidentField; + } + set + { + if ((this.MinorWoundAccidentField.Equals(value) != true)) + { + this.MinorWoundAccidentField = value; + this.RaisePropertyChanged("MinorWoundAccident"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorWoundToll + { + get + { + return this.MinorWoundTollField; + } + set + { + if ((this.MinorWoundTollField.Equals(value) != true)) + { + this.MinorWoundTollField = value; + this.RaisePropertyChanged("MinorWoundToll"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Month + { + get + { + return this.MonthField; + } + set + { + if ((this.MonthField.Equals(value) != true)) + { + this.MonthField = value; + this.RaisePropertyChanged("Month"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string TabPeople + { + get + { + return this.TabPeopleField; + } + set + { + if ((object.ReferenceEquals(this.TabPeopleField, value) != true)) + { + this.TabPeopleField = value; + this.RaisePropertyChanged("TabPeople"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalLoss + { + get + { + return this.TotalLossField; + } + set + { + if ((this.TotalLossField.Equals(value) != true)) + { + this.TotalLossField = value; + this.RaisePropertyChanged("TotalLoss"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalLossMan + { + get + { + return this.TotalLossManField; + } + set + { + if ((this.TotalLossManField.Equals(value) != true)) + { + this.TotalLossManField = value; + this.RaisePropertyChanged("TotalLossMan"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalLossTime + { + get + { + return this.TotalLossTimeField; + } + set + { + if ((this.TotalLossTimeField.Equals(value) != true)) + { + this.TotalLossTimeField = value; + this.RaisePropertyChanged("TotalLossTime"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string UnitId + { + get + { + return this.UnitIdField; + } + set + { + if ((object.ReferenceEquals(this.UnitIdField, value) != true)) + { + this.UnitIdField = value; + this.RaisePropertyChanged("UnitId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Year + { + get + { + return this.YearField; + } + set + { + if ((this.YearField.Equals(value) != true)) + { + this.YearField = value; + this.RaisePropertyChanged("Year"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) + { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) + { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + public partial class Information_AccidentCauseReportItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string AccidentCauseReportIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string AccidentCauseReportItemIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string AccidentTypeField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death1Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death10Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death11Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death2Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death3Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death4Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death5Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death6Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death7Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death8Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Death9Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries1Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries10Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries11Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries2Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries3Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries4Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries5Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries6Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries7Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries8Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable Injuries9Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries1Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries10Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries11Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries2Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries3Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries4Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries5Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries6Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries7Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries8Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MinorInjuries9Field; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalDeathField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalInjuriesField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalMinorInjuriesField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData + { + get + { + return this.extensionDataField; + } + set + { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string AccidentCauseReportId + { + get + { + return this.AccidentCauseReportIdField; + } + set + { + if ((object.ReferenceEquals(this.AccidentCauseReportIdField, value) != true)) + { + this.AccidentCauseReportIdField = value; + this.RaisePropertyChanged("AccidentCauseReportId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string AccidentCauseReportItemId + { + get + { + return this.AccidentCauseReportItemIdField; + } + set + { + if ((object.ReferenceEquals(this.AccidentCauseReportItemIdField, value) != true)) + { + this.AccidentCauseReportItemIdField = value; + this.RaisePropertyChanged("AccidentCauseReportItemId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string AccidentType + { + get + { + return this.AccidentTypeField; + } + set + { + if ((object.ReferenceEquals(this.AccidentTypeField, value) != true)) + { + this.AccidentTypeField = value; + this.RaisePropertyChanged("AccidentType"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death1 + { + get + { + return this.Death1Field; + } + set + { + if ((this.Death1Field.Equals(value) != true)) + { + this.Death1Field = value; + this.RaisePropertyChanged("Death1"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death10 + { + get + { + return this.Death10Field; + } + set + { + if ((this.Death10Field.Equals(value) != true)) + { + this.Death10Field = value; + this.RaisePropertyChanged("Death10"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death11 + { + get + { + return this.Death11Field; + } + set + { + if ((this.Death11Field.Equals(value) != true)) + { + this.Death11Field = value; + this.RaisePropertyChanged("Death11"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death2 + { + get + { + return this.Death2Field; + } + set + { + if ((this.Death2Field.Equals(value) != true)) + { + this.Death2Field = value; + this.RaisePropertyChanged("Death2"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death3 + { + get + { + return this.Death3Field; + } + set + { + if ((this.Death3Field.Equals(value) != true)) + { + this.Death3Field = value; + this.RaisePropertyChanged("Death3"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death4 + { + get + { + return this.Death4Field; + } + set + { + if ((this.Death4Field.Equals(value) != true)) + { + this.Death4Field = value; + this.RaisePropertyChanged("Death4"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death5 + { + get + { + return this.Death5Field; + } + set + { + if ((this.Death5Field.Equals(value) != true)) + { + this.Death5Field = value; + this.RaisePropertyChanged("Death5"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death6 + { + get + { + return this.Death6Field; + } + set + { + if ((this.Death6Field.Equals(value) != true)) + { + this.Death6Field = value; + this.RaisePropertyChanged("Death6"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death7 + { + get + { + return this.Death7Field; + } + set + { + if ((this.Death7Field.Equals(value) != true)) + { + this.Death7Field = value; + this.RaisePropertyChanged("Death7"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death8 + { + get + { + return this.Death8Field; + } + set + { + if ((this.Death8Field.Equals(value) != true)) + { + this.Death8Field = value; + this.RaisePropertyChanged("Death8"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Death9 + { + get + { + return this.Death9Field; + } + set + { + if ((this.Death9Field.Equals(value) != true)) + { + this.Death9Field = value; + this.RaisePropertyChanged("Death9"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries1 + { + get + { + return this.Injuries1Field; + } + set + { + if ((this.Injuries1Field.Equals(value) != true)) + { + this.Injuries1Field = value; + this.RaisePropertyChanged("Injuries1"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries10 + { + get + { + return this.Injuries10Field; + } + set + { + if ((this.Injuries10Field.Equals(value) != true)) + { + this.Injuries10Field = value; + this.RaisePropertyChanged("Injuries10"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries11 + { + get + { + return this.Injuries11Field; + } + set + { + if ((this.Injuries11Field.Equals(value) != true)) + { + this.Injuries11Field = value; + this.RaisePropertyChanged("Injuries11"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries2 + { + get + { + return this.Injuries2Field; + } + set + { + if ((this.Injuries2Field.Equals(value) != true)) + { + this.Injuries2Field = value; + this.RaisePropertyChanged("Injuries2"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries3 + { + get + { + return this.Injuries3Field; + } + set + { + if ((this.Injuries3Field.Equals(value) != true)) + { + this.Injuries3Field = value; + this.RaisePropertyChanged("Injuries3"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries4 + { + get + { + return this.Injuries4Field; + } + set + { + if ((this.Injuries4Field.Equals(value) != true)) + { + this.Injuries4Field = value; + this.RaisePropertyChanged("Injuries4"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries5 + { + get + { + return this.Injuries5Field; + } + set + { + if ((this.Injuries5Field.Equals(value) != true)) + { + this.Injuries5Field = value; + this.RaisePropertyChanged("Injuries5"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries6 + { + get + { + return this.Injuries6Field; + } + set + { + if ((this.Injuries6Field.Equals(value) != true)) + { + this.Injuries6Field = value; + this.RaisePropertyChanged("Injuries6"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries7 + { + get + { + return this.Injuries7Field; + } + set + { + if ((this.Injuries7Field.Equals(value) != true)) + { + this.Injuries7Field = value; + this.RaisePropertyChanged("Injuries7"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries8 + { + get + { + return this.Injuries8Field; + } + set + { + if ((this.Injuries8Field.Equals(value) != true)) + { + this.Injuries8Field = value; + this.RaisePropertyChanged("Injuries8"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Injuries9 + { + get + { + return this.Injuries9Field; + } + set + { + if ((this.Injuries9Field.Equals(value) != true)) + { + this.Injuries9Field = value; + this.RaisePropertyChanged("Injuries9"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries1 + { + get + { + return this.MinorInjuries1Field; + } + set + { + if ((this.MinorInjuries1Field.Equals(value) != true)) + { + this.MinorInjuries1Field = value; + this.RaisePropertyChanged("MinorInjuries1"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries10 + { + get + { + return this.MinorInjuries10Field; + } + set + { + if ((this.MinorInjuries10Field.Equals(value) != true)) + { + this.MinorInjuries10Field = value; + this.RaisePropertyChanged("MinorInjuries10"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries11 + { + get + { + return this.MinorInjuries11Field; + } + set + { + if ((this.MinorInjuries11Field.Equals(value) != true)) + { + this.MinorInjuries11Field = value; + this.RaisePropertyChanged("MinorInjuries11"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries2 + { + get + { + return this.MinorInjuries2Field; + } + set + { + if ((this.MinorInjuries2Field.Equals(value) != true)) + { + this.MinorInjuries2Field = value; + this.RaisePropertyChanged("MinorInjuries2"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries3 + { + get + { + return this.MinorInjuries3Field; + } + set + { + if ((this.MinorInjuries3Field.Equals(value) != true)) + { + this.MinorInjuries3Field = value; + this.RaisePropertyChanged("MinorInjuries3"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries4 + { + get + { + return this.MinorInjuries4Field; + } + set + { + if ((this.MinorInjuries4Field.Equals(value) != true)) + { + this.MinorInjuries4Field = value; + this.RaisePropertyChanged("MinorInjuries4"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries5 + { + get + { + return this.MinorInjuries5Field; + } + set + { + if ((this.MinorInjuries5Field.Equals(value) != true)) + { + this.MinorInjuries5Field = value; + this.RaisePropertyChanged("MinorInjuries5"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries6 + { + get + { + return this.MinorInjuries6Field; + } + set + { + if ((this.MinorInjuries6Field.Equals(value) != true)) + { + this.MinorInjuries6Field = value; + this.RaisePropertyChanged("MinorInjuries6"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries7 + { + get + { + return this.MinorInjuries7Field; + } + set + { + if ((this.MinorInjuries7Field.Equals(value) != true)) + { + this.MinorInjuries7Field = value; + this.RaisePropertyChanged("MinorInjuries7"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries8 + { + get + { + return this.MinorInjuries8Field; + } + set + { + if ((this.MinorInjuries8Field.Equals(value) != true)) + { + this.MinorInjuries8Field = value; + this.RaisePropertyChanged("MinorInjuries8"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MinorInjuries9 + { + get + { + return this.MinorInjuries9Field; + } + set + { + if ((this.MinorInjuries9Field.Equals(value) != true)) + { + this.MinorInjuries9Field = value; + this.RaisePropertyChanged("MinorInjuries9"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalDeath + { + get + { + return this.TotalDeathField; + } + set + { + if ((this.TotalDeathField.Equals(value) != true)) + { + this.TotalDeathField = value; + this.RaisePropertyChanged("TotalDeath"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalInjuries + { + get + { + return this.TotalInjuriesField; + } + set + { + if ((this.TotalInjuriesField.Equals(value) != true)) + { + this.TotalInjuriesField = value; + this.RaisePropertyChanged("TotalInjuries"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalMinorInjuries + { + get + { + return this.TotalMinorInjuriesField; + } + set + { + if ((this.TotalMinorInjuriesField.Equals(value) != true)) + { + this.TotalMinorInjuriesField = value; + this.RaisePropertyChanged("TotalMinorInjuries"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) + { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) + { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + public partial class Information_SafetyQuarterlyReport : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable AccidentFrequencyField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string AccidentFrequencyRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable BillionsOutputMortalityField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string BillionsOutputMortalityRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ChemicalAreaProjectCountField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ChemicalAreaProjectCountRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string CompileManField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ConstructionRevenueField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ConstructionRevenueRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable CorporateDirectorEduField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string CorporateDirectorEduRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable EducationTrainInField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string EducationTrainInRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable EquipmentAccidentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string EquipmentAccidentRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable FillingDateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable FireAccidentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string FireAccidentRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable FullTimeEduField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string FullTimeEduRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable FullTimeManField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string FullTimeManAttachUrlField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Collections.Generic.List FullTimeManAttachUrlFileContextField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string FullTimeManRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable HarmfulMediumCoverCountField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string HarmfulMediumCoverCountRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable HarmfulMediumCoverRateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string HarmfulMediumCoverRateRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable KeyEquipmentReportCountField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string KeyEquipmentReportCountRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable KeyEquipmentTotalField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string KeyEquipmentTotalRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable LaboAndHealthInField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string LaborAndHealthInRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MainBusinessIncomeField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string MainBusinessIncomeRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MajorEquipAccidentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string MajorEquipAccidentRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable MajorFireAccidentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string MajorFireAccidentRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable PMManField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string PMManAttachUrlField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Collections.Generic.List PMManAttachUrlFileContextField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string PMManRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable PoisoningAndInjuriesField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string PoisoningAndInjuriesRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ProductionInputField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ProductionInputRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ProductionSafetyInTotalField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ProductionSafetyInTotalRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ProjectCostRateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ProjectCostRateRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ProjectLeaderEduField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ProjectLeaderEduRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ProtectionInputField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ProtectionInputRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable QuartersField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string RemarksField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable RevenueField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string RevenueRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string SafetyQuarterlyReportIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SeriousInjuryAccidentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string SeriousInjuryAccidentRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TechnologyProgressInField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string TechnologyProgressInRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ThreeKidsEduRateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ThreeKidsEduRateRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalInWorkHoursField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string TotalInWorkHoursRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalOutWorkHoursField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string TotalOutWorkHoursRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string UnitIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable UnitTimeIncomeField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string UnitTimeIncomeRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable UplinReportRateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string UplinReportRateRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable WorkHoursAccuracyField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string WorkHoursAccuracyRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable WorkHoursLossRateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string WorkHoursLossRateRemarkField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable YearIdField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData + { + get + { + return this.extensionDataField; + } + set + { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable AccidentFrequency + { + get + { + return this.AccidentFrequencyField; + } + set + { + if ((this.AccidentFrequencyField.Equals(value) != true)) + { + this.AccidentFrequencyField = value; + this.RaisePropertyChanged("AccidentFrequency"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string AccidentFrequencyRemark + { + get + { + return this.AccidentFrequencyRemarkField; + } + set + { + if ((object.ReferenceEquals(this.AccidentFrequencyRemarkField, value) != true)) + { + this.AccidentFrequencyRemarkField = value; + this.RaisePropertyChanged("AccidentFrequencyRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable BillionsOutputMortality + { + get + { + return this.BillionsOutputMortalityField; + } + set + { + if ((this.BillionsOutputMortalityField.Equals(value) != true)) + { + this.BillionsOutputMortalityField = value; + this.RaisePropertyChanged("BillionsOutputMortality"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string BillionsOutputMortalityRemark + { + get + { + return this.BillionsOutputMortalityRemarkField; + } + set + { + if ((object.ReferenceEquals(this.BillionsOutputMortalityRemarkField, value) != true)) + { + this.BillionsOutputMortalityRemarkField = value; + this.RaisePropertyChanged("BillionsOutputMortalityRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ChemicalAreaProjectCount + { + get + { + return this.ChemicalAreaProjectCountField; + } + set + { + if ((this.ChemicalAreaProjectCountField.Equals(value) != true)) + { + this.ChemicalAreaProjectCountField = value; + this.RaisePropertyChanged("ChemicalAreaProjectCount"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ChemicalAreaProjectCountRemark + { + get + { + return this.ChemicalAreaProjectCountRemarkField; + } + set + { + if ((object.ReferenceEquals(this.ChemicalAreaProjectCountRemarkField, value) != true)) + { + this.ChemicalAreaProjectCountRemarkField = value; + this.RaisePropertyChanged("ChemicalAreaProjectCountRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string CompileMan + { + get + { + return this.CompileManField; + } + set + { + if ((object.ReferenceEquals(this.CompileManField, value) != true)) + { + this.CompileManField = value; + this.RaisePropertyChanged("CompileMan"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ConstructionRevenue + { + get + { + return this.ConstructionRevenueField; + } + set + { + if ((this.ConstructionRevenueField.Equals(value) != true)) + { + this.ConstructionRevenueField = value; + this.RaisePropertyChanged("ConstructionRevenue"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ConstructionRevenueRemark + { + get + { + return this.ConstructionRevenueRemarkField; + } + set + { + if ((object.ReferenceEquals(this.ConstructionRevenueRemarkField, value) != true)) + { + this.ConstructionRevenueRemarkField = value; + this.RaisePropertyChanged("ConstructionRevenueRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable CorporateDirectorEdu + { + get + { + return this.CorporateDirectorEduField; + } + set + { + if ((this.CorporateDirectorEduField.Equals(value) != true)) + { + this.CorporateDirectorEduField = value; + this.RaisePropertyChanged("CorporateDirectorEdu"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string CorporateDirectorEduRemark + { + get + { + return this.CorporateDirectorEduRemarkField; + } + set + { + if ((object.ReferenceEquals(this.CorporateDirectorEduRemarkField, value) != true)) + { + this.CorporateDirectorEduRemarkField = value; + this.RaisePropertyChanged("CorporateDirectorEduRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable EducationTrainIn + { + get + { + return this.EducationTrainInField; + } + set + { + if ((this.EducationTrainInField.Equals(value) != true)) + { + this.EducationTrainInField = value; + this.RaisePropertyChanged("EducationTrainIn"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string EducationTrainInRemark + { + get + { + return this.EducationTrainInRemarkField; + } + set + { + if ((object.ReferenceEquals(this.EducationTrainInRemarkField, value) != true)) + { + this.EducationTrainInRemarkField = value; + this.RaisePropertyChanged("EducationTrainInRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable EquipmentAccident + { + get + { + return this.EquipmentAccidentField; + } + set + { + if ((this.EquipmentAccidentField.Equals(value) != true)) + { + this.EquipmentAccidentField = value; + this.RaisePropertyChanged("EquipmentAccident"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string EquipmentAccidentRemark + { + get + { + return this.EquipmentAccidentRemarkField; + } + set + { + if ((object.ReferenceEquals(this.EquipmentAccidentRemarkField, value) != true)) + { + this.EquipmentAccidentRemarkField = value; + this.RaisePropertyChanged("EquipmentAccidentRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable FillingDate + { + get + { + return this.FillingDateField; + } + set + { + if ((this.FillingDateField.Equals(value) != true)) + { + this.FillingDateField = value; + this.RaisePropertyChanged("FillingDate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable FireAccident + { + get + { + return this.FireAccidentField; + } + set + { + if ((this.FireAccidentField.Equals(value) != true)) + { + this.FireAccidentField = value; + this.RaisePropertyChanged("FireAccident"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string FireAccidentRemark + { + get + { + return this.FireAccidentRemarkField; + } + set + { + if ((object.ReferenceEquals(this.FireAccidentRemarkField, value) != true)) + { + this.FireAccidentRemarkField = value; + this.RaisePropertyChanged("FireAccidentRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable FullTimeEdu + { + get + { + return this.FullTimeEduField; + } + set + { + if ((this.FullTimeEduField.Equals(value) != true)) + { + this.FullTimeEduField = value; + this.RaisePropertyChanged("FullTimeEdu"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string FullTimeEduRemark + { + get + { + return this.FullTimeEduRemarkField; + } + set + { + if ((object.ReferenceEquals(this.FullTimeEduRemarkField, value) != true)) + { + this.FullTimeEduRemarkField = value; + this.RaisePropertyChanged("FullTimeEduRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable FullTimeMan + { + get + { + return this.FullTimeManField; + } + set + { + if ((this.FullTimeManField.Equals(value) != true)) + { + this.FullTimeManField = value; + this.RaisePropertyChanged("FullTimeMan"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string FullTimeManAttachUrl + { + get + { + return this.FullTimeManAttachUrlField; + } + set + { + if ((object.ReferenceEquals(this.FullTimeManAttachUrlField, value) != true)) + { + this.FullTimeManAttachUrlField = value; + this.RaisePropertyChanged("FullTimeManAttachUrl"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.List FullTimeManAttachUrlFileContext + { + get + { + return this.FullTimeManAttachUrlFileContextField; + } + set + { + if ((object.ReferenceEquals(this.FullTimeManAttachUrlFileContextField, value) != true)) + { + this.FullTimeManAttachUrlFileContextField = value; + this.RaisePropertyChanged("FullTimeManAttachUrlFileContext"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string FullTimeManRemark + { + get + { + return this.FullTimeManRemarkField; + } + set + { + if ((object.ReferenceEquals(this.FullTimeManRemarkField, value) != true)) + { + this.FullTimeManRemarkField = value; + this.RaisePropertyChanged("FullTimeManRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable HarmfulMediumCoverCount + { + get + { + return this.HarmfulMediumCoverCountField; + } + set + { + if ((this.HarmfulMediumCoverCountField.Equals(value) != true)) + { + this.HarmfulMediumCoverCountField = value; + this.RaisePropertyChanged("HarmfulMediumCoverCount"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string HarmfulMediumCoverCountRemark + { + get + { + return this.HarmfulMediumCoverCountRemarkField; + } + set + { + if ((object.ReferenceEquals(this.HarmfulMediumCoverCountRemarkField, value) != true)) + { + this.HarmfulMediumCoverCountRemarkField = value; + this.RaisePropertyChanged("HarmfulMediumCoverCountRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable HarmfulMediumCoverRate + { + get + { + return this.HarmfulMediumCoverRateField; + } + set + { + if ((this.HarmfulMediumCoverRateField.Equals(value) != true)) + { + this.HarmfulMediumCoverRateField = value; + this.RaisePropertyChanged("HarmfulMediumCoverRate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string HarmfulMediumCoverRateRemark + { + get + { + return this.HarmfulMediumCoverRateRemarkField; + } + set + { + if ((object.ReferenceEquals(this.HarmfulMediumCoverRateRemarkField, value) != true)) + { + this.HarmfulMediumCoverRateRemarkField = value; + this.RaisePropertyChanged("HarmfulMediumCoverRateRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable KeyEquipmentReportCount + { + get + { + return this.KeyEquipmentReportCountField; + } + set + { + if ((this.KeyEquipmentReportCountField.Equals(value) != true)) + { + this.KeyEquipmentReportCountField = value; + this.RaisePropertyChanged("KeyEquipmentReportCount"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string KeyEquipmentReportCountRemark + { + get + { + return this.KeyEquipmentReportCountRemarkField; + } + set + { + if ((object.ReferenceEquals(this.KeyEquipmentReportCountRemarkField, value) != true)) + { + this.KeyEquipmentReportCountRemarkField = value; + this.RaisePropertyChanged("KeyEquipmentReportCountRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable KeyEquipmentTotal + { + get + { + return this.KeyEquipmentTotalField; + } + set + { + if ((this.KeyEquipmentTotalField.Equals(value) != true)) + { + this.KeyEquipmentTotalField = value; + this.RaisePropertyChanged("KeyEquipmentTotal"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string KeyEquipmentTotalRemark + { + get + { + return this.KeyEquipmentTotalRemarkField; + } + set + { + if ((object.ReferenceEquals(this.KeyEquipmentTotalRemarkField, value) != true)) + { + this.KeyEquipmentTotalRemarkField = value; + this.RaisePropertyChanged("KeyEquipmentTotalRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable LaboAndHealthIn + { + get + { + return this.LaboAndHealthInField; + } + set + { + if ((this.LaboAndHealthInField.Equals(value) != true)) + { + this.LaboAndHealthInField = value; + this.RaisePropertyChanged("LaboAndHealthIn"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string LaborAndHealthInRemark + { + get + { + return this.LaborAndHealthInRemarkField; + } + set + { + if ((object.ReferenceEquals(this.LaborAndHealthInRemarkField, value) != true)) + { + this.LaborAndHealthInRemarkField = value; + this.RaisePropertyChanged("LaborAndHealthInRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MainBusinessIncome + { + get + { + return this.MainBusinessIncomeField; + } + set + { + if ((this.MainBusinessIncomeField.Equals(value) != true)) + { + this.MainBusinessIncomeField = value; + this.RaisePropertyChanged("MainBusinessIncome"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string MainBusinessIncomeRemark + { + get + { + return this.MainBusinessIncomeRemarkField; + } + set + { + if ((object.ReferenceEquals(this.MainBusinessIncomeRemarkField, value) != true)) + { + this.MainBusinessIncomeRemarkField = value; + this.RaisePropertyChanged("MainBusinessIncomeRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MajorEquipAccident + { + get + { + return this.MajorEquipAccidentField; + } + set + { + if ((this.MajorEquipAccidentField.Equals(value) != true)) + { + this.MajorEquipAccidentField = value; + this.RaisePropertyChanged("MajorEquipAccident"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string MajorEquipAccidentRemark + { + get + { + return this.MajorEquipAccidentRemarkField; + } + set + { + if ((object.ReferenceEquals(this.MajorEquipAccidentRemarkField, value) != true)) + { + this.MajorEquipAccidentRemarkField = value; + this.RaisePropertyChanged("MajorEquipAccidentRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable MajorFireAccident + { + get + { + return this.MajorFireAccidentField; + } + set + { + if ((this.MajorFireAccidentField.Equals(value) != true)) + { + this.MajorFireAccidentField = value; + this.RaisePropertyChanged("MajorFireAccident"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string MajorFireAccidentRemark + { + get + { + return this.MajorFireAccidentRemarkField; + } + set + { + if ((object.ReferenceEquals(this.MajorFireAccidentRemarkField, value) != true)) + { + this.MajorFireAccidentRemarkField = value; + this.RaisePropertyChanged("MajorFireAccidentRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable PMMan + { + get + { + return this.PMManField; + } + set + { + if ((this.PMManField.Equals(value) != true)) + { + this.PMManField = value; + this.RaisePropertyChanged("PMMan"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string PMManAttachUrl + { + get + { + return this.PMManAttachUrlField; + } + set + { + if ((object.ReferenceEquals(this.PMManAttachUrlField, value) != true)) + { + this.PMManAttachUrlField = value; + this.RaisePropertyChanged("PMManAttachUrl"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.List PMManAttachUrlFileContext + { + get + { + return this.PMManAttachUrlFileContextField; + } + set + { + if ((object.ReferenceEquals(this.PMManAttachUrlFileContextField, value) != true)) + { + this.PMManAttachUrlFileContextField = value; + this.RaisePropertyChanged("PMManAttachUrlFileContext"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string PMManRemark + { + get + { + return this.PMManRemarkField; + } + set + { + if ((object.ReferenceEquals(this.PMManRemarkField, value) != true)) + { + this.PMManRemarkField = value; + this.RaisePropertyChanged("PMManRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable PoisoningAndInjuries + { + get + { + return this.PoisoningAndInjuriesField; + } + set + { + if ((this.PoisoningAndInjuriesField.Equals(value) != true)) + { + this.PoisoningAndInjuriesField = value; + this.RaisePropertyChanged("PoisoningAndInjuries"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string PoisoningAndInjuriesRemark + { + get + { + return this.PoisoningAndInjuriesRemarkField; + } + set + { + if ((object.ReferenceEquals(this.PoisoningAndInjuriesRemarkField, value) != true)) + { + this.PoisoningAndInjuriesRemarkField = value; + this.RaisePropertyChanged("PoisoningAndInjuriesRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ProductionInput + { + get + { + return this.ProductionInputField; + } + set + { + if ((this.ProductionInputField.Equals(value) != true)) + { + this.ProductionInputField = value; + this.RaisePropertyChanged("ProductionInput"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ProductionInputRemark + { + get + { + return this.ProductionInputRemarkField; + } + set + { + if ((object.ReferenceEquals(this.ProductionInputRemarkField, value) != true)) + { + this.ProductionInputRemarkField = value; + this.RaisePropertyChanged("ProductionInputRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ProductionSafetyInTotal + { + get + { + return this.ProductionSafetyInTotalField; + } + set + { + if ((this.ProductionSafetyInTotalField.Equals(value) != true)) + { + this.ProductionSafetyInTotalField = value; + this.RaisePropertyChanged("ProductionSafetyInTotal"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ProductionSafetyInTotalRemark + { + get + { + return this.ProductionSafetyInTotalRemarkField; + } + set + { + if ((object.ReferenceEquals(this.ProductionSafetyInTotalRemarkField, value) != true)) + { + this.ProductionSafetyInTotalRemarkField = value; + this.RaisePropertyChanged("ProductionSafetyInTotalRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ProjectCostRate + { + get + { + return this.ProjectCostRateField; + } + set + { + if ((this.ProjectCostRateField.Equals(value) != true)) + { + this.ProjectCostRateField = value; + this.RaisePropertyChanged("ProjectCostRate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ProjectCostRateRemark + { + get + { + return this.ProjectCostRateRemarkField; + } + set + { + if ((object.ReferenceEquals(this.ProjectCostRateRemarkField, value) != true)) + { + this.ProjectCostRateRemarkField = value; + this.RaisePropertyChanged("ProjectCostRateRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ProjectLeaderEdu + { + get + { + return this.ProjectLeaderEduField; + } + set + { + if ((this.ProjectLeaderEduField.Equals(value) != true)) + { + this.ProjectLeaderEduField = value; + this.RaisePropertyChanged("ProjectLeaderEdu"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ProjectLeaderEduRemark + { + get + { + return this.ProjectLeaderEduRemarkField; + } + set + { + if ((object.ReferenceEquals(this.ProjectLeaderEduRemarkField, value) != true)) + { + this.ProjectLeaderEduRemarkField = value; + this.RaisePropertyChanged("ProjectLeaderEduRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ProtectionInput + { + get + { + return this.ProtectionInputField; + } + set + { + if ((this.ProtectionInputField.Equals(value) != true)) + { + this.ProtectionInputField = value; + this.RaisePropertyChanged("ProtectionInput"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ProtectionInputRemark + { + get + { + return this.ProtectionInputRemarkField; + } + set + { + if ((object.ReferenceEquals(this.ProtectionInputRemarkField, value) != true)) + { + this.ProtectionInputRemarkField = value; + this.RaisePropertyChanged("ProtectionInputRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Quarters + { + get + { + return this.QuartersField; + } + set + { + if ((this.QuartersField.Equals(value) != true)) + { + this.QuartersField = value; + this.RaisePropertyChanged("Quarters"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string Remarks + { + get + { + return this.RemarksField; + } + set + { + if ((object.ReferenceEquals(this.RemarksField, value) != true)) + { + this.RemarksField = value; + this.RaisePropertyChanged("Remarks"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Revenue + { + get + { + return this.RevenueField; + } + set + { + if ((this.RevenueField.Equals(value) != true)) + { + this.RevenueField = value; + this.RaisePropertyChanged("Revenue"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string RevenueRemark + { + get + { + return this.RevenueRemarkField; + } + set + { + if ((object.ReferenceEquals(this.RevenueRemarkField, value) != true)) + { + this.RevenueRemarkField = value; + this.RaisePropertyChanged("RevenueRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string SafetyQuarterlyReportId + { + get + { + return this.SafetyQuarterlyReportIdField; + } + set + { + if ((object.ReferenceEquals(this.SafetyQuarterlyReportIdField, value) != true)) + { + this.SafetyQuarterlyReportIdField = value; + this.RaisePropertyChanged("SafetyQuarterlyReportId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SeriousInjuryAccident + { + get + { + return this.SeriousInjuryAccidentField; + } + set + { + if ((this.SeriousInjuryAccidentField.Equals(value) != true)) + { + this.SeriousInjuryAccidentField = value; + this.RaisePropertyChanged("SeriousInjuryAccident"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string SeriousInjuryAccidentRemark + { + get + { + return this.SeriousInjuryAccidentRemarkField; + } + set + { + if ((object.ReferenceEquals(this.SeriousInjuryAccidentRemarkField, value) != true)) + { + this.SeriousInjuryAccidentRemarkField = value; + this.RaisePropertyChanged("SeriousInjuryAccidentRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TechnologyProgressIn + { + get + { + return this.TechnologyProgressInField; + } + set + { + if ((this.TechnologyProgressInField.Equals(value) != true)) + { + this.TechnologyProgressInField = value; + this.RaisePropertyChanged("TechnologyProgressIn"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string TechnologyProgressInRemark + { + get + { + return this.TechnologyProgressInRemarkField; + } + set + { + if ((object.ReferenceEquals(this.TechnologyProgressInRemarkField, value) != true)) + { + this.TechnologyProgressInRemarkField = value; + this.RaisePropertyChanged("TechnologyProgressInRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ThreeKidsEduRate + { + get + { + return this.ThreeKidsEduRateField; + } + set + { + if ((this.ThreeKidsEduRateField.Equals(value) != true)) + { + this.ThreeKidsEduRateField = value; + this.RaisePropertyChanged("ThreeKidsEduRate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ThreeKidsEduRateRemark + { + get + { + return this.ThreeKidsEduRateRemarkField; + } + set + { + if ((object.ReferenceEquals(this.ThreeKidsEduRateRemarkField, value) != true)) + { + this.ThreeKidsEduRateRemarkField = value; + this.RaisePropertyChanged("ThreeKidsEduRateRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalInWorkHours + { + get + { + return this.TotalInWorkHoursField; + } + set + { + if ((this.TotalInWorkHoursField.Equals(value) != true)) + { + this.TotalInWorkHoursField = value; + this.RaisePropertyChanged("TotalInWorkHours"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string TotalInWorkHoursRemark + { + get + { + return this.TotalInWorkHoursRemarkField; + } + set + { + if ((object.ReferenceEquals(this.TotalInWorkHoursRemarkField, value) != true)) + { + this.TotalInWorkHoursRemarkField = value; + this.RaisePropertyChanged("TotalInWorkHoursRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalOutWorkHours + { + get + { + return this.TotalOutWorkHoursField; + } + set + { + if ((this.TotalOutWorkHoursField.Equals(value) != true)) + { + this.TotalOutWorkHoursField = value; + this.RaisePropertyChanged("TotalOutWorkHours"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string TotalOutWorkHoursRemark + { + get + { + return this.TotalOutWorkHoursRemarkField; + } + set + { + if ((object.ReferenceEquals(this.TotalOutWorkHoursRemarkField, value) != true)) + { + this.TotalOutWorkHoursRemarkField = value; + this.RaisePropertyChanged("TotalOutWorkHoursRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string UnitId + { + get + { + return this.UnitIdField; + } + set + { + if ((object.ReferenceEquals(this.UnitIdField, value) != true)) + { + this.UnitIdField = value; + this.RaisePropertyChanged("UnitId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable UnitTimeIncome + { + get + { + return this.UnitTimeIncomeField; + } + set + { + if ((this.UnitTimeIncomeField.Equals(value) != true)) + { + this.UnitTimeIncomeField = value; + this.RaisePropertyChanged("UnitTimeIncome"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string UnitTimeIncomeRemark + { + get + { + return this.UnitTimeIncomeRemarkField; + } + set + { + if ((object.ReferenceEquals(this.UnitTimeIncomeRemarkField, value) != true)) + { + this.UnitTimeIncomeRemarkField = value; + this.RaisePropertyChanged("UnitTimeIncomeRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable UplinReportRate + { + get + { + return this.UplinReportRateField; + } + set + { + if ((this.UplinReportRateField.Equals(value) != true)) + { + this.UplinReportRateField = value; + this.RaisePropertyChanged("UplinReportRate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string UplinReportRateRemark + { + get + { + return this.UplinReportRateRemarkField; + } + set + { + if ((object.ReferenceEquals(this.UplinReportRateRemarkField, value) != true)) + { + this.UplinReportRateRemarkField = value; + this.RaisePropertyChanged("UplinReportRateRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable WorkHoursAccuracy + { + get + { + return this.WorkHoursAccuracyField; + } + set + { + if ((this.WorkHoursAccuracyField.Equals(value) != true)) + { + this.WorkHoursAccuracyField = value; + this.RaisePropertyChanged("WorkHoursAccuracy"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string WorkHoursAccuracyRemark + { + get + { + return this.WorkHoursAccuracyRemarkField; + } + set + { + if ((object.ReferenceEquals(this.WorkHoursAccuracyRemarkField, value) != true)) + { + this.WorkHoursAccuracyRemarkField = value; + this.RaisePropertyChanged("WorkHoursAccuracyRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable WorkHoursLossRate + { + get + { + return this.WorkHoursLossRateField; + } + set + { + if ((this.WorkHoursLossRateField.Equals(value) != true)) + { + this.WorkHoursLossRateField = value; + this.RaisePropertyChanged("WorkHoursLossRate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string WorkHoursLossRateRemark + { + get + { + return this.WorkHoursLossRateRemarkField; + } + set + { + if ((object.ReferenceEquals(this.WorkHoursLossRateRemarkField, value) != true)) + { + this.WorkHoursLossRateRemarkField = value; + this.RaisePropertyChanged("WorkHoursLossRateRemark"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable YearId + { + get + { + return this.YearIdField; + } + set + { + if ((this.YearIdField.Equals(value) != true)) + { + this.YearIdField = value; + this.RaisePropertyChanged("YearId"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) + { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) + { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + public partial class Information_DrillConductedQuarterlyReport : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string CompileManField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DrillConductedQuarterlyReportIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable QuarterField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ReportDateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string UnitIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable YearIdField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData + { + get + { + return this.extensionDataField; + } + set + { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string CompileMan + { + get + { + return this.CompileManField; + } + set + { + if ((object.ReferenceEquals(this.CompileManField, value) != true)) + { + this.CompileManField = value; + this.RaisePropertyChanged("CompileMan"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string DrillConductedQuarterlyReportId + { + get + { + return this.DrillConductedQuarterlyReportIdField; + } + set + { + if ((object.ReferenceEquals(this.DrillConductedQuarterlyReportIdField, value) != true)) + { + this.DrillConductedQuarterlyReportIdField = value; + this.RaisePropertyChanged("DrillConductedQuarterlyReportId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable Quarter + { + get + { + return this.QuarterField; + } + set + { + if ((this.QuarterField.Equals(value) != true)) + { + this.QuarterField = value; + this.RaisePropertyChanged("Quarter"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ReportDate + { + get + { + return this.ReportDateField; + } + set + { + if ((this.ReportDateField.Equals(value) != true)) + { + this.ReportDateField = value; + this.RaisePropertyChanged("ReportDate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string UnitId + { + get + { + return this.UnitIdField; + } + set + { + if ((object.ReferenceEquals(this.UnitIdField, value) != true)) + { + this.UnitIdField = value; + this.RaisePropertyChanged("UnitId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable YearId + { + get + { + return this.YearIdField; + } + set + { + if ((this.YearIdField.Equals(value) != true)) + { + this.YearIdField = value; + this.RaisePropertyChanged("YearId"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) + { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) + { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + public partial class Information_DrillConductedQuarterlyReportItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable BasicConductCountField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable BasicInvestmentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable BasicPeopleCountField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable CPDesktopField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable CPSceneField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable ComprehensivePracticeField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DrillConductedQuarterlyReportIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DrillConductedQuarterlyReportItemIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable HQConductCountField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable HQInvestmentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable HQPeopleCountField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string IndustryTypeField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SDDesktopField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SDSceneField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SortIndexField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SpecialDrillField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalConductCountField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalInvestmentField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable TotalPeopleCountField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData + { + get + { + return this.extensionDataField; + } + set + { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable BasicConductCount + { + get + { + return this.BasicConductCountField; + } + set + { + if ((this.BasicConductCountField.Equals(value) != true)) + { + this.BasicConductCountField = value; + this.RaisePropertyChanged("BasicConductCount"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable BasicInvestment + { + get + { + return this.BasicInvestmentField; + } + set + { + if ((this.BasicInvestmentField.Equals(value) != true)) + { + this.BasicInvestmentField = value; + this.RaisePropertyChanged("BasicInvestment"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable BasicPeopleCount + { + get + { + return this.BasicPeopleCountField; + } + set + { + if ((this.BasicPeopleCountField.Equals(value) != true)) + { + this.BasicPeopleCountField = value; + this.RaisePropertyChanged("BasicPeopleCount"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable CPDesktop + { + get + { + return this.CPDesktopField; + } + set + { + if ((this.CPDesktopField.Equals(value) != true)) + { + this.CPDesktopField = value; + this.RaisePropertyChanged("CPDesktop"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable CPScene + { + get + { + return this.CPSceneField; + } + set + { + if ((this.CPSceneField.Equals(value) != true)) + { + this.CPSceneField = value; + this.RaisePropertyChanged("CPScene"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable ComprehensivePractice + { + get + { + return this.ComprehensivePracticeField; + } + set + { + if ((this.ComprehensivePracticeField.Equals(value) != true)) + { + this.ComprehensivePracticeField = value; + this.RaisePropertyChanged("ComprehensivePractice"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string DrillConductedQuarterlyReportId + { + get + { + return this.DrillConductedQuarterlyReportIdField; + } + set + { + if ((object.ReferenceEquals(this.DrillConductedQuarterlyReportIdField, value) != true)) + { + this.DrillConductedQuarterlyReportIdField = value; + this.RaisePropertyChanged("DrillConductedQuarterlyReportId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string DrillConductedQuarterlyReportItemId + { + get + { + return this.DrillConductedQuarterlyReportItemIdField; + } + set + { + if ((object.ReferenceEquals(this.DrillConductedQuarterlyReportItemIdField, value) != true)) + { + this.DrillConductedQuarterlyReportItemIdField = value; + this.RaisePropertyChanged("DrillConductedQuarterlyReportItemId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable HQConductCount + { + get + { + return this.HQConductCountField; + } + set + { + if ((this.HQConductCountField.Equals(value) != true)) + { + this.HQConductCountField = value; + this.RaisePropertyChanged("HQConductCount"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable HQInvestment + { + get + { + return this.HQInvestmentField; + } + set + { + if ((this.HQInvestmentField.Equals(value) != true)) + { + this.HQInvestmentField = value; + this.RaisePropertyChanged("HQInvestment"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable HQPeopleCount + { + get + { + return this.HQPeopleCountField; + } + set + { + if ((this.HQPeopleCountField.Equals(value) != true)) + { + this.HQPeopleCountField = value; + this.RaisePropertyChanged("HQPeopleCount"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string IndustryType + { + get + { + return this.IndustryTypeField; + } + set + { + if ((object.ReferenceEquals(this.IndustryTypeField, value) != true)) + { + this.IndustryTypeField = value; + this.RaisePropertyChanged("IndustryType"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SDDesktop + { + get + { + return this.SDDesktopField; + } + set + { + if ((this.SDDesktopField.Equals(value) != true)) + { + this.SDDesktopField = value; + this.RaisePropertyChanged("SDDesktop"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SDScene + { + get + { + return this.SDSceneField; + } + set + { + if ((this.SDSceneField.Equals(value) != true)) + { + this.SDSceneField = value; + this.RaisePropertyChanged("SDScene"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SortIndex + { + get + { + return this.SortIndexField; + } + set + { + if ((this.SortIndexField.Equals(value) != true)) + { + this.SortIndexField = value; + this.RaisePropertyChanged("SortIndex"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SpecialDrill + { + get + { + return this.SpecialDrillField; + } + set + { + if ((this.SpecialDrillField.Equals(value) != true)) + { + this.SpecialDrillField = value; + this.RaisePropertyChanged("SpecialDrill"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalConductCount + { + get + { + return this.TotalConductCountField; + } + set + { + if ((this.TotalConductCountField.Equals(value) != true)) + { + this.TotalConductCountField = value; + this.RaisePropertyChanged("TotalConductCount"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalInvestment + { + get + { + return this.TotalInvestmentField; + } + set + { + if ((this.TotalInvestmentField.Equals(value) != true)) + { + this.TotalInvestmentField = value; + this.RaisePropertyChanged("TotalInvestment"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable TotalPeopleCount + { + get + { + return this.TotalPeopleCountField; + } + set + { + if ((this.TotalPeopleCountField.Equals(value) != true)) + { + this.TotalPeopleCountField = value; + this.RaisePropertyChanged("TotalPeopleCount"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) + { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) + { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + public partial class Information_DrillPlanHalfYearReport : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable CompileDateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string CompileManField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DrillPlanHalfYearReportIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable HalfYearIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string TelephoneField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string UnitIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable YearIdField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData + { + get + { + return this.extensionDataField; + } + set + { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable CompileDate + { + get + { + return this.CompileDateField; + } + set + { + if ((this.CompileDateField.Equals(value) != true)) + { + this.CompileDateField = value; + this.RaisePropertyChanged("CompileDate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string CompileMan + { + get + { + return this.CompileManField; + } + set + { + if ((object.ReferenceEquals(this.CompileManField, value) != true)) + { + this.CompileManField = value; + this.RaisePropertyChanged("CompileMan"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string DrillPlanHalfYearReportId + { + get + { + return this.DrillPlanHalfYearReportIdField; + } + set + { + if ((object.ReferenceEquals(this.DrillPlanHalfYearReportIdField, value) != true)) + { + this.DrillPlanHalfYearReportIdField = value; + this.RaisePropertyChanged("DrillPlanHalfYearReportId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable HalfYearId + { + get + { + return this.HalfYearIdField; + } + set + { + if ((this.HalfYearIdField.Equals(value) != true)) + { + this.HalfYearIdField = value; + this.RaisePropertyChanged("HalfYearId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string Telephone + { + get + { + return this.TelephoneField; + } + set + { + if ((object.ReferenceEquals(this.TelephoneField, value) != true)) + { + this.TelephoneField = value; + this.RaisePropertyChanged("Telephone"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string UnitId + { + get + { + return this.UnitIdField; + } + set + { + if ((object.ReferenceEquals(this.UnitIdField, value) != true)) + { + this.UnitIdField = value; + this.RaisePropertyChanged("UnitId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable YearId + { + get + { + return this.YearIdField; + } + set + { + if ((this.YearIdField.Equals(value) != true)) + { + this.YearIdField = value; + this.RaisePropertyChanged("YearId"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) + { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) + { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + public partial class Information_DrillPlanHalfYearReportItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged + { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string AccidentSceneField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DrillPlanDateField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DrillPlanHalfYearReportIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DrillPlanHalfYearReportItemIdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DrillPlanNameField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string ExerciseWayField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string OrganizationUnitField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private System.Nullable SortIndexField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData + { + get + { + return this.extensionDataField; + } + set + { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string AccidentScene + { + get + { + return this.AccidentSceneField; + } + set + { + if ((object.ReferenceEquals(this.AccidentSceneField, value) != true)) + { + this.AccidentSceneField = value; + this.RaisePropertyChanged("AccidentScene"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string DrillPlanDate + { + get + { + return this.DrillPlanDateField; + } + set + { + if ((object.ReferenceEquals(this.DrillPlanDateField, value) != true)) + { + this.DrillPlanDateField = value; + this.RaisePropertyChanged("DrillPlanDate"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string DrillPlanHalfYearReportId + { + get + { + return this.DrillPlanHalfYearReportIdField; + } + set + { + if ((object.ReferenceEquals(this.DrillPlanHalfYearReportIdField, value) != true)) + { + this.DrillPlanHalfYearReportIdField = value; + this.RaisePropertyChanged("DrillPlanHalfYearReportId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string DrillPlanHalfYearReportItemId + { + get + { + return this.DrillPlanHalfYearReportItemIdField; + } + set + { + if ((object.ReferenceEquals(this.DrillPlanHalfYearReportItemIdField, value) != true)) + { + this.DrillPlanHalfYearReportItemIdField = value; + this.RaisePropertyChanged("DrillPlanHalfYearReportItemId"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string DrillPlanName + { + get + { + return this.DrillPlanNameField; + } + set + { + if ((object.ReferenceEquals(this.DrillPlanNameField, value) != true)) + { + this.DrillPlanNameField = value; + this.RaisePropertyChanged("DrillPlanName"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string ExerciseWay + { + get + { + return this.ExerciseWayField; + } + set + { + if ((object.ReferenceEquals(this.ExerciseWayField, value) != true)) + { + this.ExerciseWayField = value; + this.RaisePropertyChanged("ExerciseWay"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string OrganizationUnit + { + get + { + return this.OrganizationUnitField; + } + set + { + if ((object.ReferenceEquals(this.OrganizationUnitField, value) != true)) + { + this.OrganizationUnitField = value; + this.RaisePropertyChanged("OrganizationUnit"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Nullable SortIndex + { + get + { + return this.SortIndexField; + } + set + { + if ((this.SortIndexField.Equals(value) != true)) + { + this.SortIndexField = value; + this.RaisePropertyChanged("SortIndex"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) + { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) + { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } } + } diff --git a/SGGL/BLL/ZHGL/Environmental/ArchitectureReportItemService.cs b/SGGL/BLL/ZHGL/Environmental/ArchitectureReportItemService.cs new file mode 100644 index 00000000..39c5b065 --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ArchitectureReportItemService.cs @@ -0,0 +1,307 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.UI.WebControls; + +namespace BLL +{ + public static class ArchitectureReportItemService + { + /// + /// 建筑行业能源节约与生态环境保护汇总明细表 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 建筑行业能源节约与生态环境保护汇总明细表 + public static Model.Environmental_ArchitectureReportItem GetArchitectureReportItemByArchitectureReportItemId(string ArchitectureReportItemId) + { + return Funs.DB.Environmental_ArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportItemId == ArchitectureReportItemId); + } + + /// + /// 建筑行业能源节约与生态环境保护汇总明细表 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 建筑行业能源节约与生态环境保护汇总明细表 + public static Model.Environmental_ArchitectureReportItem GetArchitectureReportItemByArchitectureReportIdAndTypeId(string ArchitectureReportId) + { + return Funs.DB.Environmental_ArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId); + } + + /// + /// 根据主表Id判断是否存在明细记录 + /// + /// 企业安全数据统计月报表Id + /// 是否存在明细记录 + public static bool IsExitItems(string ArchitectureReportId) + { + return (from x in Funs.DB.Environmental_ArchitectureReportItem where x.ArchitectureReportId == ArchitectureReportId select x).Count() > 0; + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetItems(string ArchitectureReportId) + { + return (from x in Funs.DB.Environmental_ArchitectureReportItem + where x.ArchitectureReportId == ArchitectureReportId + orderby x.SortIndex + select x).ToList(); + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetYearSumItems(string unitId, int? year, int? Quarters) + { + return (from x in Funs.DB.Environmental_ArchitectureReportItem + join y in Funs.DB.Environmental_ArchitectureReport + on x.ArchitectureReportId equals y.ArchitectureReportId + where y.UnitId == unitId && y.Year == year && y.Quarters == Quarters + orderby x.SortIndex + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取年度明细记录集合 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 年度明细记录集合 + public static List GetLastYearItems(int year) + { + return (from x in Funs.DB.Environmental_ArchitectureReportItem + join y in Funs.DB.Environmental_ArchitectureReport + on x.ArchitectureReportId equals y.ArchitectureReportId + where y.Year == year + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取明细记录集合(不包含本月合计行) + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetShowItems(string ArchitectureReportId) + { + var q = (from x in Funs.DB.Environmental_ArchitectureReportItem + where x.ArchitectureReportId == ArchitectureReportId + orderby x.SortIndex + select x).ToList(); + List newItems = new List(); + var indexNames = GetIndexNames(); + var units = GetUnits(); + foreach (var item in q) + { + Model.ArchitectureReportItem newItem = new Model.ArchitectureReportItem(); + newItem.ArchitectureReportItemId = item.ArchitectureReportItemId; + newItem.IndexName = indexNames.First(x => x.Value == item.SortIndex).Text; + newItem.Unit = units.First(x => x.Value == item.SortIndex).Text; + newItem.SortIndex = item.SortIndex; + newItem.BaseNumber = item.BaseNumber; + newItem.LastYearValue = item.LastYearValue; + newItem.ThisYearValue = item.ThisYearValue; + newItem.Rate = item.Rate; + newItems.Add(newItem); + } + return newItems; + } + + /// + /// 增加建筑行业能源节约与生态环境保护汇总明细表 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表实体 + public static void AddArchitectureReportItem(Model.Environmental_ArchitectureReportItem ArchitectureReportItem) + { + Model.Environmental_ArchitectureReportItem newArchitectureReportItem = new Model.Environmental_ArchitectureReportItem + { + ArchitectureReportItemId = ArchitectureReportItem.ArchitectureReportItemId, + ArchitectureReportId = ArchitectureReportItem.ArchitectureReportId, + BaseNumber = ArchitectureReportItem.BaseNumber, + SortIndex = ArchitectureReportItem.SortIndex, + LastYearValue = ArchitectureReportItem.LastYearValue, + ThisYearValue = ArchitectureReportItem.ThisYearValue, + Rate = ArchitectureReportItem.Rate, + }; + + Funs.DB.Environmental_ArchitectureReportItem.InsertOnSubmit(newArchitectureReportItem); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改建筑行业能源节约与生态环境保护汇总明细表 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表实体 + public static void UpdateArchitectureReportItem(Model.Environmental_ArchitectureReportItem ArchitectureReportItem) + { + Model.Environmental_ArchitectureReportItem newArchitectureReportItem = Funs.DB.Environmental_ArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportItemId == ArchitectureReportItem.ArchitectureReportItemId); + newArchitectureReportItem.SortIndex = ArchitectureReportItem.SortIndex; + newArchitectureReportItem.BaseNumber = ArchitectureReportItem.BaseNumber; + newArchitectureReportItem.LastYearValue = ArchitectureReportItem.LastYearValue; + newArchitectureReportItem.ThisYearValue = ArchitectureReportItem.ThisYearValue; + newArchitectureReportItem.Rate = ArchitectureReportItem.Rate; + + Funs.DB.SubmitChanges(); + } + + /// + /// 根据Id删除所有数据 + /// + /// + public static void DeleteArchitectureReportItemByArchitectureReportId(string ArchitectureReportId) + { + var q = from x in Funs.DB.Environmental_ArchitectureReportItem where x.ArchitectureReportId == ArchitectureReportId select x; + if (q != null) + { + Funs.DB.Environmental_ArchitectureReportItem.DeleteAllOnSubmit(q); + Funs.DB.SubmitChanges(); + } + } + + /// + /// 获取指标名称集合 + /// + /// + public static ListItem[] GetIndexNames() + { + ListItem[] list = new ListItem[61]; + list[0] = new ListItem("1.能源消费量", "01"); + list[1] = new ListItem("A其中:原煤(标准量)", "02"); + list[2] = new ListItem("B原煤(实物量)", "03"); + list[3] = new ListItem("C其中:发电用煤", "04"); + list[4] = new ListItem("B焦炭", "05"); + list[5] = new ListItem("B电力", "06"); + list[6] = new ListItem("B原油", "07"); + list[7] = new ListItem("B汽油", "08"); + list[8] = new ListItem("B煤油", "09"); + list[9] = new ListItem("B柴油", "10"); + list[10] = new ListItem("B燃料油", "11"); + list[11] = new ListItem("B天然气", "12"); + list[12] = new ListItem("B热力", "13"); + list[13] = new ListItem("B其他能源", "14"); + list[14] = new ListItem("2.万元营业收入综合能耗(现价)", "15"); + list[15] = new ListItem("A其中:营业收入(现价)", "16"); + list[16] = new ListItem("E万元营业收入综合能耗(可比价)", "17"); + list[17] = new ListItem("A其中:营业收入(可比价)", "18"); + list[18] = new ListItem("3.万元增加值综合能耗(现价)", "19"); + list[19] = new ListItem("A其中:增加值(现价)", "20"); + list[20] = new ListItem("E万元增加值综合能耗(可比价)", "21"); + list[21] = new ListItem("A其中:增加值(可比价)", "22"); + list[22] = new ListItem("4.万元营业收入用新水量(可比价)", "23"); + list[23] = new ListItem("A其中:用新水量", "24"); + list[24] = new ListItem("5.节能量", "25"); + list[25] = new ListItem("6.二氧化硫排放量", "26"); + list[26] = new ListItem("7.氮氧化物排放量", "27"); + list[27] = new ListItem("8.化学需氧量排放量", "28"); + list[28] = new ListItem("A其中:排入外环境", "29"); + list[29] = new ListItem("B排入市政管网或生活污水处理厂", "30"); + list[30] = new ListItem("9.氨氮排放量", "31"); + list[31] = new ListItem("A其中:排入外环境", "32"); + list[32] = new ListItem("B排入市政管网或生活污水处理厂", "33"); + list[33] = new ListItem("10.烟(粉)尘排放量", "34"); + list[34] = new ListItem("11.挥发性有机物排放量", "35"); + list[35] = new ListItem("12.废水排放量", "36"); + list[36] = new ListItem("13.万元收入二氧化碳排放(可比价)", "37"); + list[37] = new ListItem("A其中:二氧化碳排放量", "38"); + list[38] = new ListItem("14.一般固体废物综合利用率", "39"); + list[39] = new ListItem("A其中:一般固体废物综合利用量", "40"); + list[40] = new ListItem("B其中:综合利用往年贮存量", "41"); + list[41] = new ListItem("F一般固体废物产生量", "42"); + list[42] = new ListItem("15.危险废物处置率", "43"); + list[43] = new ListItem("A其中:危险废物处置量", "44"); + list[44] = new ListItem("B其中:处置往年贮存量", "45"); + list[45] = new ListItem("F危险废物产生量", "46"); + list[46] = new ListItem("16.土壤污染治理率", "47"); + list[47] = new ListItem("A其中:土壤污染治理面积", "48"); + list[48] = new ListItem("B土壤污染需要治理面积", "49"); + list[49] = new ListItem("17.矿山(或生态)修复治理率", "50"); + list[50] = new ListItem("A其中:矿山(或生态)修复治理面积", "51"); + list[51] = new ListItem("B矿山(或生态)需要修复治理面积", "52"); + list[52] = new ListItem("18.废气治理设施数", "53"); + list[53] = new ListItem("19.废气治理设施处理能力", "54"); + list[54] = new ListItem("20.废水治理设施数", "55"); + list[55] = new ListItem("21.废水治理设施处理能力", "56"); + list[56] = new ListItem("22.生态环境污染源", "57"); + list[57] = new ListItem("23.生态环境风险点", "58"); + list[58] = new ListItem("24.节能环保投入占收入比重", "59"); + list[59] = new ListItem("A其中:节能投入", "60"); + list[60] = new ListItem("B环保投入", "61"); + return list; + } + + /// + /// 获取计量单位集合 + /// + /// + public static ListItem[] GetUnits() + { + ListItem[] list = new ListItem[61]; + list[0] = new ListItem("万吨标准煤", "01"); + list[1] = new ListItem("万吨标准煤", "02"); + list[2] = new ListItem("万吨", "03"); + list[3] = new ListItem("万吨", "04"); + list[4] = new ListItem("吨", "05"); + list[5] = new ListItem("万千瓦时", "06"); + list[6] = new ListItem("吨", "07"); + list[7] = new ListItem("吨", "08"); + list[8] = new ListItem("吨", "09"); + list[9] = new ListItem("吨", "10"); + list[10] = new ListItem("吨", "11"); + list[11] = new ListItem("万立方米", "12"); + list[12] = new ListItem("百万千焦", "13"); + list[13] = new ListItem("吨标准煤", "14"); + list[14] = new ListItem("吨标准煤/万元", "15"); + list[15] = new ListItem("万元", "16"); + list[16] = new ListItem("吨标准煤/万元", "17"); + list[17] = new ListItem("万元", "18"); + list[18] = new ListItem("吨标准煤/万元", "19"); + list[19] = new ListItem("万元", "20"); + list[20] = new ListItem("吨标准煤/万元", "21"); + list[21] = new ListItem("万元", "22"); + list[22] = new ListItem("吨/万元", "23"); + list[23] = new ListItem("万吨", "24"); + list[24] = new ListItem("吨标准煤", "25"); + list[25] = new ListItem("吨", "26"); + list[26] = new ListItem("吨", "27"); + list[27] = new ListItem("吨", "28"); + list[28] = new ListItem("吨", "29"); + list[29] = new ListItem("吨", "30"); + list[30] = new ListItem("吨", "31"); + list[31] = new ListItem("吨", "32"); + list[32] = new ListItem("吨", "33"); + list[33] = new ListItem("吨", "34"); + list[34] = new ListItem("吨", "35"); + list[35] = new ListItem("万吨", "36"); + list[36] = new ListItem("吨二氧化碳当量/万元", "37"); + list[37] = new ListItem("万吨二氧化碳当量", "38"); + list[38] = new ListItem("%", "39"); + list[39] = new ListItem("万吨", "40"); + list[40] = new ListItem("万吨", "41"); + list[41] = new ListItem("万吨", "42"); + list[42] = new ListItem("%", "43"); + list[43] = new ListItem("万吨", "44"); + list[44] = new ListItem("万吨", "45"); + list[45] = new ListItem("万吨", "46"); + list[46] = new ListItem("%", "47"); + list[47] = new ListItem("公顷", "48"); + list[48] = new ListItem("公顷", "49"); + list[49] = new ListItem("%", "50"); + list[50] = new ListItem("公顷", "51"); + list[51] = new ListItem("公顷", "52"); + list[52] = new ListItem("套", "53"); + list[53] = new ListItem("万立方米/年", "54"); + list[54] = new ListItem("套", "55"); + list[55] = new ListItem("万吨/年", "56"); + list[56] = new ListItem("个", "57"); + list[57] = new ListItem("个", "58"); + list[58] = new ListItem("%", "59"); + list[59] = new ListItem("万元", "60"); + list[60] = new ListItem("万元", "61"); + return list; + } + } +} diff --git a/SGGL/BLL/ZHGL/Environmental/ArchitectureReportService.cs b/SGGL/BLL/ZHGL/Environmental/ArchitectureReportService.cs new file mode 100644 index 00000000..1291c72b --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ArchitectureReportService.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public static class ArchitectureReportService + { + /// + /// 建筑行业能源节约与生态环境保护汇总表 + /// + /// 建筑行业能源节约与生态环境保护汇总表Id + /// 建筑行业能源节约与生态环境保护汇总表 + public static Model.Environmental_ArchitectureReport GetArchitectureReportByArchitectureReportId(string ArchitectureReportId) + { + return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId); + } + + /// + /// 建筑行业能源节约与生态环境保护汇总表 + /// + /// 单位Id + /// 年度 + /// 月份 + /// 建筑行业能源节约与生态环境保护汇总表 + public static Model.Environmental_ArchitectureReport GetArchitectureReportByUnitIdAndYearAndQuarters(string unitId, int year, int Quarters) + { + return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == unitId && e.Quarters == Quarters && e.Year == year); + } + + /// + /// 根据单位Id获取建筑行业能源节约与生态环境保护汇总表集合 + /// + /// 单位Id + /// 建筑行业能源节约与生态环境保护汇总表集合 + public static List GetArchitectureReportsByUnitId(string UnitId) + { + return (from x in Funs.DB.View_Environmental_ArchitectureReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList(); + } + + /// + /// 增加建筑行业能源节约与生态环境保护汇总表 + /// + /// 建筑行业能源节约与生态环境保护汇总表实体 + public static void AddArchitectureReport(Model.Environmental_ArchitectureReport ArchitectureReport) + { + Model.Environmental_ArchitectureReport newArchitectureReport = new Model.Environmental_ArchitectureReport + { + ArchitectureReportId = ArchitectureReport.ArchitectureReportId, + Year = ArchitectureReport.Year, + Quarters = ArchitectureReport.Quarters, + UnitId = ArchitectureReport.UnitId, + FillingDate = ArchitectureReport.FillingDate, + DutyPerson = ArchitectureReport.DutyPerson, + FillingMan = ArchitectureReport.FillingMan, + UpState = ArchitectureReport.UpState, + }; + + Funs.DB.Environmental_ArchitectureReport.InsertOnSubmit(newArchitectureReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改建筑行业能源节约与生态环境保护汇总表 + /// + /// 建筑行业能源节约与生态环境保护汇总表实体 + public static void UpdateArchitectureReport(Model.Environmental_ArchitectureReport ArchitectureReport) + { + Model.Environmental_ArchitectureReport newArchitectureReport = Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReport.ArchitectureReportId); + if (newArchitectureReport != null) + { + newArchitectureReport.Year = ArchitectureReport.Year; + newArchitectureReport.Quarters = ArchitectureReport.Quarters; + newArchitectureReport.UnitId = ArchitectureReport.UnitId; + newArchitectureReport.FillingDate = ArchitectureReport.FillingDate; + newArchitectureReport.DutyPerson = ArchitectureReport.DutyPerson; + newArchitectureReport.UpState = ArchitectureReport.UpState; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据Id获取数据 + /// + /// + public static void DeleteArchitectureReportByArchitectureReportId(string ArchitectureReportId) + { + Model.Environmental_ArchitectureReport newArchitectureReport = Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId); + if (newArchitectureReport != null) + { + Funs.DB.Environmental_ArchitectureReport.DeleteOnSubmit(newArchitectureReport); + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据报表单位,报表时间判断是否存在 + /// + /// Id + /// + public static Model.Environmental_ArchitectureReport GetArchitectureReportByUnitIdDate(string unitId, int year, int Quarters) + { + return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Quarters == Quarters); + } + + /// + /// 根据报表单位,报表年份获取对应集合 + /// + /// Id + /// + public static List GetArchitectureReportByUnitIdYear(string unitId, int year) + { + return (from x in Funs.DB.Environmental_ArchitectureReport where x.UnitId == unitId && x.Year == year select x).ToList(); + } + } +} diff --git a/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs b/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs new file mode 100644 index 00000000..3bca7f98 --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ChemicalReportItemService.cs @@ -0,0 +1,383 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.UI.WebControls; + +namespace BLL +{ + public static class ChemicalReportItemService + { + /// + /// 化工行业能源节约与生态环境保护汇总明细表 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 化工行业能源节约与生态环境保护汇总明细表 + public static Model.Environmental_ChemicalReportItem GetChemicalReportItemByChemicalReportItemId(string ChemicalReportItemId) + { + return Funs.DB.Environmental_ChemicalReportItem.FirstOrDefault(e => e.ChemicalReportItemId == ChemicalReportItemId); + } + + /// + /// 化工行业能源节约与生态环境保护汇总明细表 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 化工行业能源节约与生态环境保护汇总明细表 + public static Model.Environmental_ChemicalReportItem GetChemicalReportItemByChemicalReportIdAndTypeId(string ChemicalReportId) + { + return Funs.DB.Environmental_ChemicalReportItem.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId); + } + + /// + /// 根据主表Id判断是否存在明细记录 + /// + /// 企业安全数据统计月报表Id + /// 是否存在明细记录 + public static bool IsExitItems(string ChemicalReportId) + { + return (from x in Funs.DB.Environmental_ChemicalReportItem where x.ChemicalReportId == ChemicalReportId select x).Count() > 0; + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetItems(string ChemicalReportId) + { + return (from x in Funs.DB.Environmental_ChemicalReportItem + where x.ChemicalReportId == ChemicalReportId + orderby x.SortIndex + select x).ToList(); + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetYearSumItems(string unitId, int? year, int? month) + { + return (from x in Funs.DB.Environmental_ChemicalReportItem + join y in Funs.DB.Environmental_ChemicalReport + on x.ChemicalReportId equals y.ChemicalReportId + where y.UnitId == unitId && y.Year == year && y.Month == month + orderby x.SortIndex + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取年度明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 年度明细记录集合 + public static List GetLastYearItems(int year) + { + return (from x in Funs.DB.Environmental_ChemicalReportItem + join y in Funs.DB.Environmental_ChemicalReport + on x.ChemicalReportId equals y.ChemicalReportId + where y.Year == year + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取明细记录集合(不包含本月合计行) + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetShowItems(string ChemicalReportId) + { + var q = (from x in Funs.DB.Environmental_ChemicalReportItem + where x.ChemicalReportId == ChemicalReportId + orderby x.SortIndex + select x).ToList(); + List newItems = new List(); + var indexNames = GetIndexNames(); + var units = GetUnits(); + foreach (var item in q) + { + Model.ChemicalReportItem newItem = new Model.ChemicalReportItem(); + newItem.ChemicalReportItemId = item.ChemicalReportItemId; + newItem.IndexName = indexNames.First(x => x.Value == item.SortIndex).Text; + newItem.Unit = units.First(x => x.Value == item.SortIndex).Text; + newItem.SortIndex = item.SortIndex; + newItem.BaseNumber = item.BaseNumber; + newItem.LastYearValue = item.LastYearValue; + newItem.ThisYearValue = item.ThisYearValue; + newItem.Rate = item.Rate; + newItems.Add(newItem); + } + return newItems; + } + + /// + /// 增加化工行业能源节约与生态环境保护汇总明细表 + /// + /// 化工行业能源节约与生态环境保护汇总明细表实体 + public static void AddChemicalReportItem(Model.Environmental_ChemicalReportItem ChemicalReportItem) + { + Model.Environmental_ChemicalReportItem newChemicalReportItem = new Model.Environmental_ChemicalReportItem + { + ChemicalReportItemId = ChemicalReportItem.ChemicalReportItemId, + ChemicalReportId = ChemicalReportItem.ChemicalReportId, + SortIndex = ChemicalReportItem.SortIndex, + BaseNumber = ChemicalReportItem.BaseNumber, + LastYearValue = ChemicalReportItem.LastYearValue, + ThisYearValue = ChemicalReportItem.ThisYearValue, + Rate = ChemicalReportItem.Rate, + }; + + Funs.DB.Environmental_ChemicalReportItem.InsertOnSubmit(newChemicalReportItem); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改化工行业能源节约与生态环境保护汇总明细表 + /// + /// 化工行业能源节约与生态环境保护汇总明细表实体 + public static void UpdateChemicalReportItem(Model.Environmental_ChemicalReportItem ChemicalReportItem) + { + Model.Environmental_ChemicalReportItem newChemicalReportItem = Funs.DB.Environmental_ChemicalReportItem.FirstOrDefault(e => e.ChemicalReportItemId == ChemicalReportItem.ChemicalReportItemId); + newChemicalReportItem.SortIndex = ChemicalReportItem.SortIndex; + newChemicalReportItem.BaseNumber = ChemicalReportItem.BaseNumber; + newChemicalReportItem.LastYearValue = ChemicalReportItem.LastYearValue; + newChemicalReportItem.ThisYearValue = ChemicalReportItem.ThisYearValue; + newChemicalReportItem.Rate = ChemicalReportItem.Rate; + + Funs.DB.SubmitChanges(); + } + + /// + /// 根据Id删除所有数据 + /// + /// + public static void DeleteChemicalReportItemByChemicalReportId(string ChemicalReportId) + { + var q = from x in Funs.DB.Environmental_ChemicalReportItem where x.ChemicalReportId == ChemicalReportId select x; + if (q != null) + { + Funs.DB.Environmental_ChemicalReportItem.DeleteAllOnSubmit(q); + Funs.DB.SubmitChanges(); + } + } + + /// + /// 获取指标名称集合 + /// + /// + public static ListItem[] GetIndexNames() + { + ListItem[] list = new ListItem[99]; + list[0] = new ListItem("1.能源消费量", "01"); + list[1] = new ListItem("A含:综合能源消费量", "02"); + list[2] = new ListItem("A其中:原煤(标准量)", "03"); + list[3] = new ListItem("B原煤(实物量)", "04"); + list[4] = new ListItem("C其中:发电用煤", "05"); + list[5] = new ListItem("B焦炭", "06"); + list[6] = new ListItem("B电力", "07"); + list[7] = new ListItem("B原油", "08"); + list[8] = new ListItem("B汽油", "09"); + list[9] = new ListItem("B煤油", "10"); + list[10] = new ListItem("B柴油", "11"); + list[11] = new ListItem("B燃料油", "12"); + list[12] = new ListItem("B天然气", "13"); + list[13] = new ListItem("B热力", "14"); + list[14] = new ListItem("B其他能源", "15"); + list[15] = new ListItem("2.万元产值综合能耗(现价)", "16"); + list[16] = new ListItem("A其中:工业总产值(现价)", "17"); + list[17] = new ListItem("E万元产值综合能耗(可比价)", "18"); + list[18] = new ListItem("A其中:工业总产值(可比价)", "19"); + list[19] = new ListItem("3.万元增加值综合能耗(现价)", "20"); + list[20] = new ListItem("A其中:增加值(现价)", "21"); + list[21] = new ListItem("E万元增加值综合能耗(可比价)", "22"); + list[22] = new ListItem("A其中:增加值(可比价)", "23"); + list[23] = new ListItem("4.万元产值用新水量(可比价)", "24"); + list[24] = new ListItem("A其中:用新水量", "25"); + list[25] = new ListItem("E重复用水率", "26"); + list[26] = new ListItem("A其中:重复用水量", "27"); + list[27] = new ListItem("5.单位乙烯能耗", "28"); + list[28] = new ListItem("A其中:乙烯装置能耗", "29"); + list[29] = new ListItem("B乙烯装置合格乙烯产品产量", "30"); + list[30] = new ListItem("6.合成氨单位产品综合能耗", "31"); + list[31] = new ListItem("A其中:合成氨综合能耗", "32"); + list[32] = new ListItem("B合成氨产量", "33"); + list[33] = new ListItem("7.节能量", "34"); + list[34] = new ListItem("8.电煤占煤炭消费比重", "35"); + list[35] = new ListItem("9.余热余能回收利用率", "36"); + list[36] = new ListItem("A其中:回收利用的余热余能", "37"); + list[37] = new ListItem("10.自备电厂发电装机容量", "38"); + list[38] = new ListItem("A其中:燃煤发电", "39"); + list[39] = new ListItem("C其中:燃煤热电", "40"); + list[40] = new ListItem("B清洁能源发电", "41"); + list[41] = new ListItem("C其中:天然气发电", "42"); + list[42] = new ListItem("D核能发电", "43"); + list[43] = new ListItem("D水力发电", "44"); + list[44] = new ListItem("D风力发电", "45"); + list[45] = new ListItem("D太阳能发电", "46"); + list[46] = new ListItem("D其他清洁能源发电", "47"); + list[47] = new ListItem("B生物质发电", "48"); + list[48] = new ListItem("B其他发电", "49"); + list[49] = new ListItem("11.燃煤热电机组装机容量占燃煤发电装机容量比重", "50"); + list[50] = new ListItem("12.自备电厂发电量", "51"); + list[51] = new ListItem("13.排污许可证许可的二氧化硫排放量", "52"); + list[52] = new ListItem("14.排污许可证许可的氮氧化物排放量", "53"); + list[53] = new ListItem("15.排污许可证许可的化学需氧量排放量", "54"); + list[54] = new ListItem("16.排污许可证许可的氨氮排放量", "55"); + list[55] = new ListItem("17.排污许可证许可的烟(粉)尘排放量", "56"); + list[56] = new ListItem("18.排污许可证许可的挥发性有机物排放量", "57"); + list[57] = new ListItem("19.二氧化硫排放量", "58"); + list[58] = new ListItem("20.氮氧化物排放量", "59"); + list[59] = new ListItem("21.化学需氧量排放量", "60"); + list[60] = new ListItem("A其中:排入外环境", "61"); + list[61] = new ListItem("B排入市政管网或生活污水处理厂", "62"); + list[62] = new ListItem("22.氨氮排放量", "63"); + list[63] = new ListItem("A其中:排入外环境", "64"); + list[64] = new ListItem("B排入市政管网或生活污水处理厂", "65"); + list[65] = new ListItem("23.烟(粉)尘排放量", "66"); + list[66] = new ListItem("24.挥发性有机物排放量", "67"); + list[67] = new ListItem("25.废水排放量", "68"); + list[68] = new ListItem("26.万元产值二氧化碳排放(可比价)", "69"); + list[69] = new ListItem("A其中:二氧化碳排放量", "70"); + list[70] = new ListItem("27.一般固体废物综合利用率", "71"); + list[71] = new ListItem("A其中:一般固体废物综合利用量", "72"); + list[72] = new ListItem("C其中:综合利用往年贮存量", "73"); + list[73] = new ListItem("F一般固体废物产生量", "74"); + list[74] = new ListItem("28.危险废物处置率", "75"); + list[75] = new ListItem("A其中:危险废物处置量", "76"); + list[76] = new ListItem("C其中:处置往年贮存量", "77"); + list[77] = new ListItem("F危险废物产生量", "78"); + list[78] = new ListItem("29.土壤污染治理率", "79"); + list[79] = new ListItem("A其中:土壤污染治理面积", "80"); + list[80] = new ListItem("B土壤污染需要治理面积", "81"); + list[81] = new ListItem("30.矿山(或生态)修复治理率", "82"); + list[82] = new ListItem("A其中:矿山(或生态)修复治理面积", "83"); + list[83] = new ListItem("B矿山(或生态)需要修复治理面积", "84"); + list[84] = new ListItem("31.烟气脱硫机组装机容量占燃煤发电机组的比例", "85"); + list[85] = new ListItem("A其中:配备烟气脱硫装置的机组装机容量", "86"); + list[86] = new ListItem("32.烟气脱硝机组装机容量占燃煤发电机组的比例", "87"); + list[87] = new ListItem("A其中:配备烟气脱硝装置的机组装机容量", "88"); + list[88] = new ListItem("33.超低排放限值的机组装机容量占燃煤发电机组的比例", "89"); + list[89] = new ListItem("A其中:执行超低排放限值的机组装机容量", "90"); + list[90] = new ListItem("34.废气治理设施数", "91"); + list[91] = new ListItem("35.废气治理设施处理能力", "92"); + list[92] = new ListItem("36.废水治理设施数", "93"); + list[93] = new ListItem("37.废水治理设施处理能力", "94"); + list[94] = new ListItem("38.生态环境污染源", "95"); + list[95] = new ListItem("39.生态环境风险点", "96"); + list[96] = new ListItem("40.节能环保投入占产值比重", "97"); + list[97] = new ListItem("A其中:节能投入", "98"); + list[98] = new ListItem("B环保投入", "99"); + return list; + } + + /// + /// 获取计量单位集合 + /// + /// + public static ListItem[] GetUnits() + { + ListItem[] list = new ListItem[99]; + list[0] = new ListItem("万吨标准煤", "01"); + list[1] = new ListItem("万吨标准煤", "02"); + list[2] = new ListItem("万吨标准煤", "03"); + list[3] = new ListItem("万吨", "04"); + list[4] = new ListItem("万吨", "05"); + list[5] = new ListItem("吨", "06"); + list[6] = new ListItem("万千瓦时", "07"); + list[7] = new ListItem("吨", "08"); + list[8] = new ListItem("吨", "09"); + list[9] = new ListItem("吨", "10"); + list[10] = new ListItem("吨", "11"); + list[11] = new ListItem("吨", "12"); + list[12] = new ListItem("万立方米", "13"); + list[13] = new ListItem("百万千焦", "14"); + list[14] = new ListItem("吨标准煤", "15"); + list[15] = new ListItem("吨标准煤/万元", "16"); + list[16] = new ListItem("万元", "17"); + list[17] = new ListItem("吨标准煤/万元", "18"); + list[18] = new ListItem("万元", "19"); + list[19] = new ListItem("吨标准煤/万元", "20"); + list[20] = new ListItem("万元", "21"); + list[21] = new ListItem("吨标准煤/万元", "22"); + list[22] = new ListItem("万元", "23"); + list[23] = new ListItem("吨/万元", "24"); + list[24] = new ListItem("万吨", "25"); + list[25] = new ListItem("%", "26"); + list[26] = new ListItem("万吨", "27"); + list[27] = new ListItem("千克标准油/吨", "28"); + list[28] = new ListItem("千克标准油", "29"); + list[29] = new ListItem("吨", "30"); + list[30] = new ListItem("千克标准煤/吨", "31"); + list[31] = new ListItem("吨标准煤", "32"); + list[32] = new ListItem("吨", "33"); + list[33] = new ListItem("吨标准煤", "34"); + list[34] = new ListItem("%", "35"); + list[35] = new ListItem("%", "36"); + list[36] = new ListItem("百万千焦", "37"); + list[37] = new ListItem("万千瓦", "38"); + list[38] = new ListItem("万千瓦", "39"); + list[39] = new ListItem("万千瓦", "40"); + list[40] = new ListItem("万千瓦", "41"); + list[41] = new ListItem("万千瓦", "42"); + list[42] = new ListItem("万千瓦", "43"); + list[43] = new ListItem("万千瓦", "44"); + list[44] = new ListItem("万千瓦", "45"); + list[45] = new ListItem("万千瓦", "46"); + list[46] = new ListItem("万千瓦", "47"); + list[47] = new ListItem("万千瓦", "48"); + list[48] = new ListItem("万千瓦", "49"); + list[49] = new ListItem("%", "50"); + list[50] = new ListItem("万千瓦时", "51"); + list[51] = new ListItem("吨", "52"); + list[52] = new ListItem("吨", "53"); + list[53] = new ListItem("吨", "54"); + list[54] = new ListItem("吨", "55"); + list[55] = new ListItem("吨", "56"); + list[56] = new ListItem("吨", "57"); + list[57] = new ListItem("吨", "58"); + list[58] = new ListItem("吨", "59"); + list[59] = new ListItem("吨", "60"); + list[60] = new ListItem("吨", "61"); + list[61] = new ListItem("吨", "62"); + list[62] = new ListItem("吨", "63"); + list[63] = new ListItem("吨", "64"); + list[64] = new ListItem("吨", "65"); + list[65] = new ListItem("吨", "66"); + list[66] = new ListItem("吨", "67"); + list[67] = new ListItem("万吨", "68"); + list[68] = new ListItem("吨二氧化碳当量/万元", "69"); + list[69] = new ListItem("万吨二氧化碳当量", "70"); + list[70] = new ListItem("%", "71"); + list[71] = new ListItem("万吨", "72"); + list[72] = new ListItem("万吨", "73"); + list[73] = new ListItem("万吨", "74"); + list[74] = new ListItem("%", "75"); + list[75] = new ListItem("万吨", "76"); + list[76] = new ListItem("万吨", "77"); + list[77] = new ListItem("万吨", "78"); + list[78] = new ListItem("%", "79"); + list[79] = new ListItem("公顷", "80"); + list[80] = new ListItem("公顷", "81"); + list[81] = new ListItem("%", "82"); + list[82] = new ListItem("公顷", "83"); + list[83] = new ListItem("公顷", "84"); + list[84] = new ListItem("%", "85"); + list[85] = new ListItem("万千瓦", "86"); + list[86] = new ListItem("%", "87"); + list[87] = new ListItem("万千瓦", "88"); + list[88] = new ListItem("%", "89"); + list[89] = new ListItem("万千瓦", "90"); + list[90] = new ListItem("套", "91"); + list[91] = new ListItem("万立方米/年", "92"); + list[92] = new ListItem("套", "93"); + list[93] = new ListItem("万吨/年", "94"); + list[94] = new ListItem("个", "95"); + list[95] = new ListItem("个", "96"); + list[96] = new ListItem("%", "97"); + list[97] = new ListItem("万元", "98"); + list[98] = new ListItem("万元", "99"); + return list; + } + } +} diff --git a/SGGL/BLL/ZHGL/Environmental/ChemicalReportService.cs b/SGGL/BLL/ZHGL/Environmental/ChemicalReportService.cs new file mode 100644 index 00000000..595bbba2 --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ChemicalReportService.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public static class ChemicalReportService + { + /// + /// 化工行业能源节约与生态环境保护汇总表 + /// + /// 化工行业能源节约与生态环境保护汇总表Id + /// 化工行业能源节约与生态环境保护汇总表 + public static Model.Environmental_ChemicalReport GetChemicalReportByChemicalReportId(string ChemicalReportId) + { + return Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId); + } + + /// + /// 化工行业能源节约与生态环境保护汇总表 + /// + /// 单位Id + /// 年度 + /// 月份 + /// 化工行业能源节约与生态环境保护汇总表 + public static Model.Environmental_ChemicalReport GetChemicalReportByUnitIdAndYearAndMonth(string unitId, int year, int month) + { + return Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.UnitId == unitId && e.Month == month && e.Year == year); + } + + /// + /// 根据单位Id获取化工行业能源节约与生态环境保护汇总表集合 + /// + /// 单位Id + /// 化工行业能源节约与生态环境保护汇总表集合 + public static List GetChemicalReportsByUnitId(string UnitId) + { + return (from x in Funs.DB.View_Environmental_ChemicalReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList(); + } + + /// + /// 增加化工行业能源节约与生态环境保护汇总表 + /// + /// 化工行业能源节约与生态环境保护汇总表实体 + public static void AddChemicalReport(Model.Environmental_ChemicalReport ChemicalReport) + { + Model.Environmental_ChemicalReport newChemicalReport = new Model.Environmental_ChemicalReport + { + ChemicalReportId = ChemicalReport.ChemicalReportId, + Year = ChemicalReport.Year, + Month = ChemicalReport.Month, + UnitId = ChemicalReport.UnitId, + FillingDate = ChemicalReport.FillingDate, + DutyPerson = ChemicalReport.DutyPerson, + FillingMan = ChemicalReport.FillingMan, + UpState = ChemicalReport.UpState, + }; + + Funs.DB.Environmental_ChemicalReport.InsertOnSubmit(newChemicalReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改化工行业能源节约与生态环境保护汇总表 + /// + /// 化工行业能源节约与生态环境保护汇总表实体 + public static void UpdateChemicalReport(Model.Environmental_ChemicalReport ChemicalReport) + { + Model.Environmental_ChemicalReport newChemicalReport = Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReport.ChemicalReportId); + if (newChemicalReport != null) + { + newChemicalReport.Year = ChemicalReport.Year; + newChemicalReport.Month = ChemicalReport.Month; + newChemicalReport.UnitId = ChemicalReport.UnitId; + newChemicalReport.FillingDate = ChemicalReport.FillingDate; + newChemicalReport.DutyPerson = ChemicalReport.DutyPerson; + newChemicalReport.UpState = ChemicalReport.UpState; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据Id获取数据 + /// + /// + public static void DeleteChemicalReportByChemicalReportId(string ChemicalReportId) + { + Model.Environmental_ChemicalReport newChemicalReport = Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId); + if (newChemicalReport != null) + { + Funs.DB.Environmental_ChemicalReport.DeleteOnSubmit(newChemicalReport); + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据报表单位,报表时间判断是否存在 + /// + /// Id + /// + public static Model.Environmental_ChemicalReport GetChemicalReportByUnitIdDate(string unitId, int year, int Month) + { + return Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Month == Month); + } + + /// + /// 根据报表单位,报表年份获取对应集合 + /// + /// Id + /// + public static List GetChemicalReportByUnitIdYear(string unitId, int year) + { + return (from x in Funs.DB.Environmental_ChemicalReport where x.UnitId == unitId && x.Year == year select x).ToList(); + } + } +} diff --git a/SGGL/BLL/ZHGL/Environmental/EnergyReportService.cs b/SGGL/BLL/ZHGL/Environmental/EnergyReportService.cs new file mode 100644 index 00000000..0f709d3a --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/EnergyReportService.cs @@ -0,0 +1,165 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class EnergyReportService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetEnvironmental_EnergyReportByModle(Model.Environmental_EnergyReport table) + { + var q = from x in db.Environmental_EnergyReport + where + (string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) && + (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && + (string.IsNullOrEmpty(table.FillingMan) || x.FillingMan.Contains(table.FillingMan)) && + (string.IsNullOrEmpty(table.DutyPerson) || x.DutyPerson.Contains(table.DutyPerson)) && + (string.IsNullOrEmpty(table.UpState) || x.UpState.Contains(table.UpState)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.Environmental_EnergyReport table, Grid Grid1) + { + var q = GetEnvironmental_EnergyReportByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.EnergyReportId, + x.UnitId, + x.Year, + x.Quarters, + x.FillingMan, + x.FillingDate, + x.DutyPerson, + x.UpState, + + }; + } + #endregion + + public static Model.Environmental_EnergyReport GetEnvironmental_EnergyReportById(string EnergyReportId) + { + return db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); + } + + public static Model.Environmental_EnergyReport GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(string unitId, int year, int Quarters) + { + return Funs.DB.Environmental_EnergyReport.FirstOrDefault(e => e.UnitId == unitId && e.Quarters == Quarters && e.Year == year); + } + public static void AddEnvironmental_EnergyReport(Model.Environmental_EnergyReport newtable) + { + + Model.Environmental_EnergyReport table = new Model.Environmental_EnergyReport + { + EnergyReportId = newtable.EnergyReportId, + UnitId = newtable.UnitId, + Year = newtable.Year, + Quarters = newtable.Quarters, + FillingMan = newtable.FillingMan, + FillingDate = newtable.FillingDate, + DutyPerson = newtable.DutyPerson, + UpState = newtable.UpState, + }; + db.Environmental_EnergyReport.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkEnvironmental_EnergyReport(List newtables) + { + + db.Environmental_EnergyReport.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + /// + /// 根据报表单位,报表时间判断是否存在 + /// + /// Id + /// + public static Model.Environmental_EnergyReport GetEnergyReportByUnitIdDate(string unitId, int year, int Quarters) + { + return Funs.DB.Environmental_EnergyReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Quarters == Quarters); + } + + /// + /// 根据报表单位,报表年份获取对应集合 + /// + /// Id + /// + public static List GetEnergyReportByUnitIdYear(string unitId, int year) + { + return (from x in Funs.DB.Environmental_EnergyReport where x.UnitId == unitId && x.Year == year select x).ToList(); + } + public static void UpdateEnvironmental_EnergyReport(Model.Environmental_EnergyReport newtable) + { + + Model.Environmental_EnergyReport table = db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == newtable.EnergyReportId); + if (table != null) + { + table.EnergyReportId = newtable.EnergyReportId; + table.UnitId = newtable.UnitId; + table.Year = newtable.Year; + table.Quarters = newtable.Quarters; + table.FillingMan = newtable.FillingMan; + table.FillingDate = newtable.FillingDate; + table.DutyPerson = newtable.DutyPerson; + table.UpState = newtable.UpState; + db.SubmitChanges(); + } + + } + public static void DeleteEnvironmental_EnergyReportById(string EnergyReportId) + { + + Model.Environmental_EnergyReport table = db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); + if (table != null) + { + db.Environmental_EnergyReport.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLEnvironmental_EnergyReport() + { + if (db.Environmental_EnergyReport != null) + { + db.Environmental_EnergyReport.DeleteAllOnSubmit(db.Environmental_EnergyReport); + db.SubmitChanges(); + } + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs b/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs new file mode 100644 index 00000000..c08460be --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs @@ -0,0 +1,281 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class EnergyreportItemService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetEnvironmental_EnergyReportItemByModle(Model.Environmental_EnergyReportItem table) + { + var q = from x in db.Environmental_EnergyReportItem + where + (string.IsNullOrEmpty(table.EnergyReportItemId) || x.EnergyReportItemId.Contains(table.EnergyReportItemId)) && + (string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) && + (string.IsNullOrEmpty(table.SortIndex) || x.SortIndex.Contains(table.SortIndex)) && + (string.IsNullOrEmpty(table.BusinessCategory) || x.BusinessCategory.Contains(table.BusinessCategory)) && + (string.IsNullOrEmpty(table.Throughput_UnitOfMeasurement) || x.Throughput_UnitOfMeasurement.Contains(table.Throughput_UnitOfMeasurement)) && + (string.IsNullOrEmpty(table.Yield_UnitOfMeasurement) || x.Yield_UnitOfMeasurement.Contains(table.Yield_UnitOfMeasurement)) && + (string.IsNullOrEmpty(table.OperationScale_UnitOfMeasurement) || x.OperationScale_UnitOfMeasurement.Contains(table.OperationScale_UnitOfMeasurement)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.Environmental_EnergyReportItem table, Grid Grid1) + { + var q = GetEnvironmental_EnergyReportItemByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.EnergyReportItemId, + x.EnergyReportId, + x.SortIndex, + x.BusinessCategory, + x.Throughput_BasePeriod, + x.Throughput_LastPeriod, + x.Throughput_ThisPeriod, + x.Throughput_UnitOfMeasurement, + x.Yield_BasePeriod, + x.Yield_LastPeriod, + x.Yield_ThisPeriod, + x.Yield_UnitOfMeasurement, + x.OutputValue_BasePeriod, + x.OutputValue_LastYear, + x.OutputValue_ThisYear, + x.OperationScale_BasePeriod, + x.OperationScale_LastYear, + x.OperationScale_ThisYear, + x.OperationScale_UnitOfMeasurement, + x.ServiceOperatingIncome_BasePeriod, + x.ServiceOperatingIncome_LastYear, + x.ServiceOperatingIncome_ThisYear, + + }; + } + #endregion + + public static Model.Environmental_EnergyReportItem GetEnvironmental_EnergyReportItemById(string EnergyReportItemId) + { + return db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// + /// 明细记录集合 + public static List GetItems(string EnergyReportId) + { + return (from x in Funs.DB.Environmental_EnergyReportItem + where x.EnergyReportId == EnergyReportId + orderby x.SortIndex + select x).ToList(); + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetYearSumItems(string unitId, int? year, int? Quarters) + { + return (from x in Funs.DB.Environmental_EnergyReportItem + join y in Funs.DB.Environmental_EnergyReport + on x.EnergyReportId equals y.EnergyReportId + where y.UnitId == unitId && y.Year == year && y.Quarters == Quarters + orderby x.SortIndex + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取年度明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 年度明细记录集合 + public static List GetLastYearItems(int year) + { + return (from x in Funs.DB.Environmental_EnergyReportItem + join y in Funs.DB.Environmental_EnergyReport + on x.EnergyReportId equals y.EnergyReportId + where y.Year == year + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取明细记录集合(不包含本月合计行) + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetShowItems(string EnergyReportId) + { + var q = (from x in Funs.DB.Environmental_EnergyReportItem + where x.EnergyReportId == EnergyReportId + orderby x.SortIndex + select x).ToList(); + List newItems = new List(); + foreach (var item in q) + { + Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem(); + + newItem.EnergyReportItemId = item.EnergyReportItemId; + newItem.EnergyReportId = item.EnergyReportId; + newItem.SortIndex = item.SortIndex; + newItem.BusinessCategory = item.BusinessCategory; + newItem.Throughput_BasePeriod = item.Throughput_BasePeriod; + newItem.Throughput_LastPeriod = item.Throughput_LastPeriod; + newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod; + newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement; + newItem.Yield_BasePeriod = item.Yield_BasePeriod; + newItem.Yield_LastPeriod = item.Yield_LastPeriod; + newItem.Yield_ThisPeriod = item.Yield_ThisPeriod; + newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement; + newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod; + newItem.OutputValue_LastYear = item.OutputValue_LastYear; + newItem.OutputValue_ThisYear = item.OutputValue_ThisYear; + newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod; + newItem.OperationScale_LastYear = item.OperationScale_LastYear; + newItem.OperationScale_ThisYear = item.OperationScale_ThisYear; + newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement; + newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod; + newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear; + newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear; + newItems.Add(newItem); + } + return newItems; + } + public static void AddEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable) + { + + Model.Environmental_EnergyReportItem table = new Model.Environmental_EnergyReportItem + { + EnergyReportItemId = newtable.EnergyReportItemId, + EnergyReportId = newtable.EnergyReportId, + SortIndex = newtable.SortIndex, + BusinessCategory = newtable.BusinessCategory, + Throughput_BasePeriod = newtable.Throughput_BasePeriod, + Throughput_LastPeriod = newtable.Throughput_LastPeriod, + Throughput_ThisPeriod = newtable.Throughput_ThisPeriod, + Throughput_UnitOfMeasurement = newtable.Throughput_UnitOfMeasurement, + Yield_BasePeriod = newtable.Yield_BasePeriod, + Yield_LastPeriod = newtable.Yield_LastPeriod, + Yield_ThisPeriod = newtable.Yield_ThisPeriod, + Yield_UnitOfMeasurement = newtable.Yield_UnitOfMeasurement, + OutputValue_BasePeriod = newtable.OutputValue_BasePeriod, + OutputValue_LastYear = newtable.OutputValue_LastYear, + OutputValue_ThisYear = newtable.OutputValue_ThisYear, + OperationScale_BasePeriod = newtable.OperationScale_BasePeriod, + OperationScale_LastYear = newtable.OperationScale_LastYear, + OperationScale_ThisYear = newtable.OperationScale_ThisYear, + OperationScale_UnitOfMeasurement = newtable.OperationScale_UnitOfMeasurement, + ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod, + ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear, + ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear, + }; + db.Environmental_EnergyReportItem.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkEnvironmental_EnergyReportItem(List newtables) + { + + db.Environmental_EnergyReportItem.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + + public static void UpdateEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable) + { + + Model.Environmental_EnergyReportItem table = db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == newtable.EnergyReportItemId); + if (table != null) + { + table.EnergyReportItemId = newtable.EnergyReportItemId; + table.EnergyReportId = newtable.EnergyReportId; + table.SortIndex = newtable.SortIndex; + table.BusinessCategory = newtable.BusinessCategory; + table.Throughput_BasePeriod = newtable.Throughput_BasePeriod; + table.Throughput_LastPeriod = newtable.Throughput_LastPeriod; + table.Throughput_ThisPeriod = newtable.Throughput_ThisPeriod; + table.Throughput_UnitOfMeasurement = newtable.Throughput_UnitOfMeasurement; + table.Yield_BasePeriod = newtable.Yield_BasePeriod; + table.Yield_LastPeriod = newtable.Yield_LastPeriod; + table.Yield_ThisPeriod = newtable.Yield_ThisPeriod; + table.Yield_UnitOfMeasurement = newtable.Yield_UnitOfMeasurement; + table.OutputValue_BasePeriod = newtable.OutputValue_BasePeriod; + table.OutputValue_LastYear = newtable.OutputValue_LastYear; + table.OutputValue_ThisYear = newtable.OutputValue_ThisYear; + table.OperationScale_BasePeriod = newtable.OperationScale_BasePeriod; + table.OperationScale_LastYear = newtable.OperationScale_LastYear; + table.OperationScale_ThisYear = newtable.OperationScale_ThisYear; + table.OperationScale_UnitOfMeasurement = newtable.OperationScale_UnitOfMeasurement; + table.ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod; + table.ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear; + table.ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear; + db.SubmitChanges(); + } + + } + public static void DeleteEnvironmental_EnergyReportItemById(string EnergyReportItemId) + { + + Model.Environmental_EnergyReportItem table = db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); + if (table != null) + { + db.Environmental_EnergyReportItem.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLEnvironmental_EnergyReportItem() + { + if (db.Environmental_EnergyReportItem != null) + { + db.Environmental_EnergyReportItem.DeleteAllOnSubmit(db.Environmental_EnergyReportItem); + db.SubmitChanges(); + } + } + public static void DeleteEnergyReportItemByChemicalReportId(string EnergyReportId) + { + var q = from x in Funs.DB.Environmental_EnergyReportItem where x.EnergyReportId == EnergyReportId select x; + if (q != null) + { + Funs.DB.Environmental_EnergyReportItem.DeleteAllOnSubmit(q); + Funs.DB.SubmitChanges(); + } + } + + + } +} \ No newline at end of file diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportItemService.cs b/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportItemService.cs new file mode 100644 index 00000000..c77217ed --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportItemService.cs @@ -0,0 +1,307 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.UI.WebControls; + +namespace BLL +{ + public static class ProjectArchitectureReportItemService + { + /// + /// 建筑行业能源节约与生态环境保护汇总明细表 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 建筑行业能源节约与生态环境保护汇总明细表 + public static Model.Environmental_ProjectArchitectureReportItem GetArchitectureReportItemByArchitectureReportItemId(string ArchitectureReportItemId) + { + return Funs.DB.Environmental_ProjectArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportItemId == ArchitectureReportItemId); + } + + /// + /// 建筑行业能源节约与生态环境保护汇总明细表 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 建筑行业能源节约与生态环境保护汇总明细表 + public static Model.Environmental_ProjectArchitectureReportItem GetArchitectureReportItemByArchitectureReportIdAndTypeId(string ArchitectureReportId) + { + return Funs.DB.Environmental_ProjectArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId); + } + + /// + /// 根据主表Id判断是否存在明细记录 + /// + /// 企业安全数据统计月报表Id + /// 是否存在明细记录 + public static bool IsExitItems(string ArchitectureReportId) + { + return (from x in Funs.DB.Environmental_ProjectArchitectureReportItem where x.ArchitectureReportId == ArchitectureReportId select x).Count() > 0; + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetItems(string ArchitectureReportId) + { + return (from x in Funs.DB.Environmental_ProjectArchitectureReportItem + where x.ArchitectureReportId == ArchitectureReportId + orderby x.SortIndex + select x).ToList(); + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetYearSumItems(string projectId, int? year, int? Quarters) + { + return (from x in Funs.DB.Environmental_ProjectArchitectureReportItem + join y in Funs.DB.Environmental_ProjectArchitectureReport + on x.ArchitectureReportId equals y.ArchitectureReportId + where y.ProjectId == projectId && y.Year == year && y.Quarters == Quarters + orderby x.SortIndex + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取年度明细记录集合 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 年度明细记录集合 + public static List GetLastYearItems(int year) + { + return (from x in Funs.DB.Environmental_ProjectArchitectureReportItem + join y in Funs.DB.Environmental_ProjectArchitectureReport + on x.ArchitectureReportId equals y.ArchitectureReportId + where y.Year == year + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取明细记录集合(不包含本月合计行) + /// + /// 建筑行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetShowItems(string ArchitectureReportId) + { + var q = (from x in Funs.DB.Environmental_ProjectArchitectureReportItem + where x.ArchitectureReportId == ArchitectureReportId + orderby x.SortIndex + select x).ToList(); + List newItems = new List(); + var indexNames = GetIndexNames(); + var units = GetUnits(); + foreach (var item in q) + { + Model.ArchitectureReportItem newItem = new Model.ArchitectureReportItem(); + newItem.ArchitectureReportItemId = item.ArchitectureReportItemId; + newItem.IndexName = indexNames.First(x => x.Value == item.SortIndex).Text; + newItem.Unit = units.First(x => x.Value == item.SortIndex).Text; + newItem.SortIndex = item.SortIndex; + newItem.BaseNumber = item.BaseNumber; + newItem.LastYearValue = item.LastYearValue; + newItem.ThisYearValue = item.ThisYearValue; + newItem.Rate = item.Rate; + newItems.Add(newItem); + } + return newItems; + } + + /// + /// 增加建筑行业能源节约与生态环境保护汇总明细表 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表实体 + public static void AddArchitectureReportItem(Model.Environmental_ProjectArchitectureReportItem ArchitectureReportItem) + { + Model.Environmental_ProjectArchitectureReportItem newArchitectureReportItem = new Model.Environmental_ProjectArchitectureReportItem + { + ArchitectureReportItemId = ArchitectureReportItem.ArchitectureReportItemId, + ArchitectureReportId = ArchitectureReportItem.ArchitectureReportId, + BaseNumber = ArchitectureReportItem.BaseNumber, + SortIndex = ArchitectureReportItem.SortIndex, + LastYearValue = ArchitectureReportItem.LastYearValue, + ThisYearValue = ArchitectureReportItem.ThisYearValue, + Rate = ArchitectureReportItem.Rate, + }; + + Funs.DB.Environmental_ProjectArchitectureReportItem.InsertOnSubmit(newArchitectureReportItem); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改建筑行业能源节约与生态环境保护汇总明细表 + /// + /// 建筑行业能源节约与生态环境保护汇总明细表实体 + public static void UpdateArchitectureReportItem(Model.Environmental_ProjectArchitectureReportItem ArchitectureReportItem) + { + Model.Environmental_ProjectArchitectureReportItem newArchitectureReportItem = Funs.DB.Environmental_ProjectArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportItemId == ArchitectureReportItem.ArchitectureReportItemId); + newArchitectureReportItem.SortIndex = ArchitectureReportItem.SortIndex; + newArchitectureReportItem.BaseNumber = ArchitectureReportItem.BaseNumber; + newArchitectureReportItem.LastYearValue = ArchitectureReportItem.LastYearValue; + newArchitectureReportItem.ThisYearValue = ArchitectureReportItem.ThisYearValue; + newArchitectureReportItem.Rate = ArchitectureReportItem.Rate; + + Funs.DB.SubmitChanges(); + } + + /// + /// 根据Id删除所有数据 + /// + /// + public static void DeleteArchitectureReportItemByArchitectureReportId(string ArchitectureReportId) + { + var q = from x in Funs.DB.Environmental_ProjectArchitectureReportItem where x.ArchitectureReportId == ArchitectureReportId select x; + if (q != null) + { + Funs.DB.Environmental_ProjectArchitectureReportItem.DeleteAllOnSubmit(q); + Funs.DB.SubmitChanges(); + } + } + + /// + /// 获取指标名称集合 + /// + /// + public static ListItem[] GetIndexNames() + { + ListItem[] list = new ListItem[61]; + list[0] = new ListItem("1.能源消费量", "01"); + list[1] = new ListItem("A其中:原煤(标准量)", "02"); + list[2] = new ListItem("B原煤(实物量)", "03"); + list[3] = new ListItem("C其中:发电用煤", "04"); + list[4] = new ListItem("B焦炭", "05"); + list[5] = new ListItem("B电力", "06"); + list[6] = new ListItem("B原油", "07"); + list[7] = new ListItem("B汽油", "08"); + list[8] = new ListItem("B煤油", "09"); + list[9] = new ListItem("B柴油", "10"); + list[10] = new ListItem("B燃料油", "11"); + list[11] = new ListItem("B天然气", "12"); + list[12] = new ListItem("B热力", "13"); + list[13] = new ListItem("B其他能源", "14"); + list[14] = new ListItem("2.万元营业收入综合能耗(现价)", "15"); + list[15] = new ListItem("A其中:营业收入(现价)", "16"); + list[16] = new ListItem("E万元营业收入综合能耗(可比价)", "17"); + list[17] = new ListItem("A其中:营业收入(可比价)", "18"); + list[18] = new ListItem("3.万元增加值综合能耗(现价)", "19"); + list[19] = new ListItem("A其中:增加值(现价)", "20"); + list[20] = new ListItem("E万元增加值综合能耗(可比价)", "21"); + list[21] = new ListItem("A其中:增加值(可比价)", "22"); + list[22] = new ListItem("4.万元营业收入用新水量(可比价)", "23"); + list[23] = new ListItem("A其中:用新水量", "24"); + list[24] = new ListItem("5.节能量", "25"); + list[25] = new ListItem("6.二氧化硫排放量", "26"); + list[26] = new ListItem("7.氮氧化物排放量", "27"); + list[27] = new ListItem("8.化学需氧量排放量", "28"); + list[28] = new ListItem("A其中:排入外环境", "29"); + list[29] = new ListItem("B排入市政管网或生活污水处理厂", "30"); + list[30] = new ListItem("9.氨氮排放量", "31"); + list[31] = new ListItem("A其中:排入外环境", "32"); + list[32] = new ListItem("B排入市政管网或生活污水处理厂", "33"); + list[33] = new ListItem("10.烟(粉)尘排放量", "34"); + list[34] = new ListItem("11.挥发性有机物排放量", "35"); + list[35] = new ListItem("12.废水排放量", "36"); + list[36] = new ListItem("13.万元收入二氧化碳排放(可比价)", "37"); + list[37] = new ListItem("A其中:二氧化碳排放量", "38"); + list[38] = new ListItem("14.一般固体废物综合利用率", "39"); + list[39] = new ListItem("A其中:一般固体废物综合利用量", "40"); + list[40] = new ListItem("B其中:综合利用往年贮存量", "41"); + list[41] = new ListItem("F一般固体废物产生量", "42"); + list[42] = new ListItem("15.危险废物处置率", "43"); + list[43] = new ListItem("A其中:危险废物处置量", "44"); + list[44] = new ListItem("B其中:处置往年贮存量", "45"); + list[45] = new ListItem("F危险废物产生量", "46"); + list[46] = new ListItem("16.土壤污染治理率", "47"); + list[47] = new ListItem("A其中:土壤污染治理面积", "48"); + list[48] = new ListItem("B土壤污染需要治理面积", "49"); + list[49] = new ListItem("17.矿山(或生态)修复治理率", "50"); + list[50] = new ListItem("A其中:矿山(或生态)修复治理面积", "51"); + list[51] = new ListItem("B矿山(或生态)需要修复治理面积", "52"); + list[52] = new ListItem("18.废气治理设施数", "53"); + list[53] = new ListItem("19.废气治理设施处理能力", "54"); + list[54] = new ListItem("20.废水治理设施数", "55"); + list[55] = new ListItem("21.废水治理设施处理能力", "56"); + list[56] = new ListItem("22.生态环境污染源", "57"); + list[57] = new ListItem("23.生态环境风险点", "58"); + list[58] = new ListItem("24.节能环保投入占收入比重", "59"); + list[59] = new ListItem("A其中:节能投入", "60"); + list[60] = new ListItem("B环保投入", "61"); + return list; + } + + /// + /// 获取计量单位集合 + /// + /// + public static ListItem[] GetUnits() + { + ListItem[] list = new ListItem[61]; + list[0] = new ListItem("万吨标准煤", "01"); + list[1] = new ListItem("万吨标准煤", "02"); + list[2] = new ListItem("万吨", "03"); + list[3] = new ListItem("万吨", "04"); + list[4] = new ListItem("吨", "05"); + list[5] = new ListItem("万千瓦时", "06"); + list[6] = new ListItem("吨", "07"); + list[7] = new ListItem("吨", "08"); + list[8] = new ListItem("吨", "09"); + list[9] = new ListItem("吨", "10"); + list[10] = new ListItem("吨", "11"); + list[11] = new ListItem("万立方米", "12"); + list[12] = new ListItem("百万千焦", "13"); + list[13] = new ListItem("吨标准煤", "14"); + list[14] = new ListItem("吨标准煤/万元", "15"); + list[15] = new ListItem("万元", "16"); + list[16] = new ListItem("吨标准煤/万元", "17"); + list[17] = new ListItem("万元", "18"); + list[18] = new ListItem("吨标准煤/万元", "19"); + list[19] = new ListItem("万元", "20"); + list[20] = new ListItem("吨标准煤/万元", "21"); + list[21] = new ListItem("万元", "22"); + list[22] = new ListItem("吨/万元", "23"); + list[23] = new ListItem("万吨", "24"); + list[24] = new ListItem("吨标准煤", "25"); + list[25] = new ListItem("吨", "26"); + list[26] = new ListItem("吨", "27"); + list[27] = new ListItem("吨", "28"); + list[28] = new ListItem("吨", "29"); + list[29] = new ListItem("吨", "30"); + list[30] = new ListItem("吨", "31"); + list[31] = new ListItem("吨", "32"); + list[32] = new ListItem("吨", "33"); + list[33] = new ListItem("吨", "34"); + list[34] = new ListItem("吨", "35"); + list[35] = new ListItem("万吨", "36"); + list[36] = new ListItem("吨二氧化碳当量/万元", "37"); + list[37] = new ListItem("万吨二氧化碳当量", "38"); + list[38] = new ListItem("%", "39"); + list[39] = new ListItem("万吨", "40"); + list[40] = new ListItem("万吨", "41"); + list[41] = new ListItem("万吨", "42"); + list[42] = new ListItem("%", "43"); + list[43] = new ListItem("万吨", "44"); + list[44] = new ListItem("万吨", "45"); + list[45] = new ListItem("万吨", "46"); + list[46] = new ListItem("%", "47"); + list[47] = new ListItem("公顷", "48"); + list[48] = new ListItem("公顷", "49"); + list[49] = new ListItem("%", "50"); + list[50] = new ListItem("公顷", "51"); + list[51] = new ListItem("公顷", "52"); + list[52] = new ListItem("套", "53"); + list[53] = new ListItem("万立方米/年", "54"); + list[54] = new ListItem("套", "55"); + list[55] = new ListItem("万吨/年", "56"); + list[56] = new ListItem("个", "57"); + list[57] = new ListItem("个", "58"); + list[58] = new ListItem("%", "59"); + list[59] = new ListItem("万元", "60"); + list[60] = new ListItem("万元", "61"); + return list; + } + } +} diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportService.cs b/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportService.cs new file mode 100644 index 00000000..d58f1236 --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ProjectArchitectureReportService.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public static class ProjectArchitectureReportService + { + /// + /// 建筑行业能源节约与生态环境保护汇总表 + /// + /// 建筑行业能源节约与生态环境保护汇总表Id + /// 建筑行业能源节约与生态环境保护汇总表 + public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByArchitectureReportId(string ArchitectureReportId) + { + return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId); + } + + /// + /// 建筑行业能源节约与生态环境保护汇总表 + /// + /// 单位Id + /// 年度 + /// 月份 + /// 建筑行业能源节约与生态环境保护汇总表 + public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByProjectIdAndYearAndQuarters(string projectId, int year, int Quarters) + { + return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == projectId && e.Quarters == Quarters && e.Year == year); + } + + /// + /// 根据单位Id获取建筑行业能源节约与生态环境保护汇总表集合 + /// + /// 单位Id + /// 建筑行业能源节约与生态环境保护汇总表集合 + public static List GetArchitectureReportsByProjectId(string ProjectId) + { + return (from x in Funs.DB.View_Environmental_ProjectArchitectureReport where x.ProjectId == ProjectId orderby x.FillingDate descending select x).ToList(); + } + + /// + /// 增加建筑行业能源节约与生态环境保护汇总表 + /// + /// 建筑行业能源节约与生态环境保护汇总表实体 + public static void AddArchitectureReport(Model.Environmental_ProjectArchitectureReport ArchitectureReport) + { + Model.Environmental_ProjectArchitectureReport newArchitectureReport = new Model.Environmental_ProjectArchitectureReport + { + ArchitectureReportId = ArchitectureReport.ArchitectureReportId, + Year = ArchitectureReport.Year, + Quarters = ArchitectureReport.Quarters, + ProjectId = ArchitectureReport.ProjectId, + FillingDate = ArchitectureReport.FillingDate, + DutyPerson = ArchitectureReport.DutyPerson, + FillingMan = ArchitectureReport.FillingMan, + UpState = ArchitectureReport.UpState, + }; + + Funs.DB.Environmental_ProjectArchitectureReport.InsertOnSubmit(newArchitectureReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改建筑行业能源节约与生态环境保护汇总表 + /// + /// 建筑行业能源节约与生态环境保护汇总表实体 + public static void UpdateArchitectureReport(Model.Environmental_ProjectArchitectureReport ArchitectureReport) + { + Model.Environmental_ProjectArchitectureReport newArchitectureReport = Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReport.ArchitectureReportId); + if (newArchitectureReport != null) + { + newArchitectureReport.Year = ArchitectureReport.Year; + newArchitectureReport.Quarters = ArchitectureReport.Quarters; + newArchitectureReport.ProjectId = ArchitectureReport.ProjectId; + newArchitectureReport.FillingDate = ArchitectureReport.FillingDate; + newArchitectureReport.DutyPerson = ArchitectureReport.DutyPerson; + newArchitectureReport.UpState = ArchitectureReport.UpState; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据Id获取数据 + /// + /// + public static void DeleteArchitectureReportByArchitectureReportId(string ArchitectureReportId) + { + Model.Environmental_ProjectArchitectureReport newArchitectureReport = Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId); + if (newArchitectureReport != null) + { + Funs.DB.Environmental_ProjectArchitectureReport.DeleteOnSubmit(newArchitectureReport); + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据报表单位,报表时间判断是否存在 + /// + /// Id + /// + public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByProjectIdDate(string ProjectId, int year, int Quarters) + { + return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == ProjectId && e.Year == year && e.Quarters == Quarters); + } + + /// + /// 根据报表单位,报表年份获取对应集合 + /// + /// Id + /// + public static List GetArchitectureReportByProjectIdYear(string ProjectId, int year) + { + return (from x in Funs.DB.Environmental_ProjectArchitectureReport where x.ProjectId == ProjectId && x.Year == year select x).ToList(); + } + } +} diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectChemicalReportItemService.cs b/SGGL/BLL/ZHGL/Environmental/ProjectChemicalReportItemService.cs new file mode 100644 index 00000000..de3598ec --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ProjectChemicalReportItemService.cs @@ -0,0 +1,383 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.UI.WebControls; + +namespace BLL +{ + public static class ProjectChemicalReportItemService + { + /// + /// 化工行业能源节约与生态环境保护汇总明细表 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 化工行业能源节约与生态环境保护汇总明细表 + public static Model.Environmental_ProjectChemicalReportItem GetChemicalReportItemByChemicalReportItemId(string ChemicalReportItemId) + { + return Funs.DB.Environmental_ProjectChemicalReportItem.FirstOrDefault(e => e.ChemicalReportItemId == ChemicalReportItemId); + } + + /// + /// 化工行业能源节约与生态环境保护汇总明细表 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 化工行业能源节约与生态环境保护汇总明细表 + public static Model.Environmental_ProjectChemicalReportItem GetChemicalReportItemByChemicalReportIdAndTypeId(string ChemicalReportId) + { + return Funs.DB.Environmental_ProjectChemicalReportItem.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId); + } + + /// + /// 根据主表Id判断是否存在明细记录 + /// + /// 企业安全数据统计月报表Id + /// 是否存在明细记录 + public static bool IsExitItems(string ChemicalReportId) + { + return (from x in Funs.DB.Environmental_ProjectChemicalReportItem where x.ChemicalReportId == ChemicalReportId select x).Count() > 0; + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetItems(string ChemicalReportId) + { + return (from x in Funs.DB.Environmental_ProjectChemicalReportItem + where x.ChemicalReportId == ChemicalReportId + orderby x.SortIndex + select x).ToList(); + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetYearSumItems(string projectId, int? year, int? month) + { + return (from x in Funs.DB.Environmental_ProjectChemicalReportItem + join y in Funs.DB.Environmental_ProjectChemicalReport + on x.ChemicalReportId equals y.ChemicalReportId + where y.ProjectId == projectId && y.Year == year && y.Month == month + orderby x.SortIndex + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取年度明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 年度明细记录集合 + public static List GetLastYearItems(int year) + { + return (from x in Funs.DB.Environmental_ProjectChemicalReportItem + join y in Funs.DB.Environmental_ProjectChemicalReport + on x.ChemicalReportId equals y.ChemicalReportId + where y.Year == year + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取明细记录集合(不包含本月合计行) + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetShowItems(string ChemicalReportId) + { + var q = (from x in Funs.DB.Environmental_ProjectChemicalReportItem + where x.ChemicalReportId == ChemicalReportId + orderby x.SortIndex + select x).ToList(); + List newItems = new List(); + var indexNames = GetIndexNames(); + var units = GetUnits(); + foreach (var item in q) + { + Model.ChemicalReportItem newItem = new Model.ChemicalReportItem(); + newItem.ChemicalReportItemId = item.ChemicalReportItemId; + newItem.IndexName = indexNames.First(x => x.Value == item.SortIndex).Text; + newItem.Unit = units.First(x => x.Value == item.SortIndex).Text; + newItem.SortIndex = item.SortIndex; + newItem.BaseNumber = item.BaseNumber; + newItem.LastYearValue = item.LastYearValue; + newItem.ThisYearValue = item.ThisYearValue; + newItem.Rate = item.Rate; + newItems.Add(newItem); + } + return newItems; + } + + /// + /// 增加化工行业能源节约与生态环境保护汇总明细表 + /// + /// 化工行业能源节约与生态环境保护汇总明细表实体 + public static void AddChemicalReportItem(Model.Environmental_ProjectChemicalReportItem ChemicalReportItem) + { + Model.Environmental_ProjectChemicalReportItem newChemicalReportItem = new Model.Environmental_ProjectChemicalReportItem + { + ChemicalReportItemId = ChemicalReportItem.ChemicalReportItemId, + ChemicalReportId = ChemicalReportItem.ChemicalReportId, + SortIndex = ChemicalReportItem.SortIndex, + BaseNumber = ChemicalReportItem.BaseNumber, + LastYearValue = ChemicalReportItem.LastYearValue, + ThisYearValue = ChemicalReportItem.ThisYearValue, + Rate = ChemicalReportItem.Rate, + }; + + Funs.DB.Environmental_ProjectChemicalReportItem.InsertOnSubmit(newChemicalReportItem); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改化工行业能源节约与生态环境保护汇总明细表 + /// + /// 化工行业能源节约与生态环境保护汇总明细表实体 + public static void UpdateChemicalReportItem(Model.Environmental_ProjectChemicalReportItem ChemicalReportItem) + { + Model.Environmental_ProjectChemicalReportItem newChemicalReportItem = Funs.DB.Environmental_ProjectChemicalReportItem.FirstOrDefault(e => e.ChemicalReportItemId == ChemicalReportItem.ChemicalReportItemId); + newChemicalReportItem.SortIndex = ChemicalReportItem.SortIndex; + newChemicalReportItem.BaseNumber = ChemicalReportItem.BaseNumber; + newChemicalReportItem.LastYearValue = ChemicalReportItem.LastYearValue; + newChemicalReportItem.ThisYearValue = ChemicalReportItem.ThisYearValue; + newChemicalReportItem.Rate = ChemicalReportItem.Rate; + + Funs.DB.SubmitChanges(); + } + + /// + /// 根据Id删除所有数据 + /// + /// + public static void DeleteChemicalReportItemByChemicalReportId(string ChemicalReportId) + { + var q = from x in Funs.DB.Environmental_ProjectChemicalReportItem where x.ChemicalReportId == ChemicalReportId select x; + if (q != null) + { + Funs.DB.Environmental_ProjectChemicalReportItem.DeleteAllOnSubmit(q); + Funs.DB.SubmitChanges(); + } + } + + /// + /// 获取指标名称集合 + /// + /// + public static ListItem[] GetIndexNames() + { + ListItem[] list = new ListItem[99]; + list[0] = new ListItem("1.能源消费量", "01"); + list[1] = new ListItem("A含:综合能源消费量", "02"); + list[2] = new ListItem("A其中:原煤(标准量)", "03"); + list[3] = new ListItem("B原煤(实物量)", "04"); + list[4] = new ListItem("C其中:发电用煤", "05"); + list[5] = new ListItem("B焦炭", "06"); + list[6] = new ListItem("B电力", "07"); + list[7] = new ListItem("B原油", "08"); + list[8] = new ListItem("B汽油", "09"); + list[9] = new ListItem("B煤油", "10"); + list[10] = new ListItem("B柴油", "11"); + list[11] = new ListItem("B燃料油", "12"); + list[12] = new ListItem("B天然气", "13"); + list[13] = new ListItem("B热力", "14"); + list[14] = new ListItem("B其他能源", "15"); + list[15] = new ListItem("2.万元产值综合能耗(现价)", "16"); + list[16] = new ListItem("A其中:工业总产值(现价)", "17"); + list[17] = new ListItem("E万元产值综合能耗(可比价)", "18"); + list[18] = new ListItem("A其中:工业总产值(可比价)", "19"); + list[19] = new ListItem("3.万元增加值综合能耗(现价)", "20"); + list[20] = new ListItem("A其中:增加值(现价)", "21"); + list[21] = new ListItem("E万元增加值综合能耗(可比价)", "22"); + list[22] = new ListItem("A其中:增加值(可比价)", "23"); + list[23] = new ListItem("4.万元产值用新水量(可比价)", "24"); + list[24] = new ListItem("A其中:用新水量", "25"); + list[25] = new ListItem("E重复用水率", "26"); + list[26] = new ListItem("A其中:重复用水量", "27"); + list[27] = new ListItem("5.单位乙烯能耗", "28"); + list[28] = new ListItem("A其中:乙烯装置能耗", "29"); + list[29] = new ListItem("B乙烯装置合格乙烯产品产量", "30"); + list[30] = new ListItem("6.合成氨单位产品综合能耗", "31"); + list[31] = new ListItem("A其中:合成氨综合能耗", "32"); + list[32] = new ListItem("B合成氨产量", "33"); + list[33] = new ListItem("7.节能量", "34"); + list[34] = new ListItem("8.电煤占煤炭消费比重", "35"); + list[35] = new ListItem("9.余热余能回收利用率", "36"); + list[36] = new ListItem("A其中:回收利用的余热余能", "37"); + list[37] = new ListItem("10.自备电厂发电装机容量", "38"); + list[38] = new ListItem("A其中:燃煤发电", "39"); + list[39] = new ListItem("C其中:燃煤热电", "40"); + list[40] = new ListItem("B清洁能源发电", "41"); + list[41] = new ListItem("C其中:天然气发电", "42"); + list[42] = new ListItem("D核能发电", "43"); + list[43] = new ListItem("D水力发电", "44"); + list[44] = new ListItem("D风力发电", "45"); + list[45] = new ListItem("D太阳能发电", "46"); + list[46] = new ListItem("D其他清洁能源发电", "47"); + list[47] = new ListItem("B生物质发电", "48"); + list[48] = new ListItem("B其他发电", "49"); + list[49] = new ListItem("11.燃煤热电机组装机容量占燃煤发电装机容量比重", "50"); + list[50] = new ListItem("12.自备电厂发电量", "51"); + list[51] = new ListItem("13.排污许可证许可的二氧化硫排放量", "52"); + list[52] = new ListItem("14.排污许可证许可的氮氧化物排放量", "53"); + list[53] = new ListItem("15.排污许可证许可的化学需氧量排放量", "54"); + list[54] = new ListItem("16.排污许可证许可的氨氮排放量", "55"); + list[55] = new ListItem("17.排污许可证许可的烟(粉)尘排放量", "56"); + list[56] = new ListItem("18.排污许可证许可的挥发性有机物排放量", "57"); + list[57] = new ListItem("19.二氧化硫排放量", "58"); + list[58] = new ListItem("20.氮氧化物排放量", "59"); + list[59] = new ListItem("21.化学需氧量排放量", "60"); + list[60] = new ListItem("A其中:排入外环境", "61"); + list[61] = new ListItem("B排入市政管网或生活污水处理厂", "62"); + list[62] = new ListItem("22.氨氮排放量", "63"); + list[63] = new ListItem("A其中:排入外环境", "64"); + list[64] = new ListItem("B排入市政管网或生活污水处理厂", "65"); + list[65] = new ListItem("23.烟(粉)尘排放量", "66"); + list[66] = new ListItem("24.挥发性有机物排放量", "67"); + list[67] = new ListItem("25.废水排放量", "68"); + list[68] = new ListItem("26.万元产值二氧化碳排放(可比价)", "69"); + list[69] = new ListItem("A其中:二氧化碳排放量", "70"); + list[70] = new ListItem("27.一般固体废物综合利用率", "71"); + list[71] = new ListItem("A其中:一般固体废物综合利用量", "72"); + list[72] = new ListItem("C其中:综合利用往年贮存量", "73"); + list[73] = new ListItem("F一般固体废物产生量", "74"); + list[74] = new ListItem("28.危险废物处置率", "75"); + list[75] = new ListItem("A其中:危险废物处置量", "76"); + list[76] = new ListItem("C其中:处置往年贮存量", "77"); + list[77] = new ListItem("F危险废物产生量", "78"); + list[78] = new ListItem("29.土壤污染治理率", "79"); + list[79] = new ListItem("A其中:土壤污染治理面积", "80"); + list[80] = new ListItem("B土壤污染需要治理面积", "81"); + list[81] = new ListItem("30.矿山(或生态)修复治理率", "82"); + list[82] = new ListItem("A其中:矿山(或生态)修复治理面积", "83"); + list[83] = new ListItem("B矿山(或生态)需要修复治理面积", "84"); + list[84] = new ListItem("31.烟气脱硫机组装机容量占燃煤发电机组的比例", "85"); + list[85] = new ListItem("A其中:配备烟气脱硫装置的机组装机容量", "86"); + list[86] = new ListItem("32.烟气脱硝机组装机容量占燃煤发电机组的比例", "87"); + list[87] = new ListItem("A其中:配备烟气脱硝装置的机组装机容量", "88"); + list[88] = new ListItem("33.超低排放限值的机组装机容量占燃煤发电机组的比例", "89"); + list[89] = new ListItem("A其中:执行超低排放限值的机组装机容量", "90"); + list[90] = new ListItem("34.废气治理设施数", "91"); + list[91] = new ListItem("35.废气治理设施处理能力", "92"); + list[92] = new ListItem("36.废水治理设施数", "93"); + list[93] = new ListItem("37.废水治理设施处理能力", "94"); + list[94] = new ListItem("38.生态环境污染源", "95"); + list[95] = new ListItem("39.生态环境风险点", "96"); + list[96] = new ListItem("40.节能环保投入占产值比重", "97"); + list[97] = new ListItem("A其中:节能投入", "98"); + list[98] = new ListItem("B环保投入", "99"); + return list; + } + + /// + /// 获取计量单位集合 + /// + /// + public static ListItem[] GetUnits() + { + ListItem[] list = new ListItem[99]; + list[0] = new ListItem("万吨标准煤", "01"); + list[1] = new ListItem("万吨标准煤", "02"); + list[2] = new ListItem("万吨标准煤", "03"); + list[3] = new ListItem("万吨", "04"); + list[4] = new ListItem("万吨", "05"); + list[5] = new ListItem("吨", "06"); + list[6] = new ListItem("万千瓦时", "07"); + list[7] = new ListItem("吨", "08"); + list[8] = new ListItem("吨", "09"); + list[9] = new ListItem("吨", "10"); + list[10] = new ListItem("吨", "11"); + list[11] = new ListItem("吨", "12"); + list[12] = new ListItem("万立方米", "13"); + list[13] = new ListItem("百万千焦", "14"); + list[14] = new ListItem("吨标准煤", "15"); + list[15] = new ListItem("吨标准煤/万元", "16"); + list[16] = new ListItem("万元", "17"); + list[17] = new ListItem("吨标准煤/万元", "18"); + list[18] = new ListItem("万元", "19"); + list[19] = new ListItem("吨标准煤/万元", "20"); + list[20] = new ListItem("万元", "21"); + list[21] = new ListItem("吨标准煤/万元", "22"); + list[22] = new ListItem("万元", "23"); + list[23] = new ListItem("吨/万元", "24"); + list[24] = new ListItem("万吨", "25"); + list[25] = new ListItem("%", "26"); + list[26] = new ListItem("万吨", "27"); + list[27] = new ListItem("千克标准油/吨", "28"); + list[28] = new ListItem("千克标准油", "29"); + list[29] = new ListItem("吨", "30"); + list[30] = new ListItem("千克标准煤/吨", "31"); + list[31] = new ListItem("吨标准煤", "32"); + list[32] = new ListItem("吨", "33"); + list[33] = new ListItem("吨标准煤", "34"); + list[34] = new ListItem("%", "35"); + list[35] = new ListItem("%", "36"); + list[36] = new ListItem("百万千焦", "37"); + list[37] = new ListItem("万千瓦", "38"); + list[38] = new ListItem("万千瓦", "39"); + list[39] = new ListItem("万千瓦", "40"); + list[40] = new ListItem("万千瓦", "41"); + list[41] = new ListItem("万千瓦", "42"); + list[42] = new ListItem("万千瓦", "43"); + list[43] = new ListItem("万千瓦", "44"); + list[44] = new ListItem("万千瓦", "45"); + list[45] = new ListItem("万千瓦", "46"); + list[46] = new ListItem("万千瓦", "47"); + list[47] = new ListItem("万千瓦", "48"); + list[48] = new ListItem("万千瓦", "49"); + list[49] = new ListItem("%", "50"); + list[50] = new ListItem("万千瓦时", "51"); + list[51] = new ListItem("吨", "52"); + list[52] = new ListItem("吨", "53"); + list[53] = new ListItem("吨", "54"); + list[54] = new ListItem("吨", "55"); + list[55] = new ListItem("吨", "56"); + list[56] = new ListItem("吨", "57"); + list[57] = new ListItem("吨", "58"); + list[58] = new ListItem("吨", "59"); + list[59] = new ListItem("吨", "60"); + list[60] = new ListItem("吨", "61"); + list[61] = new ListItem("吨", "62"); + list[62] = new ListItem("吨", "63"); + list[63] = new ListItem("吨", "64"); + list[64] = new ListItem("吨", "65"); + list[65] = new ListItem("吨", "66"); + list[66] = new ListItem("吨", "67"); + list[67] = new ListItem("万吨", "68"); + list[68] = new ListItem("吨二氧化碳当量/万元", "69"); + list[69] = new ListItem("万吨二氧化碳当量", "70"); + list[70] = new ListItem("%", "71"); + list[71] = new ListItem("万吨", "72"); + list[72] = new ListItem("万吨", "73"); + list[73] = new ListItem("万吨", "74"); + list[74] = new ListItem("%", "75"); + list[75] = new ListItem("万吨", "76"); + list[76] = new ListItem("万吨", "77"); + list[77] = new ListItem("万吨", "78"); + list[78] = new ListItem("%", "79"); + list[79] = new ListItem("公顷", "80"); + list[80] = new ListItem("公顷", "81"); + list[81] = new ListItem("%", "82"); + list[82] = new ListItem("公顷", "83"); + list[83] = new ListItem("公顷", "84"); + list[84] = new ListItem("%", "85"); + list[85] = new ListItem("万千瓦", "86"); + list[86] = new ListItem("%", "87"); + list[87] = new ListItem("万千瓦", "88"); + list[88] = new ListItem("%", "89"); + list[89] = new ListItem("万千瓦", "90"); + list[90] = new ListItem("套", "91"); + list[91] = new ListItem("万立方米/年", "92"); + list[92] = new ListItem("套", "93"); + list[93] = new ListItem("万吨/年", "94"); + list[94] = new ListItem("个", "95"); + list[95] = new ListItem("个", "96"); + list[96] = new ListItem("%", "97"); + list[97] = new ListItem("万元", "98"); + list[98] = new ListItem("万元", "99"); + return list; + } + } +} diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectChemicalReportService.cs b/SGGL/BLL/ZHGL/Environmental/ProjectChemicalReportService.cs new file mode 100644 index 00000000..b70d6a7a --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ProjectChemicalReportService.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public static class ProjectChemicalReportService + { + /// + /// 化工行业能源节约与生态环境保护汇总表 + /// + /// 化工行业能源节约与生态环境保护汇总表Id + /// 化工行业能源节约与生态环境保护汇总表 + public static Model.Environmental_ProjectChemicalReport GetChemicalReportByChemicalReportId(string ChemicalReportId) + { + return Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId); + } + + /// + /// 化工行业能源节约与生态环境保护汇总表 + /// + /// 单位Id + /// 年度 + /// 月份 + /// 化工行业能源节约与生态环境保护汇总表 + public static Model.Environmental_ProjectChemicalReport GetChemicalReportByProjectIdAndYearAndMonth(string projectId, int year, int month) + { + return Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ProjectId == projectId && e.Month == month && e.Year == year); + } + + /// + /// 增加化工行业能源节约与生态环境保护汇总表 + /// + /// 化工行业能源节约与生态环境保护汇总表实体 + public static void AddChemicalReport(Model.Environmental_ProjectChemicalReport ChemicalReport) + { + Model.Environmental_ProjectChemicalReport newChemicalReport = new Model.Environmental_ProjectChemicalReport + { + ChemicalReportId = ChemicalReport.ChemicalReportId, + Year = ChemicalReport.Year, + Month = ChemicalReport.Month, + ProjectId = ChemicalReport.ProjectId, + FillingDate = ChemicalReport.FillingDate, + DutyPerson = ChemicalReport.DutyPerson, + FillingMan = ChemicalReport.FillingMan, + UpState = ChemicalReport.UpState, + }; + + Funs.DB.Environmental_ProjectChemicalReport.InsertOnSubmit(newChemicalReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改化工行业能源节约与生态环境保护汇总表 + /// + /// 化工行业能源节约与生态环境保护汇总表实体 + public static void UpdateChemicalReport(Model.Environmental_ProjectChemicalReport ChemicalReport) + { + Model.Environmental_ProjectChemicalReport newChemicalReport = Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReport.ChemicalReportId); + if (newChemicalReport != null) + { + newChemicalReport.Year = ChemicalReport.Year; + newChemicalReport.Month = ChemicalReport.Month; + newChemicalReport.ProjectId = ChemicalReport.ProjectId; + newChemicalReport.FillingDate = ChemicalReport.FillingDate; + newChemicalReport.DutyPerson = ChemicalReport.DutyPerson; + newChemicalReport.UpState = ChemicalReport.UpState; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据Id获取数据 + /// + /// + public static void DeleteChemicalReportByChemicalReportId(string ChemicalReportId) + { + Model.Environmental_ProjectChemicalReport newChemicalReport = Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId); + if (newChemicalReport != null) + { + Funs.DB.Environmental_ProjectChemicalReport.DeleteOnSubmit(newChemicalReport); + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据报表单位,报表时间判断是否存在 + /// + /// Id + /// + public static Model.Environmental_ProjectChemicalReport GetChemicalReportByProjectIdDate(string projectId, int year, int Month) + { + return Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ProjectId == projectId && e.Year == year && e.Month == Month); + } + + /// + /// 根据报表单位,报表年份获取对应集合 + /// + /// Id + /// + public static List GetChemicalReportByProjectIdYear(string projectId, int year) + { + return (from x in Funs.DB.Environmental_ProjectChemicalReport where x.ProjectId == projectId && x.Year == year select x).ToList(); + } + } +} diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectEnergyReportService.cs b/SGGL/BLL/ZHGL/Environmental/ProjectEnergyReportService.cs new file mode 100644 index 00000000..8611cd55 --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ProjectEnergyReportService.cs @@ -0,0 +1,174 @@ +using FineUIPro; +using Microsoft.SqlServer.Dts.Runtime; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography; +using System.Text; + + +namespace BLL +{ + + public static class ProjectEnergyReportService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetEnvironmental_ProjectEnergyReportByModle(Model.Environmental_ProjectEnergyReport table) + { + var q = from x in db.Environmental_ProjectEnergyReport + where + (string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) && + (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && + (string.IsNullOrEmpty(table.FillingMan) || x.FillingMan.Contains(table.FillingMan)) && + (string.IsNullOrEmpty(table.DutyPerson) || x.DutyPerson.Contains(table.DutyPerson)) && + (string.IsNullOrEmpty(table.UpState) || x.UpState.Contains(table.UpState)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.Environmental_ProjectEnergyReport table, Grid Grid1) + { + var q = GetEnvironmental_ProjectEnergyReportByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.EnergyReportId, + x.UnitId, + x.Year, + x.Quarters, + x.FillingMan, + x.FillingDate, + x.DutyPerson, + x.UpState, + x.ProjectId + + }; + } + #endregion + + public static Model.Environmental_ProjectEnergyReport GetEnvironmental_ProjectEnergyReportById(string EnergyReportId) + { + return db.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); + } + + public static Model.Environmental_ProjectEnergyReport GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(string ProjectId, int year, int Quarters) + { + return Funs.DB.Environmental_ProjectEnergyReport.FirstOrDefault(e => e.ProjectId == ProjectId && e.Quarters == Quarters && e.Year == year); + } + public static void AddEnvironmental_ProjectEnergyReport(Model.Environmental_ProjectEnergyReport newtable) + { + + Model.Environmental_ProjectEnergyReport table = new Model.Environmental_ProjectEnergyReport + { + EnergyReportId = newtable.EnergyReportId, + UnitId = newtable.UnitId, + Year = newtable.Year, + Quarters = newtable.Quarters, + FillingMan = newtable.FillingMan, + FillingDate = newtable.FillingDate, + DutyPerson = newtable.DutyPerson, + UpState = newtable.UpState, + ProjectId=newtable.ProjectId, + }; + db.Environmental_ProjectEnergyReport.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkEnvironmental_ProjectEnergyReport(List newtables) + { + + db.Environmental_ProjectEnergyReport.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + /// + /// 根据报表单位,报表时间判断是否存在 + /// + /// Id + /// + public static Model.Environmental_ProjectEnergyReport GetEnergyReportByProjectIdDate(string ProjectId, int year, int Quarters) + { + return Funs.DB.Environmental_ProjectEnergyReport.FirstOrDefault(e => e.ProjectId == ProjectId && e.Year == year && e.Quarters == Quarters); + } + public static List GetEnergyReportByDate(int year, int Quarters) + { + var q = (from x in Funs.DB.Environmental_ProjectEnergyReport where x.Year == year && x.Quarters == Quarters select x).ToList(); + return q; + } + /// + /// 根据报表单位,报表年份获取对应集合 + /// + /// Id + /// + public static List GetEnergyReportByProjectIdYear(string ProjectId, int year) + { + return (from x in Funs.DB.Environmental_ProjectEnergyReport where x.ProjectId == ProjectId && x.Year == year select x).ToList(); + } + public static void UpdateEnvironmental_ProjectEnergyReport(Model.Environmental_ProjectEnergyReport newtable) + { + + Model.Environmental_ProjectEnergyReport table = db.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == newtable.EnergyReportId); + if (table != null) + { + table.EnergyReportId = newtable.EnergyReportId; + table.UnitId = newtable.UnitId; + table.Year = newtable.Year; + table.Quarters = newtable.Quarters; + table.FillingMan = newtable.FillingMan; + table.FillingDate = newtable.FillingDate; + table.DutyPerson = newtable.DutyPerson; + table.UpState = newtable.UpState; + table.ProjectId=newtable.ProjectId; + db.SubmitChanges(); + } + + } + public static void DeleteEnvironmental_ProjectEnergyReportById(string EnergyReportId) + { + + Model.Environmental_ProjectEnergyReport table = db.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); + if (table != null) + { + db.Environmental_ProjectEnergyReport.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLEnvironmental_ProjectEnergyReport() + { + if (db.Environmental_ProjectEnergyReport != null) + { + db.Environmental_ProjectEnergyReport.DeleteAllOnSubmit(db.Environmental_ProjectEnergyReport); + db.SubmitChanges(); + } + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectEnergyreportItemService .cs b/SGGL/BLL/ZHGL/Environmental/ProjectEnergyreportItemService .cs new file mode 100644 index 00000000..6b61ef1b --- /dev/null +++ b/SGGL/BLL/ZHGL/Environmental/ProjectEnergyreportItemService .cs @@ -0,0 +1,289 @@ +using FineUIPro; +using Microsoft.SqlServer.Dts.Runtime; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class ProjectEnergyreportItemService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetEnvironmental_ProjectEnergyReportItemByModle(Model.Environmental_ProjectEnergyReportItem table) + { + var q = from x in db.Environmental_ProjectEnergyReportItem + where + (string.IsNullOrEmpty(table.EnergyReportItemId) || x.EnergyReportItemId.Contains(table.EnergyReportItemId)) && + (string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) && + (string.IsNullOrEmpty(table.SortIndex) || x.SortIndex.Contains(table.SortIndex)) && + (string.IsNullOrEmpty(table.BusinessCategory) || x.BusinessCategory.Contains(table.BusinessCategory)) && + (string.IsNullOrEmpty(table.Throughput_UnitOfMeasurement) || x.Throughput_UnitOfMeasurement.Contains(table.Throughput_UnitOfMeasurement)) && + (string.IsNullOrEmpty(table.Yield_UnitOfMeasurement) || x.Yield_UnitOfMeasurement.Contains(table.Yield_UnitOfMeasurement)) && + (string.IsNullOrEmpty(table.OperationScale_UnitOfMeasurement) || x.OperationScale_UnitOfMeasurement.Contains(table.OperationScale_UnitOfMeasurement)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.Environmental_ProjectEnergyReportItem table, Grid Grid1) + { + var q = GetEnvironmental_ProjectEnergyReportItemByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.EnergyReportItemId, + x.EnergyReportId, + x.SortIndex, + x.BusinessCategory, + x.Throughput_BasePeriod, + x.Throughput_LastPeriod, + x.Throughput_ThisPeriod, + x.Throughput_UnitOfMeasurement, + x.Yield_BasePeriod, + x.Yield_LastPeriod, + x.Yield_ThisPeriod, + x.Yield_UnitOfMeasurement, + x.OutputValue_BasePeriod, + x.OutputValue_LastYear, + x.OutputValue_ThisYear, + x.OperationScale_BasePeriod, + x.OperationScale_LastYear, + x.OperationScale_ThisYear, + x.OperationScale_UnitOfMeasurement, + x.ServiceOperatingIncome_BasePeriod, + x.ServiceOperatingIncome_LastYear, + x.ServiceOperatingIncome_ThisYear, + + }; + } + #endregion + + public static Model.Environmental_ProjectEnergyReportItem GetEnvironmental_ProjectEnergyReportItemById(string EnergyReportItemId) + { + return db.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// + /// 明细记录集合 + public static List GetItems(string EnergyReportId) + { + return (from x in Funs.DB.Environmental_ProjectEnergyReportItem + where x.EnergyReportId == EnergyReportId + orderby x.SortIndex + select x).ToList(); + } + + /// + /// 根据主表Id获取明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetYearSumItems(string ProjectId, int? year, int? Quarters) + { + return (from x in Funs.DB.Environmental_ProjectEnergyReportItem + join y in Funs.DB.Environmental_ProjectEnergyReport + on x.EnergyReportId equals y.EnergyReportId + where y.ProjectId == ProjectId && y.Year == year && y.Quarters == Quarters + orderby x.SortIndex + select x).Distinct().ToList(); + } + + /// + /// 根据主表Id获取年度明细记录集合 + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 年度明细记录集合 + public static List GetItemsByDate(int year, int Quarters) + { + return (from x in Funs.DB.Environmental_ProjectEnergyReportItem + join y in Funs.DB.Environmental_ProjectEnergyReport + on x.EnergyReportId equals y.EnergyReportId + where y.Year == year && y.Quarters== Quarters + select x).Distinct().ToList(); + } + public static List GetLastYearItems(int year) + { + return (from x in Funs.DB.Environmental_ProjectEnergyReportItem + join y in Funs.DB.Environmental_ProjectEnergyReport + on x.EnergyReportId equals y.EnergyReportId + where y.Year == year + select x).Distinct().ToList(); + } + /// + /// 根据主表Id获取明细记录集合(不包含本月合计行) + /// + /// 化工行业能源节约与生态环境保护汇总明细表Id + /// 明细记录集合 + public static List GetShowItems(string EnergyReportId) + { + var q = (from x in Funs.DB.Environmental_ProjectEnergyReportItem + where x.EnergyReportId == EnergyReportId + orderby x.SortIndex + select x).ToList(); + List newItems = new List(); + foreach (var item in q) + { + Model.Environmental_ProjectEnergyReportItem newItem = new Model.Environmental_ProjectEnergyReportItem(); + + newItem.EnergyReportItemId = item.EnergyReportItemId; + newItem.EnergyReportId = item.EnergyReportId; + newItem.SortIndex = item.SortIndex; + newItem.BusinessCategory = item.BusinessCategory; + newItem.Throughput_BasePeriod = item.Throughput_BasePeriod; + newItem.Throughput_LastPeriod = item.Throughput_LastPeriod; + newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod; + newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement; + newItem.Yield_BasePeriod = item.Yield_BasePeriod; + newItem.Yield_LastPeriod = item.Yield_LastPeriod; + newItem.Yield_ThisPeriod = item.Yield_ThisPeriod; + newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement; + newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod; + newItem.OutputValue_LastYear = item.OutputValue_LastYear; + newItem.OutputValue_ThisYear = item.OutputValue_ThisYear; + newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod; + newItem.OperationScale_LastYear = item.OperationScale_LastYear; + newItem.OperationScale_ThisYear = item.OperationScale_ThisYear; + newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement; + newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod; + newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear; + newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear; + newItems.Add(newItem); + } + return newItems; + } + public static void AddEnvironmental_ProjectEnergyReportItem(Model.Environmental_ProjectEnergyReportItem newtable) + { + + Model.Environmental_ProjectEnergyReportItem table = new Model.Environmental_ProjectEnergyReportItem + { + EnergyReportItemId = newtable.EnergyReportItemId, + EnergyReportId = newtable.EnergyReportId, + SortIndex = newtable.SortIndex, + BusinessCategory = newtable.BusinessCategory, + Throughput_BasePeriod = newtable.Throughput_BasePeriod, + Throughput_LastPeriod = newtable.Throughput_LastPeriod, + Throughput_ThisPeriod = newtable.Throughput_ThisPeriod, + Throughput_UnitOfMeasurement = newtable.Throughput_UnitOfMeasurement, + Yield_BasePeriod = newtable.Yield_BasePeriod, + Yield_LastPeriod = newtable.Yield_LastPeriod, + Yield_ThisPeriod = newtable.Yield_ThisPeriod, + Yield_UnitOfMeasurement = newtable.Yield_UnitOfMeasurement, + OutputValue_BasePeriod = newtable.OutputValue_BasePeriod, + OutputValue_LastYear = newtable.OutputValue_LastYear, + OutputValue_ThisYear = newtable.OutputValue_ThisYear, + OperationScale_BasePeriod = newtable.OperationScale_BasePeriod, + OperationScale_LastYear = newtable.OperationScale_LastYear, + OperationScale_ThisYear = newtable.OperationScale_ThisYear, + OperationScale_UnitOfMeasurement = newtable.OperationScale_UnitOfMeasurement, + ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod, + ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear, + ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear, + }; + db.Environmental_ProjectEnergyReportItem.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkEnvironmental_ProjectEnergyReportItem(List newtables) + { + + db.Environmental_ProjectEnergyReportItem.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + + public static void UpdateEnvironmental_ProjectEnergyReportItem(Model.Environmental_ProjectEnergyReportItem newtable) + { + + Model.Environmental_ProjectEnergyReportItem table = db.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == newtable.EnergyReportItemId); + if (table != null) + { + table.EnergyReportItemId = newtable.EnergyReportItemId; + table.EnergyReportId = newtable.EnergyReportId; + table.SortIndex = newtable.SortIndex; + table.BusinessCategory = newtable.BusinessCategory; + table.Throughput_BasePeriod = newtable.Throughput_BasePeriod; + table.Throughput_LastPeriod = newtable.Throughput_LastPeriod; + table.Throughput_ThisPeriod = newtable.Throughput_ThisPeriod; + table.Throughput_UnitOfMeasurement = newtable.Throughput_UnitOfMeasurement; + table.Yield_BasePeriod = newtable.Yield_BasePeriod; + table.Yield_LastPeriod = newtable.Yield_LastPeriod; + table.Yield_ThisPeriod = newtable.Yield_ThisPeriod; + table.Yield_UnitOfMeasurement = newtable.Yield_UnitOfMeasurement; + table.OutputValue_BasePeriod = newtable.OutputValue_BasePeriod; + table.OutputValue_LastYear = newtable.OutputValue_LastYear; + table.OutputValue_ThisYear = newtable.OutputValue_ThisYear; + table.OperationScale_BasePeriod = newtable.OperationScale_BasePeriod; + table.OperationScale_LastYear = newtable.OperationScale_LastYear; + table.OperationScale_ThisYear = newtable.OperationScale_ThisYear; + table.OperationScale_UnitOfMeasurement = newtable.OperationScale_UnitOfMeasurement; + table.ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod; + table.ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear; + table.ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear; + db.SubmitChanges(); + } + + } + public static void DeleteEnvironmental_ProjectEnergyReportItemById(string EnergyReportItemId) + { + + Model.Environmental_ProjectEnergyReportItem table = db.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); + if (table != null) + { + db.Environmental_ProjectEnergyReportItem.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLEnvironmental_ProjectEnergyReportItem() + { + if (db.Environmental_ProjectEnergyReportItem != null) + { + db.Environmental_ProjectEnergyReportItem.DeleteAllOnSubmit(db.Environmental_ProjectEnergyReportItem); + db.SubmitChanges(); + } + } + public static void DeleteEnergyReportItemByChemicalReportId(string EnergyReportId) + { + var q = from x in Funs.DB.Environmental_ProjectEnergyReportItem where x.EnergyReportId == EnergyReportId select x; + if (q != null) + { + Funs.DB.Environmental_ProjectEnergyReportItem.DeleteAllOnSubmit(q); + Funs.DB.SubmitChanges(); + } + } + + + } +} \ No newline at end of file diff --git a/SGGL/BLL/ZHGL/Information/EPSummaryReportService.cs b/SGGL/BLL/ZHGL/Information/EPSummaryReportService.cs new file mode 100644 index 00000000..0d0ac6e3 --- /dev/null +++ b/SGGL/BLL/ZHGL/Information/EPSummaryReportService.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 生态环保工作总结报告 + /// + public static class EPSummaryReportService + { + /// + /// 根据主键获取生态环保工作总结报告 + /// + /// + /// + public static Model.Information_EPSummaryReport GetEPSummaryReportById(string ePSummaryReportId) + { + return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReportId); + } + + /// + /// 根据单位和年份获取生态环保工作总结报告 + /// + /// + /// + /// + public static Model.Information_EPSummaryReport GetEPSummaryReportByUnitIdAndYearId(string unitId, int yearId) + { + return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId); + } + + /// + /// 添加生态环保工作总结报告 + /// + /// + public static void AddEPSummaryReport(Model.Information_EPSummaryReport ePSummaryReport) + { + Model.Information_EPSummaryReport newReport = new Model.Information_EPSummaryReport + { + EPSummaryReportId = ePSummaryReport.EPSummaryReportId, + UnitId = ePSummaryReport.UnitId, + YearId = ePSummaryReport.YearId, + ResponsiblePerson = ePSummaryReport.ResponsiblePerson, + ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel, + ContactPerson = ePSummaryReport.ContactPerson, + ContactPersonTel = ePSummaryReport.ContactPersonTel, + ReportDate = ePSummaryReport.ReportDate, + Description1 = ePSummaryReport.Description1, + Description2 = ePSummaryReport.Description2, + Description3 = ePSummaryReport.Description3, + Description4 = ePSummaryReport.Description4, + Description5 = ePSummaryReport.Description5, + Description6 = ePSummaryReport.Description6, + Description7 = ePSummaryReport.Description7, + Description8 = ePSummaryReport.Description8, + Description9 = ePSummaryReport.Description9 + }; + Funs.DB.Information_EPSummaryReport.InsertOnSubmit(newReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改生态环保工作总结报告 + /// + /// + public static void UpdateEPSummaryReport(Model.Information_EPSummaryReport ePSummaryReport) + { + Model.Information_EPSummaryReport newReport = Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReport.EPSummaryReportId); + if (newReport != null) + { + newReport.UnitId = ePSummaryReport.UnitId; + newReport.YearId = ePSummaryReport.YearId; + newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson; + newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel; + newReport.ContactPerson = ePSummaryReport.ContactPerson; + newReport.ContactPersonTel = ePSummaryReport.ContactPersonTel; + newReport.ReportDate = ePSummaryReport.ReportDate; + newReport.Description1 = ePSummaryReport.Description1; + newReport.Description2 = ePSummaryReport.Description2; + newReport.Description3 = ePSummaryReport.Description3; + newReport.Description4 = ePSummaryReport.Description4; + newReport.Description5 = ePSummaryReport.Description5; + newReport.Description6 = ePSummaryReport.Description6; + newReport.Description7 = ePSummaryReport.Description7; + newReport.Description8 = ePSummaryReport.Description8; + newReport.Description9 = ePSummaryReport.Description9; + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除生态环保工作总结报告 + /// + /// + public static void DeleteEPSummaryReportById(string ePSummaryReportId) + { + Model.Information_EPSummaryReport ePSummaryReport = Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReportId); + if (ePSummaryReport != null) + { + Funs.DB.Information_EPSummaryReport.DeleteOnSubmit(ePSummaryReport); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/ZHGL/Information/MillionsMonthlyReportItemService.cs b/SGGL/BLL/ZHGL/Information/MillionsMonthlyReportItemService.cs index fc0bd1e6..2da2d794 100644 --- a/SGGL/BLL/ZHGL/Information/MillionsMonthlyReportItemService.cs +++ b/SGGL/BLL/ZHGL/Information/MillionsMonthlyReportItemService.cs @@ -6,20 +6,20 @@ namespace BLL public static class MillionsMonthlyReportItemService { /// - /// 百万工时安全统计月报表明细表 + /// 企业安全数据统计月报明细表 /// - /// 百万工时安全统计月报表明细表Id - /// 百万工时安全统计月报表明细表 + /// 企业安全数据统计月报明细表Id + /// 企业安全数据统计月报明细表 public static Model.Information_MillionsMonthlyReportItem GetMillionsMonthlyReportItemByMillionsMonthlyReportItemId(string MillionsMonthlyReportItemId) { return Funs.DB.Information_MillionsMonthlyReportItem.FirstOrDefault(e => e.MillionsMonthlyReportItemId == MillionsMonthlyReportItemId); } /// - /// 百万工时安全统计月报表明细表 + /// 企业安全数据统计月报明细表 /// - /// 百万工时安全统计月报表明细表Id - /// 百万工时安全统计月报表明细表 + /// 企业安全数据统计月报明细表Id + /// 企业安全数据统计月报明细表 public static Model.Information_MillionsMonthlyReportItem GetMillionsMonthlyReportItemByMillionsMonthlyReportIdAndTypeId(string MillionsMonthlyReportId) { return Funs.DB.Information_MillionsMonthlyReportItem.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReportId); @@ -28,7 +28,7 @@ namespace BLL /// /// 根据主表Id判断是否存在明细记录 /// - /// 百万工时安全统计月报表表Id + /// 企业安全数据统计月报表Id /// 是否存在明细记录 public static bool IsExitItems(string MillionsMonthlyReportId) { @@ -38,7 +38,7 @@ namespace BLL /// /// 根据主表Id获取明细记录集合 /// - /// 百万工时安全统计月报表明细表Id + /// 企业安全数据统计月报明细表Id /// 明细记录集合 public static List GetItems(string MillionsMonthlyReportId) { @@ -51,7 +51,7 @@ namespace BLL /// /// 根据主表Id获取明细记录集合 /// - /// 百万工时安全统计月报表明细表Id + /// 企业安全数据统计月报明细表Id /// 明细记录集合 public static List GetYearSumItems(string unitId, int? year, int? month) { @@ -66,7 +66,7 @@ namespace BLL /// /// 根据主表Id获取明细记录集合 /// - /// 百万工时安全统计月报表明细表Id + /// 企业安全数据统计月报明细表Id /// 明细记录集合 public static List GetAllUnitYearSumItems(int year, int month) { @@ -80,7 +80,7 @@ namespace BLL /// /// 根据主表Id获取明细记录集合(不包含本月合计行) /// - /// 百万工时安全统计月报表明细表Id + /// 企业安全数据统计月报明细表Id /// 明细记录集合 public static List GetItemsNoSum(string MillionsMonthlyReportId) { @@ -92,9 +92,9 @@ namespace BLL } /// - /// 增加百万工时安全统计月报表明细表 + /// 增加企业安全数据统计月报明细表 /// - /// 百万工时安全统计月报表明细表实体 + /// 企业安全数据统计月报明细表实体 public static void AddMillionsMonthlyReportItem(Model.Information_MillionsMonthlyReportItem MillionsMonthlyReportItem) { Model.Information_MillionsMonthlyReportItem newMillionsMonthlyReportItem = new Model.Information_MillionsMonthlyReportItem @@ -109,6 +109,9 @@ namespace BLL ContractorNum = MillionsMonthlyReportItem.ContractorNum, SumPersonNum = MillionsMonthlyReportItem.SumPersonNum, TotalWorkNum = MillionsMonthlyReportItem.TotalWorkNum, + DeathAccidentNum = MillionsMonthlyReportItem.DeathAccidentNum, + DeathAccidentPersonNum = MillionsMonthlyReportItem.DeathAccidentPersonNum, + DeathAccidentLossHour = MillionsMonthlyReportItem.DeathAccidentLossHour, SeriousInjuriesNum = MillionsMonthlyReportItem.SeriousInjuriesNum, SeriousInjuriesPersonNum = MillionsMonthlyReportItem.SeriousInjuriesPersonNum, SeriousInjuriesLossHour = MillionsMonthlyReportItem.SeriousInjuriesLossHour, @@ -123,6 +126,7 @@ namespace BLL MedicalTreatmentPersonNum = MillionsMonthlyReportItem.MedicalTreatmentPersonNum, MedicalTreatmentLossHour = MillionsMonthlyReportItem.MedicalTreatmentLossHour, FireNum = MillionsMonthlyReportItem.FireNum, + EnvironmenNum = MillionsMonthlyReportItem.EnvironmenNum, ExplosionNum = MillionsMonthlyReportItem.ExplosionNum, TrafficNum = MillionsMonthlyReportItem.TrafficNum, EquipmentNum = MillionsMonthlyReportItem.EquipmentNum, @@ -138,9 +142,9 @@ namespace BLL } /// - /// 修改百万工时安全统计月报表明细表 + /// 修改企业安全数据统计月报明细表 /// - /// 百万工时安全统计月报表明细表实体 + /// 企业安全数据统计月报明细表实体 public static void UpdateMillionsMonthlyReportItem(Model.Information_MillionsMonthlyReportItem MillionsMonthlyReportItem) { Model.Information_MillionsMonthlyReportItem newMillionsMonthlyReportItem = Funs.DB.Information_MillionsMonthlyReportItem.FirstOrDefault(e => e.MillionsMonthlyReportItemId == MillionsMonthlyReportItem.MillionsMonthlyReportItemId); @@ -152,6 +156,9 @@ namespace BLL newMillionsMonthlyReportItem.ContractorNum = MillionsMonthlyReportItem.ContractorNum; newMillionsMonthlyReportItem.SumPersonNum = MillionsMonthlyReportItem.SumPersonNum; newMillionsMonthlyReportItem.TotalWorkNum = MillionsMonthlyReportItem.TotalWorkNum; + newMillionsMonthlyReportItem.DeathAccidentNum = MillionsMonthlyReportItem.DeathAccidentNum; + newMillionsMonthlyReportItem.DeathAccidentPersonNum = MillionsMonthlyReportItem.DeathAccidentPersonNum; + newMillionsMonthlyReportItem.DeathAccidentLossHour = MillionsMonthlyReportItem.DeathAccidentLossHour; newMillionsMonthlyReportItem.SeriousInjuriesNum = MillionsMonthlyReportItem.SeriousInjuriesNum; newMillionsMonthlyReportItem.SeriousInjuriesPersonNum = MillionsMonthlyReportItem.SeriousInjuriesPersonNum; newMillionsMonthlyReportItem.SeriousInjuriesLossHour = MillionsMonthlyReportItem.SeriousInjuriesLossHour; @@ -167,6 +174,7 @@ namespace BLL newMillionsMonthlyReportItem.MedicalTreatmentLossHour = MillionsMonthlyReportItem.MedicalTreatmentLossHour; newMillionsMonthlyReportItem.FireNum = MillionsMonthlyReportItem.FireNum; newMillionsMonthlyReportItem.ExplosionNum = MillionsMonthlyReportItem.ExplosionNum; + newMillionsMonthlyReportItem.EnvironmenNum = MillionsMonthlyReportItem.EnvironmenNum; newMillionsMonthlyReportItem.TrafficNum = MillionsMonthlyReportItem.TrafficNum; newMillionsMonthlyReportItem.EquipmentNum = MillionsMonthlyReportItem.EquipmentNum; newMillionsMonthlyReportItem.QualityNum = MillionsMonthlyReportItem.QualityNum; diff --git a/SGGL/BLL/ZHGL/Information/MillionsMonthlyReportService.cs b/SGGL/BLL/ZHGL/Information/MillionsMonthlyReportService.cs index 4c951c09..a807d8fa 100644 --- a/SGGL/BLL/ZHGL/Information/MillionsMonthlyReportService.cs +++ b/SGGL/BLL/ZHGL/Information/MillionsMonthlyReportService.cs @@ -6,41 +6,41 @@ namespace BLL public static class MillionsMonthlyReportService { /// - /// 百万工时安全统计月报表 + /// 企业安全数据统计月报 /// - /// 百万工时安全统计月报表Id - /// 百万工时安全统计月报表 + /// 企业安全数据统计月报Id + /// 企业安全数据统计月报 public static Model.Information_MillionsMonthlyReport GetMillionsMonthlyReportByMillionsMonthlyReportId(string MillionsMonthlyReportId) { return Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReportId); } /// - /// 百万工时安全统计月报表 + /// 企业安全数据统计月报 /// /// 单位Id /// 年度 /// 月份 - /// 百万工时安全统计月报表 + /// 企业安全数据统计月报 public static Model.Information_MillionsMonthlyReport GetMillionsMonthlyReportByUnitIdAndYearAndMonth(string unitId, int year, int month) { return Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.UnitId == unitId && e.Month == month && e.Year == year); } /// - /// 根据单位Id获取百万工时安全统计月报表集合 + /// 根据单位Id获取企业安全数据统计月报集合 /// /// 单位Id - /// 百万工时安全统计月报表集合 + /// 企业安全数据统计月报集合 public static List GetMillionsMonthlyReportsByUnitId(string UnitId) { return (from x in Funs.DB.View_Information_MillionsMonthlyReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList(); } /// - /// 增加百万工时安全统计月报表 + /// 增加企业安全数据统计月报 /// - /// 百万工时安全统计月报表实体 + /// 企业安全数据统计月报实体 public static void AddMillionsMonthlyReport(Model.Information_MillionsMonthlyReport MillionsMonthlyReport) { Model.Information_MillionsMonthlyReport newMillionsMonthlyReport = new Model.Information_MillionsMonthlyReport @@ -59,7 +59,23 @@ namespace BLL FillingMan = MillionsMonthlyReport.FillingMan, UpState = MillionsMonthlyReport.UpState, HandleState = MillionsMonthlyReport.HandleState, - HandleMan = MillionsMonthlyReport.HandleMan + HandleMan = MillionsMonthlyReport.HandleMan, + InputCosts = MillionsMonthlyReport.InputCosts, + TrainNum = MillionsMonthlyReport.TrainNum, + GeneralHazardNum = MillionsMonthlyReport.GeneralHazardNum, + MajorHazardNum = MillionsMonthlyReport.MajorHazardNum, + NotProofLargeProjectNum = MillionsMonthlyReport.NotProofLargeProjectNum, + ProofLargeProjectNum = MillionsMonthlyReport.ProofLargeProjectNum, + FireLicenseNum = MillionsMonthlyReport.FireLicenseNum, + LimitLicenseNum = MillionsMonthlyReport.LimitLicenseNum, + HighLicenseNum = MillionsMonthlyReport.HighLicenseNum, + HoistingLicenseNum = MillionsMonthlyReport.HoistingLicenseNum, + BreakGroundLicenseNum = MillionsMonthlyReport.BreakGroundLicenseNum, + ElectricityLicenseNum = MillionsMonthlyReport.ElectricityLicenseNum, + RTLicenseNum = MillionsMonthlyReport.RTLicenseNum, + NightLicenseNum = MillionsMonthlyReport.NightLicenseNum, + CommissionerNum = MillionsMonthlyReport.CommissionerNum, + SoleDutyNum = MillionsMonthlyReport.SoleDutyNum, }; Funs.DB.Information_MillionsMonthlyReport.InsertOnSubmit(newMillionsMonthlyReport); @@ -67,9 +83,9 @@ namespace BLL } /// - /// 修改百万工时安全统计月报表 + /// 修改企业安全数据统计月报 /// - /// 百万工时安全统计月报表实体 + /// 企业安全数据统计月报实体 public static void UpdateMillionsMonthlyReport(Model.Information_MillionsMonthlyReport MillionsMonthlyReport) { Model.Information_MillionsMonthlyReport newMillionsMonthlyReport = Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReport.MillionsMonthlyReportId); @@ -88,6 +104,22 @@ namespace BLL newMillionsMonthlyReport.UpState = MillionsMonthlyReport.UpState; newMillionsMonthlyReport.HandleState = MillionsMonthlyReport.HandleState; newMillionsMonthlyReport.HandleMan = MillionsMonthlyReport.HandleMan; + newMillionsMonthlyReport.InputCosts = MillionsMonthlyReport.InputCosts; + newMillionsMonthlyReport.TrainNum = MillionsMonthlyReport.TrainNum; + newMillionsMonthlyReport.GeneralHazardNum = MillionsMonthlyReport.GeneralHazardNum; + newMillionsMonthlyReport.MajorHazardNum = MillionsMonthlyReport.MajorHazardNum; + newMillionsMonthlyReport.NotProofLargeProjectNum = MillionsMonthlyReport.NotProofLargeProjectNum; + newMillionsMonthlyReport.ProofLargeProjectNum = MillionsMonthlyReport.ProofLargeProjectNum; + newMillionsMonthlyReport.FireLicenseNum = MillionsMonthlyReport.FireLicenseNum; + newMillionsMonthlyReport.LimitLicenseNum = MillionsMonthlyReport.LimitLicenseNum; + newMillionsMonthlyReport.HighLicenseNum = MillionsMonthlyReport.HighLicenseNum; + newMillionsMonthlyReport.HoistingLicenseNum = MillionsMonthlyReport.HoistingLicenseNum; + newMillionsMonthlyReport.BreakGroundLicenseNum = MillionsMonthlyReport.BreakGroundLicenseNum; + newMillionsMonthlyReport.ElectricityLicenseNum = MillionsMonthlyReport.ElectricityLicenseNum; + newMillionsMonthlyReport.RTLicenseNum = MillionsMonthlyReport.RTLicenseNum; + newMillionsMonthlyReport.NightLicenseNum = MillionsMonthlyReport.NightLicenseNum; + newMillionsMonthlyReport.CommissionerNum = MillionsMonthlyReport.CommissionerNum; + newMillionsMonthlyReport.SoleDutyNum = MillionsMonthlyReport.SoleDutyNum; Funs.DB.SubmitChanges(); } diff --git a/SGGL/BLL/ZHGL/Information/QualityWorkSummaryReportService.cs b/SGGL/BLL/ZHGL/Information/QualityWorkSummaryReportService.cs new file mode 100644 index 00000000..25e1059c --- /dev/null +++ b/SGGL/BLL/ZHGL/Information/QualityWorkSummaryReportService.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 质量管理工作总结报告 + /// + public static class QualityWorkSummaryReportService + { + /// + /// 根据主键获取质量管理工作总结报告 + /// + /// + /// + public static Model.Information_QualityWorkSummaryReport GetQualityWorkSummaryReportById(string qualityWorkSummaryReportId) + { + return Funs.DB.Information_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == qualityWorkSummaryReportId); + } + + /// + /// 质量管理工作总结报告 + /// + /// 单位Id + /// 年度 + /// 质量管理工作总结报告 + public static Model.Information_QualityWorkSummaryReport GetQualityWorkSummaryReportByUnitIdAndYear(string unitId, int year) + { + return Funs.DB.Information_QualityWorkSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == year); + } + + /// + /// 添加质量管理工作总结报告 + /// + /// + public static void AddQualityWorkSummaryReport(Model.Information_QualityWorkSummaryReport qualityWorkSummaryReport) + { + Model.Information_QualityWorkSummaryReport newQualityWorkSummaryReport = new Model.Information_QualityWorkSummaryReport + { + QualityWorkSummaryReportId = qualityWorkSummaryReport.QualityWorkSummaryReportId, + YearId = qualityWorkSummaryReport.YearId, + UnitId = qualityWorkSummaryReport.UnitId, + ResponsiblePerson = qualityWorkSummaryReport.ResponsiblePerson, + ResponsiblePersonTel = qualityWorkSummaryReport.ResponsiblePersonTel, + ContactPerson = qualityWorkSummaryReport.ContactPerson, + ContactPersonTel = qualityWorkSummaryReport.ContactPersonTel, + ReportDate = qualityWorkSummaryReport.ReportDate, + Performance = qualityWorkSummaryReport.Performance, + AccidentSituation = qualityWorkSummaryReport.AccidentSituation, + Awards = qualityWorkSummaryReport.Awards, + WorkDevelopment = qualityWorkSummaryReport.WorkDevelopment, + PersonnelTraining = qualityWorkSummaryReport.PersonnelTraining, + CheckSituation = qualityWorkSummaryReport.CheckSituation, + ManagementActivity = qualityWorkSummaryReport.ManagementActivity, + WorkExperience = qualityWorkSummaryReport.WorkExperience, + Countermeasures = qualityWorkSummaryReport.Countermeasures, + NextYearWorkPlan = qualityWorkSummaryReport.NextYearWorkPlan, + JobSuggestion = qualityWorkSummaryReport.JobSuggestion, + UpState = qualityWorkSummaryReport.UpState + }; + Funs.DB.Information_QualityWorkSummaryReport.InsertOnSubmit(newQualityWorkSummaryReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改质量管理工作总结报告 + /// + /// + public static void UpdateQualityWorkSummaryReport(Model.Information_QualityWorkSummaryReport qualityWorkSummaryReport) + { + Model.Information_QualityWorkSummaryReport newQualityWorkSummaryReport = Funs.DB.Information_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == qualityWorkSummaryReport.QualityWorkSummaryReportId); + if (newQualityWorkSummaryReport != null) + { + newQualityWorkSummaryReport.UnitId = qualityWorkSummaryReport.UnitId; + newQualityWorkSummaryReport.YearId = qualityWorkSummaryReport.YearId; + newQualityWorkSummaryReport.ResponsiblePerson = qualityWorkSummaryReport.ResponsiblePerson; + newQualityWorkSummaryReport.ResponsiblePersonTel = qualityWorkSummaryReport.ResponsiblePersonTel; + newQualityWorkSummaryReport.ContactPerson = qualityWorkSummaryReport.ContactPerson; + newQualityWorkSummaryReport.ContactPersonTel = qualityWorkSummaryReport.ContactPersonTel; + newQualityWorkSummaryReport.ReportDate = qualityWorkSummaryReport.ReportDate; + newQualityWorkSummaryReport.Performance = qualityWorkSummaryReport.Performance; + newQualityWorkSummaryReport.AccidentSituation = qualityWorkSummaryReport.AccidentSituation; + newQualityWorkSummaryReport.Awards = qualityWorkSummaryReport.Awards; + newQualityWorkSummaryReport.WorkDevelopment = qualityWorkSummaryReport.WorkDevelopment; + newQualityWorkSummaryReport.PersonnelTraining = qualityWorkSummaryReport.PersonnelTraining; + newQualityWorkSummaryReport.CheckSituation = qualityWorkSummaryReport.CheckSituation; + newQualityWorkSummaryReport.ManagementActivity = qualityWorkSummaryReport.ManagementActivity; + newQualityWorkSummaryReport.WorkExperience = qualityWorkSummaryReport.WorkExperience; + newQualityWorkSummaryReport.Countermeasures = qualityWorkSummaryReport.Countermeasures; + newQualityWorkSummaryReport.NextYearWorkPlan = qualityWorkSummaryReport.NextYearWorkPlan; + newQualityWorkSummaryReport.JobSuggestion = qualityWorkSummaryReport.JobSuggestion; + newQualityWorkSummaryReport.UpState = qualityWorkSummaryReport.UpState; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除质量管理工作总结报告 + /// + /// + public static void DeleteQualityWorkSummaryReportById(string QualityWorkSummaryReportId) + { + Model.Information_QualityWorkSummaryReport qualityWorkSummaryReport = Funs.DB.Information_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == QualityWorkSummaryReportId); + if (qualityWorkSummaryReport != null) + { + Funs.DB.Information_QualityWorkSummaryReport.DeleteOnSubmit(qualityWorkSummaryReport); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/ZHGL/Information/QuarterlyProjectQualityService.cs b/SGGL/BLL/ZHGL/Information/QuarterlyProjectQualityService.cs new file mode 100644 index 00000000..b0b6a6af --- /dev/null +++ b/SGGL/BLL/ZHGL/Information/QuarterlyProjectQualityService.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 季度工程项目质量信息表 + /// + public static class QuarterlyProjectQualityService + { + /// + /// 根据主键获取季度工程项目质量信息表 + /// + /// + /// + public static Model.Information_QuarterlyProjectQuality GetQuarterlyProjectQualityById(string quarterlyProjectQualityId) + { + return Funs.DB.Information_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQualityId); + } + + /// + /// 季度工程项目质量信息表 + /// + /// 单位Id + /// 年度 + /// 季度 + /// 季度工程项目质量信息表 + public static Model.Information_QuarterlyProjectQuality GetQuarterlyProjectQualityByUnitIdAndYearAndQuarter(string unitId, int year,int quarter) + { + return Funs.DB.Information_QuarterlyProjectQuality.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Quarter == quarter); + } + + /// + /// 添加季度工程项目质量信息表 + /// + /// + public static void AddQuarterlyProjectQuality(Model.Information_QuarterlyProjectQuality quarterlyProjectQuality) + { + Model.Information_QuarterlyProjectQuality newQuarterlyProjectQuality = new Model.Information_QuarterlyProjectQuality + { + QuarterlyProjectQualityId = quarterlyProjectQuality.QuarterlyProjectQualityId, + UnitId = quarterlyProjectQuality.UnitId, + Year = quarterlyProjectQuality.Year, + Quarter = quarterlyProjectQuality.Quarter, + QualityManagePersonNum = quarterlyProjectQuality.QualityManagePersonNum, + AdvancedTitlePersonNum = quarterlyProjectQuality.AdvancedTitlePersonNum, + IntermediateTitlePersonNum = quarterlyProjectQuality.IntermediateTitlePersonNum, + BeImplementedProjectNum = quarterlyProjectQuality.BeImplementedProjectNum, + StartImplementedProjectNum = quarterlyProjectQuality.StartImplementedProjectNum, + AccumulativeStartImplemented = quarterlyProjectQuality.AccumulativeStartImplemented, + CompleteProjectNum = quarterlyProjectQuality.CompleteProjectNum, + YearCompleteProjectNum = quarterlyProjectQuality.YearCompleteProjectNum, + QuarterTotal = quarterlyProjectQuality.QuarterTotal, + QuarterFirstPassNum = quarterlyProjectQuality.QuarterFirstPassNum, + QuarterFirstPassRate = quarterlyProjectQuality.QuarterFirstPassRate, + YearTotal = quarterlyProjectQuality.YearTotal, + YearFirstPassNum = quarterlyProjectQuality.YearFirstPassNum, + YearFirstPassRate = quarterlyProjectQuality.YearFirstPassRate, + QuaterCheckSuperviseNum = quarterlyProjectQuality.QuaterCheckSuperviseNum, + QuaterCorrectiveNoticeNum = quarterlyProjectQuality.QuaterCorrectiveNoticeNum, + QuaterQualityProblemNum = quarterlyProjectQuality.QuaterQualityProblemNum, + QuaterClosedQualityProblemNum = quarterlyProjectQuality.QuaterClosedQualityProblemNum, + YearCheckSuperviseNum = quarterlyProjectQuality.YearCheckSuperviseNum, + YearCorrectiveNoticeNum = quarterlyProjectQuality.YearCorrectiveNoticeNum, + YearQualityProblemNum = quarterlyProjectQuality.YearQualityProblemNum, + YearClosedQualityProblemNum = quarterlyProjectQuality.YearClosedQualityProblemNum, + QuaterQualityAccidentNum = quarterlyProjectQuality.QuaterQualityAccidentNum, + QuaterDirectEconomicLoss = quarterlyProjectQuality.QuaterDirectEconomicLoss, + YearQualityAccidentNum = quarterlyProjectQuality.YearQualityAccidentNum, + YearDirectEconomicLoss = quarterlyProjectQuality.YearDirectEconomicLoss, + ResponsiblePerson = quarterlyProjectQuality.ResponsiblePerson, + CompileMan = quarterlyProjectQuality.CompileMan, + CompileDate = quarterlyProjectQuality.CompileDate, + Tel = quarterlyProjectQuality.Tel, + UpState = quarterlyProjectQuality.UpState + }; + Funs.DB.Information_QuarterlyProjectQuality.InsertOnSubmit(newQuarterlyProjectQuality); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改季度工程项目质量信息表 + /// + /// + public static void UpdateQuarterlyProjectQuality(Model.Information_QuarterlyProjectQuality quarterlyProjectQuality) + { + Model.Information_QuarterlyProjectQuality newQuarterlyProjectQuality = Funs.DB.Information_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQuality.QuarterlyProjectQualityId); + if (newQuarterlyProjectQuality != null) + { + newQuarterlyProjectQuality.UnitId = quarterlyProjectQuality.UnitId; + newQuarterlyProjectQuality.Year = quarterlyProjectQuality.Year; + newQuarterlyProjectQuality.Quarter = quarterlyProjectQuality.Quarter; + newQuarterlyProjectQuality.QualityManagePersonNum = quarterlyProjectQuality.QualityManagePersonNum; + newQuarterlyProjectQuality.AdvancedTitlePersonNum = quarterlyProjectQuality.AdvancedTitlePersonNum; + newQuarterlyProjectQuality.IntermediateTitlePersonNum = quarterlyProjectQuality.IntermediateTitlePersonNum; + newQuarterlyProjectQuality.BeImplementedProjectNum = quarterlyProjectQuality.BeImplementedProjectNum; + newQuarterlyProjectQuality.StartImplementedProjectNum = quarterlyProjectQuality.StartImplementedProjectNum; + newQuarterlyProjectQuality.AccumulativeStartImplemented = quarterlyProjectQuality.AccumulativeStartImplemented; + newQuarterlyProjectQuality.CompleteProjectNum = quarterlyProjectQuality.CompleteProjectNum; + newQuarterlyProjectQuality.YearCompleteProjectNum = quarterlyProjectQuality.YearCompleteProjectNum; + newQuarterlyProjectQuality.QuarterTotal = quarterlyProjectQuality.QuarterTotal; + newQuarterlyProjectQuality.QuarterFirstPassNum = quarterlyProjectQuality.QuarterFirstPassNum; + newQuarterlyProjectQuality.QuarterFirstPassRate = quarterlyProjectQuality.QuarterFirstPassRate; + newQuarterlyProjectQuality.YearTotal = quarterlyProjectQuality.YearTotal; + newQuarterlyProjectQuality.YearFirstPassNum = quarterlyProjectQuality.YearFirstPassNum; + newQuarterlyProjectQuality.YearFirstPassRate = quarterlyProjectQuality.YearFirstPassRate; + newQuarterlyProjectQuality.QuaterCheckSuperviseNum = quarterlyProjectQuality.QuaterCheckSuperviseNum; + newQuarterlyProjectQuality.QuaterCorrectiveNoticeNum = quarterlyProjectQuality.QuaterCorrectiveNoticeNum; + newQuarterlyProjectQuality.QuaterQualityProblemNum = quarterlyProjectQuality.QuaterQualityProblemNum; + newQuarterlyProjectQuality.QuaterClosedQualityProblemNum = quarterlyProjectQuality.QuaterClosedQualityProblemNum; + newQuarterlyProjectQuality.YearCheckSuperviseNum = quarterlyProjectQuality.YearCheckSuperviseNum; + newQuarterlyProjectQuality.YearCorrectiveNoticeNum = quarterlyProjectQuality.YearCorrectiveNoticeNum; + newQuarterlyProjectQuality.YearQualityProblemNum = quarterlyProjectQuality.YearQualityProblemNum; + newQuarterlyProjectQuality.YearClosedQualityProblemNum = quarterlyProjectQuality.YearClosedQualityProblemNum; + newQuarterlyProjectQuality.QuaterQualityAccidentNum = quarterlyProjectQuality.QuaterQualityAccidentNum; + newQuarterlyProjectQuality.QuaterDirectEconomicLoss = quarterlyProjectQuality.QuaterDirectEconomicLoss; + newQuarterlyProjectQuality.YearQualityAccidentNum = quarterlyProjectQuality.YearQualityAccidentNum; + newQuarterlyProjectQuality.YearDirectEconomicLoss = quarterlyProjectQuality.YearDirectEconomicLoss; + newQuarterlyProjectQuality.ResponsiblePerson = quarterlyProjectQuality.ResponsiblePerson; + newQuarterlyProjectQuality.CompileMan = quarterlyProjectQuality.CompileMan; + newQuarterlyProjectQuality.CompileDate = quarterlyProjectQuality.CompileDate; + newQuarterlyProjectQuality.Tel = quarterlyProjectQuality.Tel; + newQuarterlyProjectQuality.UpState = quarterlyProjectQuality.UpState; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除季度工程项目质量信息表 + /// + /// + public static void DeleteQuarterlyProjectQualityById(string quarterlyProjectQualityId) + { + Model.Information_QuarterlyProjectQuality quarterlyProjectQuality = Funs.DB.Information_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQualityId); + if (quarterlyProjectQuality != null) + { + Funs.DB.Information_QuarterlyProjectQuality.DeleteOnSubmit(quarterlyProjectQuality); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/ZHGL/Information/SafetyBriefingService.cs b/SGGL/BLL/ZHGL/Information/SafetyBriefingService.cs new file mode 100644 index 00000000..78e56ee2 --- /dev/null +++ b/SGGL/BLL/ZHGL/Information/SafetyBriefingService.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 实业安全简报 + /// + public static class SafetyBriefingService + { + /// + /// 根据主键获取实业安全简报 + /// + /// + /// + public static Model.Information_SafetyBriefing GetSafetyBriefingById(string safetyBriefingId) + { + return Funs.DB.Information_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefingId); + } + + /// + /// 实业安全简报 + /// + /// 单位Id + /// 年度 + /// 月份 + /// 实业安全简报 + public static Model.Information_SafetyBriefing GetSafetyBriefingByUnitIdAndYearAndMonth(string unitId, int year,int month) + { + return Funs.DB.Information_SafetyBriefing.FirstOrDefault(e => e.UnitId == unitId && e.YearId == year && e.Month == month); + } + + /// + /// 添加实业安全简报 + /// + /// + public static void AddSafetyBriefing(Model.Information_SafetyBriefing safetyBriefing) + { + Model.Information_SafetyBriefing newSafetyBriefing = new Model.Information_SafetyBriefing + { + SafetyBriefingId = safetyBriefing.SafetyBriefingId, + UnitId = safetyBriefing.UnitId, + YearId = safetyBriefing.YearId, + Month = safetyBriefing.Month, + CompileMan = safetyBriefing.CompileMan, + CompileDate = safetyBriefing.CompileDate, + Auditor = safetyBriefing.Auditor, + Approver = safetyBriefing.Approver, + MainWork=safetyBriefing.MainWork, + HazardRecording=safetyBriefing.HazardRecording, + SafetyAccident=safetyBriefing.SafetyAccident, + EPAccident=safetyBriefing.EPAccident, + OHAccident=safetyBriefing.OHAccident, + WorkPermitNum=safetyBriefing.WorkPermitNum, + HiddenDangerDetection=safetyBriefing.HiddenDangerDetection, + RectificationSituation=safetyBriefing.RectificationSituation, + CheckProblemsRectification=safetyBriefing.CheckProblemsRectification, + PendingProject=safetyBriefing.PendingProject, + ContractorManagement=safetyBriefing.ContractorManagement, + EnvironmentalEmissions=safetyBriefing.EnvironmentalEmissions, + NextMonthWorkPlan=safetyBriefing.NextMonthWorkPlan, + UpState = safetyBriefing.UpState + }; + Funs.DB.Information_SafetyBriefing.InsertOnSubmit(newSafetyBriefing); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改实业安全简报 + /// + /// + public static void UpdateSafetyBriefing(Model.Information_SafetyBriefing safetyBriefing) + { + Model.Information_SafetyBriefing newSafetyBriefing = Funs.DB.Information_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefing.SafetyBriefingId); + if (newSafetyBriefing != null) + { + newSafetyBriefing.UnitId = safetyBriefing.UnitId; + newSafetyBriefing.YearId = safetyBriefing.YearId; + newSafetyBriefing.Month = safetyBriefing.Month; + newSafetyBriefing.CompileMan = safetyBriefing.CompileMan; + newSafetyBriefing.CompileDate = safetyBriefing.CompileDate; + newSafetyBriefing.Auditor = safetyBriefing.Auditor; + newSafetyBriefing.Approver = safetyBriefing.Approver; + newSafetyBriefing.MainWork = safetyBriefing.MainWork; + newSafetyBriefing.HazardRecording = safetyBriefing.HazardRecording; + newSafetyBriefing.SafetyAccident = safetyBriefing.SafetyAccident; + newSafetyBriefing.EPAccident = safetyBriefing.EPAccident; + newSafetyBriefing.OHAccident = safetyBriefing.OHAccident; + newSafetyBriefing.WorkPermitNum = safetyBriefing.WorkPermitNum; + newSafetyBriefing.HiddenDangerDetection = safetyBriefing.HiddenDangerDetection; + newSafetyBriefing.RectificationSituation = safetyBriefing.RectificationSituation; + newSafetyBriefing.CheckProblemsRectification = safetyBriefing.CheckProblemsRectification; + newSafetyBriefing.PendingProject = safetyBriefing.PendingProject; + newSafetyBriefing.ContractorManagement = safetyBriefing.ContractorManagement; + newSafetyBriefing.EnvironmentalEmissions = safetyBriefing.EnvironmentalEmissions; + newSafetyBriefing.NextMonthWorkPlan = safetyBriefing.NextMonthWorkPlan; + newSafetyBriefing.UpState = safetyBriefing.UpState; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除实业安全简报 + /// + /// + public static void DeleteSafetyBriefingById(string safetyBriefingId) + { + Model.Information_SafetyBriefing safetyBriefing = Funs.DB.Information_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefingId); + if (safetyBriefing != null) + { + Funs.DB.Information_SafetyBriefing.DeleteOnSubmit(safetyBriefing); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/ZHGL/Information/UrgeReportService.cs b/SGGL/BLL/ZHGL/Information/UrgeReportService.cs index 354206fd..b33408f2 100644 --- a/SGGL/BLL/ZHGL/Information/UrgeReportService.cs +++ b/SGGL/BLL/ZHGL/Information/UrgeReportService.cs @@ -4,9 +4,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; - -namespace BLL +namespace BLL { + /// + /// + /// public static class UrgeReportService { /// @@ -19,11 +21,11 @@ namespace BLL public static void SetComplete(string unitId, string reportType, string year, string value) { Model.Information_UrgeReport urgeReport = new Model.Information_UrgeReport(); - if (reportType == Const.ReportType_1 || reportType == Const.ReportType_2) + if (reportType == Const.ReportType_1 || reportType == Const.ReportType_2 || reportType == Const.ReportType_8) { urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year && x.MonthId == value); } - else if (reportType == Const.ReportType_3 || reportType == Const.ReportType_4) + else if (reportType == Const.ReportType_3 || reportType == Const.ReportType_4 || reportType == Const.ReportType_9) { urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year && x.QuarterId == value); } @@ -31,6 +33,10 @@ namespace BLL { urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year && x.HalfYearId == value); } + else if (reportType == Const.ReportType_6 || reportType == Const.ReportType_7 || reportType == Const.ReportType_10) + { + urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year); + } if (urgeReport != null) { urgeReport.IsComplete = true; @@ -38,5 +44,4 @@ namespace BLL } } } - } diff --git a/SGGL/BLL/ZHGL/Information/WorkSummaryReportService.cs b/SGGL/BLL/ZHGL/Information/WorkSummaryReportService.cs new file mode 100644 index 00000000..a88464b4 --- /dev/null +++ b/SGGL/BLL/ZHGL/Information/WorkSummaryReportService.cs @@ -0,0 +1,113 @@ +using System.Linq; + +namespace BLL +{ + /// + /// 安全管理工作总结报告 + /// + public static class WorkSummaryReportService + { + /// + /// 根据主键获取安全管理工作总结报告 + /// + /// + /// + public static Model.Information_WorkSummaryReport GetWorkSummaryReportById(string workSummaryReportId) + { + return Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId); + } + + /// + /// 安全管理工作总结报告 + /// + /// 单位Id + /// 年度 + /// 安全管理工作总结报告 + public static Model.Information_WorkSummaryReport GetWorkSummaryReportByUnitIdAndYear(string unitId, int year) + { + return Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == year); + } + + /// + /// 添加安全管理工作总结报告 + /// + /// + public static void AddWorkSummaryReport(Model.Information_WorkSummaryReport workSummaryReport) + { + Model.Information_WorkSummaryReport newWorkSummaryReport = new Model.Information_WorkSummaryReport + { + WorkSummaryReportId = workSummaryReport.WorkSummaryReportId, + YearId = workSummaryReport.YearId, + UnitId = workSummaryReport.UnitId, + ResponsiblePerson = workSummaryReport.ResponsiblePerson, + ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel, + ContactPerson = workSummaryReport.ContactPerson, + ContactPersonTel = workSummaryReport.ContactPersonTel, + ReportDate = workSummaryReport.ReportDate, + SafeLaborTime = workSummaryReport.SafeLaborTime, + SafetyObjectives = workSummaryReport.SafetyObjectives, + AccidentSituation = workSummaryReport.AccidentSituation, + Awards = workSummaryReport.Awards, + WorkDevelopment = workSummaryReport.WorkDevelopment, + PersonnelTraining = workSummaryReport.PersonnelTraining, + GovernanceSituation = workSummaryReport.GovernanceSituation, + ManagementActivity = workSummaryReport.ManagementActivity, + WorkExperience = workSummaryReport.WorkExperience, + Countermeasures = workSummaryReport.Countermeasures, + NextYearWorkPlan = workSummaryReport.NextYearWorkPlan, + JobSuggestion = workSummaryReport.JobSuggestion, + UpState = workSummaryReport.UpState + }; + Funs.DB.Information_WorkSummaryReport.InsertOnSubmit(newWorkSummaryReport); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改安全管理工作总结报告 + /// + /// + public static void UpdateWorkSummaryReport(Model.Information_WorkSummaryReport workSummaryReport) + { + Model.Information_WorkSummaryReport newWorkSummaryReport = Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReport.WorkSummaryReportId); + if (newWorkSummaryReport != null) + { + newWorkSummaryReport.UnitId = workSummaryReport.UnitId; + newWorkSummaryReport.YearId = workSummaryReport.YearId; + newWorkSummaryReport.ResponsiblePerson = workSummaryReport.ResponsiblePerson; + newWorkSummaryReport.ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel; + newWorkSummaryReport.ContactPerson = workSummaryReport.ContactPerson; + newWorkSummaryReport.ContactPersonTel = workSummaryReport.ContactPersonTel; + newWorkSummaryReport.ReportDate = workSummaryReport.ReportDate; + newWorkSummaryReport.SafeLaborTime = workSummaryReport.SafeLaborTime; + newWorkSummaryReport.SafetyObjectives = workSummaryReport.SafetyObjectives; + newWorkSummaryReport.AccidentSituation = workSummaryReport.AccidentSituation; + newWorkSummaryReport.Awards = workSummaryReport.Awards; + newWorkSummaryReport.WorkDevelopment = workSummaryReport.WorkDevelopment; + newWorkSummaryReport.PersonnelTraining = workSummaryReport.PersonnelTraining; + newWorkSummaryReport.GovernanceSituation = workSummaryReport.GovernanceSituation; + newWorkSummaryReport.ManagementActivity = workSummaryReport.ManagementActivity; + newWorkSummaryReport.WorkExperience = workSummaryReport.WorkExperience; + newWorkSummaryReport.Countermeasures = workSummaryReport.Countermeasures; + newWorkSummaryReport.NextYearWorkPlan = workSummaryReport.NextYearWorkPlan; + newWorkSummaryReport.JobSuggestion = workSummaryReport.JobSuggestion; + newWorkSummaryReport.UpState = workSummaryReport.UpState; + + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除安全管理工作总结报告 + /// + /// + public static void DeleteWorkSummaryReportById(string workSummaryReportId) + { + Model.Information_WorkSummaryReport workSummaryReport = Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId); + if (workSummaryReport != null) + { + Funs.DB.Information_WorkSummaryReport.DeleteOnSubmit(workSummaryReport); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReport.aspx b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReport.aspx new file mode 100644 index 00000000..28b5493b --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReport.aspx @@ -0,0 +1,129 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityWorkSummaryReport.aspx.cs" Inherits="FineUIPro.Web.CQMS.ManageReport.QualityWorkSummaryReport" %> + + + + + + + 质量管理工作总结报告 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + <%-- + + + + --%> + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReport.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReport.aspx.cs new file mode 100644 index 00000000..fa8ee4cc --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReport.aspx.cs @@ -0,0 +1,277 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.ManageReport +{ + public partial class QualityWorkSummaryReport : PageBase + { + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + + ////权限按钮方法 + this.GetButtonPower(); + + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + + this.btnNew.OnClientClick = Window1.GetShowReference("QualityWorkSummaryReportEdit.aspx") + "return false;"; + if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) + { + Grid1.PageSize = this.CurrUser.PageSize.Value; + } + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT report.QualityWorkSummaryReportId," + + @"report.ProjectId," + + @"report.UnitId," + + @"report.YearId," + + @"report.ResponsiblePerson," + + @"report.ResponsiblePersonTel," + + @"report.ContactPerson," + + @"report.ContactPersonTel," + + @"report.ReportDate," + + @"report.Performance," + + @"report.AccidentSituation," + + @"report.Awards," + + @"report.WorkDevelopment," + + @"report.PersonnelTraining," + + @"report.CheckSituation," + + @"report.ManagementActivity," + + @"report.WorkExperience," + + @"report.Countermeasures," + + @"report.NextYearWorkPlan," + + @"report.JobSuggestion," + + @"report.CompileMan," + + @"report.CompileDate, " + + @"U.UserName as CompileManName, " + + @"Unit.UnitName " + + @" FROM InformationProject_QualityWorkSummaryReport AS report " + + @" LEFT JOIN Sys_User AS U ON U.UserId = report.CompileMan " + + @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = report.UnitId WHERE 1=1 "; + + List listStr = new List(); + strSql += " AND report.ProjectId = '" + this.ProjectId + "'"; + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + strSql += " AND report.YearId = @Year"; + listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue))); + } + 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(); + } + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 改变索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + #endregion + + #region 编辑 + /// + /// 双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var projectQualityWorkSummaryReport = BLL.ProjectQualityWorkSummaryReportService.GetQualityWorkSummaryReportById(id); + if (projectQualityWorkSummaryReport != null) + { + //if (this.btnMenuEdit.Hidden) ////双击事件 编辑权限有:编辑页面,无:查看页面 + //{ + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkSummaryReportView.aspx?workSummaryReportId={0}", id, "查看 - "))); + //} + //else + //{ + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("QualityWorkSummaryReportEdit.aspx?qualityWorkSummaryReportId={0}", id, "编辑 - "))); + //} + } + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var report = BLL.ProjectQualityWorkSummaryReportService.GetQualityWorkSummaryReportById(rowID); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString(), rowID, BLL.Const.ProjectQualitySummaryReportMenuId, BLL.Const.BtnDelete); + BLL.ProjectQualityWorkSummaryReportService.DeleteQualityWorkSummaryReportById(rowID); + } + } + this.BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + //protected void btnPrint_Click(object sender, EventArgs e) + //{ + // if (!string.IsNullOrEmpty(Grid1.SelectedRowID)) + // { + // PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/ReportPrint/ExReportPrint.aspx?reportId={0}&&replaceParameter={1}&&varValue={2}", Const.ProjectInformation_MillionsMonthlyReportId, Grid1.SelectedRowID, "", "打印 - "))); + // } + //} + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectQualitySummaryReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReport.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReport.aspx.designer.cs new file mode 100644 index 00000000..8b79e091 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReport.aspx.designer.cs @@ -0,0 +1,150 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.ManageReport { + + + public partial class QualityWorkSummaryReport { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReportEdit.aspx b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReportEdit.aspx new file mode 100644 index 00000000..17475fa4 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReportEdit.aspx @@ -0,0 +1,287 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityWorkSummaryReportEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.ManageReport.QualityWorkSummaryReportEdit" %> + + + + + + + 编辑质量管理工作总结报告 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReportEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReportEdit.aspx.cs new file mode 100644 index 00000000..d5b36dcd --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReportEdit.aspx.cs @@ -0,0 +1,203 @@ +using BLL; +using System; +using System.Linq; + +namespace FineUIPro.Web.CQMS.ManageReport +{ + public partial class QualityWorkSummaryReportEdit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string QualityWorkSummaryReportId + { + get + { + return (string)ViewState["QualityWorkSummaryReportId"]; + } + set + { + ViewState["QualityWorkSummaryReportId"] = value; + } + } + + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + BLL.ConstValue.InitConstValueDropDownList(this.ddlYearId, BLL.ConstValue.Group_0008, true); + + this.QualityWorkSummaryReportId = Request.Params["qualityWorkSummaryReportId"]; + if (!string.IsNullOrEmpty(this.QualityWorkSummaryReportId)) + { + var report = BLL.ProjectQualityWorkSummaryReportService.GetQualityWorkSummaryReportById(this.QualityWorkSummaryReportId); + if (report != null) + { + this.ProjectId = report.ProjectId; + #region 赋值 + if (report.YearId != null) + { + this.ddlYearId.SelectedValue = report.YearId.ToString(); + this.txtReportDate.Text = report.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReportDate) : ""; + this.txtResponsiblePerson.Text = report.ResponsiblePerson; + this.txtResponsiblePersonTel.Text = report.ResponsiblePersonTel; + this.txtContactPerson.Text = report.ContactPerson; + this.txtContactPersonTel.Text = report.ContactPersonTel; + this.txtPerformance.Text = report.Performance; + this.txtAccidentSituation.Text = report.AccidentSituation; + this.txtAwards.Text = report.Awards; + this.txtWorkDevelopment.Text = report.WorkDevelopment; + this.txtPersonnelTraining.Text = report.PersonnelTraining; + this.txtCheckSituation.Text = report.CheckSituation; + this.txtManagementActivity.Text = report.ManagementActivity; + this.txtWorkExperience.Text = report.WorkExperience; + this.txtCountermeasures.Text = report.Countermeasures; + this.txtNextYearWorkPlan.Text = report.NextYearWorkPlan; + this.txtJobSuggestion.Text = report.JobSuggestion; + } + #endregion + } + } + else + { + this.ddlYearId.SelectedValue = DateTime.Now.Year.ToString(); + this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + } + } + } + #endregion + + #region 保存、提交 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.ddlYearId.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + ///// + ///// 提交按钮 + ///// + ///// + ///// + //protected void btnSubmit_Click(object sender, EventArgs e) + //{ + // if (this.ddlYearId.SelectedValue == BLL.Const._Null) + // { + // Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + // return; + // } + // if (this.ddlQuarter.SelectedValue == BLL.Const._Null) + // { + // Alert.ShowInTop("请选择季度", MessageBoxIcon.Warning); + // return; + // } + // this.SaveData(BLL.Const.BtnSubmit); + // PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + //} + + /// + /// 提交数据 + /// + /// + private void SaveData(string type) + { + Model.InformationProject_QualityWorkSummaryReport report = new Model.InformationProject_QualityWorkSummaryReport + { + ProjectId = this.ProjectId, + UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_CD : this.CurrUser.UnitId, + }; + if (this.ddlYearId.SelectedValue != BLL.Const._Null) + { + report.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue); + } + report.ResponsiblePerson = this.txtResponsiblePerson.Text.Trim(); + report.ResponsiblePersonTel = this.txtResponsiblePersonTel.Text.Trim(); + report.ContactPerson = this.txtContactPerson.Text.Trim(); + report.ContactPersonTel = this.txtContactPersonTel.Text.Trim(); + report.ReportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim()); + report.Performance = this.txtPerformance.Text.Trim(); + report.AccidentSituation = this.txtAccidentSituation.Text.Trim(); + report.Awards = this.txtAwards.Text.Trim(); + report.WorkDevelopment = this.txtWorkDevelopment.Text.Trim(); + report.PersonnelTraining = this.txtPersonnelTraining.Text.Trim(); + report.CheckSituation = this.txtCheckSituation.Text.Trim(); + report.ManagementActivity = this.txtManagementActivity.Text.Trim(); + report.WorkExperience = this.txtWorkExperience.Text.Trim(); + report.Countermeasures = this.txtCountermeasures.Text.Trim(); + report.NextYearWorkPlan = this.txtNextYearWorkPlan.Text.Trim(); + report.JobSuggestion = this.txtJobSuggestion.Text.Trim(); + + report.CompileMan = this.CurrUser.UserId; + report.CompileDate = DateTime.Now; + //if (type == BLL.Const.BtnSubmit) + //{ + // safetyQuarterlyReport.States = this.ctlAuditFlow.NextStep; + //} + if (!string.IsNullOrEmpty(this.QualityWorkSummaryReportId)) + { + report.QualityWorkSummaryReportId = this.QualityWorkSummaryReportId; + BLL.ProjectQualityWorkSummaryReportService.UpdateQualityWorkSummaryReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString(), report.QualityWorkSummaryReportId, BLL.Const.ProjectQualitySummaryReportMenuId, BLL.Const.BtnModify); + } + else + { + Model.InformationProject_QualityWorkSummaryReport oldReport = (from x in Funs.DB.InformationProject_QualityWorkSummaryReport + where x.ProjectId == report.ProjectId && x.YearId == report.YearId + select x).FirstOrDefault(); + if (oldReport == null) + { + this.QualityWorkSummaryReportId = SQLHelper.GetNewID(typeof(Model.InformationProject_QualityWorkSummaryReport)); + report.QualityWorkSummaryReportId = this.QualityWorkSummaryReportId; + BLL.ProjectQualityWorkSummaryReportService.AddQualityWorkSummaryReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString(), report.QualityWorkSummaryReportId, BLL.Const.ProjectQualitySummaryReportMenuId, BLL.Const.BtnAdd); + + } + else + { + Alert.ShowInTop("该年度记录已存在", MessageBoxIcon.Warning); + return; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReportEdit.aspx.designer.cs new file mode 100644 index 00000000..d711f10f --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QualityWorkSummaryReportEdit.aspx.designer.cs @@ -0,0 +1,465 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.ManageReport { + + + public partial class QualityWorkSummaryReportEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// ddlYearId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlYearId; + + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReportDate; + + /// + /// txtResponsiblePerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtResponsiblePerson; + + /// + /// txtResponsiblePersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtResponsiblePersonTel; + + /// + /// txtContactPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContactPerson; + + /// + /// txtContactPersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContactPersonTel; + + /// + /// GroupPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// GroupPanel6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel6; + + /// + /// Form7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form7; + + /// + /// txtPerformance 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtPerformance; + + /// + /// GroupPanel7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel7; + + /// + /// Form8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form8; + + /// + /// txtAccidentSituation 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtAccidentSituation; + + /// + /// GroupPanel8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel8; + + /// + /// Form9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form9; + + /// + /// txtAwards 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtAwards; + + /// + /// GroupPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel2; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// GroupPanel9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel9; + + /// + /// Form10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form10; + + /// + /// txtWorkDevelopment 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtWorkDevelopment; + + /// + /// GroupPanel10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel10; + + /// + /// Form11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form11; + + /// + /// txtPersonnelTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtPersonnelTraining; + + /// + /// GroupPanel11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel11; + + /// + /// Form12 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form12; + + /// + /// txtCheckSituation 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtCheckSituation; + + /// + /// GroupPanel12 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel12; + + /// + /// Form13 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form13; + + /// + /// txtManagementActivity 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtManagementActivity; + + /// + /// GroupPanel13 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel13; + + /// + /// Form14 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form14; + + /// + /// txtWorkExperience 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtWorkExperience; + + /// + /// GroupPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel3; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtCountermeasures 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtCountermeasures; + + /// + /// GroupPanel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel4; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// txtNextYearWorkPlan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtNextYearWorkPlan; + + /// + /// GroupPanel5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel5; + + /// + /// Form6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form6; + + /// + /// txtJobSuggestion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtJobSuggestion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQuality.aspx b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQuality.aspx new file mode 100644 index 00000000..1116ecdc --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQuality.aspx @@ -0,0 +1,104 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QuarterlyProjectQuality.aspx.cs" Inherits="FineUIPro.Web.CQMS.ManageReport.QuarterlyProjectQuality" %> + + + + + + + 季度工程项目质量信息表 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQuality.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQuality.aspx.cs new file mode 100644 index 00000000..912c55f8 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQuality.aspx.cs @@ -0,0 +1,245 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.CQMS.ManageReport +{ + public partial class QuarterlyProjectQuality : PageBase + { + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + ////权限按钮方法 + this.GetButtonPower(); + + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, BLL.ConstValue.Group_0011, true); + this.btnNew.OnClientClick = Window1.GetShowReference("QuarterlyProjectQualityEdit.aspx") + "return false;"; + if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) + { + Grid1.PageSize = this.CurrUser.PageSize.Value; + } + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT QuarterlyProjectQuality.QuarterlyProjectQualityId, " + + @"QuarterlyProjectQuality.ProjectId," + + @"QuarterlyProjectQuality.UnitId," + + @"QuarterlyProjectQuality.Year," + + @"QuarterlyProjectQuality.Quarter," + + @"(CAST(QuarterlyProjectQuality.Year AS NVARCHAR(4))+'年 第'+CAST(QuarterlyProjectQuality.Quarter AS NVARCHAR(4))+'季度') AS YearAndQuarters," + + @"QuarterlyProjectQuality.CompileMan," + + @"QuarterlyProjectQuality.CompileDate," + + @"Unit.UnitName," + + @"Users.UserName AS CompileManName," + + @"u.UserName AS ResponsiblePersonName " + + @" FROM InformationProject_QuarterlyProjectQuality AS QuarterlyProjectQuality " + + @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = QuarterlyProjectQuality.UnitId" + + @" LEFT JOIN Sys_User AS u ON QuarterlyProjectQuality.ResponsiblePerson = u.UserId" + + @" LEFT JOIN Sys_User AS Users ON QuarterlyProjectQuality.CompileMan = Users.UserId WHERE 1=1 "; + List listStr = new List(); + strSql += " AND QuarterlyProjectQuality.ProjectId = '" + this.ProjectId + "'"; + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + strSql += " AND QuarterlyProjectQuality.YearId = @Year"; + listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue))); + } + if (this.drpQuarters.SelectedValue != BLL.Const._Null) + { + strSql += " AND QuarterlyProjectQuality.Quarter = @Quarter "; + listStr.Add(new SqlParameter("@Quarter", Funs.GetNewInt(this.drpQuarters.SelectedValue))); + } + 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(); + } + + #region 分页 排序 + /// + /// 改变索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 编辑 + /// + /// 双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var quality = BLL.ProjectQuarterlyProjectQualityService.GetQuarterlyProjectQualityById(id); + if (quality != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("QuarterlyProjectQualityEdit.aspx?QuarterlyProjectQualityId={0}", id, "编辑 - "))); + } + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var getV = BLL.ProjectQuarterlyProjectQualityService.GetQuarterlyProjectQualityById(rowID); + if (getV != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, getV.Year.ToString() + "-" + getV.Quarter.ToString(), getV.QuarterlyProjectQualityId, BLL.Const.ProjectQuarterlyProjectQualityMenuId, BLL.Const.BtnDelete); + BLL.ProjectQuarterlyProjectQualityService.DeleteQuarterlyProjectQualityById(rowID); + } + } + this.BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectQuarterlyProjectQualityMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQuality.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQuality.aspx.designer.cs new file mode 100644 index 00000000..22252fc5 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQuality.aspx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.ManageReport { + + + public partial class QuarterlyProjectQuality { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQualityEdit.aspx b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQualityEdit.aspx new file mode 100644 index 00000000..eba815d3 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQualityEdit.aspx @@ -0,0 +1,234 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QuarterlyProjectQualityEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.ManageReport.QuarterlyProjectQualityEdit" %> + + + + + + + 季度工程项目质量信息表 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQualityEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQualityEdit.aspx.cs new file mode 100644 index 00000000..da7d2eca --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQualityEdit.aspx.cs @@ -0,0 +1,315 @@ +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace FineUIPro.Web.CQMS.ManageReport +{ + public partial class QuarterlyProjectQualityEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string QuarterlyProjectQualityId + { + get + { + return (string)ViewState["QuarterlyProjectQualityId"]; + } + set + { + ViewState["QuarterlyProjectQualityId"] = value; + } + } + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + BLL.ConstValue.InitConstValueDropDownList(this.ddlYearId, BLL.ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.ddlQuarter, BLL.ConstValue.Group_0011, true); + BLL.UserService.InitUserProjectIdUnitIdDropDownList(this.drpCompileMan, this.ProjectId, this.CurrUser.UnitId, true); + BLL.UserService.InitUserProjectIdUnitIdDropDownList(this.drpResponsiblePerson, this.ProjectId, this.CurrUser.UnitId, true); + + this.QuarterlyProjectQualityId = Request.Params["QuarterlyProjectQualityId"]; + if (!string.IsNullOrEmpty(this.QuarterlyProjectQualityId)) + { + var quarterlyProjectQuality = BLL.ProjectQuarterlyProjectQualityService.GetQuarterlyProjectQualityById(this.QuarterlyProjectQualityId); + if (quarterlyProjectQuality != null) + { + this.ProjectId = quarterlyProjectQuality.ProjectId; + if (quarterlyProjectQuality.Year.HasValue) + { + this.ddlYearId.SelectedValue = quarterlyProjectQuality.Year.ToString(); + } + if (quarterlyProjectQuality.Quarter.HasValue) + { + this.ddlQuarter.SelectedValue = quarterlyProjectQuality.Quarter.ToString(); + } + if (quarterlyProjectQuality.CompileDate != null) + { + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", quarterlyProjectQuality.CompileDate); + } + if (!string.IsNullOrEmpty(quarterlyProjectQuality.ResponsiblePerson)) + { + this.drpResponsiblePerson.SelectedValue = quarterlyProjectQuality.ResponsiblePerson; + } + if (!string.IsNullOrEmpty(quarterlyProjectQuality.CompileMan)) + { + this.drpCompileMan.SelectedValue = quarterlyProjectQuality.CompileMan; + } + this.txtTel.Text = quarterlyProjectQuality.Tel; + this.txtQualityManagePersonNum.Text = quarterlyProjectQuality.QualityManagePersonNum.HasValue ? quarterlyProjectQuality.QualityManagePersonNum.ToString() : ""; + this.txtAdvancedTitlePersonNum.Text = quarterlyProjectQuality.AdvancedTitlePersonNum.HasValue ? quarterlyProjectQuality.AdvancedTitlePersonNum.ToString() : ""; + this.txtIntermediateTitlePersonNum.Text = quarterlyProjectQuality.IntermediateTitlePersonNum.HasValue ? quarterlyProjectQuality.IntermediateTitlePersonNum.ToString() : ""; + this.txtBeImplementedProjectNum.Text = quarterlyProjectQuality.BeImplementedProjectNum.HasValue ? quarterlyProjectQuality.BeImplementedProjectNum.ToString() : ""; + this.txtStartImplementedProjectNum.Text = quarterlyProjectQuality.StartImplementedProjectNum.HasValue ? quarterlyProjectQuality.StartImplementedProjectNum.ToString() : ""; + this.txtAccumulativeStartImplemented.Text = quarterlyProjectQuality.AccumulativeStartImplemented.HasValue ? quarterlyProjectQuality.AccumulativeStartImplemented.ToString() : ""; + this.txtCompleteProjectNum.Text = quarterlyProjectQuality.CompleteProjectNum.HasValue ? quarterlyProjectQuality.CompleteProjectNum.ToString() : ""; + this.txtYearCompleteProjectNum.Text = quarterlyProjectQuality.YearCompleteProjectNum.HasValue ? quarterlyProjectQuality.YearCompleteProjectNum.ToString() : ""; + this.txtQuarterTotal.Text = quarterlyProjectQuality.QuarterTotal.HasValue ? quarterlyProjectQuality.QuarterTotal.ToString() : ""; + this.txtQuarterFirstPassNum.Text = quarterlyProjectQuality.QuarterFirstPassNum.HasValue ? quarterlyProjectQuality.QuarterFirstPassNum.ToString() : ""; + this.txtQuarterFirstPassRate.Text = quarterlyProjectQuality.QuarterFirstPassRate.HasValue ? quarterlyProjectQuality.QuarterFirstPassRate.ToString() : ""; + this.txtYearTotal.Text = quarterlyProjectQuality.YearTotal.HasValue ? quarterlyProjectQuality.YearTotal.ToString() : ""; + this.txtYearFirstPassNum.Text = quarterlyProjectQuality.YearFirstPassNum.HasValue ? quarterlyProjectQuality.YearFirstPassNum.ToString() : ""; + this.txtYearFirstPassRate.Text = quarterlyProjectQuality.YearFirstPassRate.HasValue ? quarterlyProjectQuality.YearFirstPassRate.ToString() : ""; + this.txtQuaterCheckSuperviseNum.Text = quarterlyProjectQuality.QuaterCheckSuperviseNum.HasValue ? quarterlyProjectQuality.QuaterCheckSuperviseNum.ToString() : ""; + this.txtQuaterCorrectiveNoticeNum.Text = quarterlyProjectQuality.QuaterCorrectiveNoticeNum.HasValue ? quarterlyProjectQuality.QuaterCorrectiveNoticeNum.ToString() : ""; + this.txtQuaterQualityProblemNum.Text = quarterlyProjectQuality.QuaterQualityProblemNum.HasValue ? quarterlyProjectQuality.QuaterQualityProblemNum.ToString() : ""; + this.txtQuaterClosedQualityProblemNum.Text = quarterlyProjectQuality.QuaterClosedQualityProblemNum.HasValue ? quarterlyProjectQuality.QuaterClosedQualityProblemNum.ToString() : ""; + this.txtYearCheckSuperviseNum.Text = quarterlyProjectQuality.YearCheckSuperviseNum.HasValue ? quarterlyProjectQuality.YearCheckSuperviseNum.ToString() : ""; + this.txtYearCorrectiveNoticeNum.Text = quarterlyProjectQuality.YearCorrectiveNoticeNum.HasValue ? quarterlyProjectQuality.YearCorrectiveNoticeNum.ToString() : ""; + this.txtYearQualityProblemNum.Text = quarterlyProjectQuality.YearQualityProblemNum.HasValue ? quarterlyProjectQuality.YearQualityProblemNum.ToString() : ""; + this.txtYearClosedQualityProblemNum.Text = quarterlyProjectQuality.YearClosedQualityProblemNum.HasValue ? quarterlyProjectQuality.YearClosedQualityProblemNum.ToString() : ""; + this.txtQuaterQualityAccidentNum.Text = quarterlyProjectQuality.QuaterQualityAccidentNum.HasValue ? quarterlyProjectQuality.QuaterQualityAccidentNum.ToString() : ""; + this.txtQuaterDirectEconomicLoss.Text = quarterlyProjectQuality.QuaterDirectEconomicLoss.HasValue ? quarterlyProjectQuality.QuaterDirectEconomicLoss.ToString() : ""; + this.txtYearQualityAccidentNum.Text = quarterlyProjectQuality.YearQualityAccidentNum.HasValue ? quarterlyProjectQuality.YearQualityAccidentNum.ToString() : ""; + this.txtYearDirectEconomicLoss.Text = quarterlyProjectQuality.YearDirectEconomicLoss.HasValue ? quarterlyProjectQuality.YearDirectEconomicLoss.ToString() : ""; + } + } + else + { + DateTime showDate = DateTime.Now.AddMonths(-3); + this.ddlQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + this.ddlYearId.SelectedValue = showDate.Year.ToString(); + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + DateTime startTime = Funs.GetQuarterlyMonths(this.ddlYearId.SelectedValue, this.ddlQuarter.SelectedValue); + DateTime endTime = startTime.AddMonths(3); + } + } + } + #endregion + + #region 年季度变化事件 + /// + /// 年季度变化事件 + /// + /// + /// + protected void drpYear_SelectedIndexChanged(object sender, EventArgs e) + { + if (this.ddlYearId.SelectedValue != BLL.Const._Null && this.ddlQuarter.SelectedValue != BLL.Const._Null) + { + DateTime startTime = Funs.GetQuarterlyMonths(this.ddlYearId.SelectedValue, this.ddlQuarter.SelectedValue); + DateTime endTime = startTime.AddMonths(3); + } + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.ddlYearId.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + return; + } + if (this.ddlQuarter.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择季度", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + Model.InformationProject_QuarterlyProjectQuality quarterlyProjectQuality = new Model.InformationProject_QuarterlyProjectQuality + { + ProjectId = this.ProjectId, + UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_CD : this.CurrUser.UnitId, + QualityManagePersonNum = Funs.GetNewInt(this.txtQualityManagePersonNum.Text.Trim()), + AdvancedTitlePersonNum = Funs.GetNewInt(this.txtAdvancedTitlePersonNum.Text.Trim()), + IntermediateTitlePersonNum = Funs.GetNewInt(this.txtIntermediateTitlePersonNum.Text.Trim()), + BeImplementedProjectNum = Funs.GetNewInt(this.txtBeImplementedProjectNum.Text.Trim()), + StartImplementedProjectNum = Funs.GetNewInt(this.txtStartImplementedProjectNum.Text.Trim()), + AccumulativeStartImplemented = Funs.GetNewInt(this.txtAccumulativeStartImplemented.Text.Trim()), + CompleteProjectNum = Funs.GetNewInt(this.txtCompleteProjectNum.Text.Trim()), + YearCompleteProjectNum = Funs.GetNewInt(this.txtYearCompleteProjectNum.Text.Trim()), + QuarterTotal = Funs.GetNewInt(this.txtQuarterTotal.Text.Trim()), + QuarterFirstPassNum = Funs.GetNewInt(this.txtQuarterFirstPassNum.Text.Trim()), + QuarterFirstPassRate = Funs.GetNewDecimal(this.txtQuarterFirstPassRate.Text.Trim()), + YearTotal = Funs.GetNewInt(this.txtYearTotal.Text.Trim()), + YearFirstPassNum = Funs.GetNewInt(this.txtYearFirstPassNum.Text.Trim()), + YearFirstPassRate = Funs.GetNewDecimal(this.txtYearFirstPassRate.Text.Trim()), + QuaterCheckSuperviseNum = Funs.GetNewInt(this.txtQuaterCheckSuperviseNum.Text.Trim()), + QuaterCorrectiveNoticeNum = Funs.GetNewInt(this.txtQuaterCorrectiveNoticeNum.Text.Trim()), + QuaterQualityProblemNum = Funs.GetNewInt(this.txtQuaterQualityProblemNum.Text.Trim()), + QuaterClosedQualityProblemNum = Funs.GetNewInt(this.txtQuaterClosedQualityProblemNum.Text.Trim()), + YearCheckSuperviseNum = Funs.GetNewInt(this.txtYearCheckSuperviseNum.Text.Trim()), + YearCorrectiveNoticeNum = Funs.GetNewInt(this.txtYearCorrectiveNoticeNum.Text.Trim()), + YearQualityProblemNum = Funs.GetNewInt(this.txtYearQualityProblemNum.Text.Trim()), + YearClosedQualityProblemNum = Funs.GetNewInt(this.txtYearClosedQualityProblemNum.Text.Trim()), + QuaterQualityAccidentNum = Funs.GetNewInt(this.txtQuaterQualityAccidentNum.Text.Trim()), + QuaterDirectEconomicLoss = Funs.GetNewDecimal(this.txtQuaterDirectEconomicLoss.Text.Trim()), + YearQualityAccidentNum = Funs.GetNewInt(this.txtYearQualityAccidentNum.Text.Trim()), + YearDirectEconomicLoss = Funs.GetNewInt(this.txtYearDirectEconomicLoss.Text.Trim()), + Tel = this.txtTel.Text.Trim() + }; + + if (this.ddlYearId.SelectedValue != BLL.Const._Null) + { + quarterlyProjectQuality.Year = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue); + } + if (this.ddlQuarter.SelectedValue != BLL.Const._Null) + { + quarterlyProjectQuality.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue); + } + if (this.drpResponsiblePerson.SelectedValue != BLL.Const._Null) + { + quarterlyProjectQuality.ResponsiblePerson = this.drpResponsiblePerson.SelectedValue; + } + if (this.drpCompileMan.SelectedValue != BLL.Const._Null) + { + quarterlyProjectQuality.CompileMan = this.drpCompileMan.SelectedValue; + } + quarterlyProjectQuality.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim()); + + if (!string.IsNullOrEmpty(this.QuarterlyProjectQualityId)) + { + quarterlyProjectQuality.QuarterlyProjectQualityId = this.QuarterlyProjectQualityId; + BLL.ProjectQuarterlyProjectQualityService.UpdateQuarterlyProjectQuality(quarterlyProjectQuality); + BLL.LogService.AddSys_Log(this.CurrUser, quarterlyProjectQuality.Year.ToString() + "-" + quarterlyProjectQuality.Quarter.ToString(), quarterlyProjectQuality.QuarterlyProjectQualityId, BLL.Const.ProjectQuarterlyProjectQualityMenuId, BLL.Const.BtnModify); + } + else + { + Model.InformationProject_QuarterlyProjectQuality oldDrillConductedQuarterlyReport = (from x in Funs.DB.InformationProject_QuarterlyProjectQuality + where x.ProjectId == quarterlyProjectQuality.ProjectId && x.Year == quarterlyProjectQuality.Year && x.Quarter == quarterlyProjectQuality.Quarter + select x).FirstOrDefault(); + if (oldDrillConductedQuarterlyReport == null) + { + this.QuarterlyProjectQualityId = SQLHelper.GetNewID(typeof(Model.InformationProject_QuarterlyProjectQuality)); + quarterlyProjectQuality.QuarterlyProjectQualityId = this.QuarterlyProjectQualityId; + BLL.ProjectQuarterlyProjectQualityService.AddQuarterlyProjectQuality(quarterlyProjectQuality); + BLL.LogService.AddSys_Log(this.CurrUser, quarterlyProjectQuality.Year.ToString() + "-" + quarterlyProjectQuality.Quarter.ToString(), quarterlyProjectQuality.QuarterlyProjectQualityId, BLL.Const.ProjectQuarterlyProjectQualityMenuId, BLL.Const.BtnAdd); + + } + else + { + Alert.ShowInTop("该季度记录已存在", MessageBoxIcon.Warning); + return; + } + } + } + #endregion + + /// + /// 本季度完成一次合格率 + /// + /// + /// + protected void txtQuarterTotal_TextChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.txtQuarterTotal.Text.Trim()) && !string.IsNullOrEmpty(txtQuarterFirstPassNum.Text.Trim())) + { + txtQuarterFirstPassRate.Text = (Funs.GetNewDecimalOrZero(txtQuarterFirstPassNum.Text.Trim()) / Funs.GetNewDecimalOrZero(this.txtQuarterTotal.Text.Trim())*100).ToString(); + } + else + { + this.txtQuarterFirstPassRate.Text = string.Empty; + } + } + + /// + /// 本年度完成一次合格率 + /// + /// + /// + protected void txtYearTotal_TextChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.txtYearTotal.Text.Trim()) && !string.IsNullOrEmpty(this.txtYearFirstPassNum.Text.Trim())) + { + this.txtYearFirstPassRate.Text = (Funs.GetNewDecimalOrZero(this.txtYearFirstPassNum.Text.Trim()) / Funs.GetNewDecimalOrZero(this.txtYearTotal.Text.Trim())*100).ToString(); + } + } + + /// + /// 获取本年累计开始实施项目数量(个) + /// + /// + /// + //protected void txtStartImplementedProjectNum_TextChanged(object sender, EventArgs e) + //{ + // var q = (from x in Funs.DB.InformationProject_QuarterlyProjectQuality where x.Year == Convert.ToInt32(this.ddlYearId.SelectedValue) select x.StartImplementedProjectNum).Sum(); + // if (q > 0) + // { + // this.txtAccumulativeStartImplemented.Text = (q + Funs.GetNewIntOrZero(txtStartImplementedProjectNum.Text.Trim())).ToString(); + // } + //} + + /// + /// 获取本年累计完成(竣工)项目数量(个) + /// + /// + /// + //protected void txtCompleteProjectNum_TextChanged(object sender, EventArgs e) + //{ + // var q = (from x in Funs.DB.InformationProject_QuarterlyProjectQuality where x.Year == Convert.ToInt32(this.ddlYearId.SelectedValue) select x.CompleteProjectNum).Sum(); + // if (q > 0) + // { + // this.txtYearCompleteProjectNum.Text = (q + Funs.GetNewIntOrZero(this.txtCompleteProjectNum.Text.Trim())).ToString(); + // } + //} + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQualityEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQualityEdit.aspx.designer.cs new file mode 100644 index 00000000..73ae3576 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/ManageReport/QuarterlyProjectQualityEdit.aspx.designer.cs @@ -0,0 +1,546 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.ManageReport { + + + public partial class QuarterlyProjectQualityEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// ddlYearId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlYearId; + + /// + /// ddlQuarter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlQuarter; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// drpResponsiblePerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpResponsiblePerson; + + /// + /// drpCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCompileMan; + + /// + /// txtTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTel; + + /// + /// GroupPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtQualityManagePersonNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQualityManagePersonNum; + + /// + /// txtAdvancedTitlePersonNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtAdvancedTitlePersonNum; + + /// + /// txtIntermediateTitlePersonNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtIntermediateTitlePersonNum; + + /// + /// GroupPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel2; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// txtBeImplementedProjectNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtBeImplementedProjectNum; + + /// + /// txtStartImplementedProjectNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtStartImplementedProjectNum; + + /// + /// txtAccumulativeStartImplemented 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtAccumulativeStartImplemented; + + /// + /// txtCompleteProjectNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtCompleteProjectNum; + + /// + /// txtYearCompleteProjectNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearCompleteProjectNum; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// GroupPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel3; + + /// + /// GroupPanel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel4; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtQuarterTotal 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQuarterTotal; + + /// + /// txtQuarterFirstPassNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQuarterFirstPassNum; + + /// + /// txtQuarterFirstPassRate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQuarterFirstPassRate; + + /// + /// GroupPanel5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel5; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// txtYearTotal 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearTotal; + + /// + /// txtYearFirstPassNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearFirstPassNum; + + /// + /// txtYearFirstPassRate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearFirstPassRate; + + /// + /// GroupPanel6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel6; + + /// + /// GroupPanel7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel7; + + /// + /// Form6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form6; + + /// + /// txtQuaterCheckSuperviseNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQuaterCheckSuperviseNum; + + /// + /// txtQuaterCorrectiveNoticeNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQuaterCorrectiveNoticeNum; + + /// + /// txtQuaterQualityProblemNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQuaterQualityProblemNum; + + /// + /// txtQuaterClosedQualityProblemNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQuaterClosedQualityProblemNum; + + /// + /// GroupPanel8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel8; + + /// + /// Form7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form7; + + /// + /// txtYearCheckSuperviseNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearCheckSuperviseNum; + + /// + /// txtYearCorrectiveNoticeNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearCorrectiveNoticeNum; + + /// + /// txtYearQualityProblemNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearQualityProblemNum; + + /// + /// txtYearClosedQualityProblemNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearClosedQualityProblemNum; + + /// + /// GroupPanel9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel9; + + /// + /// GroupPanel10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel10; + + /// + /// Form8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form8; + + /// + /// txtQuaterQualityAccidentNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQuaterQualityAccidentNum; + + /// + /// txtQuaterDirectEconomicLoss 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtQuaterDirectEconomicLoss; + + /// + /// GroupPanel11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel11; + + /// + /// Form9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form9; + + /// + /// txtYearQualityAccidentNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearQualityAccidentNum; + + /// + /// txtYearDirectEconomicLoss 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearDirectEconomicLoss; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 78f974a7..c081f3c5 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -477,6 +477,10 @@ + + + + @@ -1004,6 +1008,8 @@ + + @@ -1028,6 +1034,8 @@ + + @@ -1742,6 +1750,8 @@ + + @@ -1871,15 +1881,31 @@ + + + + + + + + + + + + + + + + @@ -1907,12 +1933,22 @@ + + + + + + + + + + @@ -7733,6 +7769,34 @@ NCRStatisc.aspx + + QualityWorkSummaryReport.aspx + ASPXCodeBehind + + + QualityWorkSummaryReport.aspx + + + QualityWorkSummaryReportEdit.aspx + ASPXCodeBehind + + + QualityWorkSummaryReportEdit.aspx + + + QuarterlyProjectQuality.aspx + ASPXCodeBehind + + + QuarterlyProjectQuality.aspx + + + QuarterlyProjectQualityEdit.aspx + ASPXCodeBehind + + + QuarterlyProjectQualityEdit.aspx + WeekReport.aspx ASPXCodeBehind @@ -11422,6 +11486,20 @@ DrillPlanHalfYearReportView.aspx + + EPSummaryReport.aspx + ASPXCodeBehind + + + EPSummaryReport.aspx + + + EPSummaryReportEdit.aspx + ASPXCodeBehind + + + EPSummaryReportEdit.aspx + FileCabinetA.aspx ASPXCodeBehind @@ -11590,6 +11668,20 @@ SafetyQuarterlyReportView.aspx + + WorkSummaryReport.aspx + ASPXCodeBehind + + + WorkSummaryReport.aspx + + + WorkSummaryReportEdit.aspx + ASPXCodeBehind + + + WorkSummaryReportEdit.aspx + HSSEStandardList.aspx ASPXCodeBehind @@ -14763,6 +14855,20 @@ + + SafetyBriefing.aspx + ASPXCodeBehind + + + SafetyBriefing.aspx + + + SafetyBriefingEdit.aspx + ASPXCodeBehind + + + SafetyBriefingEdit.aspx + CustomQuery.aspx ASPXCodeBehind @@ -15876,6 +15982,34 @@ SYHSEData_SYHSEEdit.aspx + + ArchitectureReport.aspx + ASPXCodeBehind + + + ArchitectureReport.aspx + + + ArchitectureReportSave.aspx + ASPXCodeBehind + + + ArchitectureReportSave.aspx + + + ChemicalReport.aspx + ASPXCodeBehind + + + ChemicalReport.aspx + + + ChemicalReportSave.aspx + ASPXCodeBehind + + + ChemicalReportSave.aspx + EIAReport.aspx ASPXCodeBehind @@ -15897,6 +16031,20 @@ EIAReportView.aspx + + EnergyReport.aspx + ASPXCodeBehind + + + EnergyReport.aspx + + + EnergyReportSave.aspx + ASPXCodeBehind + + + EnergyReportSave.aspx + EnvironmentalEmergencyPlan.aspx ASPXCodeBehind @@ -15939,6 +16087,76 @@ EnvironmentalMonitoringView.aspx + + OperationReport.aspx + ASPXCodeBehind + + + OperationReport.aspx + + + OperationReportEdit.aspx + ASPXCodeBehind + + + OperationReportEdit.aspx + + + ProjectArchitectureReport.aspx + ASPXCodeBehind + + + ProjectArchitectureReport.aspx + + + ProjectArchitectureReportSave.aspx + ASPXCodeBehind + + + ProjectArchitectureReportSave.aspx + + + ProjectChemicalReport.aspx + ASPXCodeBehind + + + ProjectChemicalReport.aspx + + + ProjectChemicalReportSave.aspx + ASPXCodeBehind + + + ProjectChemicalReportSave.aspx + + + ProjectEnergyReport.aspx + ASPXCodeBehind + + + ProjectEnergyReport.aspx + + + ProjectEnergyReportSave.aspx + ASPXCodeBehind + + + ProjectEnergyReportSave.aspx + + + ProjectOperationReport.aspx + ASPXCodeBehind + + + ProjectOperationReport.aspx + + + ProjectOperationReportEdit.aspx + ASPXCodeBehind + + + ProjectOperationReportEdit.aspx + UnexpectedEnvironmental.aspx ASPXCodeBehind @@ -16128,6 +16346,20 @@ DrillPlanHalfYearReportAdd.aspx + + EPSummaryReport.aspx + ASPXCodeBehind + + + EPSummaryReport.aspx + + + EPSummaryReportEdit.aspx + ASPXCodeBehind + + + EPSummaryReportEdit.aspx + MillionsMonthlyReport.aspx ASPXCodeBehind @@ -16142,6 +16374,34 @@ MillionsMonthlyReportSave.aspx + + QualityWorkSummaryReport.aspx + ASPXCodeBehind + + + QualityWorkSummaryReport.aspx + + + QualityWorkSummaryReportEdit.aspx + ASPXCodeBehind + + + QualityWorkSummaryReportEdit.aspx + + + QuarterlyProjectQuality.aspx + ASPXCodeBehind + + + QuarterlyProjectQuality.aspx + + + QuarterlyProjectQualityEdit.aspx + ASPXCodeBehind + + + QuarterlyProjectQualityEdit.aspx + ReportAuditSee.aspx ASPXCodeBehind @@ -16156,6 +16416,20 @@ ReportSubmit.aspx + + SafetyBriefing.aspx + ASPXCodeBehind + + + SafetyBriefing.aspx + + + SafetyBriefingEdit.aspx + ASPXCodeBehind + + + SafetyBriefingEdit.aspx + SafetyQuarterlyReport.aspx ASPXCodeBehind @@ -16170,6 +16444,20 @@ SafetyQuarterlyReportEdit.aspx + + WorkSummaryReport.aspx + ASPXCodeBehind + + + WorkSummaryReport.aspx + + + WorkSummaryReportEdit.aspx + ASPXCodeBehind + + + WorkSummaryReportEdit.aspx + CheckDaily.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx new file mode 100644 index 00000000..b8e12ec3 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx @@ -0,0 +1,107 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EPSummaryReport.aspx.cs" Inherits="FineUIPro.Web.HSSE.InformationProject.EPSummaryReport" %> + + + + + + + 生态环保工作总结报告 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.cs new file mode 100644 index 00000000..f163bd5a --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.cs @@ -0,0 +1,247 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + + +namespace FineUIPro.Web.HSSE.InformationProject +{ + public partial class EPSummaryReport : PageBase + { + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + + ////权限按钮方法 + this.GetButtonPower(); + + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + + this.btnNew.OnClientClick = Window1.GetShowReference("EPSummaryReportEdit.aspx") + "return false;"; + if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) + { + Grid1.PageSize = this.CurrUser.PageSize.Value; + } + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT report.EPSummaryReportId," + + @"report.ProjectId," + + @"report.UnitId," + + @"report.YearId," + + @"report.ResponsiblePerson," + + @"report.ResponsiblePersonTel," + + @"report.ContactPerson," + + @"report.ContactPersonTel," + + @"report.ReportDate," + + @"report.Description1," + + @"report.Description2," + + @"report.Description3," + + @"report.Description4," + + @"report.Description5," + + @"report.Description6," + + @"report.Description7," + + @"report.Description8," + + @"report.Description9," + + @"Unit.UnitName " + + @" FROM InformationProject_EPSummaryReport AS report " + + @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = report.UnitId WHERE 1=1 "; + + List listStr = new List(); + strSql += " AND report.ProjectId = '" + this.ProjectId + "'"; + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + strSql += " AND report.YearId = @Year"; + listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue))); + } + 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(); + } + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 改变索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + #endregion + + #region 编辑 + /// + /// 双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var report = BLL.ProjectEPSummaryReportService.GetEPSummaryReportById(id); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EPSummaryReportEdit.aspx?EPSummaryReportId={0}", id, "编辑 - "))); + } + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var report = BLL.ProjectEPSummaryReportService.GetEPSummaryReportById(rowID); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString(), rowID, BLL.Const.ProjectEPSummaryReportMenuId, BLL.Const.BtnDelete); + BLL.ProjectEPSummaryReportService.DeleteEPSummaryReportById(rowID); + } + } + this.BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectEPSummaryReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + } + } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.designer.cs new file mode 100644 index 00000000..802a192d --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.designer.cs @@ -0,0 +1,150 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.InformationProject { + + + public partial class EPSummaryReport { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx new file mode 100644 index 00000000..6710b187 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx @@ -0,0 +1,139 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EPSummaryReportEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.InformationProject.EPSummaryReportEdit" %> + + + + + + + 编辑生态环保工作总结报告 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.cs new file mode 100644 index 00000000..29dd722f --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.cs @@ -0,0 +1,175 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.HSSE.InformationProject +{ + public partial class EPSummaryReportEdit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string EPSummaryReportId + { + get + { + return (string)ViewState["EPSummaryReportId"]; + } + set + { + ViewState["EPSummaryReportId"] = value; + } + } + + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + BLL.ConstValue.InitConstValueDropDownList(this.ddlYearId, BLL.ConstValue.Group_0008, true); + + this.EPSummaryReportId = Request.Params["EPSummaryReportId"]; + if (!string.IsNullOrEmpty(this.EPSummaryReportId)) + { + var report = BLL.ProjectEPSummaryReportService.GetEPSummaryReportById(this.EPSummaryReportId); + if (report != null) + { + this.ProjectId = report.ProjectId; + #region 赋值 + if (report.YearId != null) + { + this.ddlYearId.SelectedValue = report.YearId.ToString(); + this.txtReportDate.Text = report.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReportDate) : ""; + this.txtResponsiblePerson.Text = report.ResponsiblePerson; + this.txtResponsiblePersonTel.Text = report.ResponsiblePersonTel; + this.txtContactPerson.Text = report.ContactPerson; + this.txtContactPersonTel.Text = report.ContactPersonTel; + this.txtDescription1.Text = report.Description1; + this.txtDescription2.Text = report.Description2; + this.txtDescription3.Text = report.Description3; + this.txtDescription4.Text = report.Description4; + this.txtDescription5.Text = report.Description5; + this.txtDescription6.Text = report.Description6; + this.txtDescription7.Text = report.Description7; + this.txtDescription8.Text = report.Description8; + this.txtDescription9.Text = report.Description9; + } + #endregion + } + } + else + { + this.ddlYearId.SelectedValue = DateTime.Now.Year.ToString(); + this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + } + } + } + #endregion + + #region 保存、提交 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.ddlYearId.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + /// + /// 提交数据 + /// + /// + private void SaveData(string type) + { + Model.InformationProject_EPSummaryReport report = new Model.InformationProject_EPSummaryReport + { + ProjectId = this.ProjectId, + UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_CD : this.CurrUser.UnitId, + }; + if (this.ddlYearId.SelectedValue != BLL.Const._Null) + { + report.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue); + } + report.ResponsiblePerson = this.txtResponsiblePerson.Text.Trim(); + report.ResponsiblePersonTel = this.txtResponsiblePersonTel.Text.Trim(); + report.ContactPerson = this.txtContactPerson.Text.Trim(); + report.ContactPersonTel = this.txtContactPersonTel.Text.Trim(); + report.ReportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim()); + report.Description1 = txtDescription1.Text.Trim(); + report.Description2 = this.txtDescription2.Text.Trim(); + report.Description3 = this.txtDescription3.Text.Trim(); + report.Description4 = this.txtDescription4.Text.Trim(); + report.Description5 = this.txtDescription5.Text.Trim(); + report.Description6 = this.txtDescription6.Text.Trim(); + report.Description7 = this.txtDescription7.Text.Trim(); + report.Description8 = this.txtDescription8.Text.Trim(); + report.Description9 = this.txtDescription9.Text.Trim(); + if (!string.IsNullOrEmpty(this.EPSummaryReportId)) + { + report.EPSummaryReportId = this.EPSummaryReportId; + BLL.ProjectEPSummaryReportService.UpdateEPSummaryReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString(), report.EPSummaryReportId, BLL.Const.ProjectEPSummaryReportMenuId, BLL.Const.BtnModify); + } + else + { + Model.InformationProject_EPSummaryReport oldReport = (from x in Funs.DB.InformationProject_EPSummaryReport + where x.ProjectId == report.ProjectId && x.YearId == report.YearId + select x).FirstOrDefault(); + if (oldReport == null) + { + this.EPSummaryReportId = SQLHelper.GetNewID(typeof(Model.InformationProject_EPSummaryReport)); + report.EPSummaryReportId = this.EPSummaryReportId; + BLL.ProjectEPSummaryReportService.AddEPSummaryReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString(), report.EPSummaryReportId, BLL.Const.ProjectEPSummaryReportMenuId, BLL.Const.BtnAdd); + + } + else + { + Alert.ShowInTop("该年度记录已存在", MessageBoxIcon.Warning); + return; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.designer.cs new file mode 100644 index 00000000..a0c877c2 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.designer.cs @@ -0,0 +1,294 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.InformationProject { + + + public partial class EPSummaryReportEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// ddlYearId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlYearId; + + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReportDate; + + /// + /// txtResponsiblePerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtResponsiblePerson; + + /// + /// txtResponsiblePersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtResponsiblePersonTel; + + /// + /// txtContactPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContactPerson; + + /// + /// txtContactPersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContactPersonTel; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// txtDescription1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription1; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label2; + + /// + /// txtDescription2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription2; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label3; + + /// + /// txtDescription3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription3; + + /// + /// Label4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label4; + + /// + /// txtDescription4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription4; + + /// + /// Label5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label5; + + /// + /// txtDescription5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription5; + + /// + /// Label6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label6; + + /// + /// txtDescription6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription6; + + /// + /// Label7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label7; + + /// + /// txtDescription7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription7; + + /// + /// Label8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label8; + + /// + /// txtDescription8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription8; + + /// + /// Label9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label9; + + /// + /// txtDescription9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription9; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/MillionsMonthlyReport.aspx b/SGGL/FineUIPro.Web/HSSE/InformationProject/MillionsMonthlyReport.aspx index 8ed0f7e4..7eefa8b2 100644 --- a/SGGL/FineUIPro.Web/HSSE/InformationProject/MillionsMonthlyReport.aspx +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/MillionsMonthlyReport.aspx @@ -4,237 +4,239 @@ - 百万工时安全统计月报 + 企业安全数据统计月报
- - - - - - - - - - - - - - - - - - - - - - - - <%-- + + + + + + + + + + + + + + + + + + + + + <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReport.aspx.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReport.aspx.cs new file mode 100644 index 00000000..453f80ab --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReport.aspx.cs @@ -0,0 +1,275 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.HSSE.InformationProject +{ + public partial class WorkSummaryReport : PageBase + { + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + + ////权限按钮方法 + this.GetButtonPower(); + + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + + this.btnNew.OnClientClick = Window1.GetShowReference("WorkSummaryReportEdit.aspx") + "return false;"; + if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) + { + Grid1.PageSize = this.CurrUser.PageSize.Value; + } + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT workSummaryReport.WorkSummaryReportId," + + @"workSummaryReport.ProjectId," + + @"workSummaryReport.UnitId," + + @"workSummaryReport.YearId," + + @"workSummaryReport.ResponsiblePerson," + + @"workSummaryReport.ResponsiblePersonTel," + + @"workSummaryReport.ContactPerson," + + @"workSummaryReport.ContactPersonTel," + + @"workSummaryReport.ReportDate," + + @"workSummaryReport.SafeLaborTime," + + @"workSummaryReport.SafetyObjectives," + + @"workSummaryReport.AccidentSituation," + + @"workSummaryReport.Awards," + + @"workSummaryReport.WorkDevelopment," + + @"workSummaryReport.PersonnelTraining," + + @"workSummaryReport.GovernanceSituation," + + @"workSummaryReport.ManagementActivity," + + @"workSummaryReport.WorkExperience," + + @"workSummaryReport.Countermeasures," + + @"workSummaryReport.NextYearWorkPlan," + + @"workSummaryReport.JobSuggestion," + + @"workSummaryReport.CompileMan," + + @"workSummaryReport.CompileDate, " + + @"U.UserName as CompileManName, " + + @"Unit.UnitName " + + @" FROM InformationProject_WorkSummaryReport AS workSummaryReport " + + @" LEFT JOIN Sys_User AS U ON U.UserId = workSummaryReport.CompileMan " + + @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = workSummaryReport.UnitId WHERE 1=1 "; + + List listStr = new List(); + strSql += " AND workSummaryReport.ProjectId = '" + this.ProjectId + "'"; + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + strSql += " AND workSummaryReport.YearId = @Year"; + listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue))); + } + 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(); + } + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 改变索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + #endregion + + #region 编辑 + /// + /// 双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var projectWorkSummaryReport = BLL.ProjectWorkSummaryReportService.GetWorkSummaryReportById(id); + if (projectWorkSummaryReport != null) + { + //if (this.btnMenuEdit.Hidden) ////双击事件 编辑权限有:编辑页面,无:查看页面 + //{ + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkSummaryReportView.aspx?workSummaryReportId={0}", id, "查看 - "))); + //} + //else + //{ + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkSummaryReportEdit.aspx?workSummaryReportId={0}", id, "编辑 - "))); + //} + } + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var report = BLL.ProjectWorkSummaryReportService.GetWorkSummaryReportById(rowID); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString(), rowID, BLL.Const.ProjectWorkSummaryReportMenuId, BLL.Const.BtnDelete); + BLL.ProjectWorkSummaryReportService.DeleteWorkSummaryReportById(rowID); + } + } + this.BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + //protected void btnPrint_Click(object sender, EventArgs e) + //{ + // if (!string.IsNullOrEmpty(Grid1.SelectedRowID)) + // { + // PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/ReportPrint/ExReportPrint.aspx?reportId={0}&&replaceParameter={1}&&varValue={2}", Const.ProjectInformation_MillionsMonthlyReportId, Grid1.SelectedRowID, "", "打印 - "))); + // } + //} + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectWorkSummaryReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReport.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReport.aspx.designer.cs new file mode 100644 index 00000000..54ad3a33 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReport.aspx.designer.cs @@ -0,0 +1,150 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.InformationProject { + + + public partial class WorkSummaryReport { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReportEdit.aspx b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReportEdit.aspx new file mode 100644 index 00000000..6e2f2ff8 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReportEdit.aspx @@ -0,0 +1,292 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkSummaryReportEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.InformationProject.WorkSummaryReportEdit" %> + + + + + + + 编辑安全管理工作总结报告 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReportEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReportEdit.aspx.cs new file mode 100644 index 00000000..84900f13 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReportEdit.aspx.cs @@ -0,0 +1,205 @@ +using BLL; +using System; +using System.Linq; + +namespace FineUIPro.Web.HSSE.InformationProject +{ + public partial class WorkSummaryReportEdit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string WorkSummaryReportId + { + get + { + return (string)ViewState["WorkSummaryReportId"]; + } + set + { + ViewState["WorkSummaryReportId"] = value; + } + } + + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + BLL.ConstValue.InitConstValueDropDownList(this.ddlYearId, BLL.ConstValue.Group_0008, true); + + this.WorkSummaryReportId = Request.Params["workSummaryReportId"]; + if (!string.IsNullOrEmpty(this.WorkSummaryReportId)) + { + var report = BLL.ProjectWorkSummaryReportService.GetWorkSummaryReportById(this.WorkSummaryReportId); + if (report != null) + { + this.ProjectId = report.ProjectId; + #region 赋值 + if (report.YearId != null) + { + this.ddlYearId.SelectedValue = report.YearId.ToString(); + this.txtReportDate.Text = report.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReportDate) : ""; + this.txtResponsiblePerson.Text = report.ResponsiblePerson; + this.txtResponsiblePersonTel.Text = report.ResponsiblePersonTel; + this.txtContactPerson.Text = report.ContactPerson; + this.txtContactPersonTel.Text = report.ContactPersonTel; + this.txtSafeLaborTime.Text = report.SafeLaborTime.HasValue ? report.SafeLaborTime.ToString() : ""; + this.txtSafetyObjectives.Text = report.SafetyObjectives; + this.txtAccidentSituation.Text = report.AccidentSituation; + this.txtAwards.Text = report.Awards; + this.txtWorkDevelopment.Text = report.WorkDevelopment; + this.txtPersonnelTraining.Text = report.PersonnelTraining; + this.txtGovernanceSituation.Text = report.GovernanceSituation; + this.txtManagementActivity.Text = report.ManagementActivity; + this.txtWorkExperience.Text = report.WorkExperience; + this.txtCountermeasures.Text = report.Countermeasures; + this.txtNextYearWorkPlan.Text = report.NextYearWorkPlan; + this.txtJobSuggestion.Text = report.JobSuggestion; + } + #endregion + } + } + else + { + this.ddlYearId.SelectedValue = DateTime.Now.Year.ToString(); + this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + } + } + } + #endregion + + #region 保存、提交 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.ddlYearId.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + ///// + ///// 提交按钮 + ///// + ///// + ///// + //protected void btnSubmit_Click(object sender, EventArgs e) + //{ + // if (this.ddlYearId.SelectedValue == BLL.Const._Null) + // { + // Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + // return; + // } + // if (this.ddlQuarter.SelectedValue == BLL.Const._Null) + // { + // Alert.ShowInTop("请选择季度", MessageBoxIcon.Warning); + // return; + // } + // this.SaveData(BLL.Const.BtnSubmit); + // PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + //} + + /// + /// 提交数据 + /// + /// + private void SaveData(string type) + { + Model.InformationProject_WorkSummaryReport report = new Model.InformationProject_WorkSummaryReport + { + ProjectId = this.ProjectId, + UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_CD : this.CurrUser.UnitId, + }; + if (this.ddlYearId.SelectedValue != BLL.Const._Null) + { + report.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue); + } + report.ResponsiblePerson = this.txtResponsiblePerson.Text.Trim(); + report.ResponsiblePersonTel = this.txtResponsiblePersonTel.Text.Trim(); + report.ContactPerson = this.txtContactPerson.Text.Trim(); + report.ContactPersonTel = this.txtContactPersonTel.Text.Trim(); + report.ReportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim()); + report.SafeLaborTime = Funs.GetNewDecimal(this.txtSafeLaborTime.Text); + report.SafetyObjectives = this.txtSafetyObjectives.Text.Trim(); + report.AccidentSituation = this.txtAccidentSituation.Text.Trim(); + report.Awards = this.txtAwards.Text.Trim(); + report.WorkDevelopment = this.txtWorkDevelopment.Text.Trim(); + report.PersonnelTraining = this.txtPersonnelTraining.Text.Trim(); + report.GovernanceSituation = this.txtGovernanceSituation.Text.Trim(); + report.ManagementActivity = this.txtManagementActivity.Text.Trim(); + report.WorkExperience = this.txtWorkExperience.Text.Trim(); + report.Countermeasures = this.txtCountermeasures.Text.Trim(); + report.NextYearWorkPlan = this.txtNextYearWorkPlan.Text.Trim(); + report.JobSuggestion = this.txtJobSuggestion.Text.Trim(); + + report.CompileMan = this.CurrUser.UserId; + report.CompileDate = DateTime.Now; + //if (type == BLL.Const.BtnSubmit) + //{ + // safetyQuarterlyReport.States = this.ctlAuditFlow.NextStep; + //} + if (!string.IsNullOrEmpty(this.WorkSummaryReportId)) + { + report.WorkSummaryReportId = this.WorkSummaryReportId; + BLL.ProjectWorkSummaryReportService.UpdateWorkSummaryReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString(), report.WorkSummaryReportId, BLL.Const.ProjectWorkSummaryReportMenuId, BLL.Const.BtnModify); + } + else + { + Model.InformationProject_WorkSummaryReport oldReport = (from x in Funs.DB.InformationProject_WorkSummaryReport + where x.ProjectId == report.ProjectId && x.YearId == report.YearId + select x).FirstOrDefault(); + if (oldReport == null) + { + this.WorkSummaryReportId = SQLHelper.GetNewID(typeof(Model.InformationProject_WorkSummaryReport)); + report.WorkSummaryReportId = this.WorkSummaryReportId; + BLL.ProjectWorkSummaryReportService.AddWorkSummaryReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString(), report.WorkSummaryReportId, BLL.Const.ProjectWorkSummaryReportMenuId, BLL.Const.BtnAdd); + + } + else + { + Alert.ShowInTop("该年度记录已存在", MessageBoxIcon.Warning); + return; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReportEdit.aspx.designer.cs new file mode 100644 index 00000000..b4ddf947 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/WorkSummaryReportEdit.aspx.designer.cs @@ -0,0 +1,474 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.InformationProject { + + + public partial class WorkSummaryReportEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// ddlYearId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlYearId; + + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReportDate; + + /// + /// txtResponsiblePerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtResponsiblePerson; + + /// + /// txtResponsiblePersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtResponsiblePersonTel; + + /// + /// txtContactPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContactPerson; + + /// + /// txtContactPersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContactPersonTel; + + /// + /// GroupPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtSafeLaborTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSafeLaborTime; + + /// + /// GroupPanel6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel6; + + /// + /// Form7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form7; + + /// + /// txtSafetyObjectives 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtSafetyObjectives; + + /// + /// GroupPanel7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel7; + + /// + /// Form8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form8; + + /// + /// txtAccidentSituation 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtAccidentSituation; + + /// + /// GroupPanel8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel8; + + /// + /// Form9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form9; + + /// + /// txtAwards 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtAwards; + + /// + /// GroupPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel2; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// GroupPanel9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel9; + + /// + /// Form10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form10; + + /// + /// txtWorkDevelopment 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtWorkDevelopment; + + /// + /// GroupPanel10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel10; + + /// + /// Form11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form11; + + /// + /// txtPersonnelTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtPersonnelTraining; + + /// + /// GroupPanel11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel11; + + /// + /// Form12 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form12; + + /// + /// txtGovernanceSituation 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtGovernanceSituation; + + /// + /// GroupPanel12 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel12; + + /// + /// Form13 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form13; + + /// + /// txtManagementActivity 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtManagementActivity; + + /// + /// GroupPanel13 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel13; + + /// + /// Form14 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form14; + + /// + /// txtWorkExperience 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtWorkExperience; + + /// + /// GroupPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel3; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtCountermeasures 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtCountermeasures; + + /// + /// GroupPanel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel4; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// txtNextYearWorkPlan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtNextYearWorkPlan; + + /// + /// GroupPanel5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel5; + + /// + /// Form6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form6; + + /// + /// txtJobSuggestion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtJobSuggestion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefing.aspx b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefing.aspx new file mode 100644 index 00000000..2ca785b6 --- /dev/null +++ b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefing.aspx @@ -0,0 +1,120 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyBriefing.aspx.cs" Inherits="FineUIPro.Web.SHIYE.InformationProject.SafetyBriefing" %> + + + + + + + 实业安全简报 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + <%-- + + + + --%> + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + diff --git a/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefing.aspx.cs b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefing.aspx.cs new file mode 100644 index 00000000..1a23dea6 --- /dev/null +++ b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefing.aspx.cs @@ -0,0 +1,265 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.SHIYE.InformationProject +{ + public partial class SafetyBriefing :PageBase + { + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + + ////权限按钮方法 + this.GetButtonPower(); + + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, BLL.ConstValue.Group_0009, true); + + this.btnNew.OnClientClick = Window1.GetShowReference("SafetyBriefingEdit.aspx") + "return false;"; + if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) + { + Grid1.PageSize = this.CurrUser.PageSize.Value; + } + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT safetyBriefing.SafetyBriefingId," + + @"safetyBriefing.ProjectId," + + @"safetyBriefing.UnitId," + + @"safetyBriefing.YearId," + + @"safetyBriefing.Month," + + @"(CAST(safetyBriefing.YearId AS NVARCHAR(4))+'年'+CAST(safetyBriefing.Month AS NVARCHAR(4))+'月') AS YearAndMonth," + + @"safetyBriefing.CompileMan," + + @"safetyBriefing.CompileDate," + + @"safetyBriefing.Auditor," + + @"safetyBriefing.Approver," + + @"Unit.UnitName, " + + @"Users.UserName AS CompileManName " + + @" FROM InformationProject_SafetyBriefing AS safetyBriefing " + + @" LEFT JOIN Sys_User AS Users ON safetyBriefing.CompileMan = Users.UserId " + + @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = safetyBriefing.UnitId WHERE 1=1 "; + List listStr = new List(); + strSql += " AND safetyBriefing.ProjectId = '" + this.ProjectId + "'"; + //if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值 + //{ + // strSql += " AND MillionsMonthlyReport.States = @States"; ///状态为已完成 + // listStr.Add(new SqlParameter("@States", BLL.Const.State_2)); + //} + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + strSql += " AND safetyBriefing.YearId = @Year"; + listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue))); + } + if (this.drpMonth.SelectedValue != BLL.Const._Null) + { + strSql += " AND safetyBriefing.Month = @Month "; + listStr.Add(new SqlParameter("@Month", Funs.GetNewInt(this.drpMonth.SelectedValue))); + } + 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(); + } + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 改变索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + #endregion + + #region 编辑 + /// + /// 双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var safetyBriefing = BLL.InformationProject_SafetyBriefingService.GetSafetyBriefingById(id); + if (safetyBriefing != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyBriefingEdit.aspx?safetyBriefingId={0}", id, "编辑 - "))); + } + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var safetyBriefing = BLL.InformationProject_SafetyBriefingService.GetSafetyBriefingById(rowID); + if (safetyBriefing != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, safetyBriefing.YearId.ToString() + "-" + safetyBriefing.Month.ToString(), rowID, BLL.Const.ProjectSafetyBriefingMenuId, BLL.Const.BtnDelete); + BLL.InformationProject_SafetyBriefingService.DeleteSafetyBriefingById(rowID); + } + } + this.BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + //protected void btnPrint_Click(object sender, EventArgs e) + //{ + // if (!string.IsNullOrEmpty(Grid1.SelectedRowID)) + // { + // PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/ReportPrint/ExReportPrint.aspx?reportId={0}&&replaceParameter={1}&&varValue={2}", Const.ProjectInformation_MillionsMonthlyReportId, Grid1.SelectedRowID, "", "打印 - "))); + // } + //} + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectSafetyBriefingMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefing.aspx.designer.cs b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefing.aspx.designer.cs new file mode 100644 index 00000000..b465ae11 --- /dev/null +++ b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefing.aspx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.SHIYE.InformationProject { + + + public partial class SafetyBriefing { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpMonth; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefingEdit.aspx b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefingEdit.aspx new file mode 100644 index 00000000..90f43fc6 --- /dev/null +++ b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefingEdit.aspx @@ -0,0 +1,290 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyBriefingEdit.aspx.cs" Inherits="FineUIPro.Web.SHIYE.InformationProject.SafetyBriefingEdit" %> + + + + + + + 实业安全简报 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefingEdit.aspx.cs b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefingEdit.aspx.cs new file mode 100644 index 00000000..1c97642d --- /dev/null +++ b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefingEdit.aspx.cs @@ -0,0 +1,250 @@ +using BLL; +using System; +using System.Linq; + +namespace FineUIPro.Web.SHIYE.InformationProject +{ + public partial class SafetyBriefingEdit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string SafetyBriefingId + { + get + { + return (string)ViewState["SafetyBriefingId"]; + } + set + { + ViewState["SafetyBriefingId"] = value; + } + } + #endregion + + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, BLL.ConstValue.Group_0009, true); + + BLL.UserService.InitUserDropDownList(this.drpCompileMan, this.ProjectId, true); + + this.SafetyBriefingId = Request.Params["safetyBriefingId"]; + if (!string.IsNullOrEmpty(this.SafetyBriefingId)) + { + Model.InformationProject_SafetyBriefing safetyBriefing = BLL.InformationProject_SafetyBriefingService.GetSafetyBriefingById(this.SafetyBriefingId); + if (safetyBriefing != null) + { + this.ProjectId = safetyBriefing.ProjectId; + if (!string.IsNullOrEmpty(safetyBriefing.UnitId)) + { + this.txtUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(safetyBriefing.UnitId); + } + BLL.UserService.InitUserDropDownList(this.drpCompileMan, this.ProjectId, true); + if (safetyBriefing.YearId != null) + { + this.drpYear.SelectedValue = Convert.ToString(safetyBriefing.YearId); + } + if (safetyBriefing.Month != null) + { + this.drpMonth.SelectedValue = Convert.ToString(safetyBriefing.Month); + } + if (!string.IsNullOrEmpty(safetyBriefing.CompileMan)) + { + this.drpCompileMan.SelectedValue = safetyBriefing.CompileMan; + } + this.txtAuditor.Text = safetyBriefing.Auditor; + this.txtApprover.Text = safetyBriefing.Approver; + this.txtMainWork.Text = safetyBriefing.MainWork; + this.txtHazardRecording.Text = safetyBriefing.HazardRecording; + this.txtSafetyAccident.Text = safetyBriefing.SafetyAccident; + this.txtEPAccident.Text = safetyBriefing.EPAccident; + this.txtOHAccident.Text = safetyBriefing.OHAccident; + this.txtWorkPermitNum.Text = safetyBriefing.WorkPermitNum; + this.txtHiddenDangerDetection.Text = safetyBriefing.HiddenDangerDetection; + this.txtRectificationSituation.Text = safetyBriefing.RectificationSituation; + this.txtCheckProblemsRectification.Text = safetyBriefing.CheckProblemsRectification; + this.txtPendingProject.Text = safetyBriefing.PendingProject; + this.txtContractorManagement.Text = safetyBriefing.ContractorManagement; + this.txtEnvironmentalEmissions.Text = safetyBriefing.EnvironmentalEmissions; + this.txtNextMonthWorkPlan.Text = safetyBriefing.NextMonthWorkPlan; + } + } + else + { + this.drpYear.SelectedValue = DateTime.Now.Year.ToString(); + this.drpMonth.SelectedValue = DateTime.Now.Month.ToString(); + //DateTime startTime = Convert.ToDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue + "-01"); + //DateTime endTime = startTime.AddMonths(1); + //GetData(startTime, endTime); + this.drpCompileMan.SelectedValue = this.CurrUser.UserId; + this.txtUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_CD : this.CurrUser.UnitId); + } + } + } + #endregion + + #region 保存、提交 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.drpYear.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + return; + } + if (this.drpMonth.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择月份", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + /// + /// 提交按钮 + /// + /// + /// + protected void btnSubmit_Click(object sender, EventArgs e) + { + if (this.drpYear.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + return; + } + if (this.drpMonth.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择月份", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSubmit); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + Model.InformationProject_SafetyBriefing safetyBriefing = new Model.InformationProject_SafetyBriefing + { + ProjectId = this.ProjectId, + UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_CD : this.CurrUser.UnitId, + }; + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + safetyBriefing.YearId = Funs.GetNewInt(this.drpYear.SelectedValue); + } + if (this.drpMonth.SelectedValue != BLL.Const._Null) + { + safetyBriefing.Month = Funs.GetNewInt(this.drpMonth.SelectedValue); + } + if (this.drpCompileMan.SelectedValue != BLL.Const._Null) + { + safetyBriefing.CompileMan = this.drpCompileMan.SelectedValue; + } + safetyBriefing.CompileDate = DateTime.Now; + safetyBriefing.Auditor = this.txtAuditor.Text.Trim(); + safetyBriefing.Approver = this.txtApprover.Text.Trim(); + safetyBriefing.MainWork = this.txtMainWork.Text.Trim(); + safetyBriefing.HazardRecording = this.txtHazardRecording.Text.Trim(); + safetyBriefing.SafetyAccident = this.txtSafetyAccident.Text.Trim(); + safetyBriefing.EPAccident = this.txtEPAccident.Text.Trim(); + safetyBriefing.OHAccident = this.txtOHAccident.Text.Trim(); + safetyBriefing.WorkPermitNum = this.txtWorkPermitNum.Text.Trim(); + safetyBriefing.HiddenDangerDetection = this.txtHiddenDangerDetection.Text.Trim(); + safetyBriefing.RectificationSituation = this.txtRectificationSituation.Text.Trim(); + safetyBriefing.CheckProblemsRectification = this.txtCheckProblemsRectification.Text.Trim(); + safetyBriefing.PendingProject = this.txtPendingProject.Text.Trim(); + safetyBriefing.ContractorManagement = this.txtContractorManagement.Text.Trim(); + safetyBriefing.EnvironmentalEmissions = this.txtEnvironmentalEmissions.Text.Trim(); + safetyBriefing.NextMonthWorkPlan = this.txtNextMonthWorkPlan.Text.Trim(); + if (!string.IsNullOrEmpty(this.SafetyBriefingId)) + { + safetyBriefing.SafetyBriefingId = this.SafetyBriefingId; + BLL.InformationProject_SafetyBriefingService.UpdateSafetyBriefing(safetyBriefing); + BLL.LogService.AddSys_Log(this.CurrUser, safetyBriefing.YearId.ToString() + "-" + safetyBriefing.Month.ToString(), safetyBriefing.SafetyBriefingId, BLL.Const.ProjectSafetyBriefingMenuId, BLL.Const.BtnModify); + + } + else + { + Model.InformationProject_SafetyBriefing oldSafetyBriefing = (from x in Funs.DB.InformationProject_SafetyBriefing + where x.ProjectId == safetyBriefing.ProjectId && x.YearId == safetyBriefing.YearId && x.Month == safetyBriefing.Month + select x).FirstOrDefault(); + if (oldSafetyBriefing == null) + { + this.SafetyBriefingId = SQLHelper.GetNewID(typeof(Model.InformationProject_SafetyBriefing)); + safetyBriefing.SafetyBriefingId = this.SafetyBriefingId; + BLL.InformationProject_SafetyBriefingService.AddSafetyBriefing(safetyBriefing); + BLL.LogService.AddSys_Log(this.CurrUser, safetyBriefing.YearId.ToString() + "-" + safetyBriefing.Month.ToString(), safetyBriefing.SafetyBriefingId, BLL.Const.ProjectSafetyBriefingMenuId, BLL.Const.BtnAdd); + } + else + { + Alert.ShowInTop("该月份记录已存在", MessageBoxIcon.Warning); + return; + } + } + } + #endregion + + #region 年月变化事件 + /// + /// 年月变化事件 + /// + /// + /// + protected void drpYear_SelectedIndexChanged(object sender, EventArgs e) + { + if (this.drpYear.SelectedValue != BLL.Const._Null && this.drpMonth.SelectedValue != BLL.Const._Null) + { + DateTime startTime = Convert.ToDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue + "-01"); + DateTime endTime = startTime.AddMonths(1); + //GetData(startTime, endTime); + } + else + { + + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefingEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefingEdit.aspx.designer.cs new file mode 100644 index 00000000..e5a1051a --- /dev/null +++ b/SGGL/FineUIPro.Web/SHIYE/InformationProject/SafetyBriefingEdit.aspx.designer.cs @@ -0,0 +1,528 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.SHIYE.InformationProject { + + + public partial class SafetyBriefingEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtUnitName; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpMonth; + + /// + /// drpCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCompileMan; + + /// + /// txtAuditor 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAuditor; + + /// + /// txtApprover 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtApprover; + + /// + /// GroupPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel1; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtMainWork 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtMainWork; + + /// + /// GroupPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel2; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// txtHazardRecording 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtHazardRecording; + + /// + /// GroupPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel3; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// GroupPanel9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel9; + + /// + /// Form11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form11; + + /// + /// txtSafetyAccident 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtSafetyAccident; + + /// + /// GroupPanel10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel10; + + /// + /// Form12 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form12; + + /// + /// txtEPAccident 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtEPAccident; + + /// + /// GroupPanel11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel11; + + /// + /// Form13 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form13; + + /// + /// txtOHAccident 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtOHAccident; + + /// + /// GroupPanel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel4; + + /// + /// Form6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form6; + + /// + /// txtWorkPermitNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtWorkPermitNum; + + /// + /// GroupPanel5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel5; + + /// + /// Form7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form7; + + /// + /// GroupPanel12 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel12; + + /// + /// Form14 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form14; + + /// + /// txtHiddenDangerDetection 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtHiddenDangerDetection; + + /// + /// GroupPanel13 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel13; + + /// + /// Form15 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form15; + + /// + /// txtRectificationSituation 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRectificationSituation; + + /// + /// GroupPanel14 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel14; + + /// + /// Form16 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form16; + + /// + /// txtCheckProblemsRectification 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtCheckProblemsRectification; + + /// + /// GroupPanel15 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel15; + + /// + /// Form17 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form17; + + /// + /// txtPendingProject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtPendingProject; + + /// + /// GroupPanel6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel6; + + /// + /// Form8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form8; + + /// + /// txtContractorManagement 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtContractorManagement; + + /// + /// GroupPanel7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel7; + + /// + /// Form9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form9; + + /// + /// txtEnvironmentalEmissions 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtEnvironmentalEmissions; + + /// + /// GroupPanel8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel8; + + /// + /// Form10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form10; + + /// + /// txtNextMonthWorkPlan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtNextMonthWorkPlan; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/Web.config b/SGGL/FineUIPro.Web/Web.config index b37d472d..09ec6db5 100644 --- a/SGGL/FineUIPro.Web/Web.config +++ b/SGGL/FineUIPro.Web/Web.config @@ -1,4 +1,4 @@ - + -
+
- + - + - - - - - + + + + + - - - + + + - + - - - + + + - + - + - - - + + + - - + + - - - + + + - - + + - + - - + + - - + + - - - + + + - + - + - - + + - + - - - + + + - - - - + + + + - + - + - + - + - + - + - - - - + + + + - + - - + + @@ -150,16 +150,16 @@ - - + + - - + + - - + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx new file mode 100644 index 00000000..98f0cbc8 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx @@ -0,0 +1,138 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ArchitectureReport.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ArchitectureReport" %> + + + + + + + 建筑行业能源节约与生态环境保护汇总表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.cs new file mode 100644 index 00000000..bcc7d7de --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.cs @@ -0,0 +1,636 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BLL; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ArchitectureReport : PageBase + { + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + ////取上个报表时间 + DateTime showDate = System.DateTime.Now.AddMonths(-3); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + drpYear.SelectedValue = showDate.Year.ToString(); + GetValue(); + } + } + + private void SetEmpty() + { + this.SimpleForm1.Title = string.Empty; + lbUnitName.Text = "填报企业:"; + lbFillingDate.Text = "填报日期:"; + lbDutyPerson.Text = "负责人:"; + lbHandleMan.Text = string.Empty; + this.Grid1.DataSource = null; + this.Grid1.DataBind(); + } + #endregion + + #region 获取记录值 + private void GetValue() + { + int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + int Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue); + Model.View_Environmental_ArchitectureReport report = Funs.DB.View_Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarters == Quarters && e.Year == year); + if (report != null) + { + string upState = string.Empty; + if (report.UpState == BLL.Const.UpState_3) + { + upState = "(已上报)"; + } + else + { + upState = "(未上报)"; + } + this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.QuartersStr + report.YearStr + upState; + lbUnitName.Text = "填报企业:" + report.UnitName; + if (report.FillingDate != null) + { + lbFillingDate.Text = "填报日期:" + string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + else + { + lbFillingDate.Text = "填报日期:"; + } + lbDutyPerson.Text = "负责人:" + report.DutyPerson; + //if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3) + //{ + // this.lbHandleMan.Hidden = true; + //} + //else + //{ + // this.lbHandleMan.Hidden = false; + // lbHandleMan.Text = "下一步办理人:" + report.UserName; + //} + var indexNames = ArchitectureReportItemService.GetIndexNames(); + var units = ArchitectureReportItemService.GetUnits(); + //之前月度合计值集合 + List reportItems = BLL.ArchitectureReportItemService.GetItems(report.ArchitectureReportId); + List items = new List(); + foreach (var yearSumItem in reportItems) + { + Model.ArchitectureReportItem item = new Model.ArchitectureReportItem(); + item.ArchitectureReportItemId = yearSumItem.ArchitectureReportItemId; + item.IndexName = indexNames.First(x => x.Value == yearSumItem.SortIndex).Text; + item.Unit = units.First(x => x.Value == yearSumItem.SortIndex).Text; + item.SortIndex = yearSumItem.SortIndex; + item.BaseNumber = yearSumItem.BaseNumber; + item.LastYearValue = yearSumItem.LastYearValue; + item.ThisYearValue = yearSumItem.ThisYearValue; + item.Rate = yearSumItem.Rate; + items.Add(item); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + else + { + SetEmpty(); + } + this.GetButtonPower(); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭导入弹出窗口 + /// + /// + /// + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭查看审批信息弹出窗口 + /// + /// + /// + protected void Window4_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ArchitectureReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnDelete.Hidden = false; + } + } + + var getReport = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + this.btnAudit1.Hidden = true; + this.btnAudit2.Hidden = true; + if (getReport != null) + { + this.btnNew.Hidden = true; + //if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入 + //{ + // if (getReport.HandleState == BLL.Const.HandleState_2) + // { + // this.btnAudit1.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_3) + // { + // this.btnAudit2.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_4) + // { + this.btnUpdata.Hidden = false; + // } + //} + } + } + #endregion + + #region 增加、修改、审核、审批、上报、删除 + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Quarterss={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - "))); + } + + /// + /// 修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审核 + /// + /// + /// + protected void btnAudit1_Click(object sender, EventArgs e) + { + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审批 + /// + /// + /// + protected void btnAudit2_Click(object sender, EventArgs e) + { + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 上报 + /// + /// + /// + protected void btnUpdata_Click(object sender, EventArgs e) + { + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}&type=Updata", report.ArchitectureReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnDelete); + BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.ArchitectureReportId); + BLL.ArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId); + BLL.ArchitectureReportService.DeleteArchitectureReportByArchitectureReportId(report.ArchitectureReportId); + + SetEmpty(); + this.btnNew.Hidden = false; + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify("所选时间无报表记录!"); + } + } + #endregion + + #region 格式化字符串 + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertCompileDate(object CompileDate) + { + if (CompileDate != null) + { + return string.Format("{0:yyyy-MM-dd}", CompileDate); + } + return ""; + } + + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertDate(object ArchitectureReportId) + { + if (ArchitectureReportId != null) + { + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId.ToString()); + if (report != null) + { + return report.Year + "年" + report.Quarters + "月"; + } + } + return ""; + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉框联动事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + var units = BLL.UnitService.GetUnitDropDownList(); + if (units != null && !string.IsNullOrEmpty(this.drpUnit.SelectedText)) + { + var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText); + if (unit != null) + { + drpUnit.SelectedValue = unit.UnitId; + } + } + + GetValue(); + } + #endregion + + #region 月份向前/向后 + /// + /// 前一个月 + /// + /// + /// + protected void BtnBulletLeft_Click(object sender, EventArgs e) + { + SetQuartersChange("-"); + } + + /// + /// 后一个月 + /// + /// + /// + protected void BulletRight_Click(object sender, EventArgs e) + { + SetQuartersChange("+"); + } + + /// + /// 月份加减变化 + /// + /// + private void SetQuartersChange(string type) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + if (type == "+") + { + showDate = nowDate.Value.AddMonths(3); + } + else + { + showDate = nowDate.Value.AddMonths(-3); + } + + this.drpYear.SelectedValue = showDate.Year.ToString(); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + ///值变化 + GetValue(); + } + } + #endregion + + #region 查看审批信息 + /// + /// 查看审批信息 + /// + /// + /// + protected void btnSee_Click(object sender, EventArgs e) + { + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.ArchitectureReportId, "查看 - "))); + } + else + { + ShowNotify("所选月份无记录!", MessageBoxIcon.Warning); + } + } + #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(); + MultiHeaderTable mht = new 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("lblNumber") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + sb.Append(""); + } + sb.Append("
{0}
"); + return sb.ToString(); + } + + #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 + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.designer.cs new file mode 100644 index 00000000..45dd9dfd --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReport.aspx.designer.cs @@ -0,0 +1,258 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental { + + + public partial class ArchitectureReport { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// RegionPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RegionPanel RegionPanel1; + + /// + /// Region2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Region Region2; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// BtnBulletLeft 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletLeft; + + /// + /// BtnBulletRight 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletRight; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSee 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSee; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// btnAudit1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit1; + + /// + /// btnAudit2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit2; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// lbUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbUnitName; + + /// + /// lbFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbFillingDate; + + /// + /// lbDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDutyPerson; + + /// + /// lbHandleMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbHandleMan; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window4; + + /// + /// Window5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window5; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx new file mode 100644 index 00000000..aef849ad --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx @@ -0,0 +1,128 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ArchitectureReportSave.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ArchitectureReportSave" %> + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs new file mode 100644 index 00000000..00b0ff00 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs @@ -0,0 +1,1420 @@ +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ArchitectureReportSave : PageBase + { + #region 定义变量 + /// + /// 报表主键Id + /// + public string ArchitectureReportId + { + get + { + return (string)ViewState["ArchitectureReportId"]; + } + set + { + ViewState["ArchitectureReportId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List items = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (Request.Params["type"] != "-1") + { + this.GetButtonPower(); + } + items.Clear(); + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + string unitId = Request.QueryString["UnitId"]; + string year = Request.QueryString["Year"]; + string quarters = Request.QueryString["Quarterss"]; + ArchitectureReportId = Request.QueryString["ArchitectureReportId"]; + if (!string.IsNullOrEmpty(Request.QueryString["type"])) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = false; + } + else + { + this.btnSave.Hidden = false; + this.btnUpdata.Hidden = true; + } + if (!String.IsNullOrEmpty(ArchitectureReportId)) + { + items = BLL.ArchitectureReportItemService.GetShowItems(ArchitectureReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + var report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId); + if (report != null) + { + //this.btnCopy.Hidden = true; + //if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.hfnbdId) + //{ + // this.btnSave.Hidden = false; + //} + if (report.UpState == BLL.Const.UpState_3) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = true; + } + drpQuarters.SelectedValue = report.Quarters.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + drpUnit.SelectedValue = report.UnitId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + } + } + else + { + //this.btnCopy.Hidden = false; + drpQuarters.SelectedValue = quarters; + drpYear.SelectedValue = year; + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + txtDutyPerson.Text = this.CurrUser.UserName; + //增加明细集合 + GetNewItems(year, quarters); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + SetUnEditableRow(); + GetData(); + } + else + { + if (GetRequestEventArgument() == "UPDATE_SUMMARY") + { + GetData(); + } + } + } + #endregion + + #region 设置不可编辑行 + private void SetUnEditableRow() + { + if (Grid1.Rows.Count == 61) + { + Grid1.Rows[0].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[0].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[14].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[14].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[16].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[16].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[17].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[18].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[18].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[20].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[20].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[21].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[22].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[24].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[24].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[36].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[36].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[58].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[58].CellCssClasses[5] = "f-grid-cell-uneditable"; + } + var lastYearReport = ArchitectureReportService.GetArchitectureReportByUnitIdYear(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); + if (lastYearReport.Count > 0) + { + var lastYearReportItems = ArchitectureReportItemService.GetLastYearItems(Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); + Grid1.Rows[1].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + SetLastYearUnEditableRow(); + } + else + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + DateTime lastQuarters = nowDate.Value.AddMonths(-3); + Environmental_ArchitectureReport lastQuartersReport = ArchitectureReportService.GetArchitectureReportByUnitIdDate(drpUnit.SelectedValue, lastQuarters.Year, Funs.GetNowQuarterlyByTime(lastQuarters)); + if (lastQuartersReport != null) + { + var lastQuartersReportItems = BLL.ArchitectureReportItemService.GetItems(lastQuartersReport.ArchitectureReportId); + Grid1.Rows[1].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + SetLastYearUnEditableRow(); + } + else + { + string year = Request.QueryString["Year"]; + string quarters = Request.QueryString["Quarterss"]; + var items = (from x in Funs.DB.Environmental_ProjectArchitectureReportItem + join y in Funs.DB.Environmental_ProjectArchitectureReport + on x.ArchitectureReportId equals y.ArchitectureReportId + where y.Year == Funs.GetNewIntOrZero(year) && y.Quarters == Funs.GetNewIntOrZero(quarters) + orderby x.SortIndex + select x).ToList(); + if (items.Count() > 0) + { + Grid1.Rows[0].Values[3] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[1].Values[3] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[2].Values[3] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[3].Values[3] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[4].Values[3] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[5].Values[3] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[6].Values[3] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[7].Values[3] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[8].Values[3] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[9].Values[3] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[10].Values[3] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[11].Values[3] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[12].Values[3] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[13].Values[3] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[15].Values[3] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[16].Values[3] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[17].Values[3] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[19].Values[3] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[20].Values[3] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[21].Values[3] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[22].Values[3] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[23].Values[3] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[24].Values[3] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[25].Values[3] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[26].Values[3] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[27].Values[3] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[28].Values[3] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[29].Values[3] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[30].Values[3] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[31].Values[3] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[32].Values[3] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[33].Values[3] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[34].Values[3] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[35].Values[3] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[36].Values[3] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[37].Values[3] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[38].Values[3] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[39].Values[3] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[40].Values[3] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[41].Values[3] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[42].Values[3] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[43].Values[3] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[44].Values[3] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[45].Values[3] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[46].Values[3] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[47].Values[3] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[48].Values[3] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[49].Values[3] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[50].Values[3] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[51].Values[3] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[52].Values[3] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[53].Values[3] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[54].Values[3] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[55].Values[3] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[56].Values[3] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[57].Values[3] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[59].Values[3] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[60].Values[3] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + + Grid1.Rows[0].Values[4] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[1].Values[4] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[2].Values[4] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[3].Values[4] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[4].Values[4] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[5].Values[4] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[6].Values[4] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[7].Values[4] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[8].Values[4] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[9].Values[4] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[10].Values[4] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[11].Values[4] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[12].Values[4] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[13].Values[4] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[15].Values[4] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[16].Values[4] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[17].Values[4] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[19].Values[4] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[20].Values[4] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[21].Values[4] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[22].Values[4] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[23].Values[4] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[24].Values[4] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[25].Values[4] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[26].Values[4] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[27].Values[4] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[28].Values[4] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[29].Values[4] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[30].Values[4] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[31].Values[4] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[32].Values[4] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[33].Values[4] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[34].Values[4] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[35].Values[4] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[36].Values[4] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[37].Values[4] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[38].Values[4] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[39].Values[4] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[40].Values[4] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[41].Values[4] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[42].Values[4] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[43].Values[4] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[44].Values[4] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[45].Values[4] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[46].Values[4] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[47].Values[4] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[48].Values[4] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[49].Values[4] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[50].Values[4] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[51].Values[4] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[52].Values[4] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[53].Values[4] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[54].Values[4] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[55].Values[4] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[56].Values[4] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[57].Values[4] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[59].Values[4] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[60].Values[4] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + + Grid1.Rows[0].Values[5] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[1].Values[5] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[5] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[5] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[5] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[5] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[5] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[5] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[5] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[5] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[5] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[5] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[5] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[5] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[5] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[5] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[5] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[5] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[5] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[5] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[5] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[5] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[5] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[5] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[5] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[5] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[5] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[5] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[5] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[5] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[5] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[5] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[5] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[5] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[5] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[5] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[5] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[5] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[5] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[5] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[5] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[5] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[5] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[5] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[5] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[5] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[5] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[5] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[5] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[5] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[5] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[5] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[5] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[5] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[5] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[5] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[5] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[5] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + } + } + } + } + + private void SetLastYearUnEditableRow() + { + Grid1.Rows[1].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[2].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[3].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[4].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[5].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[6].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[7].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[8].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[9].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[10].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[11].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[12].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[13].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[16].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[20].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[24].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[25].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[26].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[27].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[28].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[29].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[30].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[31].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[32].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[33].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[34].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[35].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[36].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[37].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[38].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[39].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[40].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[41].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[42].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[43].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[44].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[45].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[46].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[47].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[48].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[49].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[50].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[51].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[52].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[53].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[54].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[55].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[56].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[57].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[59].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[60].CellCssClasses[4] = "f-grid-cell-uneditable"; + } + #endregion + + #region 计算方法 + /// + /// 计算方法 + /// + private void GetData() + { + decimal E6 = 0, F6 = 0, E7 = 0, F7 = 0, E8, F8, E9 = 0, F9 = 0, E10 = 0, F10 = 0, E11 = 0, F11 = 0, E12 = 0, F12 = 0, E13 = 0, F13 = 0, E14 = 0, F14 = 0, E15 = 0, F15 = 0, E16 = 0, F16 = 0, E17 = 0, F17 = 0, E18 = 0, F18 = 0, E20 = 0, F20 = 0, E21 = 0, F21 = 0, E22 = 0, F22 = 0, + E24 = 0, F24 = 0, E25 = 0, F25 = 0, E26 = 0, F26 = 0, E27 = 0, F27 = 0, E28, F28, E29 = 0, F29 = 0, E30, F30, E31, F31, E32, F32, E33, F33, E34, F34, E35, F35, E36, F36, E37, F37, E38, F38, E39, F39, E40, F40, E41 = 0, F41 = 0, + E42, F42, E43, F43, E44, F44, E45, F45, E46, F46, E47, F47, E48, F48, E49, F49, E50, F50, E51, F51, E52, F52, E53, F53, E54, F54, E55, F55, + E56, F56, E57, F57, E58, F58, E59, F59, E60, F60, E61, F61, E62, F62, E64 = 0, F64 = 0, E65 = 0, F65 = 0; + JArray mergedData = Grid1.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + string sortIndex = values.Value("SortIndex"); + var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (item != null) + { + item.BaseNumber = System.Web.HttpUtility.HtmlDecode(values.Value("BaseNumber")); + item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); + item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); + + } + } + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + SetUnEditableRow(); + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + if (rowIndex == 1) + { + E6 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F6 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E6 > 0 && F6 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F6 - E6) * 100 / E6, 2).ToString() + "%"; + } + } + else if (rowIndex == 2) + { + E7 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F7 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E7 > 0 && F7 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F7 - E7) * 100 / E7, 2).ToString() + "%"; + } + } + else if (rowIndex == 3) + { + E8 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F8 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E8 > 0 && F8 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F8 - E8) * 100 / E8, 2).ToString() + "%"; + } + } + else if (rowIndex == 4) + { + E9 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F9 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E9 > 0 && F9 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F9 - E9) * 100 / E9, 2).ToString() + "%"; + } + } + else if (rowIndex == 5) + { + E10 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F10 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E10 > 0 && F10 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F10 - E10) * 100 / E10, 2).ToString() + "%"; + } + } + else if (rowIndex == 6) + { + E11 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F11 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E11 > 0 && F11 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F11 - E11) * 100 / E11, 2).ToString() + "%"; + } + } + else if (rowIndex == 7) + { + E12 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F12 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E12 > 0 && F12 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F12 - E12) * 100 / E12, 2).ToString() + "%"; + } + } + else if (rowIndex == 8) + { + E13 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F13 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E13 > 0 && F13 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F13 - E13) * 100 / E13, 2).ToString() + "%"; + } + } + else if (rowIndex == 9) + { + E14 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F14 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E14 > 0 && F14 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F14 - E14) * 100 / E14, 2).ToString() + "%"; + } + } + else if (rowIndex == 10) + { + E15 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F15 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E15 > 0 && F15 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F15 - E15) * 100 / E15, 2).ToString() + "%"; + } + } + else if (rowIndex == 11) + { + E16 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F16 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E16 > 0 && F16 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F16 - E16) * 100 / E16, 2).ToString() + "%"; + } + } + else if (rowIndex == 12) + { + E17 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F17 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E17 > 0 && F17 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F17 - E17) * 100 / E17, 2).ToString() + "%"; + } + } + else if (rowIndex == 13) + { + E18 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F18 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E18 > 0 && F18 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F18 - E18) * 100 / E18, 2).ToString() + "%"; + } + } + else if (rowIndex == 15) + { + E20 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F20 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E20 > 0 && F20 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F20 - E20) * 100 / E20, 2).ToString() + "%"; + } + } + else if (rowIndex == 16) + { + E21 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F21 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E21 > 0 && F21 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F21 - E21) * 100 / E21, 2).ToString() + "%"; + } + } + else if (rowIndex == 17) + { + E22 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F22 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E22 > 0 && F22 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F22 - E22) * 100 / E22, 2).ToString() + "%"; + } + } + else if (rowIndex == 19) + { + E24 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F24 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E24 > 0 && F24 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F24 - E24) * 100 / E24, 2).ToString() + "%"; + } + } + else if (rowIndex == 20) + { + E25 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F25 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E25 > 0 && F25 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F25 - E25) * 100 / E25, 2).ToString() + "%"; + } + } + else if (rowIndex == 21) + { + E26 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F26 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E26 > 0 && F26 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F26 - E26) * 100 / E26, 2).ToString() + "%"; + } + } + else if (rowIndex == 22) + { + E27 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F27 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E27 > 0 && F27 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F27 - E27) * 100 / E27, 2).ToString() + "%"; + } + } + else if (rowIndex == 23) + { + E28 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F28 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E28 > 0 && F28 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F28 - E28) * 100 / E28, 2).ToString() + "%"; + } + } + else if (rowIndex == 24) + { + E29 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F29 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E29 > 0 && F29 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F29 - E29) * 100 / E29, 2).ToString() + "%"; + } + } + else if (rowIndex == 25) + { + E30 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F30 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E30 > 0 && F30 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F30 - E30) * 100 / E30, 2).ToString() + "%"; + } + } + else if (rowIndex == 26) + { + E31 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F31 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E31 > 0 && F31 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F31 - E31) * 100 / E31, 2).ToString() + "%"; + } + } + else if (rowIndex == 27) + { + E32 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F32 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E32 > 0 && F32 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F32 - E32) * 100 / E32, 2).ToString() + "%"; + } + } + else if (rowIndex == 28) + { + E33 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F33 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E33 > 0 && F33 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F33 - E33) * 100 / E33, 2).ToString() + "%"; + } + } + else if (rowIndex == 29) + { + E34 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F34 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E34 > 0 && F34 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F34 - E34) * 100 / E34, 2).ToString() + "%"; + } + } + else if (rowIndex == 30) + { + E35 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F35 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E35 > 0 && F35 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F35 - E35) * 100 / E35, 2).ToString() + "%"; + } + } + else if (rowIndex == 31) + { + E36 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F36 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E36 > 0 && F36 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F36 - E36) * 100 / E36, 2).ToString() + "%"; + } + } + else if (rowIndex == 32) + { + E37 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F37 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E37 > 0 && F37 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F37 - E37) * 100 / E37, 2).ToString() + "%"; + } + } + else if (rowIndex == 33) + { + E38 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F38 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E38 > 0 && F38 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F38 - E38) * 100 / E38, 2).ToString() + "%"; + } + } + else if (rowIndex == 34) + { + E39 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F39 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E39 > 0 && F39 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F39 - E39) * 100 / E39, 2).ToString() + "%"; + } + } + else if (rowIndex == 35) + { + E40 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F40 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E40 > 0 && F40 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F40 - E40) * 100 / E40, 2).ToString() + "%"; + } + } + else if (rowIndex == 36) + { + E41 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F41 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E41 > 0 && F41 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F41 - E41) * 100 / E41, 2).ToString() + "%"; + } + } + else if (rowIndex == 37) + { + E42 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F42 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E42 > 0 && F42 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F42 - E42) * 100 / E42, 2).ToString() + "%"; + } + } + else if (rowIndex == 38) + { + E43 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F43 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E43 > 0 && F43 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F43 - E43) * 100 / E43, 2).ToString() + "%"; + } + } + else if (rowIndex == 39) + { + E44 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F44 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E44 > 0 && F44 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F44 - E44) * 100 / E44, 2).ToString() + "%"; + } + } + else if (rowIndex == 40) + { + E45 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F45 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E45 > 0 && F45 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F45 - E45) * 100 / E45, 2).ToString() + "%"; + } + } + else if (rowIndex == 41) + { + E46 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F46 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E46 > 0 && F46 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F46 - E46) * 100 / E46, 2).ToString() + "%"; + } + } + else if (rowIndex == 42) + { + E47 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F47 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E47 > 0 && F47 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F47 - E47) * 100 / E47, 2).ToString() + "%"; + } + } + else if (rowIndex == 43) + { + E48 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F48 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E48 > 0 && F48 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F48 - E48) * 100 / E48, 2).ToString() + "%"; + } + } + else if (rowIndex == 44) + { + E49 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F49 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E49 > 0 && F49 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F49 - E49) * 100 / E49, 2).ToString() + "%"; + } + } + else if (rowIndex == 45) + { + E50 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F50 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E50 > 0 && F50 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F50 - E50) * 100 / E50, 2).ToString() + "%"; + } + } + else if (rowIndex == 46) + { + E51 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F51 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E51 > 0 && F51 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F51 - E51) * 100 / E51, 2).ToString() + "%"; + } + } + else if (rowIndex == 47) + { + E52 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F52 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E52 > 0 && F52 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F52 - E52) * 100 / E52, 2).ToString() + "%"; + } + } + else if (rowIndex == 48) + { + E53 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F53 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E53 > 0 && F53 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F53 - E53) * 100 / E53, 2).ToString() + "%"; + } + } + else if (rowIndex == 49) + { + E54 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F54 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E54 > 0 && F54 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F54 - E54) * 100 / E54, 2).ToString() + "%"; + } + } + else if (rowIndex == 50) + { + E55 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F55 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E55 > 0 && F55 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F55 - E55) * 100 / E55, 2).ToString() + "%"; + } + } + else if (rowIndex == 51) + { + E56 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F56 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E56 > 0 && F56 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F56 - E56) * 100 / E56, 2).ToString() + "%"; + } + } + else if (rowIndex == 52) + { + E57 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F57 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E57 > 0 && F57 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F57 - E57) * 100 / E57, 2).ToString() + "%"; + } + } + else if (rowIndex == 53) + { + E58 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F58 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E58 > 0 && F58 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F58 - E58) * 100 / E58, 2).ToString() + "%"; + } + } + else if (rowIndex == 54) + { + E59 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F59 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E59 > 0 && F59 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F59 - E59) * 100 / E59, 2).ToString() + "%"; + } + } + else if (rowIndex == 55) + { + E60 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F60 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E60 > 0 && F60 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F60 - E60) * 100 / E60, 2).ToString() + "%"; + } + } + else if (rowIndex == 56) + { + E61 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F61 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E61 > 0 && F61 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F61 - E61) * 100 / E61, 2).ToString() + "%"; + } + } + else if (rowIndex == 57) + { + E62 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F62 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E62 > 0 && F62 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F62 - E62) * 100 / E62, 2).ToString() + "%"; + } + } + else if (rowIndex == 59) + { + E64 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F64 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E64 > 0 && F64 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F64 - E64) * 100 / E64, 2).ToString() + "%"; + } + } + else if (rowIndex == 60) + { + E65 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F65 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E65 > 0 && F65 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F65 - E65) * 100 / E65, 2).ToString() + "%"; + } + } + } + if (E6 > 0 || E9 > 0 || E10 > 0 || E11 > 0 || E12 > 0 || E13 > 0 || E14 > 0 || E15 > 0 || E16 > 0 || E17 > 0 || E18 > 0) + { + this.Grid1.Rows[0].Values[4] = (E6 + (E9 * Convert.ToDecimal(0.9714) + E10 * Convert.ToDecimal(1.229) + E11 * Convert.ToDecimal(1.4286) + E12 * Convert.ToDecimal(1.4714) + E13 * Convert.ToDecimal(1.4714) + E14 * Convert.ToDecimal(1.4571) + E15 * Convert.ToDecimal(1.4286) + E16 * Convert.ToDecimal(13.3) + E17 * Convert.ToDecimal(0.0341) + E18) / 10000); + } + if (F6 > 0 || F9 > 0 || F10 > 0 || F11 > 0 || F12 > 0 || F13 > 0 || F14 > 0 || F15 > 0 || F16 > 0 || F17 > 0 || F18 > 0) + { + this.Grid1.Rows[0].Values[5] = (F6 + (F9 * Convert.ToDecimal(0.9714) + F10 * Convert.ToDecimal(1.229) + F11 * Convert.ToDecimal(1.4286) + F12 * Convert.ToDecimal(1.4714) + F13 * Convert.ToDecimal(1.4714) + F14 * Convert.ToDecimal(1.4571) + F15 * Convert.ToDecimal(1.4286) + F16 * Convert.ToDecimal(13.3) + F17 * Convert.ToDecimal(0.0341) + F18) / 10000); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && !string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString())) + { + this.Grid1.Rows[0].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()), 2).ToString() + "%"; + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E20 > 0) + { + this.Grid1.Rows[14].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E20, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F20 > 0) + { + this.Grid1.Rows[14].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F20, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[14].Values[4].ToString()) && this.Grid1.Rows[14].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[14].Values[5].ToString())) + { + this.Grid1.Rows[14].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString()), 2).ToString() + "%"; + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E24 > 0) + { + this.Grid1.Rows[18].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E24, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F24 > 0) + { + this.Grid1.Rows[18].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F24, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[18].Values[4].ToString()) && this.Grid1.Rows[18].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[18].Values[5].ToString())) + { + this.Grid1.Rows[18].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString()), 2).ToString() + "%"; + } + if (E64 > 0 && E65 > 0 && E20 > 0) + { + this.Grid1.Rows[58].Values[4] = decimal.Round((E64 + E65) / E20, 4); + } + if (F64 > 0 && F65 > 0 && F20 > 0) + { + this.Grid1.Rows[58].Values[5] = decimal.Round((F64 + F65) / F20, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[58].Values[4].ToString()) && this.Grid1.Rows[58].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[58].Values[5].ToString())) + { + this.Grid1.Rows[58].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[58].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[58].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[58].Values[4].ToString()), 2).ToString() + "%"; + } + } + #endregion + + #region 关闭窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId); + this.btnSave.Hidden = false; + } + #endregion + + #region 保存、上报 + /// + /// 保存数据 + /// + /// + private void Save(string type) + { + //string ArchitectureReportId = Request.QueryString["ArchitectureReportId"]; + Model.Environmental_ArchitectureReport report = new Environmental_ArchitectureReport + { + UnitId = drpUnit.SelectedValue, + Year = Funs.GetNewIntOrZero(drpYear.SelectedValue), + Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue) + }; + if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim())) + { + report.FillingDate = Convert.ToDateTime(txtFillingDate.Text.Trim()); + } + report.DutyPerson = txtDutyPerson.Text.Trim(); + if (String.IsNullOrEmpty(ArchitectureReportId)) + { + Environmental_ArchitectureReport old = ArchitectureReportService.GetArchitectureReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (old == null) + { + report.ArchitectureReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReport)); + report.UpState = BLL.Const.UpState_2; + report.FillingMan = this.CurrUser.UserName; + BLL.ArchitectureReportService.AddArchitectureReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnAdd); + } + else + { + ShowNotify("该月份记录已存在!", MessageBoxIcon.Warning); + return; + } + } + else + { + Model.Environmental_ArchitectureReport oldReport = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId); + report.ArchitectureReportId = ArchitectureReportId; + report.UpState = BLL.Const.UpState_2; + BLL.ArchitectureReportService.UpdateArchitectureReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnModify); + } + ArchitectureReportId = report.ArchitectureReportId; + BLL.ArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId); + List mReportItemList = new List(); + GetItems(report.ArchitectureReportId); + foreach (var item in items) + { + Model.Environmental_ArchitectureReportItem newItem = new Environmental_ArchitectureReportItem(); + newItem.ArchitectureReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReportItem)); + newItem.ArchitectureReportId = report.ArchitectureReportId; + newItem.BaseNumber = System.Web.HttpUtility.HtmlDecode(item.BaseNumber); + newItem.SortIndex = System.Web.HttpUtility.HtmlDecode(item.SortIndex); + newItem.LastYearValue = System.Web.HttpUtility.HtmlDecode(item.LastYearValue); + newItem.ThisYearValue = System.Web.HttpUtility.HtmlDecode(item.ThisYearValue); + newItem.Rate = System.Web.HttpUtility.HtmlDecode(item.Rate); + ArchitectureReportItemService.AddArchitectureReportItem(newItem); + mReportItemList.Add(newItem); + } + if (type == "updata") //数据同步 + { + if (report.UpState == BLL.Const.UpState_2) + { + string code = CNCECHSSEWebService.UpArchitectureReport(report.ArchitectureReportId, this.CurrUser); + if (code == "1") + { + ShowNotify("同步成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + return; + } + else + { + Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); + } + } + else + { + ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning); + return; + } + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + Save("add"); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + protected void btnUpdata_Click(object sender, EventArgs e) + { + Save("updata"); + } + + protected void btnSubmit_Click(object sender, EventArgs e) + { + Save("submit"); + } + #endregion + + #region 增加本月明细 + private void GetItems(string ArchitectureReportId) + { + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + string sortIndex = values.Value("SortIndex"); + var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (item != null) + { + item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); + item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); + item.Rate = System.Web.HttpUtility.HtmlDecode(values.Value("Rate")); + } + } + } + #endregion + + #region 获取明细 + private void GetNewItems(string year, string quarters) + { + var indexNames = ArchitectureReportItemService.GetIndexNames(); + var units = ArchitectureReportItemService.GetUnits(); + foreach (var indexName in indexNames) + { + //增加明细集合 + Model.ArchitectureReportItem item = new ArchitectureReportItem + { + ArchitectureReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReportItem)), + IndexName = indexName.Text, + Unit = units.First(x => x.Value == indexName.Value).Text, + SortIndex = indexName.Value, + }; + //if (item.SortIndex == "17" || item.SortIndex == "18" || item.SortIndex == "21" || item.SortIndex == "22" || item.SortIndex == "23" || item.SortIndex == "25" || item.SortIndex == "37") + //{ + // item.LastYearValue = "×"; + // item.ThisYearValue = "×"; + // if (item.SortIndex == "25") + // { + // item.Rate = "─"; + // } + // else + // { + // item.Rate = "×"; + // } + //} + items.Add(item); + } + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉选择事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + items.Clear(); + if (drpUnit.SelectedValue != BLL.Const._Null) + { + //GetNewItems(); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ArchitectureReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + //this.btnCopy.Hidden = false; + } + //if (buttonList.Contains(BLL.Const.BtnSaveUp)) + //{ + // this.btnUpdata.Hidden = false; + //} + } + } + #endregion + + #region 复制上个月数据 + /// + /// 复制上个月的数据 + /// + /// + /// + protected void btnCopy_Click(object sender, EventArgs e) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + showDate = nowDate.Value.AddMonths(-3); + Model.Environmental_ArchitectureReport ArchitectureReport = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(this.drpUnit.SelectedValue, showDate.Year, Funs.GetNowQuarterlyByTime(showDate)); + if (ArchitectureReport != null) + { + Model.Environmental_ArchitectureReport newArchitectureReport = new Environmental_ArchitectureReport(); + this.ArchitectureReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReport)); + newArchitectureReport.ArchitectureReportId = this.ArchitectureReportId; + newArchitectureReport.UnitId = this.drpUnit.SelectedValue; + newArchitectureReport.Year = Convert.ToInt32(this.drpYear.SelectedValue); + newArchitectureReport.Quarters = Convert.ToInt32(this.drpQuarters.SelectedValue); + newArchitectureReport.FillingMan = this.CurrUser.UserName; + newArchitectureReport.FillingDate = DateTime.Now; + newArchitectureReport.DutyPerson = this.CurrUser.UserName; + newArchitectureReport.UpState = BLL.Const.UpState_2; + BLL.ArchitectureReportService.AddArchitectureReport(newArchitectureReport); + + var oldItems = BLL.ArchitectureReportItemService.GetItems(ArchitectureReport.ArchitectureReportId); + if (oldItems.Count > 0) + { + foreach (var item in oldItems) + { + Model.Environmental_ArchitectureReportItem newItem = new Environmental_ArchitectureReportItem + { + ArchitectureReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ArchitectureReportItem)), + ArchitectureReportId = this.ArchitectureReportId, + BaseNumber = item.BaseNumber, + SortIndex = item.SortIndex, + LastYearValue = item.LastYearValue, + ThisYearValue = item.ThisYearValue, + Rate = item.Rate, + }; + BLL.ArchitectureReportItemService.AddArchitectureReportItem(newItem); + } + } + + GetValues(newArchitectureReport.ArchitectureReportId); + } + } + } + + /// + /// 获取复制的值绑定到文本中 + /// + private void GetValues(string ArchitectureReportId) + { + var report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId); + if (report != null) + { + drpQuarters.SelectedValue = report.Quarters.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + drpUnit.SelectedValue = report.UnitId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + items = BLL.ArchitectureReportItemService.GetShowItems(ArchitectureReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.designer.cs new file mode 100644 index 00000000..5918d103 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental { + + + public partial class ArchitectureReportSave { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// txtFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtFillingDate; + + /// + /// txtDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDutyPerson; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// txtBaseNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBaseNumber; + + /// + /// txtLastYearValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtLastYearValue; + + /// + /// txtThisYearValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtThisYearValue; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReport.aspx new file mode 100644 index 00000000..5aced289 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReport.aspx @@ -0,0 +1,138 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChemicalReport.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ChemicalReport" %> + + + + + + + 化工行业能源节约与生态环境保护汇总表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReport.aspx.cs new file mode 100644 index 00000000..99cbbd78 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReport.aspx.cs @@ -0,0 +1,636 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BLL; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ChemicalReport : PageBase + { + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + ////取上个报表时间 + DateTime showDate = System.DateTime.Now.AddMonths(-1); + drpMonth.SelectedValue = showDate.Month.ToString(); + drpYear.SelectedValue = showDate.Year.ToString(); + GetValue(); + } + } + + private void SetEmpty() + { + this.SimpleForm1.Title = string.Empty; + lbUnitName.Text = "填报企业:"; + lbFillingDate.Text = "填报日期:"; + lbDutyPerson.Text = "负责人:"; + lbHandleMan.Text = string.Empty; + this.Grid1.DataSource = null; + this.Grid1.DataBind(); + } + #endregion + + #region 获取记录值 + private void GetValue() + { + int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + int month = Funs.GetNewIntOrZero(drpMonth.SelectedValue); + Model.View_Environmental_ChemicalReport report = Funs.DB.View_Environmental_ChemicalReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Month == month && e.Year == year); + if (report != null) + { + string upState = string.Empty; + if (report.UpState == BLL.Const.UpState_3) + { + upState = "(已上报)"; + } + else + { + upState = "(未上报)"; + } + this.SimpleForm1.Title = "企业化工行业能源节约与生态环境保护汇总表" + report.MonthStr + report.YearStr + upState; + lbUnitName.Text = "填报企业:" + report.UnitName; + if (report.FillingDate != null) + { + lbFillingDate.Text = "填报日期:" + string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + else + { + lbFillingDate.Text = "填报日期:"; + } + lbDutyPerson.Text = "负责人:" + report.DutyPerson; + //if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3) + //{ + // this.lbHandleMan.Hidden = true; + //} + //else + //{ + // this.lbHandleMan.Hidden = false; + // lbHandleMan.Text = "下一步办理人:" + report.UserName; + //} + var indexNames = ChemicalReportItemService.GetIndexNames(); + var units = ChemicalReportItemService.GetUnits(); + //之前月度合计值集合 + List reportItems = BLL.ChemicalReportItemService.GetItems(report.ChemicalReportId); + List items = new List(); + foreach (var yearSumItem in reportItems) + { + Model.ChemicalReportItem item = new Model.ChemicalReportItem(); + item.ChemicalReportItemId = yearSumItem.ChemicalReportItemId; + item.IndexName = indexNames.First(x => x.Value == yearSumItem.SortIndex).Text; + item.Unit = units.First(x => x.Value == yearSumItem.SortIndex).Text; + item.SortIndex = yearSumItem.SortIndex; + item.BaseNumber = yearSumItem.BaseNumber; + item.LastYearValue = yearSumItem.LastYearValue; + item.ThisYearValue = yearSumItem.ThisYearValue; + item.Rate = yearSumItem.Rate; + items.Add(item); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + else + { + SetEmpty(); + } + this.GetButtonPower(); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭导入弹出窗口 + /// + /// + /// + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭查看审批信息弹出窗口 + /// + /// + /// + protected void Window4_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ChemicalReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnDelete.Hidden = false; + } + } + + var getReport = BLL.ChemicalReportService.GetChemicalReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + this.btnAudit1.Hidden = true; + this.btnAudit2.Hidden = true; + if (getReport != null) + { + this.btnNew.Hidden = true; + //if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入 + //{ + // if (getReport.HandleState == BLL.Const.HandleState_2) + // { + // this.btnAudit1.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_3) + // { + // this.btnAudit2.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_4) + // { + this.btnUpdata.Hidden = false; + // } + //} + } + } + #endregion + + #region 增加、修改、审核、审批、上报、删除 + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ChemicalReportSave.aspx?UnitId={0}&&Year={1}&&Months={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpMonth.SelectedValue, "编辑 - "))); + } + + /// + /// 修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + Model.Environmental_ChemicalReport report = BLL.ChemicalReportService.GetChemicalReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ChemicalReportSave.aspx?ChemicalReportId={0}", report.ChemicalReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审核 + /// + /// + /// + protected void btnAudit1_Click(object sender, EventArgs e) + { + Model.Environmental_ChemicalReport report = BLL.ChemicalReportService.GetChemicalReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ChemicalReportSave.aspx?ChemicalReportId={0}", report.ChemicalReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审批 + /// + /// + /// + protected void btnAudit2_Click(object sender, EventArgs e) + { + Model.Environmental_ChemicalReport report = BLL.ChemicalReportService.GetChemicalReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ChemicalReportSave.aspx?ChemicalReportId={0}", report.ChemicalReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 上报 + /// + /// + /// + protected void btnUpdata_Click(object sender, EventArgs e) + { + Model.Environmental_ChemicalReport report = BLL.ChemicalReportService.GetChemicalReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ChemicalReportSave.aspx?ChemicalReportId={0}&type=Updata", report.ChemicalReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + Model.Environmental_ChemicalReport report = BLL.ChemicalReportService.GetChemicalReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ChemicalReportId, BLL.Const.ChemicalReportMenuId, BLL.Const.BtnDelete); + BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.ChemicalReportId); + BLL.ChemicalReportItemService.DeleteChemicalReportItemByChemicalReportId(report.ChemicalReportId); + BLL.ChemicalReportService.DeleteChemicalReportByChemicalReportId(report.ChemicalReportId); + + SetEmpty(); + this.btnNew.Hidden = false; + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify("所选时间无报表记录!"); + } + } + #endregion + + #region 格式化字符串 + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertCompileDate(object CompileDate) + { + if (CompileDate != null) + { + return string.Format("{0:yyyy-MM-dd}", CompileDate); + } + return ""; + } + + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertDate(object ChemicalReportId) + { + if (ChemicalReportId != null) + { + Model.Environmental_ChemicalReport report = BLL.ChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId.ToString()); + if (report != null) + { + return report.Year + "年" + report.Month + "月"; + } + } + return ""; + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉框联动事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + var units = BLL.UnitService.GetUnitDropDownList(); + if (units != null && !string.IsNullOrEmpty(this.drpUnit.SelectedText)) + { + var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText); + if (unit != null) + { + drpUnit.SelectedValue = unit.UnitId; + } + } + + GetValue(); + } + #endregion + + #region 月份向前/向后 + /// + /// 前一个月 + /// + /// + /// + protected void BtnBulletLeft_Click(object sender, EventArgs e) + { + SetMonthChange("-"); + } + + /// + /// 后一个月 + /// + /// + /// + protected void BulletRight_Click(object sender, EventArgs e) + { + SetMonthChange("+"); + } + + /// + /// 月份加减变化 + /// + /// + private void SetMonthChange(string type) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + if (type == "+") + { + showDate = nowDate.Value.AddMonths(1); + } + else + { + showDate = nowDate.Value.AddMonths(-1); + } + + this.drpYear.SelectedValue = showDate.Year.ToString(); + drpMonth.SelectedValue = showDate.Month.ToString(); + ///值变化 + GetValue(); + } + } + #endregion + + #region 查看审批信息 + /// + /// 查看审批信息 + /// + /// + /// + protected void btnSee_Click(object sender, EventArgs e) + { + Model.Environmental_ChemicalReport report = BLL.ChemicalReportService.GetChemicalReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.ChemicalReportId, "查看 - "))); + } + else + { + ShowNotify("所选月份无记录!", MessageBoxIcon.Warning); + } + } + #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(); + MultiHeaderTable mht = new 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("lblNumber") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + sb.Append(""); + } + sb.Append("
{0}
"); + return sb.ToString(); + } + + #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 + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReport.aspx.designer.cs new file mode 100644 index 00000000..7881ce86 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReport.aspx.designer.cs @@ -0,0 +1,258 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental { + + + public partial class ChemicalReport { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// RegionPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RegionPanel RegionPanel1; + + /// + /// Region2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Region Region2; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpMonth; + + /// + /// BtnBulletLeft 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletLeft; + + /// + /// BtnBulletRight 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletRight; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSee 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSee; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// btnAudit1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit1; + + /// + /// btnAudit2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit2; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// lbUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbUnitName; + + /// + /// lbFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbFillingDate; + + /// + /// lbDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDutyPerson; + + /// + /// lbHandleMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbHandleMan; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window4; + + /// + /// Window5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window5; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx new file mode 100644 index 00000000..2540e8f0 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx @@ -0,0 +1,128 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChemicalReportSave.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ChemicalReportSave" %> + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.cs new file mode 100644 index 00000000..661ad794 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.cs @@ -0,0 +1,2031 @@ +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using Org.BouncyCastle.Asn1.Ocsp; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ChemicalReportSave : PageBase + { + #region 定义变量 + /// + /// 报表主键Id + /// + public string ChemicalReportId + { + get + { + return (string)ViewState["ChemicalReportId"]; + } + set + { + ViewState["ChemicalReportId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List items = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (Request.Params["type"] != "-1") + { + this.GetButtonPower(); + } + items.Clear(); + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + string unitId = Request.QueryString["UnitId"]; + string year = Request.QueryString["Year"]; + string months = Request.QueryString["Months"]; + ChemicalReportId = Request.QueryString["ChemicalReportId"]; + if (!string.IsNullOrEmpty(Request.QueryString["type"])) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = false; + } + else + { + this.btnSave.Hidden = false; + this.btnUpdata.Hidden = true; + } + if (!String.IsNullOrEmpty(ChemicalReportId)) + { + items = BLL.ChemicalReportItemService.GetShowItems(ChemicalReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + var report = BLL.ChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId); + if (report != null) + { + //this.btnCopy.Hidden = true; + //if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.hfnbdId) + //{ + // this.btnSave.Hidden = false; + //} + if (report.UpState == BLL.Const.UpState_3) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = true; + } + drpMonth.SelectedValue = report.Month.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + drpUnit.SelectedValue = report.UnitId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + } + } + else + { + //this.btnCopy.Hidden = false; + drpMonth.SelectedValue = months; + drpYear.SelectedValue = year; + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + txtDutyPerson.Text = this.CurrUser.UserName; + //增加明细集合 + GetNewItems(year, months); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + SetUnEditableRow(); + GetData(); + } + else + { + if (GetRequestEventArgument() == "UPDATE_SUMMARY") + { + GetData(); + } + } + Grid1.Rows[0].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[0].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[96].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[96].CellCssClasses[5] = "f-grid-cell-uneditable"; + } + #endregion + + #region 设置不可编辑行 + private void SetUnEditableRow() + { + if (Grid1.Rows.Count == 99) + { + Grid1.Rows[0].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[0].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[17].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[18].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[18].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[21].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[22].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[23].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[33].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[33].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[96].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[96].CellCssClasses[5] = "f-grid-cell-uneditable"; + } + var lastYearReport = ChemicalReportService.GetChemicalReportByUnitIdYear(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); + if (lastYearReport.Count > 0) + { + var lastYearReportItems = ChemicalReportItemService.GetLastYearItems(Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); + Grid1.Rows[1].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[14].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "15").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[18].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "19").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[58].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "59").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[61].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "62").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[62].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "63").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[63].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "64").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[64].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "65").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[65].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "66").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[66].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "67").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[67].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "68").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[68].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "69").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[69].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "70").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[70].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "71").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[71].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "72").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[72].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "73").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[73].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "74").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[74].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "75").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[75].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "76").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[76].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "77").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[77].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "78").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[78].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "79").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[79].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "80").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[80].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "81").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[81].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "82").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[82].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "83").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[83].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "84").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[84].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "85").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[85].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "86").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[86].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "87").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[87].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "88").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[88].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "89").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[89].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "90").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[90].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "91").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[91].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "92").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[92].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "93").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[93].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "94").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[94].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "95").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[95].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "96").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[96].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "97").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[97].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "98").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[98].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "99").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + SetLastYearUnEditableRow(); + } + else + { + DateTime lastMonth = Convert.ToDateTime(drpYear.SelectedValue + "-" + drpMonth.SelectedValue + "-01").AddMonths(-1); + Environmental_ChemicalReport lastMonthReport = ChemicalReportService.GetChemicalReportByUnitIdDate(drpUnit.SelectedValue, lastMonth.Year, lastMonth.Month); + if (lastMonthReport != null) + { + var lastMonthReportItems = BLL.ChemicalReportItemService.GetItems(lastMonthReport.ChemicalReportId); + Grid1.Rows[1].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[2].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[3].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[4].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[5].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[6].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[7].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[8].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[9].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[10].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[11].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[12].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[13].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[14].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "15").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[15].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[16].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[17].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[18].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "19").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[19].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[20].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[21].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[22].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[23].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[24].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[25].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[26].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[27].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[28].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[29].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[30].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[31].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[32].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[33].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[34].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[35].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[36].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[37].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[38].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[39].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[40].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[41].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[42].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[43].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[44].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[45].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[46].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[47].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[48].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[49].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[50].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[51].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[52].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[53].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[54].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[55].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[56].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[57].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[58].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "59").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[59].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[60].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[61].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "62").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[62].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "63").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[63].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "64").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[64].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "65").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[65].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "66").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[66].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "67").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[67].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "68").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[68].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "69").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[69].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "70").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[70].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "71").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[71].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "72").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[72].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "73").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[73].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "74").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[74].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "75").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[75].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "76").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[76].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "77").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[77].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "78").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[78].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "79").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[79].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "80").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[80].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "81").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[81].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "82").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[82].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "83").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[83].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "84").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[84].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "85").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[85].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "86").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[86].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "87").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[87].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "88").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[88].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "89").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[89].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "90").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[90].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "91").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[91].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "92").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[92].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "93").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[93].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "94").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[94].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "95").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[95].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "96").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[96].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "97").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[97].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "98").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[98].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "99").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + SetLastYearUnEditableRow(); + } + else + { + string year = Request.QueryString["Year"]; + string months = Request.QueryString["Months"]; + var items = (from x in Funs.DB.Environmental_ProjectChemicalReportItem + join y in Funs.DB.Environmental_ProjectChemicalReport + on x.ChemicalReportId equals y.ChemicalReportId + where y.Year == Funs.GetNewIntOrZero(year) && y.Month == Funs.GetNewIntOrZero(months) + orderby x.SortIndex + select x).ToList(); + if (items.Count() > 0) + { + Grid1.Rows[0].Values[3] = items.Where(x => x.SortIndex == "01").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[1].Values[3] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[2].Values[3] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[3].Values[3] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[4].Values[3] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[5].Values[3] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[6].Values[3] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[7].Values[3] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[8].Values[3] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[9].Values[3] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[10].Values[3] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[11].Values[3] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[12].Values[3] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[13].Values[3] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[14].Values[3] = items.Where(x => x.SortIndex == "15").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[15].Values[3] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[16].Values[3] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[17].Values[3] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[18].Values[3] = items.Where(x => x.SortIndex == "19").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[19].Values[3] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[20].Values[3] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[21].Values[3] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[22].Values[3] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[23].Values[3] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[24].Values[3] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[25].Values[3] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[26].Values[3] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[27].Values[3] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[28].Values[3] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[29].Values[3] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[30].Values[3] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[31].Values[3] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[32].Values[3] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[33].Values[3] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[34].Values[3] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[35].Values[3] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[36].Values[3] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[37].Values[3] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[38].Values[3] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[39].Values[3] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[40].Values[3] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[41].Values[3] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[42].Values[3] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[43].Values[3] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[44].Values[3] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[45].Values[3] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[46].Values[3] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[47].Values[3] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[48].Values[3] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[49].Values[3] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[50].Values[3] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[51].Values[3] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[52].Values[3] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[53].Values[3] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[54].Values[3] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[55].Values[3] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[56].Values[3] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[57].Values[3] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[58].Values[3] = items.Where(x => x.SortIndex == "59").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[59].Values[3] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[60].Values[3] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[61].Values[3] = items.Where(x => x.SortIndex == "62").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[62].Values[3] = items.Where(x => x.SortIndex == "63").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[63].Values[3] = items.Where(x => x.SortIndex == "64").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[64].Values[3] = items.Where(x => x.SortIndex == "65").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[65].Values[3] = items.Where(x => x.SortIndex == "66").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[66].Values[3] = items.Where(x => x.SortIndex == "67").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[67].Values[3] = items.Where(x => x.SortIndex == "68").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[68].Values[3] = items.Where(x => x.SortIndex == "69").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[69].Values[3] = items.Where(x => x.SortIndex == "70").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[70].Values[3] = items.Where(x => x.SortIndex == "71").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[71].Values[3] = items.Where(x => x.SortIndex == "72").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[72].Values[3] = items.Where(x => x.SortIndex == "73").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[73].Values[3] = items.Where(x => x.SortIndex == "74").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[74].Values[3] = items.Where(x => x.SortIndex == "75").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[75].Values[3] = items.Where(x => x.SortIndex == "76").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[76].Values[3] = items.Where(x => x.SortIndex == "77").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[77].Values[3] = items.Where(x => x.SortIndex == "78").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[78].Values[3] = items.Where(x => x.SortIndex == "79").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[79].Values[3] = items.Where(x => x.SortIndex == "80").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[80].Values[3] = items.Where(x => x.SortIndex == "81").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[81].Values[3] = items.Where(x => x.SortIndex == "82").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[82].Values[3] = items.Where(x => x.SortIndex == "83").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[83].Values[3] = items.Where(x => x.SortIndex == "84").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[84].Values[3] = items.Where(x => x.SortIndex == "85").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[85].Values[3] = items.Where(x => x.SortIndex == "86").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[86].Values[3] = items.Where(x => x.SortIndex == "87").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[87].Values[3] = items.Where(x => x.SortIndex == "88").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[88].Values[3] = items.Where(x => x.SortIndex == "89").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[89].Values[3] = items.Where(x => x.SortIndex == "90").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[90].Values[3] = items.Where(x => x.SortIndex == "91").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[91].Values[3] = items.Where(x => x.SortIndex == "92").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[92].Values[3] = items.Where(x => x.SortIndex == "93").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[93].Values[3] = items.Where(x => x.SortIndex == "94").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[94].Values[3] = items.Where(x => x.SortIndex == "95").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[95].Values[3] = items.Where(x => x.SortIndex == "96").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[96].Values[3] = items.Where(x => x.SortIndex == "97").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[97].Values[3] = items.Where(x => x.SortIndex == "98").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + Grid1.Rows[98].Values[3] = items.Where(x => x.SortIndex == "99").Sum(x => Funs.GetNewDecimalOrZero(x.BaseNumber)); + + Grid1.Rows[1].Values[4] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[2].Values[4] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[3].Values[4] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[4].Values[4] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[5].Values[4] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[6].Values[4] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[7].Values[4] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[8].Values[4] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[9].Values[4] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[10].Values[4] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[11].Values[4] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[12].Values[4] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[13].Values[4] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[14].Values[4] = items.Where(x => x.SortIndex == "15").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[15].Values[4] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[16].Values[4] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[17].Values[4] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[18].Values[4] = items.Where(x => x.SortIndex == "19").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[19].Values[4] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[20].Values[4] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[21].Values[4] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[22].Values[4] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[23].Values[4] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[24].Values[4] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[25].Values[4] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[26].Values[4] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[27].Values[4] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[28].Values[4] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[29].Values[4] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[30].Values[4] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[31].Values[4] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[32].Values[4] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[33].Values[4] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[34].Values[4] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[35].Values[4] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[36].Values[4] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[37].Values[4] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[38].Values[4] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[39].Values[4] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[40].Values[4] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[41].Values[4] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[42].Values[4] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[43].Values[4] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[44].Values[4] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[45].Values[4] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[46].Values[4] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[47].Values[4] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[48].Values[4] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[49].Values[4] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[50].Values[4] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[51].Values[4] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[52].Values[4] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[53].Values[4] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[54].Values[4] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[55].Values[4] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[56].Values[4] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[57].Values[4] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[58].Values[4] = items.Where(x => x.SortIndex == "59").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[59].Values[4] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[60].Values[4] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[61].Values[4] = items.Where(x => x.SortIndex == "62").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[62].Values[4] = items.Where(x => x.SortIndex == "63").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[63].Values[4] = items.Where(x => x.SortIndex == "64").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[64].Values[4] = items.Where(x => x.SortIndex == "65").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[65].Values[4] = items.Where(x => x.SortIndex == "66").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[66].Values[4] = items.Where(x => x.SortIndex == "67").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[67].Values[4] = items.Where(x => x.SortIndex == "68").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[68].Values[4] = items.Where(x => x.SortIndex == "69").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[69].Values[4] = items.Where(x => x.SortIndex == "70").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[70].Values[4] = items.Where(x => x.SortIndex == "71").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[71].Values[4] = items.Where(x => x.SortIndex == "72").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[72].Values[4] = items.Where(x => x.SortIndex == "73").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[73].Values[4] = items.Where(x => x.SortIndex == "74").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[74].Values[4] = items.Where(x => x.SortIndex == "75").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[75].Values[4] = items.Where(x => x.SortIndex == "76").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[76].Values[4] = items.Where(x => x.SortIndex == "77").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[77].Values[4] = items.Where(x => x.SortIndex == "78").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[78].Values[4] = items.Where(x => x.SortIndex == "79").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[79].Values[4] = items.Where(x => x.SortIndex == "80").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[80].Values[4] = items.Where(x => x.SortIndex == "81").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[81].Values[4] = items.Where(x => x.SortIndex == "82").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[82].Values[4] = items.Where(x => x.SortIndex == "83").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[83].Values[4] = items.Where(x => x.SortIndex == "84").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[84].Values[4] = items.Where(x => x.SortIndex == "85").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[85].Values[4] = items.Where(x => x.SortIndex == "86").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[86].Values[4] = items.Where(x => x.SortIndex == "87").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[87].Values[4] = items.Where(x => x.SortIndex == "88").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[88].Values[4] = items.Where(x => x.SortIndex == "89").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[89].Values[4] = items.Where(x => x.SortIndex == "90").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[90].Values[4] = items.Where(x => x.SortIndex == "91").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[91].Values[4] = items.Where(x => x.SortIndex == "92").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[92].Values[4] = items.Where(x => x.SortIndex == "93").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[93].Values[4] = items.Where(x => x.SortIndex == "94").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[94].Values[4] = items.Where(x => x.SortIndex == "95").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[95].Values[4] = items.Where(x => x.SortIndex == "96").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[96].Values[4] = items.Where(x => x.SortIndex == "97").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[97].Values[4] = items.Where(x => x.SortIndex == "98").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[98].Values[4] = items.Where(x => x.SortIndex == "99").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + + Grid1.Rows[1].Values[5] = items.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[5] = items.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[5] = items.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[5] = items.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[5] = items.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[5] = items.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[5] = items.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[5] = items.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[5] = items.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[5] = items.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[5] = items.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[5] = items.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[5] = items.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[14].Values[5] = items.Where(x => x.SortIndex == "15").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[5] = items.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[5] = items.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[5] = items.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[18].Values[5] = items.Where(x => x.SortIndex == "19").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[5] = items.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[5] = items.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[5] = items.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[5] = items.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[5] = items.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[5] = items.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[5] = items.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[5] = items.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[5] = items.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[5] = items.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[5] = items.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[5] = items.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[5] = items.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[5] = items.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[5] = items.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[5] = items.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[5] = items.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[5] = items.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[5] = items.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[5] = items.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[5] = items.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[5] = items.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[5] = items.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[5] = items.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[5] = items.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[5] = items.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[5] = items.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[5] = items.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[5] = items.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[5] = items.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[5] = items.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[5] = items.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[5] = items.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[5] = items.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[5] = items.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[5] = items.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[5] = items.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[5] = items.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[5] = items.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[58].Values[5] = items.Where(x => x.SortIndex == "59").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[5] = items.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[5] = items.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[61].Values[5] = items.Where(x => x.SortIndex == "62").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[62].Values[5] = items.Where(x => x.SortIndex == "63").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[63].Values[5] = items.Where(x => x.SortIndex == "64").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[64].Values[5] = items.Where(x => x.SortIndex == "65").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[65].Values[5] = items.Where(x => x.SortIndex == "66").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[66].Values[5] = items.Where(x => x.SortIndex == "67").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[67].Values[5] = items.Where(x => x.SortIndex == "68").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[68].Values[5] = items.Where(x => x.SortIndex == "69").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[69].Values[5] = items.Where(x => x.SortIndex == "70").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[70].Values[5] = items.Where(x => x.SortIndex == "71").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[71].Values[5] = items.Where(x => x.SortIndex == "72").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[72].Values[5] = items.Where(x => x.SortIndex == "73").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[73].Values[5] = items.Where(x => x.SortIndex == "74").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[74].Values[5] = items.Where(x => x.SortIndex == "75").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[75].Values[5] = items.Where(x => x.SortIndex == "76").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[76].Values[5] = items.Where(x => x.SortIndex == "77").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[77].Values[5] = items.Where(x => x.SortIndex == "78").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[78].Values[5] = items.Where(x => x.SortIndex == "79").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[79].Values[5] = items.Where(x => x.SortIndex == "80").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[80].Values[5] = items.Where(x => x.SortIndex == "81").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[81].Values[5] = items.Where(x => x.SortIndex == "82").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[82].Values[5] = items.Where(x => x.SortIndex == "83").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[83].Values[5] = items.Where(x => x.SortIndex == "84").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[84].Values[5] = items.Where(x => x.SortIndex == "85").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[85].Values[5] = items.Where(x => x.SortIndex == "86").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[86].Values[5] = items.Where(x => x.SortIndex == "87").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[87].Values[5] = items.Where(x => x.SortIndex == "88").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[88].Values[5] = items.Where(x => x.SortIndex == "89").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[89].Values[5] = items.Where(x => x.SortIndex == "90").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[90].Values[5] = items.Where(x => x.SortIndex == "91").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[91].Values[5] = items.Where(x => x.SortIndex == "92").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[92].Values[5] = items.Where(x => x.SortIndex == "93").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[93].Values[5] = items.Where(x => x.SortIndex == "94").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[94].Values[5] = items.Where(x => x.SortIndex == "95").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[95].Values[5] = items.Where(x => x.SortIndex == "96").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[96].Values[5] = items.Where(x => x.SortIndex == "97").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[97].Values[5] = items.Where(x => x.SortIndex == "98").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[98].Values[5] = items.Where(x => x.SortIndex == "99").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + } + } + } + } + + private void SetLastYearUnEditableRow() + { + Grid1.Rows[1].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[2].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[3].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[4].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[5].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[6].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[7].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[8].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[9].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[10].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[11].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[12].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[13].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[14].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[16].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[18].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[20].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[24].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[25].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[26].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[27].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[28].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[29].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[30].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[31].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[32].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[33].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[34].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[35].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[36].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[37].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[38].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[39].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[40].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[41].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[42].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[43].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[44].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[45].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[46].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[47].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[48].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[49].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[50].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[51].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[52].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[53].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[54].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[55].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[56].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[57].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[58].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[59].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[60].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[61].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[62].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[63].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[64].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[65].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[66].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[67].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[68].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[69].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[70].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[71].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[72].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[73].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[74].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[75].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[76].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[77].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[78].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[79].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[80].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[81].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[82].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[83].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[84].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[85].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[86].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[87].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[88].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[89].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[90].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[91].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[92].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[93].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[94].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[95].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[96].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[97].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[98].CellCssClasses[4] = "f-grid-cell-uneditable"; + } + #endregion + + #region 计算方法 + /// + /// 计算方法 + /// + private void GetData() + { + decimal E6 = 0, F6 = 0, E7 = 0, F7 = 0, E8, F8, E9, F9, E10 = 0, F10 = 0, E11 = 0, F11 = 0, E12 = 0, F12 = 0, E13 = 0, F13 = 0, E14 = 0, F14 = 0, E15 = 0, F15 = 0, E16 = 0, F16 = 0, E17 = 0, F17 = 0, E18 = 0, F18 = 0, E19 = 0, F19 = 0, + E21 = 0, F21 = 0, E22 = 0, F22 = 0, E23 = 0, F23 = 0, E25 = 0, F25 = 0, E26 = 0, F26 = 0, E27 = 0, F27 = 0, E28 = 0, F28 = 0, E29, F29, E30, F30, E31, F31, E32, F32, E33, F33, E34, F34, E35, F35, E36, F36, E37, F37, E38, F38, E39, F39, E40, F40, E41, F41, + E42, F42, E43, F43, E44, F44, E45, F45, E46, F46, E47, F47, E48, F48, E49, F49, E50, F50, E51, F51, E52, F52, E53, F53, E54, F54, E55, F55, + E56, F56, E57, F57, E58, F58, E59, F59, E60, F60, E61, F61, E62, F62, E63, F63, E64, F64, E65, F65, E66, F66, E67, F67, E68, F68, E69, F69, + E70, F70, E71, F71, E72, F72, E73, F73, E74, F74, E75, F75, E76, F76, E77, F77, E78, F78, E79, F79, E80, F80, E81, F81, E82, F82, E83, F83, + E84, F84, E85, F85, E86, F86, E87, F87, E88, F88, E89, F89, E90, F90, E91, F91, E92, F92, E93, F93, E94, F94, E95, F95, E96, F96, E97, F97, + E98, F98, E99, F99, E100, F100, E102 = 0, F102 = 0, E103 = 0, F103 = 0; + JArray mergedData = Grid1.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + string sortIndex = values.Value("SortIndex"); + var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (item != null) + { + item.BaseNumber = System.Web.HttpUtility.HtmlDecode(values.Value("BaseNumber")); + item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); + item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); + + } + } + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + //SetUnEditableRow(); + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + if (rowIndex == 1) + { + E6 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F6 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E6 > 0 && F6 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F6 - E6) * 100 / E6, 2).ToString() + "%"; + } + } + else if (rowIndex == 2) + { + E7 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F7 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E7 > 0 && F7 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F7 - E7) * 100 / E7, 2).ToString() + "%"; + } + } + else if (rowIndex == 3) + { + E8 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F8 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E8 > 0 && F8 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F8 - E8) * 100 / E8, 2).ToString() + "%"; + } + } + else if (rowIndex == 4) + { + E9 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F9 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E9 > 0 && F9 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F9 - E9) * 100 / E9, 2).ToString() + "%"; + } + } + else if (rowIndex == 5) + { + E10 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F10 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E10 > 0 && F10 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F10 - E10) * 100 / E10, 2).ToString() + "%"; + } + } + else if (rowIndex == 6) + { + E11 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F11 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E11 > 0 && F11 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F11 - E11) * 100 / E11, 2).ToString() + "%"; + } + } + else if (rowIndex == 7) + { + E12 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F12 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E12 > 0 && F12 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F12 - E12) * 100 / E12, 2).ToString() + "%"; + } + } + else if (rowIndex == 8) + { + E13 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F13 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E13 > 0 && F13 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F13 - E13) * 100 / E13, 2).ToString() + "%"; + } + } + else if (rowIndex == 9) + { + E14 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F14 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E14 > 0 && F14 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F14 - E14) * 100 / E14, 2).ToString() + "%"; + } + } + else if (rowIndex == 10) + { + E15 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F15 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E15 > 0 && F15 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F15 - E15) * 100 / E15, 2).ToString() + "%"; + } + } + else if (rowIndex == 11) + { + E16 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F16 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E16 > 0 && F16 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F16 - E16) * 100 / E16, 2).ToString() + "%"; + } + } + else if (rowIndex == 12) + { + E17 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F17 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E17 > 0 && F17 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F17 - E17) * 100 / E17, 2).ToString() + "%"; + } + } + else if (rowIndex == 13) + { + E18 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F18 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E18 > 0 && F18 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F18 - E18) * 100 / E18, 2).ToString() + "%"; + } + } + else if (rowIndex == 14) + { + E19 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F19 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E19 > 0 && F19 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F19 - E19) * 100 / E19, 2).ToString() + "%"; + } + } + else if (rowIndex == 16) + { + E21 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F21 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E21 > 0 && F21 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F21 - E21) * 100 / E21, 2).ToString() + "%"; + } + } + else if (rowIndex == 17) + { + E22 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F22 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E22 > 0 && F22 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F22 - E22) * 100 / E22, 2).ToString() + "%"; + } + } + else if (rowIndex == 18) + { + E23 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F23 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E23 > 0 && F23 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F23 - E23) * 100 / E23, 2).ToString() + "%"; + } + } + else if (rowIndex == 20) + { + E25 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F25 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E25 > 0 && F25 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F25 - E25) * 100 / E25, 2).ToString() + "%"; + } + } + else if (rowIndex == 21) + { + E26 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F26 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E26 > 0 && F26 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F26 - E26) * 100 / E26, 2).ToString() + "%"; + } + } + else if (rowIndex == 22) + { + E27 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F27 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E27 > 0 && F27 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F27 - E27) * 100 / E27, 2).ToString() + "%"; + } + } + else if (rowIndex == 23) + { + E28 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F28 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E28 > 0 && F28 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F28 - E28) * 100 / E28, 2).ToString() + "%"; + } + } + else if (rowIndex == 24) + { + E29 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F29 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E29 > 0 && F29 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F29 - E29) * 100 / E29, 2).ToString() + "%"; + } + } + else if (rowIndex == 25) + { + E30 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F30 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E30 > 0 && F30 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F30 - E30) * 100 / E30, 2).ToString() + "%"; + } + } + else if (rowIndex == 26) + { + E31 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F31 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E31 > 0 && F31 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F31 - E31) * 100 / E31, 2).ToString() + "%"; + } + } + else if (rowIndex == 27) + { + E32 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F32 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E32 > 0 && F32 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F32 - E32) * 100 / E32, 2).ToString() + "%"; + } + } + else if (rowIndex == 28) + { + E33 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F33 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E33 > 0 && F33 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F33 - E33) * 100 / E33, 2).ToString() + "%"; + } + } + else if (rowIndex == 29) + { + E34 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F34 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E34 > 0 && F34 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F34 - E34) * 100 / E34, 2).ToString() + "%"; + } + } + else if (rowIndex == 30) + { + E35 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F35 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E35 > 0 && F35 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F35 - E35) * 100 / E35, 2).ToString() + "%"; + } + } + else if (rowIndex == 31) + { + E36 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F36 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E36 > 0 && F36 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F36 - E36) * 100 / E36, 2).ToString() + "%"; + } + } + else if (rowIndex == 32) + { + E37 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F37 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E37 > 0 && F37 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F37 - E37) * 100 / E37, 2).ToString() + "%"; + } + } + else if (rowIndex == 33) + { + E38 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F38 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E38 > 0 && F38 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F38 - E38) * 100 / E38, 2).ToString() + "%"; + } + } + else if (rowIndex == 34) + { + E39 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F39 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E39 > 0 && F39 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F39 - E39) * 100 / E39, 2).ToString() + "%"; + } + } + else if (rowIndex == 35) + { + E40 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F40 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E40 > 0 && F40 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F40 - E40) * 100 / E40, 2).ToString() + "%"; + } + } + else if (rowIndex == 36) + { + E41 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F41 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E41 > 0 && F41 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F41 - E41) * 100 / E41, 2).ToString() + "%"; + } + } + else if (rowIndex == 37) + { + E42 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F42 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E42 > 0 && F42 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F42 - E42) * 100 / E42, 2).ToString() + "%"; + } + } + else if (rowIndex == 38) + { + E43 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F43 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E43 > 0 && F43 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F43 - E43) * 100 / E43, 2).ToString() + "%"; + } + } + else if (rowIndex == 39) + { + E44 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F44 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E44 > 0 && F44 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F44 - E44) * 100 / E44, 2).ToString() + "%"; + } + } + else if (rowIndex == 40) + { + E45 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F45 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E45 > 0 && F45 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F45 - E45) * 100 / E45, 2).ToString() + "%"; + } + } + else if (rowIndex == 41) + { + E46 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F46 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E46 > 0 && F46 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F46 - E46) * 100 / E46, 2).ToString() + "%"; + } + } + else if (rowIndex == 42) + { + E47 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F47 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E47 > 0 && F47 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F47 - E47) * 100 / E47, 2).ToString() + "%"; + } + } + else if (rowIndex == 43) + { + E48 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F48 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E48 > 0 && F48 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F48 - E48) * 100 / E48, 2).ToString() + "%"; + } + } + else if (rowIndex == 44) + { + E49 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F49 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E49 > 0 && F49 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F49 - E49) * 100 / E49, 2).ToString() + "%"; + } + } + else if (rowIndex == 45) + { + E50 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F50 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E50 > 0 && F50 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F50 - E50) * 100 / E50, 2).ToString() + "%"; + } + } + else if (rowIndex == 46) + { + E51 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F51 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E51 > 0 && F51 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F51 - E51) * 100 / E51, 2).ToString() + "%"; + } + } + else if (rowIndex == 47) + { + E52 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F52 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E52 > 0 && F52 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F52 - E52) * 100 / E52, 2).ToString() + "%"; + } + } + else if (rowIndex == 48) + { + E53 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F53 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E53 > 0 && F53 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F53 - E53) * 100 / E53, 2).ToString() + "%"; + } + } + else if (rowIndex == 49) + { + E54 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F54 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E54 > 0 && F54 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F54 - E54) * 100 / E54, 2).ToString() + "%"; + } + } + else if (rowIndex == 50) + { + E55 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F55 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E55 > 0 && F55 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F55 - E55) * 100 / E55, 2).ToString() + "%"; + } + } + else if (rowIndex == 51) + { + E56 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F56 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E56 > 0 && F56 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F56 - E56) * 100 / E56, 2).ToString() + "%"; + } + } + else if (rowIndex == 52) + { + E57 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F57 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E57 > 0 && F57 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F57 - E57) * 100 / E57, 2).ToString() + "%"; + } + } + else if (rowIndex == 53) + { + E58 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F58 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E58 > 0 && F58 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F58 - E58) * 100 / E58, 2).ToString() + "%"; + } + } + else if (rowIndex == 54) + { + E59 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F59 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E59 > 0 && F59 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F59 - E59) * 100 / E59, 2).ToString() + "%"; + } + } + else if (rowIndex == 55) + { + E60 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F60 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E60 > 0 && F60 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F60 - E60) * 100 / E60, 2).ToString() + "%"; + } + } + else if (rowIndex == 56) + { + E61 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F61 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E61 > 0 && F61 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F61 - E61) * 100 / E61, 2).ToString() + "%"; + } + } + else if (rowIndex == 57) + { + E62 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F62 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E62 > 0 && F62 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F62 - E62) * 100 / E62, 2).ToString() + "%"; + } + } + else if (rowIndex == 58) + { + E63 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F63 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E63 > 0 && F63 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F63 - E63) * 100 / E63, 2).ToString() + "%"; + } + } + else if (rowIndex == 59) + { + E64 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F64 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E64 > 0 && F64 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F64 - E64) * 100 / E64, 2).ToString() + "%"; + } + } + else if (rowIndex == 60) + { + E65 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F65 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E65 > 0 && F65 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F65 - E65) * 100 / E65, 2).ToString() + "%"; + } + } + else if (rowIndex == 61) + { + E66 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F66 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E66 > 0 && F66 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F66 - E66) * 100 / E66, 2).ToString() + "%"; + } + } + else if (rowIndex == 62) + { + E67 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F67 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E67 > 0 && F67 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F67 - E67) * 100 / E67, 2).ToString() + "%"; + } + } + else if (rowIndex == 63) + { + E68 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F68 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E68 > 0 && F68 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F68 - E68) * 100 / E68, 2).ToString() + "%"; + } + } + else if (rowIndex == 64) + { + E69 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F69 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E69 > 0 && F69 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F69 - E69) * 100 / E69, 2).ToString() + "%"; + } + } + else if (rowIndex == 65) + { + E70 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F70 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E70 > 0 && F70 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F70 - E70) * 100 / E70, 2).ToString() + "%"; + } + } + else if (rowIndex == 66) + { + E71 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F71 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E71 > 0 && F71 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F71 - E71) * 100 / E71, 2).ToString() + "%"; + } + } + else if (rowIndex == 67) + { + E72 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F72 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E72 > 0 && F72 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F72 - E72) * 100 / E72, 2).ToString() + "%"; + } + } + else if (rowIndex == 68) + { + E73 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F73 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E73 > 0 && F73 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F73 - E73) * 100 / E73, 2).ToString() + "%"; + } + } + else if (rowIndex == 69) + { + E74 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F74 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E74 > 0 && F74 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F74 - E74) * 100 / E74, 2).ToString() + "%"; + } + } + else if (rowIndex == 70) + { + E75 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F75 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E75 > 0 && F75 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F75 - E75) * 100 / E75, 2).ToString() + "%"; + } + } + else if (rowIndex == 71) + { + E76 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F76 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E76 > 0 && F76 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F76 - E76) * 100 / E76, 2).ToString() + "%"; + } + } + else if (rowIndex == 72) + { + E77 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F77 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E77 > 0 && F77 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F77 - E77) * 100 / E77, 2).ToString() + "%"; + } + } + else if (rowIndex == 73) + { + E78 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F78 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E78 > 0 && F78 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F78 - E78) * 100 / E78, 2).ToString() + "%"; + } + } + else if (rowIndex == 74) + { + E79 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F79 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E79 > 0 && F79 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F79 - E79) * 100 / E79, 2).ToString() + "%"; + } + } + else if (rowIndex == 75) + { + E80 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F80 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E80 > 0 && F80 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F80 - E80) * 100 / E80, 2).ToString() + "%"; + } + } + else if (rowIndex == 76) + { + E81 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F81 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E81 > 0 && F81 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F81 - E81) * 100 / E81, 2).ToString() + "%"; + } + } + else if (rowIndex == 77) + { + E82 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F82 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E82 > 0 && F82 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F82 - E82) * 100 / E82, 2).ToString() + "%"; + } + } + else if (rowIndex == 78) + { + E83 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F83 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E83 > 0 && F83 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F83 - E83) * 100 / E83, 2).ToString() + "%"; + } + } + else if (rowIndex == 79) + { + E84 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F84 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E84 > 0 && F84 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F84 - E84) * 100 / E84, 2).ToString() + "%"; + } + } + else if (rowIndex == 80) + { + E85 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F85 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E85 > 0 && F85 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F85 - E85) * 100 / E85, 2).ToString() + "%"; + } + } + else if (rowIndex == 81) + { + E86 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F86 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E86 > 0 && F86 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F86 - E86) * 100 / E86, 2).ToString() + "%"; + } + } + else if (rowIndex == 82) + { + E87 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F87 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E87 > 0 && F87 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F87 - E87) * 100 / E87, 2).ToString() + "%"; + } + } + else if (rowIndex == 83) + { + E88 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F88 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E88 > 0 && F88 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F88 - E88) * 100 / E88, 2).ToString() + "%"; + } + } + else if (rowIndex == 84) + { + E89 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F89 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E89 > 0 && F89 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F89 - E89) * 100 / E89, 2).ToString() + "%"; + } + } + else if (rowIndex == 85) + { + E90 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F90 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E90 > 0 && F90 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F90 - E90) * 100 / E90, 2).ToString() + "%"; + } + } + else if (rowIndex == 86) + { + E91 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F91 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E91 > 0 && F91 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F91 - E91) * 100 / E91, 2).ToString() + "%"; + } + } + else if (rowIndex == 87) + { + E92 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F92 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E92 > 0 && F92 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F92 - E92) * 100 / E92, 2).ToString() + "%"; + } + } + else if (rowIndex == 88) + { + E93 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F93 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E93 > 0 && F93 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F93 - E93) * 100 / E93, 2).ToString() + "%"; + } + } + else if (rowIndex == 89) + { + E94 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F94 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E94 > 0 && F94 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F94 - E94) * 100 / E94, 2).ToString() + "%"; + } + } + else if (rowIndex == 90) + { + E95 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F95 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E95 > 0 && F95 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F95 - E95) * 100 / E95, 2).ToString() + "%"; + } + } + else if (rowIndex == 91) + { + E96 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F96 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E96 > 0 && F96 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F96 - E96) * 100 / E96, 2).ToString() + "%"; + } + } + else if (rowIndex == 92) + { + E97 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F97 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E97 > 0 && F97 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F97 - E97) * 100 / E97, 2).ToString() + "%"; + } + } + else if (rowIndex == 93) + { + E98 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F98 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E98 > 0 && F98 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F98 - E98) * 100 / E98, 2).ToString() + "%"; + } + } + else if (rowIndex == 94) + { + E99 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F99 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E99 > 0 && F99 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F99 - E99) * 100 / E99, 2).ToString() + "%"; + } + } + else if (rowIndex == 95) + { + E100 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F100 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E100 > 0 && F100 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F100 - E100) * 100 / E100, 2).ToString() + "%"; + } + } + else if (rowIndex == 97) + { + E102 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F102 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E102 > 0 && F102 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F102 - E102) * 100 / E102, 2).ToString() + "%"; + } + } + else if (rowIndex == 98) + { + E103 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F103 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E103 > 0 && F103 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F103 - E103) * 100 / E103, 2).ToString() + "%"; + } + } + } + if (E7 > 0 || E10 > 0 || E11 > 0 || E12 > 0 || E13 > 0 || E14 > 0 || E15 > 0 || E16 > 0 || E17 > 0 || E18 > 0 || E19 > 0) + { + this.Grid1.Rows[0].Values[4] = (E7 + (E10 * Convert.ToDecimal(0.9714) + E11 * Convert.ToDecimal(1.229) + E12 * Convert.ToDecimal(1.4286) + E13 * Convert.ToDecimal(1.4714) + E14 * Convert.ToDecimal(1.4714) + E15 * Convert.ToDecimal(1.4571) + E16 * Convert.ToDecimal(1.4286) + E17 * Convert.ToDecimal(13.3) + E18 * Convert.ToDecimal(0.0341) + E19) / 10000); + } + if (F7 > 0 || F10 > 0 || F11 > 0 || F12 > 0 || F13 > 0 || F14 > 0 || F15 > 0 || F16 > 0 || F17 > 0 || F18 > 0 || F19 > 0) + { + this.Grid1.Rows[0].Values[5] = (F7 + (F10 * Convert.ToDecimal(0.9714) + F11 * Convert.ToDecimal(1.229) + F12 * Convert.ToDecimal(1.4286) + F13 * Convert.ToDecimal(1.4714) + F14 * Convert.ToDecimal(1.4714) + F15 * Convert.ToDecimal(1.4571) + F16 * Convert.ToDecimal(1.4286) + F17 * Convert.ToDecimal(13.3) + F18 * Convert.ToDecimal(0.0341) + F19) / 10000); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && !string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString())) + { + this.Grid1.Rows[0].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()), 2).ToString() + "%"; + } + if (E6 > 0 && E21 > 0) + { + this.Grid1.Rows[15].Values[4] = decimal.Round(E6 * 10000 / E21, 4); + } + if (F6 > 0 && F21 > 0) + { + this.Grid1.Rows[15].Values[5] = decimal.Round(F6 * 10000 / F21, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[15].Values[4].ToString()) && this.Grid1.Rows[15].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[15].Values[5].ToString())) + { + this.Grid1.Rows[15].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[4].ToString()), 2).ToString() + "%"; + } + if (E6 > 0 && E25 > 0) + { + this.Grid1.Rows[19].Values[4] = decimal.Round(E6 * 10000 / E25, 4); + } + if (F6 > 0 && F25 > 0) + { + this.Grid1.Rows[19].Values[5] = decimal.Round(F6 * 10000 / F25, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[19].Values[4].ToString()) && this.Grid1.Rows[19].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[19].Values[5].ToString())) + { + this.Grid1.Rows[19].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[4].ToString()), 2).ToString() + "%"; + } + if (E102 > 0 && E103 > 0 && E21 > 0) + { + this.Grid1.Rows[96].Values[4] = decimal.Round((E102 + E103) / E21, 4); + } + if (F102 > 0 && F103 > 0 && F21 > 0) + { + this.Grid1.Rows[96].Values[5] = decimal.Round((F102 + F103) / F21, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[96].Values[4].ToString()) && this.Grid1.Rows[96].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[96].Values[5].ToString())) + { + this.Grid1.Rows[96].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[96].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[96].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[96].Values[4].ToString()), 2).ToString() + "%"; + } + + + + + + + + + + + //this.Grid1.Rows[0].Values[15] = totalRateSum; + //this.Grid1.Rows[0].Values[16] = totalCompleteValueSumAll; + //this.Grid1.Rows[0].Values[17] = totalRateSumAll; + //this.Grid1.Rows[0].Values[19] = totalRealValueSum; + //this.Grid1.Rows[0].Values[20] = Funs.GetNewDecimalOrZero(firstValues.Value("RealValueTotalPart")) + totalRealValueSum; + //this.Grid1.Rows[0].Values[22] = totalCompleteValueSumAll - Funs.GetNewDecimalOrZero(firstValues.Value("PlanValueTotal")); + //this.Grid1.Rows[0].Values[23] = totalCompleteValueSumAll - (Funs.GetNewDecimalOrZero(firstValues.Value("RealValueTotalPart")) + totalRealValueSum); + } + #endregion + + #region 关闭窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + Model.Environmental_ChemicalReport report = BLL.ChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId); + this.btnSave.Hidden = false; + } + #endregion + + #region 保存、上报 + /// + /// 保存数据 + /// + /// + private void Save(string type) + { + //string ChemicalReportId = Request.QueryString["ChemicalReportId"]; + Model.Environmental_ChemicalReport report = new Environmental_ChemicalReport + { + UnitId = drpUnit.SelectedValue, + Year = Funs.GetNewIntOrZero(drpYear.SelectedValue), + Month = Funs.GetNewIntOrZero(drpMonth.SelectedValue) + }; + if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim())) + { + report.FillingDate = Convert.ToDateTime(txtFillingDate.Text.Trim()); + } + report.DutyPerson = txtDutyPerson.Text.Trim(); + if (String.IsNullOrEmpty(ChemicalReportId)) + { + Environmental_ChemicalReport old = ChemicalReportService.GetChemicalReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (old == null) + { + report.ChemicalReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ChemicalReport)); + report.UpState = BLL.Const.UpState_2; + report.FillingMan = this.CurrUser.UserName; + BLL.ChemicalReportService.AddChemicalReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ChemicalReportId, BLL.Const.ProjectChemicalReportMenuId, BLL.Const.BtnAdd); + } + else + { + ShowNotify("该月份记录已存在!", MessageBoxIcon.Warning); + return; + } + } + else + { + Model.Environmental_ChemicalReport oldReport = BLL.ChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId); + report.ChemicalReportId = ChemicalReportId; + report.UpState = BLL.Const.UpState_2; + BLL.ChemicalReportService.UpdateChemicalReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ChemicalReportId, BLL.Const.ProjectChemicalReportMenuId, BLL.Const.BtnModify); + } + ChemicalReportId = report.ChemicalReportId; + BLL.ChemicalReportItemService.DeleteChemicalReportItemByChemicalReportId(report.ChemicalReportId); + List mReportItemList = new List(); + GetItems(report.ChemicalReportId); + foreach (var item in items) + { + Model.Environmental_ChemicalReportItem newItem = new Environmental_ChemicalReportItem(); + newItem.ChemicalReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ChemicalReportItem)); + newItem.ChemicalReportId = report.ChemicalReportId; + newItem.SortIndex = System.Web.HttpUtility.HtmlDecode(item.SortIndex); + newItem.BaseNumber = System.Web.HttpUtility.HtmlDecode(item.BaseNumber); + newItem.LastYearValue = System.Web.HttpUtility.HtmlDecode(item.LastYearValue); + newItem.ThisYearValue = System.Web.HttpUtility.HtmlDecode(item.ThisYearValue); + newItem.Rate = System.Web.HttpUtility.HtmlDecode(item.Rate); + ChemicalReportItemService.AddChemicalReportItem(newItem); + mReportItemList.Add(newItem); + } + if (type == "updata") //数据同步 + { + if (report.UpState == BLL.Const.UpState_2) + { + string code = CNCECHSSEWebService.UpChemicalReport(report.ChemicalReportId, this.CurrUser); + if (code == "1") + { + ShowNotify("同步成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + return; + } + else + { + Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); + } + } + else + { + ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning); + return; + } + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + Save("add"); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + protected void btnUpdata_Click(object sender, EventArgs e) + { + Save("updata"); + } + + protected void btnSubmit_Click(object sender, EventArgs e) + { + Save("submit"); + } + #endregion + + #region 增加本月明细 + private void GetItems(string ChemicalReportId) + { + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + string sortIndex = values.Value("SortIndex"); + var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (item != null) + { + item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); + item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); + item.Rate = System.Web.HttpUtility.HtmlDecode(values.Value("Rate")); + } + } + } + #endregion + + #region 获取明细 + private void GetNewItems(string year, string months) + { + var indexNames = ChemicalReportItemService.GetIndexNames(); + var units = ChemicalReportItemService.GetUnits(); + foreach (var indexName in indexNames) + { + //增加明细集合 + Model.ChemicalReportItem item = new ChemicalReportItem + { + ChemicalReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ChemicalReportItem)), + IndexName = indexName.Text, + Unit = units.First(x => x.Value == indexName.Value).Text, + SortIndex = indexName.Value, + }; + //if (item.SortIndex == "18" || item.SortIndex == "19" || item.SortIndex == "22" || item.SortIndex == "23" || item.SortIndex == "24" || item.SortIndex == "34") + //{ + // item.LastYearValue = "×"; + // item.ThisYearValue = "×"; + // if (item.SortIndex == "34") + // { + // item.Rate = "─"; + // } + // else + // { + // item.Rate = "×"; + // } + //} + items.Add(item); + } + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉选择事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + items.Clear(); + if (drpUnit.SelectedValue != BLL.Const._Null) + { + //GetNewItems(); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectChemicalReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + //this.btnCopy.Hidden = false; + } + //if (buttonList.Contains(BLL.Const.BtnSaveUp)) + //{ + // this.btnUpdata.Hidden = false; + //} + } + } + #endregion + + #region 复制上个月数据 + /// + /// 复制上个月的数据 + /// + /// + /// + protected void btnCopy_Click(object sender, EventArgs e) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + showDate = nowDate.Value.AddMonths(-1); + Model.Environmental_ChemicalReport ChemicalReport = BLL.ChemicalReportService.GetChemicalReportByUnitIdAndYearAndMonth(this.drpUnit.SelectedValue, showDate.Year, showDate.Month); + if (ChemicalReport != null) + { + Model.Environmental_ChemicalReport newChemicalReport = new Environmental_ChemicalReport(); + this.ChemicalReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ChemicalReport)); + newChemicalReport.ChemicalReportId = this.ChemicalReportId; + newChemicalReport.UnitId = this.drpUnit.SelectedValue; + newChemicalReport.Year = Convert.ToInt32(this.drpYear.SelectedValue); + newChemicalReport.Month = Convert.ToInt32(this.drpMonth.SelectedValue); + newChemicalReport.FillingMan = this.CurrUser.UserName; + newChemicalReport.FillingDate = DateTime.Now; + newChemicalReport.DutyPerson = this.CurrUser.UserName; + newChemicalReport.UpState = BLL.Const.UpState_2; + BLL.ChemicalReportService.AddChemicalReport(newChemicalReport); + + var oldItems = BLL.ChemicalReportItemService.GetItems(ChemicalReport.ChemicalReportId); + if (oldItems.Count > 0) + { + foreach (var item in oldItems) + { + Model.Environmental_ChemicalReportItem newItem = new Environmental_ChemicalReportItem + { + ChemicalReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ChemicalReportItem)), + ChemicalReportId = this.ChemicalReportId, + SortIndex = item.SortIndex, + LastYearValue = item.LastYearValue, + ThisYearValue = item.ThisYearValue, + Rate = item.Rate, + }; + BLL.ChemicalReportItemService.AddChemicalReportItem(newItem); + } + } + + GetValues(newChemicalReport.ChemicalReportId); + } + } + } + + /// + /// 获取复制的值绑定到文本中 + /// + private void GetValues(string ChemicalReportId) + { + var report = BLL.ChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId); + if (report != null) + { + drpMonth.SelectedValue = report.Month.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + drpUnit.SelectedValue = report.UnitId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + items = BLL.ChemicalReportItemService.GetShowItems(ChemicalReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.designer.cs new file mode 100644 index 00000000..da3c6933 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental { + + + public partial class ChemicalReportSave { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpMonth; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// txtFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtFillingDate; + + /// + /// txtDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDutyPerson; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// txtBaseNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBaseNumber; + + /// + /// txtLastYearValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtLastYearValue; + + /// + /// txtThisYearValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtThisYearValue; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx new file mode 100644 index 00000000..d84c07bb --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx @@ -0,0 +1,167 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnergyReport.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.EnergyReport" %> + + + + + + + 中央企业节能环保产业企业生产和服务业务情况报表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.cs new file mode 100644 index 00000000..abad4c6f --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.cs @@ -0,0 +1,652 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class EnergyReport : PageBase + { + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + ////取上个报表时间 + DateTime showDate = System.DateTime.Now.AddMonths(-1); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + drpYear.SelectedValue = showDate.Year.ToString(); + GetValue(); + } + } + + private void SetEmpty() + { + this.SimpleForm1.Title = string.Empty; + lbUnitName.Text = "填报企业:"; + lbFillingDate.Text = "填报日期:"; + lbDutyPerson.Text = "负责人:"; + lbHandleMan.Text = string.Empty; + this.Grid1.DataSource = null; + this.Grid1.DataBind(); + } + #endregion + + #region 获取记录值 + private void GetValue() + { + int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + int Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue); + Model.View_Environmental_EnergyReport report = Funs.DB.View_Environmental_EnergyReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarters == Quarters && e.Year == year); + if (report != null) + { + string upState = string.Empty; + if (report.UpState == BLL.Const.UpState_3) + { + upState = "(已上报)"; + } + else + { + upState = "(未上报)"; + } + this.SimpleForm1.Title = "中央企业节能环保产业企业生产和服务业务情况报表" + report.QuartersStr + report.YearStr + upState; + lbUnitName.Text = "填报企业:" + report.UnitName; + if (report.FillingDate != null) + { + lbFillingDate.Text = "填报日期:" + string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + else + { + lbFillingDate.Text = "填报日期:"; + } + lbDutyPerson.Text = "负责人:" + report.DutyPerson; + //if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3) + //{ + // this.lbHandleMan.Hidden = true; + //} + //else + //{ + // this.lbHandleMan.Hidden = false; + // lbHandleMan.Text = "下一步办理人:" + report.UserName; + //} + var businessCategorys = EnergyreportItemService.GetItems("Template"); + //之前月度合计值集合 + List reportItems = BLL.EnergyreportItemService.GetItems(report.EnergyReportId); + List newItemList = new List(); + foreach (var item in reportItems) + { + Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem(); + newItem.EnergyReportItemId = item.EnergyReportItemId; + newItem.EnergyReportId = item.EnergyReportId; + newItem.SortIndex = item.SortIndex; + newItem.BusinessCategory = item.BusinessCategory; + newItem.Throughput_BasePeriod = item.Throughput_BasePeriod; + newItem.Throughput_LastPeriod = item.Throughput_LastPeriod; + newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod; + newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement; + newItem.Yield_BasePeriod = item.Yield_BasePeriod; + newItem.Yield_LastPeriod = item.Yield_LastPeriod; + newItem.Yield_ThisPeriod = item.Yield_ThisPeriod; + newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement; + newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod; + newItem.OutputValue_LastYear = item.OutputValue_LastYear; + newItem.OutputValue_ThisYear = item.OutputValue_ThisYear; + newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod; + newItem.OperationScale_LastYear = item.OperationScale_LastYear; + newItem.OperationScale_ThisYear = item.OperationScale_ThisYear; + newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement; + newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod; + newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear; + newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear; + newItemList.Add(item); + } + Grid1.DataSource = newItemList; + Grid1.DataBind(); + } + else + { + SetEmpty(); + } + this.GetButtonPower(); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭导入弹出窗口 + /// + /// + /// + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭查看审批信息弹出窗口 + /// + /// + /// + protected void Window4_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.EnergyReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnDelete.Hidden = false; + } + } + + var getReport = BLL.EnergyReportService.GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + this.btnAudit1.Hidden = true; + this.btnAudit2.Hidden = true; + if (getReport != null) + { + this.btnNew.Hidden = true; + //if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入 + //{ + // if (getReport.HandleState == BLL.Const.HandleState_2) + // { + // this.btnAudit1.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_3) + // { + // this.btnAudit2.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_4) + // { + this.btnUpdata.Hidden = false; + // } + //} + } + } + #endregion + + #region 增加、修改、审核、审批、上报、删除 + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EnergyReportSave.aspx?UnitId={0}&&Year={1}&&Quarters={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - "))); + } + + /// + /// 修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + Model.Environmental_EnergyReport report = BLL.EnergyReportService.GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EnergyReportSave.aspx?EnergyReportId={0}", report.EnergyReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审核 + /// + /// + /// + protected void btnAudit1_Click(object sender, EventArgs e) + { + Model.Environmental_EnergyReport report = BLL.EnergyReportService.GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EnergyReportSave.aspx?EnergyReportId={0}", report.EnergyReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审批 + /// + /// + /// + protected void btnAudit2_Click(object sender, EventArgs e) + { + Model.Environmental_EnergyReport report = BLL.EnergyReportService.GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EnergyReportSave.aspx?EnergyReportId={0}", report.EnergyReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 上报 + /// + /// + /// + protected void btnUpdata_Click(object sender, EventArgs e) + { + Model.Environmental_EnergyReport report = BLL.EnergyReportService.GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EnergyReportSave.aspx?EnergyReportId={0}&type=Updata", report.EnergyReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + Model.Environmental_EnergyReport report = BLL.EnergyReportService.GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.EnergyReportId, BLL.Const.EnergyReportMenuId, BLL.Const.BtnDelete); + BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.EnergyReportId); + BLL.EnergyreportItemService.DeleteEnergyReportItemByChemicalReportId(report.EnergyReportId); + BLL.EnergyReportService.DeleteEnvironmental_EnergyReportById(report.EnergyReportId); + + SetEmpty(); + this.btnNew.Hidden = false; + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify("所选时间无报表记录!"); + } + } + #endregion + + #region 格式化字符串 + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertCompileDate(object CompileDate) + { + if (CompileDate != null) + { + return string.Format("{0:yyyy-MM-dd}", CompileDate); + } + return ""; + } + + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertDate(object EnergyReportId) + { + if (EnergyReportId != null) + { + Model.Environmental_EnergyReport report = BLL.EnergyReportService.GetEnvironmental_EnergyReportById(EnergyReportId.ToString()); + if (report != null) + { + return report.Year + "年" + report.Quarters + "月"; + } + } + return ""; + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉框联动事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + var units = BLL.UnitService.GetUnitDropDownList(); + if (units != null && !string.IsNullOrEmpty(this.drpUnit.SelectedText)) + { + var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText); + if (unit != null) + { + drpUnit.SelectedValue = unit.UnitId; + } + } + + GetValue(); + } + #endregion + + #region 月份向前/向后 + /// + /// 前一个月 + /// + /// + /// + protected void BtnBulletLeft_Click(object sender, EventArgs e) + { + SetQuartersChange("-"); + } + + /// + /// 后一个月 + /// + /// + /// + protected void BulletRight_Click(object sender, EventArgs e) + { + SetQuartersChange("+"); + } + + /// + /// 月份加减变化 + /// + /// + private void SetQuartersChange(string type) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + if (type == "+") + { + showDate = nowDate.Value.AddMonths(3); + } + else + { + showDate = nowDate.Value.AddMonths(-3); + } + + this.drpYear.SelectedValue = showDate.Year.ToString(); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + ///值变化 + GetValue(); + } + } + #endregion + + #region 查看审批信息 + /// + /// 查看审批信息 + /// + /// + /// + protected void btnSee_Click(object sender, EventArgs e) + { + Model.Environmental_EnergyReport report = BLL.EnergyReportService.GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.EnergyReportId, "查看 - "))); + } + else + { + ShowNotify("所选月份无记录!", MessageBoxIcon.Warning); + } + } + #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(); + MultiHeaderTable mht = new 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("lblNumber") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + sb.Append(""); + } + sb.Append("
{0}
"); + return sb.ToString(); + } + + #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 + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.designer.cs new file mode 100644 index 00000000..c9cd6646 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.designer.cs @@ -0,0 +1,260 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental +{ + + + public partial class EnergyReport + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// RegionPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RegionPanel RegionPanel1; + + /// + /// Region2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Region Region2; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// BtnBulletLeft 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletLeft; + + /// + /// BtnBulletRight 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletRight; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSee 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSee; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// btnAudit1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit1; + + /// + /// btnAudit2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit2; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// lbUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbUnitName; + + /// + /// lbFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbFillingDate; + + /// + /// lbDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDutyPerson; + + /// + /// lbHandleMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbHandleMan; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window4; + + /// + /// Window5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window5; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx new file mode 100644 index 00000000..7c96db24 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx @@ -0,0 +1,243 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnergyReportSave.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.EnergyReportSave" %> + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx.cs new file mode 100644 index 00000000..f919b842 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx.cs @@ -0,0 +1,572 @@ +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using Org.BouncyCastle.Asn1.Ocsp; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class EnergyReportSave : PageBase + { + #region 定义变量 + /// + /// 报表主键Id + /// + public string EnergyReportId + { + get + { + return (string)ViewState["EnergyReportId"]; + } + set + { + ViewState["EnergyReportId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List items = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (Request.Params["type"] != "-1") + { + this.GetButtonPower(); + } + items.Clear(); + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + string unitId = Request.QueryString["UnitId"]; + string year = Request.QueryString["Year"]; + string quarters = Request.QueryString["Quarters"]; + EnergyReportId = Request.QueryString["EnergyReportId"]; + if (!string.IsNullOrEmpty(Request.QueryString["type"])) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = false; + } + else + { + this.btnSave.Hidden = false; + this.btnUpdata.Hidden = true; + } + if (!String.IsNullOrEmpty(EnergyReportId)) + { + items = BLL.EnergyreportItemService.GetShowItems(EnergyReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + var report = BLL.EnergyReportService.GetEnvironmental_EnergyReportById(EnergyReportId); + if (report != null) + { + //this.btnCopy.Hidden = true; + //if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.hfnbdId) + //{ + // this.btnSave.Hidden = false; + //} + if (report.UpState == BLL.Const.UpState_3) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = true; + } + drpQuarters.SelectedValue = report.Quarters.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + drpUnit.SelectedValue = report.UnitId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + } + } + else + { + //this.btnCopy.Hidden = false; + drpQuarters.SelectedValue = quarters; + drpYear.SelectedValue = year; + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + txtDutyPerson.Text = this.CurrUser.UserName; + //增加明细集合 + GetNewItems(Funs.GetNewIntOrZero(year), Funs.GetNewIntOrZero(quarters)); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + + } + else + { + string arg = GetRequestEventArgument(); // 此函数所在文件:PageBase.cs + if (arg == "UPDATE_SUMMARY") + { + SaveData(); + } + } + + } + void SaveData() + { + List _EnergyReportItems = new List(); + + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + string sortIndex = values.Value("SortIndex"); + var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (newItem != null) + { + newItem.EnergyReportItemId = SQLHelper.GetNewID(); + newItem.EnergyReportId = EnergyReportId; + newItem.SortIndex = values.Value("SortIndex"); + newItem.BusinessCategory = values.Value("BusinessCategory"); + newItem.Throughput_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_BasePeriod")).ToString(); + newItem.Throughput_LastPeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_LastPeriod")).ToString(); + newItem.Throughput_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_ThisPeriod")).ToString(); + newItem.Throughput_UnitOfMeasurement = values.Value("Throughput_UnitOfMeasurement"); + newItem.Yield_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_BasePeriod")).ToString(); + newItem.Yield_LastPeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_LastPeriod")).ToString(); + newItem.Yield_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_ThisPeriod")).ToString(); + newItem.Yield_UnitOfMeasurement = values.Value("Yield_UnitOfMeasurement"); + newItem.OutputValue_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("OutputValue_BasePeriod")).ToString(); + newItem.OutputValue_LastYear = Funs.GetNewDecimalOrZero(values.Value("OutputValue_LastYear")).ToString(); + newItem.OutputValue_ThisYear = Funs.GetNewDecimalOrZero(values.Value("OutputValue_ThisYear")).ToString(); + newItem.OperationScale_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("OperationScale_BasePeriod")).ToString(); + newItem.OperationScale_LastYear = Funs.GetNewDecimalOrZero(values.Value("OperationScale_LastYear")).ToString(); + newItem.OperationScale_ThisYear = Funs.GetNewDecimalOrZero(values.Value("OperationScale_ThisYear")).ToString(); + newItem.OperationScale_UnitOfMeasurement = values.Value("OperationScale_UnitOfMeasurement"); + newItem.ServiceOperatingIncome_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_BasePeriod")).ToString(); + newItem.ServiceOperatingIncome_LastYear = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_LastYear")).ToString(); + newItem.ServiceOperatingIncome_ThisYear = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_ThisYear")).ToString(); + _EnergyReportItems.Add(newItem); + + } + } + this.Grid1.DataSource = _EnergyReportItems; + this.Grid1.DataBind(); + _EnergyReportItems.RemoveAll(x => x.SortIndex == "01"); + var q = (from x in _EnergyReportItems + group x by x.EnergyReportId into g + select new + { + g.Key, + Throughput_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Throughput_BasePeriod)), + Throughput_LastPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Throughput_LastPeriod)), + Throughput_ThisPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Throughput_ThisPeriod)), + Yield_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Yield_BasePeriod)), + Yield_LastPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Yield_LastPeriod)), + Yield_ThisPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Yield_ThisPeriod)), + OutputValue_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.OutputValue_BasePeriod)), + OutputValue_LastYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OutputValue_LastYear)), + OutputValue_ThisYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OutputValue_ThisYear)), + OperationScale_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.OperationScale_BasePeriod)), + OperationScale_LastYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OperationScale_LastYear)), + OperationScale_ThisYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OperationScale_ThisYear)), + ServiceOperatingIncome_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.ServiceOperatingIncome_BasePeriod)), + ServiceOperatingIncome_LastYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.ServiceOperatingIncome_LastYear)), + ServiceOperatingIncome_ThisYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.ServiceOperatingIncome_ThisYear)), + } + ).FirstOrDefault(); + this.Grid1.Rows[0].Values[4] = q.Throughput_BasePeriod; + this.Grid1.Rows[0].Values[5] = q.Throughput_LastPeriod; + this.Grid1.Rows[0].Values[6] = q.Throughput_ThisPeriod; + this.Grid1.Rows[0].Values[9] = q.Yield_BasePeriod; + this.Grid1.Rows[0].Values[10] = q.Yield_LastPeriod; + this.Grid1.Rows[0].Values[11] = q.Yield_ThisPeriod; + this.Grid1.Rows[0].Values[14] = q.OutputValue_BasePeriod; + this.Grid1.Rows[0].Values[15] = q.OutputValue_LastYear; + this.Grid1.Rows[0].Values[16] = q.OutputValue_ThisYear; + this.Grid1.Rows[0].Values[19] = q.OperationScale_BasePeriod; + this.Grid1.Rows[0].Values[20] = q.OperationScale_LastYear; + this.Grid1.Rows[0].Values[21] = q.OperationScale_ThisYear; + this.Grid1.Rows[0].Values[24] = q.ServiceOperatingIncome_BasePeriod; + this.Grid1.Rows[0].Values[25] = q.ServiceOperatingIncome_LastYear; + this.Grid1.Rows[0].Values[26] = q.ServiceOperatingIncome_ThisYear; + + } + + protected void Grid1_RowDataBound(object sender, GridRowEventArgs e) + { + Model.Environmental_EnergyReportItem a = (Model.Environmental_EnergyReportItem)e.DataItem; + e.DataItem.ToString(); + + //string SortIndex = Convert.ToString(row["SortIndex"]); + if (a.SortIndex == "01") + { + + for (int i = 0; i < e.CellCssClasses.Count(); i++) + { + e.CellCssClasses[i] = "f-grid-cell-uneditable"; + } + + } + } + + #endregion + + + #region 关闭窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + var report = BLL.EnergyReportService.GetEnvironmental_EnergyReportById(EnergyReportId); + this.btnSave.Hidden = false; + } + #endregion + + #region 保存、上报 + /// + /// 保存数据 + /// + /// + private void Save(string type) + { + //string EnergyReportId = Request.QueryString["EnergyReportId"]; + Model.Environmental_EnergyReport report = new Environmental_EnergyReport + { + UnitId = drpUnit.SelectedValue, + Year = Funs.GetNewIntOrZero(drpYear.SelectedValue), + Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue) + }; + if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim())) + { + report.FillingDate = Convert.ToDateTime(txtFillingDate.Text.Trim()); + } + report.DutyPerson = txtDutyPerson.Text.Trim(); + if (String.IsNullOrEmpty(EnergyReportId)) + { + Environmental_EnergyReport old = EnergyReportService.GetEnergyReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (old == null) + { + report.EnergyReportId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReport)); + report.UpState = BLL.Const.UpState_2; + report.FillingMan = this.CurrUser.UserName; + BLL.EnergyReportService.AddEnvironmental_EnergyReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.EnergyReportId, BLL.Const.EnergyReportMenuId, BLL.Const.BtnAdd); + } + else + { + ShowNotify("该月份记录已存在!", MessageBoxIcon.Warning); + return; + } + } + else + { + Model.Environmental_EnergyReport oldReport = BLL.EnergyReportService.GetEnvironmental_EnergyReportById(EnergyReportId); + report.EnergyReportId = EnergyReportId; + report.UpState = BLL.Const.UpState_2; + BLL.EnergyReportService.UpdateEnvironmental_EnergyReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.EnergyReportId, BLL.Const.EnergyReportMenuId, BLL.Const.BtnModify); + } + EnergyReportId = report.EnergyReportId; + BLL.EnergyreportItemService.DeleteEnergyReportItemByChemicalReportId(report.EnergyReportId); + GetItems(report.EnergyReportId); + List mReportItemList = new List(); + foreach (var item in items) + { + Model.Environmental_EnergyReportItem newItem = new Environmental_EnergyReportItem(); + newItem.EnergyReportItemId = item.EnergyReportItemId; + newItem.EnergyReportId = item.EnergyReportId; + newItem.SortIndex = item.SortIndex; + newItem.BusinessCategory = item.BusinessCategory; + newItem.Throughput_BasePeriod = item.Throughput_BasePeriod; + newItem.Throughput_LastPeriod = item.Throughput_LastPeriod; + newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod; + newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement; + newItem.Yield_BasePeriod = item.Yield_BasePeriod; + newItem.Yield_LastPeriod = item.Yield_LastPeriod; + newItem.Yield_ThisPeriod = item.Yield_ThisPeriod; + newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement; + newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod; + newItem.OutputValue_LastYear = item.OutputValue_LastYear; + newItem.OutputValue_ThisYear = item.OutputValue_ThisYear; + newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod; + newItem.OperationScale_LastYear = item.OperationScale_LastYear; + newItem.OperationScale_ThisYear = item.OperationScale_ThisYear; + newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement; + newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod; + newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear; + newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear; + EnergyreportItemService.AddEnvironmental_EnergyReportItem(newItem); + mReportItemList.Add(newItem); + } + if (type == "updata") //数据同步 + { + if (report.UpState == BLL.Const.UpState_2) + { + string code = CNCECHSSEWebService.UpEnergyReport(report.EnergyReportId, this.CurrUser); + if (code == "1") + { + ShowNotify("同步成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + return; + } + else + { + Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); + } + } + else + { + ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning); + return; + } + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + Save("add"); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + protected void btnUpdata_Click(object sender, EventArgs e) + { + Save("updata"); + } + + protected void btnSubmit_Click(object sender, EventArgs e) + { + Save("submit"); + } + #endregion + + #region 增加本月明细 + private void GetItems(string EnergyReportId) + { + List newItemLists = new List(); + + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + string sortIndex = values.Value("SortIndex"); + var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (newItem != null) + { + newItem.EnergyReportItemId = SQLHelper.GetNewID(); + newItem.EnergyReportId = EnergyReportId; + newItem.SortIndex = values.Value("SortIndex"); + newItem.BusinessCategory = values.Value("BusinessCategory"); + newItem.Throughput_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_BasePeriod")).ToString(); + newItem.Throughput_LastPeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_LastPeriod")).ToString(); + newItem.Throughput_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_ThisPeriod")).ToString(); + newItem.Throughput_UnitOfMeasurement = values.Value("Throughput_UnitOfMeasurement"); + newItem.Yield_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_BasePeriod")).ToString(); + newItem.Yield_LastPeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_LastPeriod")).ToString(); + newItem.Yield_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_ThisPeriod")).ToString(); + newItem.Yield_UnitOfMeasurement = values.Value("Yield_UnitOfMeasurement"); + newItem.OutputValue_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("OutputValue_BasePeriod")).ToString(); + newItem.OutputValue_LastYear = Funs.GetNewDecimalOrZero(values.Value("OutputValue_LastYear")).ToString(); + newItem.OutputValue_ThisYear = Funs.GetNewDecimalOrZero(values.Value("OutputValue_ThisYear")).ToString(); + newItem.OperationScale_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("OperationScale_BasePeriod")).ToString(); + newItem.OperationScale_LastYear = Funs.GetNewDecimalOrZero(values.Value("OperationScale_LastYear")).ToString(); + newItem.OperationScale_ThisYear = Funs.GetNewDecimalOrZero(values.Value("OperationScale_ThisYear")).ToString(); + newItem.OperationScale_UnitOfMeasurement = values.Value("OperationScale_UnitOfMeasurement"); + newItem.ServiceOperatingIncome_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_BasePeriod")).ToString(); + newItem.ServiceOperatingIncome_LastYear = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_LastYear")).ToString(); + newItem.ServiceOperatingIncome_ThisYear = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_ThisYear")).ToString(); + newItemLists.Add(newItem); + } + } + items = newItemLists; + } + #endregion + + #region 获取明细 + private void GetNewItems(int year, int Quarters) + { + var indexNames = EnergyreportItemService.GetItems("Template"); + foreach (var indexName in indexNames) + { + //增加明细集合 + Model.Environmental_EnergyReportItem item = new Environmental_EnergyReportItem + { + EnergyReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReportItem)), + BusinessCategory = indexName.BusinessCategory, + SortIndex = indexName.SortIndex, + }; + + items.Add(item); + } + var ListProjectEnergyItemReport= ProjectEnergyreportItemService.GetItemsByDate(year, Quarters); + var q = from x in ListProjectEnergyItemReport + group x by x.SortIndex into g + select new + { + g.Key, + Throughput_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Throughput_BasePeriod)), + Throughput_LastPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Throughput_LastPeriod)), + Throughput_ThisPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Throughput_ThisPeriod)), + Yield_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Yield_BasePeriod)), + Yield_LastPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Yield_LastPeriod)), + Yield_ThisPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Yield_ThisPeriod)), + OutputValue_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.OutputValue_BasePeriod)), + OutputValue_LastYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OutputValue_LastYear)), + OutputValue_ThisYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OutputValue_ThisYear)), + OperationScale_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.OperationScale_BasePeriod)), + OperationScale_LastYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OperationScale_LastYear)), + OperationScale_ThisYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OperationScale_ThisYear)), + ServiceOperatingIncome_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.ServiceOperatingIncome_BasePeriod)), + ServiceOperatingIncome_LastYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.ServiceOperatingIncome_LastYear)), + ServiceOperatingIncome_ThisYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.ServiceOperatingIncome_ThisYear)), + }; + foreach (var item in items) + { + item.Throughput_BasePeriod = q.Where(x => x.Key == item.SortIndex).Select(y => y.Throughput_BasePeriod).FirstOrDefault().ToString(); + item.Throughput_LastPeriod = q.Where(x => x.Key == item.SortIndex).Select(y => y.Throughput_LastPeriod).FirstOrDefault().ToString(); + item.Throughput_ThisPeriod = q.Where(x => x.Key == item.SortIndex).Select(y => y.Throughput_ThisPeriod).FirstOrDefault().ToString(); + item.Yield_BasePeriod = q.Where(x => x.Key == item.SortIndex).Select(y => y.Yield_BasePeriod).FirstOrDefault().ToString(); + item.Yield_LastPeriod = q.Where(x => x.Key == item.SortIndex).Select(y => y.Yield_LastPeriod).FirstOrDefault().ToString(); + item.Yield_ThisPeriod = q.Where(x => x.Key == item.SortIndex).Select(y => y.Yield_ThisPeriod).FirstOrDefault().ToString(); + item.OutputValue_BasePeriod = q.Where(x => x.Key == item.SortIndex).Select(y => y.OutputValue_BasePeriod).FirstOrDefault().ToString(); + item.OutputValue_LastYear = q.Where(x => x.Key == item.SortIndex).Select(y => y.OutputValue_LastYear).FirstOrDefault().ToString(); + item.OutputValue_ThisYear = q.Where(x => x.Key == item.SortIndex).Select(y => y.OutputValue_ThisYear).FirstOrDefault().ToString(); + item.OperationScale_BasePeriod = q.Where(x => x.Key == item.SortIndex).Select(y => y.OperationScale_BasePeriod).FirstOrDefault().ToString(); + item.OperationScale_LastYear = q.Where(x => x.Key == item.SortIndex).Select(y => y.OperationScale_LastYear).FirstOrDefault().ToString(); + item.OperationScale_ThisYear = q.Where(x => x.Key == item.SortIndex).Select(y => y.OperationScale_ThisYear).FirstOrDefault().ToString(); + item.ServiceOperatingIncome_BasePeriod = q.Where(x => x.Key == item.SortIndex).Select(y => y.ServiceOperatingIncome_BasePeriod).FirstOrDefault().ToString(); + item.ServiceOperatingIncome_LastYear = q.Where(x => x.Key == item.SortIndex).Select(y => y.ServiceOperatingIncome_LastYear).FirstOrDefault().ToString(); + item.ServiceOperatingIncome_ThisYear = q.Where(x => x.Key == item.SortIndex).Select(y => y.ServiceOperatingIncome_ThisYear).FirstOrDefault().ToString(); + } + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉选择事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + items.Clear(); + if (drpUnit.SelectedValue != BLL.Const._Null) + { + //GetNewItems(); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.EnergyReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + //this.btnCopy.Hidden = false; + } + //if (buttonList.Contains(BLL.Const.BtnSaveUp)) + //{ + // this.btnUpdata.Hidden = false; + //} + } + } + #endregion + + #region 复制上个月数据 + /// + /// 复制上个月的数据 + /// + /// + /// + protected void btnCopy_Click(object sender, EventArgs e) + { + //DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue); + //if (nowDate.HasValue) + //{ + // DateTime showDate = new DateTime(); + // showDate = nowDate.Value.AddMonths(-1); + // Model.Environmental_EnergyReport ChemicalReport = BLL.EnergyReportService.GetEnvironmental_EnergyReportByUnitIdAndYearAndMonth(this.drpUnit.SelectedValue, showDate.Year, showDate.Month); + // if (ChemicalReport != null) + // { + // Model.Environmental_EnergyReport newChemicalReport = new Environmental_EnergyReport(); + // this.EnergyReportId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReport)); + // newChemicalReport.EnergyReportId = this.EnergyReportId; + // newChemicalReport.UnitId = this.drpUnit.SelectedValue; + // newChemicalReport.Year = Convert.ToInt32(this.drpYear.SelectedValue); + // newChemicalReport.Month = Convert.ToInt32(this.drpMonth.SelectedValue); + // newChemicalReport.FillingMan = this.CurrUser.UserName; + // newChemicalReport.FillingDate = DateTime.Now; + // newChemicalReport.DutyPerson = this.CurrUser.UserName; + // newChemicalReport.UpState = BLL.Const.UpState_2; + // BLL.EnergyReportService.ad(newChemicalReport); + + // var oldItems = BLL.EnergyreportItemService.GetItems(ChemicalReport.EnergyReportId); + // if (oldItems.Count > 0) + // { + // foreach (var item in oldItems) + // { + // Model.Environmental_EnergyReportItem newItem = new Environmental_EnergyReportItem + // { + // ChemicalReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReportItem)), + // EnergyReportId = this.EnergyReportId, + // SortIndex = item.SortIndex, + // LastYearValue = item.LastYearValue, + // ThisYearValue = item.ThisYearValue, + // Rate = item.Rate, + // }; + // BLL.EnergyreportItemService.AddChemicalReportItem(newItem); + // } + // } + + // GetValues(newChemicalReport.EnergyReportId); + // } + //} + } + + /// + /// 获取复制的值绑定到文本中 + /// + private void GetValues(string EnergyReportId) + { + var report = BLL.EnergyReportService.GetEnvironmental_EnergyReportById(EnergyReportId); + if (report != null) + { + drpQuarters.SelectedValue = report.Quarters.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + drpUnit.SelectedValue = report.UnitId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + items = BLL.EnergyreportItemService.GetShowItems(EnergyReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx.designer.cs new file mode 100644 index 00000000..d6f50a50 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx.designer.cs @@ -0,0 +1,296 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental +{ + + + public partial class EnergyReportSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// txtFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtFillingDate; + + /// + /// txtDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDutyPerson; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// txtThroughput_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtThroughput_BasePeriod; + + /// + /// txtThroughput_LastPeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtThroughput_LastPeriod; + + /// + /// txtThroughput_ThisPeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtThroughput_ThisPeriod; + + /// + /// txtThroughput_UnitOfMeasurement 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtThroughput_UnitOfMeasurement; + + /// + /// txtYield_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYield_BasePeriod; + + /// + /// txtYield_LastPeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYield_LastPeriod; + + /// + /// txtYield_ThisPeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYield_ThisPeriod; + + /// + /// txtYield_UnitOfMeasurement 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtYield_UnitOfMeasurement; + + /// + /// txtOutputValue_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOutputValue_BasePeriod; + + /// + /// txtOutputValue_LastYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOutputValue_LastYear; + + /// + /// txtOutputValue_ThisYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOutputValue_ThisYear; + + /// + /// txtOperationScale_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOperationScale_BasePeriod; + + /// + /// ttxOperationScale_LastYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox ttxOperationScale_LastYear; + + /// + /// txtOperationScale_ThisYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOperationScale_ThisYear; + + /// + /// txtOperationScale_UnitOfMeasurement 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtOperationScale_UnitOfMeasurement; + + /// + /// txtServiceOperatingIncome_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtServiceOperatingIncome_BasePeriod; + + /// + /// txtServiceOperatingIncome_LastYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtServiceOperatingIncome_LastYear; + + /// + /// txtServiceOperatingIncome_ThisYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtServiceOperatingIncome_ThisYear; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReport.aspx new file mode 100644 index 00000000..dded2399 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReport.aspx @@ -0,0 +1,129 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OperationReport.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.OperationReport" %> + + + + + 中央企业节能环保企业基本情况和经营状况 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReport.aspx.cs new file mode 100644 index 00000000..92b4f8e1 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReport.aspx.cs @@ -0,0 +1,338 @@ +using BLL; + +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class OperationReport : PageBase + { + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + //权限按钮方法 + this.GetButtonPower(); + + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, BLL.ConstValue.Group_0011, true); + + DateTime showDate = DateTime.Now.AddMonths(-3); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + this.drpYear.SelectedValue = showDate.Year.ToString(); + + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + + if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) + { + Grid1.PageSize = this.CurrUser.PageSize.Value; + } + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = "select * from Environmental_OperationReport where 1=1 "; + + strSql += " AND UnitId = '" + Const.UnitId_CD + "'"; + + List listStr = new List(); + + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + strSql += " AND Year = @Year"; + listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue))); + } + if (this.drpQuarters.SelectedValue != BLL.Const._Null) + { + strSql += " AND Quarters = @Quarters "; + listStr.Add(new SqlParameter("@Quarters", Funs.GetNewInt(this.drpQuarters.SelectedValue))); + } + + 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(); + + Model.Environmental_OperationReport report = Funs.DB.Environmental_OperationReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarters == Funs.GetNewInt(this.drpQuarters.SelectedValue) && e.Year == Funs.GetNewInt(this.drpYear.SelectedValue)); + if (report != null) + { + string upState = string.Empty; + if (report.UpState == BLL.Const.UpState_3) + { + upState = "(已上报)"; + } + else + { + upState = "(未上报)"; + } + this.Grid1.Title = "中央企业节能环保和经营状况季报" + this.drpQuarters.SelectedItem.Text + this.drpYear.SelectedItem.Text + upState; + } + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 改变索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 编辑\上报 + /// + /// 增加按钮 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}", Const.UnitId_CD, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - "))); + } + /// + /// 双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var operationReport = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == id); + if (operationReport != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}", Const.UnitId_CD, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, id, "编辑 - "))); + } + } + + /// + /// 上报 + /// + /// + /// + protected void btnUpdata_Click(object sender, EventArgs e) + { + var currUnitId = Const.UnitId_CD; + var year = this.drpYear.SelectedValue; + var quarter = this.drpQuarters.SelectedValue; + + Model.Environmental_OperationReport report = Funs.DB.Environmental_OperationReport.Where(s => s.UnitId == currUnitId && s.Year.ToString() == year && s.Quarters.ToString() == quarter).FirstOrDefault(); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}&type=Update", Const.UnitId_CD, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, report.BusinessReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉框联动事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + var units = BLL.UnitService.GetUnitDropDownList(); + if (units != null && !string.IsNullOrEmpty(this.drpUnit.SelectedText)) + { + var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText); + if (unit != null) + { + drpUnit.SelectedValue = unit.UnitId; + } + } + + BindGrid(); + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var getD = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == rowID); + if (getD != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, null, getD.BusinessReportId, BLL.Const.OperationReportMenuId, BLL.Const.BtnDelete); + + Funs.DB.Environmental_OperationReport.DeleteOnSubmit(getD); + Funs.DB.SubmitChanges(); + } + } + + this.BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(Grid1.SelectedRowID)) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/ReportPrint/ExReportPrint.aspx?reportId={0}&&replaceParameter={1}&&varValue={2}", Const.ProjectInformation_SafetyQuarterlyReportId, Grid1.SelectedRowID, "", "打印 - "))); + } + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + string menuId = BLL.Const.OperationReportMenuId; + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + menuId = BLL.Const.ProjectOperationReportMenuId; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, menuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + + var unitId = Const.UnitId_CD; + var year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + var quarter = Funs.GetNewIntOrZero(drpQuarters.SelectedValue); + + var getReport = Funs.DB.Environmental_OperationReport.Where(s => s.UnitId == unitId && s.Year == year && s.Quarters == quarter).FirstOrDefault(); + if (getReport != null) + { + this.btnNew.Hidden = true; + this.btnUpdata.Hidden = false; + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReport.aspx.designer.cs new file mode 100644 index 00000000..8509bf42 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReport.aspx.designer.cs @@ -0,0 +1,188 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental +{ + + + public partial class OperationReport + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReportEdit.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReportEdit.aspx new file mode 100644 index 00000000..13fbea7c --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReportEdit.aspx @@ -0,0 +1,147 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OperationReportEdit.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.OperationReportEdit" %> + + + + + 中央企业节能环保企业基本情况和经营状况 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReportEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReportEdit.aspx.cs new file mode 100644 index 00000000..73b26b28 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReportEdit.aspx.cs @@ -0,0 +1,326 @@ +using BLL; +using Microsoft.Office.Interop.Excel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class OperationReportEdit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string BusinessReportId + { + get + { + return (string)ViewState["BusinessReportId"]; + } + set + { + ViewState["BusinessReportId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.ddlQuarter, BLL.ConstValue.Group_0011, true); + + this.ddlUnitId.DataTextField = "UnitName"; + this.ddlUnitId.DataValueField = "UnitId"; + this.ddlUnitId.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + this.ddlUnitId.DataBind(); + + this.ddlUnitId.Readonly = true; + + var year = Request.Params["Year"]; + var quarter = Request.Params["Quarter"]; + string unitId = Request.Params["UnitId"]; + + this.drpYear.SelectedValue = year; + this.ddlQuarter.SelectedValue = quarter; + + if (!string.IsNullOrEmpty(Request.QueryString["type"])) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = false; + } + else + { + this.btnSave.Hidden = false; + this.btnUpdata.Hidden = true; + } + + BindGrid(year, quarter, unitId); + } + } + + private void BindGrid(string year, string quarter, string unitId) + { + this.BusinessReportId = Request.Params["BusinessReportId"]; + if (!string.IsNullOrEmpty(this.BusinessReportId)) + { + var operationReport = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == this.BusinessReportId); + + if (operationReport != null) + { + #region 赋值 + if (operationReport.Year != null) + { + this.drpYear.SelectedValue = operationReport.Year.ToString(); + } + if (operationReport.Quarters != null) + { + this.ddlQuarter.SelectedValue = operationReport.Quarters.ToString(); + } + if (!string.IsNullOrWhiteSpace(operationReport.FillingMan)) + { + this.txtCompileMan.Text = operationReport.FillingMan.ToString(); + } + if (!string.IsNullOrWhiteSpace(operationReport.UnitLevel)) + { + this.txtUnitLevel.Text = operationReport.UnitLevel; + } + if (!string.IsNullOrWhiteSpace(operationReport.Place)) + { + this.txtPlace.Text = operationReport.Place; + } + if (operationReport.FillingDate != null) + { + this.txtFillingDate.Text = operationReport.FillingDate.Value.ToString("yyyy-MM-dd"); + } + if (operationReport.CreateDate != null) + { + this.txtCreateDate.Text = operationReport.CreateDate.Value.ToString("yyyy-MM-dd"); + } + if (!string.IsNullOrWhiteSpace(operationReport.Code)) + { + this.txtCode.Text = operationReport.Code; + } + if (operationReport.PersonNum != null) + { + this.txtPersonNum.Text = operationReport.PersonNum.ToString(); + } + if (operationReport.TotalAssets != null) + { + this.txtTotalAssets.Text = operationReport.TotalAssets.ToString(); + } + if (operationReport.TotalValue != null) + { + this.txtTotalValue.Text = operationReport.TotalValue.ToString(); + } + if (operationReport.NewInvestment != null) + { + this.txtNewInvestment.Text = operationReport.NewInvestment.ToString(); + } + this.txtStatisticsDutyPerson.Text = operationReport.StatisticsDutyPerson; + this.txtUnitDutyPerson.Text = operationReport.UnitDutyPerson; + this.txtRemark.Text = operationReport.Remark; + + #endregion + } + } + else + { + #region 不存在则根据项目统计生成 + this.ddlUnitId.SelectedValue = unitId; + this.drpYear.SelectedValue = year; + this.ddlQuarter.SelectedValue = quarter; + this.txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + + var projects = Funs.DB.Base_Project.Where(s => s.UnitId == unitId).Select(s => s.ProjectId).ToList(); + + var items = Funs.DB.Environmental_ProjectOperationReport + .Where(s => s.Year.ToString() == year && s.Quarters.ToString() == quarter && projects.Contains(s.ProjectId)) + .ToList(); + + if (items.Any()) + { + this.txtPersonNum.Text = items.Sum(s => s.PersonNum ?? 0).ToString(); + this.txtTotalAssets.Text = items.Sum(s => s.TotalAssets ?? 0).ToString(); + this.txtTotalValue.Text = items.Sum(s => s.TotalValue ?? 0).ToString(); + this.txtNewInvestment.Text = items.Sum(s => s.NewInvestment ?? 0).ToString(); + } + this.txtCompileMan.Text = this.CurrUser.UserName; + this.txtStatisticsDutyPerson.Text = this.CurrUser.UserName; + this.txtUnitDutyPerson.Text = this.CurrUser.UserName; + + #endregion + } + } + #endregion + + #region 保存、提交、关闭 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.drpYear.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + return; + } + if (this.ddlQuarter.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择季度", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + /// + /// 上报 + /// + /// + /// + protected void btnUpdata_Click(object sender, EventArgs e) + { + SaveData("updata"); + } + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + Model.Environmental_OperationReport operationReport = new Model.Environmental_OperationReport + { + UnitId = this.ddlUnitId.SelectedValue + }; + + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + operationReport.Year = Funs.GetNewInt(this.drpYear.SelectedValue); + } + if (this.ddlQuarter.SelectedValue != BLL.Const._Null) + { + operationReport.Quarters = Funs.GetNewInt(this.ddlQuarter.SelectedValue); + } + operationReport.FillingMan = this.txtCompileMan.Text.Trim(); + operationReport.StatisticsDutyPerson = this.txtStatisticsDutyPerson.Text.Trim(); + operationReport.UnitDutyPerson = this.txtUnitDutyPerson.Text.Trim(); + operationReport.FillingDate = Funs.GetNewDateTime(this.txtFillingDate.Text); + operationReport.Code = this.txtCode.Text.Trim(); + operationReport.PersonNum = Funs.GetNewInt(this.txtPersonNum.Text.Trim()); + operationReport.TotalAssets = Funs.GetNewDecimalOrZero(this.txtTotalAssets.Text.Trim()); + operationReport.TotalValue = Funs.GetNewDecimalOrZero(this.txtTotalValue.Text.Trim()); + operationReport.NewInvestment = Funs.GetNewDecimalOrZero(this.txtNewInvestment.Text.Trim()); + operationReport.UnitLevel = this.txtUnitLevel.Text.Trim(); + operationReport.CreateDate = Funs.GetNewDateTime(this.txtCreateDate.Text); + operationReport.Place = this.txtPlace.Text.Trim(); + operationReport.Remark = this.txtRemark.Text.Trim(); + + if (!string.IsNullOrEmpty(this.BusinessReportId)) + { + var model = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == this.BusinessReportId); + if (model != null) + { + model.Code = operationReport.Code; + model.PersonNum = operationReport.PersonNum; + model.TotalAssets = operationReport.TotalAssets; + model.TotalValue = operationReport.TotalValue; + model.NewInvestment = operationReport.NewInvestment; + model.Quarters = operationReport.Quarters; + model.Year = operationReport.Year; + model.FillingMan = operationReport.FillingMan; + model.FillingDate = operationReport.FillingDate; + model.CreateDate = operationReport.CreateDate; + model.Place = operationReport.Place; + model.Remark = operationReport.Remark; + model.StatisticsDutyPerson = operationReport.StatisticsDutyPerson; + model.UnitDutyPerson = operationReport.UnitDutyPerson; + + operationReport.UpState = model.UpState; + operationReport.BusinessReportId = model.BusinessReportId; + + BLL.LogService.AddSys_Log(this.CurrUser, operationReport.Year.ToString() + "-" + operationReport.Quarters.ToString(), operationReport.BusinessReportId, BLL.Const.OperationReportMenuId, BLL.Const.BtnModify); + Funs.DB.SubmitChanges(); + } + } + else + { + var model = (from x in Funs.DB.Environmental_OperationReport + where x.UnitId == operationReport.UnitId && x.Year == operationReport.Year && x.Quarters == operationReport.Quarters + select x).FirstOrDefault(); + + if (model == null) + { + this.BusinessReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectOperationReport)); + operationReport.BusinessReportId = this.BusinessReportId; + operationReport.UpState = Const.UpState_2; + + Funs.DB.Environmental_OperationReport.InsertOnSubmit(operationReport); + BLL.LogService.AddSys_Log(this.CurrUser, operationReport.Year.ToString() + "-" + operationReport.Quarters.ToString(), operationReport.BusinessReportId, + BLL.Const.OperationReportMenuId, BLL.Const.BtnAdd); + + Funs.DB.SubmitChanges(); + } + else + { + Alert.ShowInTop("该季度记录已存在", MessageBoxIcon.Warning); + return; + } + } + + if (type == "updata") //数据同步 + { + if (operationReport.UpState == BLL.Const.UpState_2) + { + string code = CNCECHSSEWebService.UpOperationReport(operationReport.BusinessReportId, this.CurrUser); + if (code == "1") + { + ShowNotify("同步成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + return; + } + else + { + Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); + } + } + else + { + ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning); + return; + } + } + } + + #endregion + + #region 年季度变化事件 + /// + /// 年季度变化事件 + /// + /// + /// + protected void drpYear_SelectedIndexChanged(object sender, EventArgs e) + { + if (this.drpYear.SelectedValue != BLL.Const._Null && this.ddlQuarter.SelectedValue != BLL.Const._Null) + { + BindGrid(this.drpYear.SelectedValue, this.ddlQuarter.SelectedValue, Request.Params["unitId"]); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReportEdit.aspx.designer.cs new file mode 100644 index 00000000..ccfbb7d9 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/OperationReportEdit.aspx.designer.cs @@ -0,0 +1,296 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental +{ + + + public partial class OperationReportEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// ddlUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlUnitId; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// ddlQuarter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlQuarter; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCode; + + /// + /// GroupPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel1; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// txtUnitLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtUnitLevel; + + /// + /// txtCreateDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCreateDate; + + /// + /// txtPlace 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPlace; + + /// + /// txtPersonNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtPersonNum; + + /// + /// GroupPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel2; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// txtTotalAssets 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtTotalAssets; + + /// + /// txtTotalValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtTotalValue; + + /// + /// txtNewInvestment 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtNewInvestment; + + /// + /// Form6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form6; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRemark; + + /// + /// Form11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form11; + + /// + /// txtCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileMan; + + /// + /// txtStatisticsDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtStatisticsDutyPerson; + + /// + /// txtUnitDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtUnitDutyPerson; + + /// + /// txtFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtFillingDate; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx new file mode 100644 index 00000000..d901b296 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx @@ -0,0 +1,138 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectArchitectureReport.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ProjectArchitectureReport" %> + + + + + + + 建筑行业能源节约与生态环境保护汇总表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.cs new file mode 100644 index 00000000..005bad9d --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.cs @@ -0,0 +1,636 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BLL; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ProjectArchitectureReport : PageBase + { + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + ////取上个报表时间 + DateTime showDate = System.DateTime.Now.AddMonths(-3); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + drpYear.SelectedValue = showDate.Year.ToString(); + GetValue(); + } + } + + private void SetEmpty() + { + this.SimpleForm1.Title = string.Empty; + lbUnitName.Text = "填报企业:"; + lbFillingDate.Text = "填报日期:"; + lbDutyPerson.Text = "负责人:"; + lbHandleMan.Text = string.Empty; + this.Grid1.DataSource = null; + this.Grid1.DataBind(); + } + #endregion + + #region 获取记录值 + private void GetValue() + { + int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + int Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue); + Model.View_Environmental_ProjectArchitectureReport report = Funs.DB.View_Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == this.CurrUser.LoginProjectId && e.Quarters == Quarters && e.Year == year); + if (report != null) + { + string upState = string.Empty; + if (report.UpState == BLL.Const.UpState_3) + { + upState = "(已上报)"; + } + else + { + upState = "(未上报)"; + } + this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.QuartersStr + report.YearStr + upState; + lbUnitName.Text = "填报企业:" + report.ProjectName; + if (report.FillingDate != null) + { + lbFillingDate.Text = "填报日期:" + string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + else + { + lbFillingDate.Text = "填报日期:"; + } + lbDutyPerson.Text = "负责人:" + report.DutyPerson; + //if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3) + //{ + // this.lbHandleMan.Hidden = true; + //} + //else + //{ + // this.lbHandleMan.Hidden = false; + // lbHandleMan.Text = "下一步办理人:" + report.UserName; + //} + var indexNames = ProjectArchitectureReportItemService.GetIndexNames(); + var units = ProjectArchitectureReportItemService.GetUnits(); + //之前月度合计值集合 + List reportItems = BLL.ProjectArchitectureReportItemService.GetItems(report.ArchitectureReportId); + List items = new List(); + foreach (var yearSumItem in reportItems) + { + Model.ArchitectureReportItem item = new Model.ArchitectureReportItem(); + item.ArchitectureReportItemId = yearSumItem.ArchitectureReportItemId; + item.IndexName = indexNames.First(x => x.Value == yearSumItem.SortIndex).Text; + item.Unit = units.First(x => x.Value == yearSumItem.SortIndex).Text; + item.SortIndex = yearSumItem.SortIndex; + item.BaseNumber = yearSumItem.BaseNumber; + item.LastYearValue = yearSumItem.LastYearValue; + item.ThisYearValue = yearSumItem.ThisYearValue; + item.Rate = yearSumItem.Rate; + items.Add(item); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + else + { + SetEmpty(); + } + this.GetButtonPower(); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭导入弹出窗口 + /// + /// + /// + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭查看审批信息弹出窗口 + /// + /// + /// + protected void Window4_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectArchitectureReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnDelete.Hidden = false; + } + } + + var getReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + this.btnAudit1.Hidden = true; + this.btnAudit2.Hidden = true; + if (getReport != null) + { + this.btnNew.Hidden = true; + //if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入 + //{ + // if (getReport.HandleState == BLL.Const.HandleState_2) + // { + // this.btnAudit1.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_3) + // { + // this.btnAudit2.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_4) + // { + this.btnUpdata.Hidden = false; + // } + //} + } + } + #endregion + + #region 增加、修改、审核、审批、上报、删除 + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Quarterss={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - "))); + } + + /// + /// 修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审核 + /// + /// + /// + protected void btnAudit1_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审批 + /// + /// + /// + protected void btnAudit2_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 上报 + /// + /// + /// + protected void btnUpdata_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectArchitectureReportSave.aspx?ArchitectureReportId={0}&type=Updata", report.ArchitectureReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnDelete); + BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.ArchitectureReportId); + BLL.ProjectArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId); + BLL.ProjectArchitectureReportService.DeleteArchitectureReportByArchitectureReportId(report.ArchitectureReportId); + + SetEmpty(); + this.btnNew.Hidden = false; + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify("所选时间无报表记录!"); + } + } + #endregion + + #region 格式化字符串 + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertCompileDate(object CompileDate) + { + if (CompileDate != null) + { + return string.Format("{0:yyyy-MM-dd}", CompileDate); + } + return ""; + } + + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertDate(object ArchitectureReportId) + { + if (ArchitectureReportId != null) + { + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId.ToString()); + if (report != null) + { + return report.Year + "年" + report.Quarters + "月"; + } + } + return ""; + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉框联动事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + var units = BLL.UnitService.GetUnitDropDownList(); + if (units != null && !string.IsNullOrEmpty(this.drpUnit.SelectedText)) + { + var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText); + if (unit != null) + { + this.CurrUser.LoginProjectId = unit.UnitId; + } + } + + GetValue(); + } + #endregion + + #region 月份向前/向后 + /// + /// 前一个月 + /// + /// + /// + protected void BtnBulletLeft_Click(object sender, EventArgs e) + { + SetQuartersChange("-"); + } + + /// + /// 后一个月 + /// + /// + /// + protected void BulletRight_Click(object sender, EventArgs e) + { + SetQuartersChange("+"); + } + + /// + /// 月份加减变化 + /// + /// + private void SetQuartersChange(string type) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + if (type == "+") + { + showDate = nowDate.Value.AddMonths(3); + } + else + { + showDate = nowDate.Value.AddMonths(-3); + } + + this.drpYear.SelectedValue = showDate.Year.ToString(); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + ///值变化 + GetValue(); + } + } + #endregion + + #region 查看审批信息 + /// + /// 查看审批信息 + /// + /// + /// + protected void btnSee_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.ArchitectureReportId, "查看 - "))); + } + else + { + ShowNotify("所选月份无记录!", MessageBoxIcon.Warning); + } + } + #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(); + MultiHeaderTable mht = new 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("lblNumber") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + sb.Append(""); + } + sb.Append("
{0}
"); + return sb.ToString(); + } + + #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 + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.designer.cs new file mode 100644 index 00000000..d9caee1b --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReport.aspx.designer.cs @@ -0,0 +1,258 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental { + + + public partial class ProjectArchitectureReport { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// RegionPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RegionPanel RegionPanel1; + + /// + /// Region2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Region Region2; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// BtnBulletLeft 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletLeft; + + /// + /// BtnBulletRight 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletRight; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSee 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSee; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// btnAudit1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit1; + + /// + /// btnAudit2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit2; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// lbUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbUnitName; + + /// + /// lbFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbFillingDate; + + /// + /// lbDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDutyPerson; + + /// + /// lbHandleMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbHandleMan; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window4; + + /// + /// Window5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window5; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx new file mode 100644 index 00000000..2e7dfea4 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx @@ -0,0 +1,128 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectArchitectureReportSave.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ProjectArchitectureReportSave" %> + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx.cs new file mode 100644 index 00000000..85c492ec --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx.cs @@ -0,0 +1,1227 @@ +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ProjectArchitectureReportSave : PageBase + { + #region 定义变量 + /// + /// 报表主键Id + /// + public string ArchitectureReportId + { + get + { + return (string)ViewState["ArchitectureReportId"]; + } + set + { + ViewState["ArchitectureReportId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List items = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + items.Clear(); + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + string unitId = Request.QueryString["UnitId"]; + string year = Request.QueryString["Year"]; + string quarters = Request.QueryString["Quarterss"]; + ArchitectureReportId = Request.QueryString["ArchitectureReportId"]; + if (!string.IsNullOrEmpty(Request.QueryString["type"])) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = false; + } + else + { + this.btnSave.Hidden = false; + this.btnUpdata.Hidden = true; + } + if (!String.IsNullOrEmpty(ArchitectureReportId)) + { + items = BLL.ProjectArchitectureReportItemService.GetShowItems(ArchitectureReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + var report = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId); + if (report != null) + { + //this.btnCopy.Hidden = true; + //if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.hfnbdId) + //{ + // this.btnSave.Hidden = false; + //} + if (report.UpState == BLL.Const.UpState_3) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = true; + } + drpQuarters.SelectedValue = report.Quarters.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + this.CurrUser.LoginProjectId = report.ProjectId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + } + } + else + { + //this.btnCopy.Hidden = false; + drpQuarters.SelectedValue = quarters; + drpYear.SelectedValue = year; + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + txtDutyPerson.Text = this.CurrUser.UserName; + //增加明细集合 + GetNewItems(year, quarters); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + SetUnEditableRow(); + GetData(); + } + else + { + if (GetRequestEventArgument() == "UPDATE_SUMMARY") + { + GetData(); + } + } + } + #endregion + + #region 设置不可编辑行 + private void SetUnEditableRow() + { + if (Grid1.Rows.Count == 61) + { + Grid1.Rows[0].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[0].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[14].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[14].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[16].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[16].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[17].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[18].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[18].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[20].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[20].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[21].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[22].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[24].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[24].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[36].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[36].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[58].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[58].CellCssClasses[5] = "f-grid-cell-uneditable"; + } + var lastYearReport = ProjectArchitectureReportService.GetArchitectureReportByProjectIdYear(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); + if (lastYearReport.Count > 0) + { + var lastYearReportItems = ProjectArchitectureReportItemService.GetLastYearItems(Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); + Grid1.Rows[1].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + SetLastYearUnEditableRow(); + } + else + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + DateTime lastQuarters = nowDate.Value.AddMonths(-3); + Environmental_ProjectArchitectureReport lastQuartersReport = ProjectArchitectureReportService.GetArchitectureReportByProjectIdDate(this.CurrUser.LoginProjectId, lastQuarters.Year, Funs.GetNowQuarterlyByTime(lastQuarters)); + if (lastQuartersReport != null) + { + var lastQuartersReportItems = BLL.ProjectArchitectureReportItemService.GetItems(lastQuartersReport.ArchitectureReportId); + Grid1.Rows[1].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + SetLastYearUnEditableRow(); + } + } + } + + private void SetLastYearUnEditableRow() + { + Grid1.Rows[1].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[2].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[3].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[4].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[5].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[6].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[7].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[8].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[9].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[10].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[11].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[12].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[13].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[16].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[20].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[24].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[25].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[26].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[27].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[28].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[29].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[30].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[31].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[32].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[33].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[34].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[35].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[36].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[37].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[38].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[39].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[40].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[41].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[42].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[43].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[44].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[45].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[46].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[47].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[48].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[49].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[50].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[51].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[52].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[53].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[54].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[55].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[56].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[57].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[59].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[60].CellCssClasses[4] = "f-grid-cell-uneditable"; + } + #endregion + + #region 计算方法 + /// + /// 计算方法 + /// + private void GetData() + { + decimal E6 = 0, F6 = 0, E7 = 0, F7 = 0, E8, F8, E9 = 0, F9 = 0, E10 = 0, F10 = 0, E11 = 0, F11 = 0, E12 = 0, F12 = 0, E13 = 0, F13 = 0, E14 = 0, F14 = 0, E15 = 0, F15 = 0, E16 = 0, F16 = 0, E17 = 0, F17 = 0, E18 = 0, F18 = 0, E20 = 0, F20 = 0, E21 = 0, F21 = 0, E22 = 0, F22 = 0, + E24 = 0, F24 = 0, E25 = 0, F25 = 0, E26 = 0, F26 = 0, E27 = 0, F27 = 0, E28, F28, E29 = 0, F29 = 0, E30, F30, E31, F31, E32, F32, E33, F33, E34, F34, E35, F35, E36, F36, E37, F37, E38, F38, E39, F39, E40, F40, E41 = 0, F41 = 0, + E42, F42, E43, F43, E44, F44, E45, F45, E46, F46, E47, F47, E48, F48, E49, F49, E50, F50, E51, F51, E52, F52, E53, F53, E54, F54, E55, F55, + E56, F56, E57, F57, E58, F58, E59, F59, E60, F60, E61, F61, E62, F62, E64 = 0, F64 = 0, E65 = 0, F65 = 0; + JArray mergedData = Grid1.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + string sortIndex = values.Value("SortIndex"); + var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (item != null) + { + item.BaseNumber = System.Web.HttpUtility.HtmlDecode(values.Value("BaseNumber")); + item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); + item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); + + } + } + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + SetUnEditableRow(); + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + if (rowIndex == 1) + { + E6 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F6 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E6 > 0 && F6 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F6 - E6) * 100 / E6, 2).ToString() + "%"; + } + } + else if (rowIndex == 2) + { + E7 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F7 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E7 > 0 && F7 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F7 - E7) * 100 / E7, 2).ToString() + "%"; + } + } + else if (rowIndex == 3) + { + E8 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F8 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E8 > 0 && F8 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F8 - E8) * 100 / E8, 2).ToString() + "%"; + } + } + else if (rowIndex == 4) + { + E9 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F9 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E9 > 0 && F9 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F9 - E9) * 100 / E9, 2).ToString() + "%"; + } + } + else if (rowIndex == 5) + { + E10 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F10 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E10 > 0 && F10 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F10 - E10) * 100 / E10, 2).ToString() + "%"; + } + } + else if (rowIndex == 6) + { + E11 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F11 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E11 > 0 && F11 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F11 - E11) * 100 / E11, 2).ToString() + "%"; + } + } + else if (rowIndex == 7) + { + E12 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F12 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E12 > 0 && F12 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F12 - E12) * 100 / E12, 2).ToString() + "%"; + } + } + else if (rowIndex == 8) + { + E13 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F13 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E13 > 0 && F13 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F13 - E13) * 100 / E13, 2).ToString() + "%"; + } + } + else if (rowIndex == 9) + { + E14 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F14 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E14 > 0 && F14 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F14 - E14) * 100 / E14, 2).ToString() + "%"; + } + } + else if (rowIndex == 10) + { + E15 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F15 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E15 > 0 && F15 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F15 - E15) * 100 / E15, 2).ToString() + "%"; + } + } + else if (rowIndex == 11) + { + E16 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F16 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E16 > 0 && F16 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F16 - E16) * 100 / E16, 2).ToString() + "%"; + } + } + else if (rowIndex == 12) + { + E17 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F17 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E17 > 0 && F17 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F17 - E17) * 100 / E17, 2).ToString() + "%"; + } + } + else if (rowIndex == 13) + { + E18 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F18 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E18 > 0 && F18 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F18 - E18) * 100 / E18, 2).ToString() + "%"; + } + } + else if (rowIndex == 15) + { + E20 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F20 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E20 > 0 && F20 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F20 - E20) * 100 / E20, 2).ToString() + "%"; + } + } + else if (rowIndex == 16) + { + E21 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F21 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E21 > 0 && F21 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F21 - E21) * 100 / E21, 2).ToString() + "%"; + } + } + else if (rowIndex == 17) + { + E22 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F22 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E22 > 0 && F22 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F22 - E22) * 100 / E22, 2).ToString() + "%"; + } + } + else if (rowIndex == 19) + { + E24 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F24 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E24 > 0 && F24 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F24 - E24) * 100 / E24, 2).ToString() + "%"; + } + } + else if (rowIndex == 20) + { + E25 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F25 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E25 > 0 && F25 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F25 - E25) * 100 / E25, 2).ToString() + "%"; + } + } + else if (rowIndex == 21) + { + E26 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F26 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E26 > 0 && F26 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F26 - E26) * 100 / E26, 2).ToString() + "%"; + } + } + else if (rowIndex == 22) + { + E27 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F27 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E27 > 0 && F27 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F27 - E27) * 100 / E27, 2).ToString() + "%"; + } + } + else if (rowIndex == 23) + { + E28 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F28 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E28 > 0 && F28 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F28 - E28) * 100 / E28, 2).ToString() + "%"; + } + } + else if (rowIndex == 24) + { + E29 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F29 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E29 > 0 && F29 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F29 - E29) * 100 / E29, 2).ToString() + "%"; + } + } + else if (rowIndex == 25) + { + E30 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F30 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E30 > 0 && F30 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F30 - E30) * 100 / E30, 2).ToString() + "%"; + } + } + else if (rowIndex == 26) + { + E31 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F31 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E31 > 0 && F31 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F31 - E31) * 100 / E31, 2).ToString() + "%"; + } + } + else if (rowIndex == 27) + { + E32 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F32 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E32 > 0 && F32 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F32 - E32) * 100 / E32, 2).ToString() + "%"; + } + } + else if (rowIndex == 28) + { + E33 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F33 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E33 > 0 && F33 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F33 - E33) * 100 / E33, 2).ToString() + "%"; + } + } + else if (rowIndex == 29) + { + E34 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F34 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E34 > 0 && F34 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F34 - E34) * 100 / E34, 2).ToString() + "%"; + } + } + else if (rowIndex == 30) + { + E35 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F35 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E35 > 0 && F35 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F35 - E35) * 100 / E35, 2).ToString() + "%"; + } + } + else if (rowIndex == 31) + { + E36 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F36 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E36 > 0 && F36 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F36 - E36) * 100 / E36, 2).ToString() + "%"; + } + } + else if (rowIndex == 32) + { + E37 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F37 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E37 > 0 && F37 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F37 - E37) * 100 / E37, 2).ToString() + "%"; + } + } + else if (rowIndex == 33) + { + E38 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F38 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E38 > 0 && F38 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F38 - E38) * 100 / E38, 2).ToString() + "%"; + } + } + else if (rowIndex == 34) + { + E39 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F39 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E39 > 0 && F39 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F39 - E39) * 100 / E39, 2).ToString() + "%"; + } + } + else if (rowIndex == 35) + { + E40 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F40 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E40 > 0 && F40 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F40 - E40) * 100 / E40, 2).ToString() + "%"; + } + } + else if (rowIndex == 36) + { + E41 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F41 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E41 > 0 && F41 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F41 - E41) * 100 / E41, 2).ToString() + "%"; + } + } + else if (rowIndex == 37) + { + E42 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F42 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E42 > 0 && F42 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F42 - E42) * 100 / E42, 2).ToString() + "%"; + } + } + else if (rowIndex == 38) + { + E43 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F43 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E43 > 0 && F43 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F43 - E43) * 100 / E43, 2).ToString() + "%"; + } + } + else if (rowIndex == 39) + { + E44 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F44 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E44 > 0 && F44 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F44 - E44) * 100 / E44, 2).ToString() + "%"; + } + } + else if (rowIndex == 40) + { + E45 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F45 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E45 > 0 && F45 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F45 - E45) * 100 / E45, 2).ToString() + "%"; + } + } + else if (rowIndex == 41) + { + E46 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F46 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E46 > 0 && F46 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F46 - E46) * 100 / E46, 2).ToString() + "%"; + } + } + else if (rowIndex == 42) + { + E47 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F47 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E47 > 0 && F47 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F47 - E47) * 100 / E47, 2).ToString() + "%"; + } + } + else if (rowIndex == 43) + { + E48 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F48 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E48 > 0 && F48 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F48 - E48) * 100 / E48, 2).ToString() + "%"; + } + } + else if (rowIndex == 44) + { + E49 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F49 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E49 > 0 && F49 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F49 - E49) * 100 / E49, 2).ToString() + "%"; + } + } + else if (rowIndex == 45) + { + E50 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F50 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E50 > 0 && F50 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F50 - E50) * 100 / E50, 2).ToString() + "%"; + } + } + else if (rowIndex == 46) + { + E51 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F51 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E51 > 0 && F51 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F51 - E51) * 100 / E51, 2).ToString() + "%"; + } + } + else if (rowIndex == 47) + { + E52 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F52 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E52 > 0 && F52 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F52 - E52) * 100 / E52, 2).ToString() + "%"; + } + } + else if (rowIndex == 48) + { + E53 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F53 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E53 > 0 && F53 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F53 - E53) * 100 / E53, 2).ToString() + "%"; + } + } + else if (rowIndex == 49) + { + E54 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F54 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E54 > 0 && F54 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F54 - E54) * 100 / E54, 2).ToString() + "%"; + } + } + else if (rowIndex == 50) + { + E55 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F55 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E55 > 0 && F55 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F55 - E55) * 100 / E55, 2).ToString() + "%"; + } + } + else if (rowIndex == 51) + { + E56 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F56 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E56 > 0 && F56 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F56 - E56) * 100 / E56, 2).ToString() + "%"; + } + } + else if (rowIndex == 52) + { + E57 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F57 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E57 > 0 && F57 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F57 - E57) * 100 / E57, 2).ToString() + "%"; + } + } + else if (rowIndex == 53) + { + E58 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F58 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E58 > 0 && F58 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F58 - E58) * 100 / E58, 2).ToString() + "%"; + } + } + else if (rowIndex == 54) + { + E59 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F59 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E59 > 0 && F59 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F59 - E59) * 100 / E59, 2).ToString() + "%"; + } + } + else if (rowIndex == 55) + { + E60 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F60 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E60 > 0 && F60 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F60 - E60) * 100 / E60, 2).ToString() + "%"; + } + } + else if (rowIndex == 56) + { + E61 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F61 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E61 > 0 && F61 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F61 - E61) * 100 / E61, 2).ToString() + "%"; + } + } + else if (rowIndex == 57) + { + E62 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F62 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E62 > 0 && F62 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F62 - E62) * 100 / E62, 2).ToString() + "%"; + } + } + else if (rowIndex == 59) + { + E64 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F64 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E64 > 0 && F64 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F64 - E64) * 100 / E64, 2).ToString() + "%"; + } + } + else if (rowIndex == 60) + { + E65 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F65 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E65 > 0 && F65 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F65 - E65) * 100 / E65, 2).ToString() + "%"; + } + } + } + if (E6 > 0 || E9 > 0 || E10 > 0 || E11 > 0 || E12 > 0 || E13 > 0 || E14 > 0 || E15 > 0 || E16 > 0 || E17 > 0 || E18 > 0) + { + this.Grid1.Rows[0].Values[4] = (E6 + (E9 * Convert.ToDecimal(0.9714) + E10 * Convert.ToDecimal(1.229) + E11 * Convert.ToDecimal(1.4286) + E12 * Convert.ToDecimal(1.4714) + E13 * Convert.ToDecimal(1.4714) + E14 * Convert.ToDecimal(1.4571) + E15 * Convert.ToDecimal(1.4286) + E16 * Convert.ToDecimal(13.3) + E17 * Convert.ToDecimal(0.0341) + E18) / 10000); + } + if (F6 > 0 || F9 > 0 || F10 > 0 || F11 > 0 || F12 > 0 || F13 > 0 || F14 > 0 || F15 > 0 || F16 > 0 || F17 > 0 || F18 > 0) + { + this.Grid1.Rows[0].Values[5] = (F6 + (F9 * Convert.ToDecimal(0.9714) + F10 * Convert.ToDecimal(1.229) + F11 * Convert.ToDecimal(1.4286) + F12 * Convert.ToDecimal(1.4714) + F13 * Convert.ToDecimal(1.4714) + F14 * Convert.ToDecimal(1.4571) + F15 * Convert.ToDecimal(1.4286) + F16 * Convert.ToDecimal(13.3) + F17 * Convert.ToDecimal(0.0341) + F18) / 10000); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && !string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString())) + { + this.Grid1.Rows[0].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()), 2).ToString() + "%"; + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E20 > 0) + { + this.Grid1.Rows[14].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E20, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F20 > 0) + { + this.Grid1.Rows[14].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F20, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[14].Values[4].ToString()) && this.Grid1.Rows[14].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[14].Values[5].ToString())) + { + this.Grid1.Rows[14].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString()), 2).ToString() + "%"; + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E24 > 0) + { + this.Grid1.Rows[18].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E24, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F24 > 0) + { + this.Grid1.Rows[18].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F24, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[18].Values[4].ToString()) && this.Grid1.Rows[18].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[18].Values[5].ToString())) + { + this.Grid1.Rows[18].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString()), 2).ToString() + "%"; + } + if (E64 > 0 && E65 > 0 && E20 > 0) + { + this.Grid1.Rows[58].Values[4] = decimal.Round((E64 + E65) / E20, 4); + } + if (F64 > 0 && F65 > 0 && F20 > 0) + { + this.Grid1.Rows[58].Values[5] = decimal.Round((F64 + F65) / F20, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[58].Values[4].ToString()) && this.Grid1.Rows[58].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[58].Values[5].ToString())) + { + this.Grid1.Rows[58].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[58].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[58].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[58].Values[4].ToString()), 2).ToString() + "%"; + } + } + #endregion + + #region 关闭窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + Model.Environmental_ProjectArchitectureReport report = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId); + this.btnSave.Hidden = false; + } + #endregion + + #region 保存、上报 + /// + /// 保存数据 + /// + /// + private void Save(string type) + { + //string ArchitectureReportId = Request.QueryString["ArchitectureReportId"]; + Model.Environmental_ProjectArchitectureReport report = new Environmental_ProjectArchitectureReport + { + ProjectId = this.CurrUser.LoginProjectId, + Year = Funs.GetNewIntOrZero(drpYear.SelectedValue), + Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue) + }; + if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim())) + { + report.FillingDate = Convert.ToDateTime(txtFillingDate.Text.Trim()); + } + report.DutyPerson = txtDutyPerson.Text.Trim(); + if (String.IsNullOrEmpty(ArchitectureReportId)) + { + Environmental_ProjectArchitectureReport old = ProjectArchitectureReportService.GetArchitectureReportByProjectIdDate(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (old == null) + { + report.ArchitectureReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectArchitectureReport)); + report.UpState = BLL.Const.UpState_2; + report.FillingMan = this.CurrUser.UserName; + BLL.ProjectArchitectureReportService.AddArchitectureReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnAdd); + } + else + { + ShowNotify("该月份记录已存在!", MessageBoxIcon.Warning); + return; + } + } + else + { + Model.Environmental_ProjectArchitectureReport oldReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId); + report.ArchitectureReportId = ArchitectureReportId; + report.UpState = BLL.Const.UpState_2; + BLL.ProjectArchitectureReportService.UpdateArchitectureReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnModify); + } + ArchitectureReportId = report.ArchitectureReportId; + BLL.ProjectArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId); + List mReportItemList = new List(); + GetItems(report.ArchitectureReportId); + foreach (var item in items) + { + Model.Environmental_ProjectArchitectureReportItem newItem = new Environmental_ProjectArchitectureReportItem(); + newItem.ArchitectureReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectArchitectureReportItem)); + newItem.ArchitectureReportId = report.ArchitectureReportId; + newItem.BaseNumber = System.Web.HttpUtility.HtmlDecode(item.BaseNumber); + newItem.SortIndex = System.Web.HttpUtility.HtmlDecode(item.SortIndex); + newItem.LastYearValue = System.Web.HttpUtility.HtmlDecode(item.LastYearValue); + newItem.ThisYearValue = System.Web.HttpUtility.HtmlDecode(item.ThisYearValue); + newItem.Rate = System.Web.HttpUtility.HtmlDecode(item.Rate); + ProjectArchitectureReportItemService.AddArchitectureReportItem(newItem); + mReportItemList.Add(newItem); + } + if (type == "updata") //数据同步 + { + if (report.UpState == BLL.Const.UpState_2) + { + string code = CNCECHSSEWebService.UpArchitectureReport(report.ArchitectureReportId, this.CurrUser); + if (code == "1") + { + ShowNotify("同步成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + return; + } + else + { + Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); + } + } + else + { + ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning); + return; + } + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + Save("add"); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + protected void btnUpdata_Click(object sender, EventArgs e) + { + Save("updata"); + } + + protected void btnSubmit_Click(object sender, EventArgs e) + { + Save("submit"); + } + #endregion + + #region 增加本月明细 + private void GetItems(string ArchitectureReportId) + { + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + string sortIndex = values.Value("SortIndex"); + var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (item != null) + { + item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); + item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); + item.Rate = System.Web.HttpUtility.HtmlDecode(values.Value("Rate")); + } + } + } + #endregion + + #region 获取明细 + private void GetNewItems(string year, string quarters) + { + var indexNames = ProjectArchitectureReportItemService.GetIndexNames(); + var units = ProjectArchitectureReportItemService.GetUnits(); + foreach (var indexName in indexNames) + { + //增加明细集合 + Model.ArchitectureReportItem item = new ArchitectureReportItem + { + ArchitectureReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectArchitectureReportItem)), + IndexName = indexName.Text, + Unit = units.First(x => x.Value == indexName.Value).Text, + SortIndex = indexName.Value, + }; + //if (item.SortIndex == "17" || item.SortIndex == "18" || item.SortIndex == "21" || item.SortIndex == "22" || item.SortIndex == "23" || item.SortIndex == "25" || item.SortIndex == "37") + //{ + // item.LastYearValue = "×"; + // item.ThisYearValue = "×"; + // if (item.SortIndex == "25") + // { + // item.Rate = "─"; + // } + // else + // { + // item.Rate = "×"; + // } + //} + items.Add(item); + } + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉选择事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + items.Clear(); + if (this.CurrUser.LoginProjectId != BLL.Const._Null) + { + //GetNewItems(); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectArchitectureReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + //this.btnCopy.Hidden = false; + } + //if (buttonList.Contains(BLL.Const.BtnSaveUp)) + //{ + // this.btnUpdata.Hidden = false; + //} + } + } + #endregion + + #region 复制上个月数据 + /// + /// 复制上个月的数据 + /// + /// + /// + protected void btnCopy_Click(object sender, EventArgs e) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + showDate = nowDate.Value.AddMonths(-3); + Model.Environmental_ProjectArchitectureReport ArchitectureReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, showDate.Year, Funs.GetNowQuarterlyByTime(showDate)); + if (ArchitectureReport != null) + { + Model.Environmental_ProjectArchitectureReport newArchitectureReport = new Environmental_ProjectArchitectureReport(); + this.ArchitectureReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectArchitectureReport)); + newArchitectureReport.ArchitectureReportId = this.ArchitectureReportId; + newArchitectureReport.ProjectId = this.CurrUser.LoginProjectId; + newArchitectureReport.Year = Convert.ToInt32(this.drpYear.SelectedValue); + newArchitectureReport.Quarters = Convert.ToInt32(this.drpQuarters.SelectedValue); + newArchitectureReport.FillingMan = this.CurrUser.UserName; + newArchitectureReport.FillingDate = DateTime.Now; + newArchitectureReport.DutyPerson = this.CurrUser.UserName; + newArchitectureReport.UpState = BLL.Const.UpState_2; + BLL.ProjectArchitectureReportService.AddArchitectureReport(newArchitectureReport); + + var oldItems = BLL.ProjectArchitectureReportItemService.GetItems(ArchitectureReport.ArchitectureReportId); + if (oldItems.Count > 0) + { + foreach (var item in oldItems) + { + Model.Environmental_ProjectArchitectureReportItem newItem = new Environmental_ProjectArchitectureReportItem + { + ArchitectureReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectArchitectureReportItem)), + ArchitectureReportId = this.ArchitectureReportId, + BaseNumber = item.BaseNumber, + SortIndex = item.SortIndex, + LastYearValue = item.LastYearValue, + ThisYearValue = item.ThisYearValue, + Rate = item.Rate, + }; + BLL.ProjectArchitectureReportItemService.AddArchitectureReportItem(newItem); + } + } + + GetValues(newArchitectureReport.ArchitectureReportId); + } + } + } + + /// + /// 获取复制的值绑定到文本中 + /// + private void GetValues(string ArchitectureReportId) + { + var report = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId); + if (report != null) + { + drpQuarters.SelectedValue = report.Quarters.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + this.CurrUser.LoginProjectId = report.ProjectId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + items = BLL.ProjectArchitectureReportItemService.GetShowItems(ArchitectureReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx.designer.cs new file mode 100644 index 00000000..46a59b94 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectArchitectureReportSave.aspx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental { + + + public partial class ProjectArchitectureReportSave { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// txtFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtFillingDate; + + /// + /// txtDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDutyPerson; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// txtBaseNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBaseNumber; + + /// + /// txtLastYearValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtLastYearValue; + + /// + /// txtThisYearValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtThisYearValue; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReport.aspx new file mode 100644 index 00000000..f8d3c3e1 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReport.aspx @@ -0,0 +1,135 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectChemicalReport.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ProjectChemicalReport" %> + + + + + + + 化工行业能源节约与生态环境保护汇总表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReport.aspx.cs new file mode 100644 index 00000000..d695d0ac --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReport.aspx.cs @@ -0,0 +1,636 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BLL; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ProjectChemicalReport : PageBase + { + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + ////取上个报表时间 + DateTime showDate = System.DateTime.Now.AddMonths(-1); + drpMonth.SelectedValue = showDate.Month.ToString(); + drpYear.SelectedValue = showDate.Year.ToString(); + GetValue(); + } + } + + private void SetEmpty() + { + this.SimpleForm1.Title = string.Empty; + lbUnitName.Text = "填报企业:"; + lbFillingDate.Text = "填报日期:"; + lbDutyPerson.Text = "负责人:"; + lbHandleMan.Text = string.Empty; + this.Grid1.DataSource = null; + this.Grid1.DataBind(); + } + #endregion + + #region 获取记录值 + private void GetValue() + { + int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + int month = Funs.GetNewIntOrZero(drpMonth.SelectedValue); + Model.View_Environmental_ProjectChemicalReport report = Funs.DB.View_Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ProjectId == this.CurrUser.LoginProjectId && e.Month == month && e.Year == year); + if (report != null) + { + string upState = string.Empty; + if (report.UpState == BLL.Const.UpState_3) + { + upState = "(已上报)"; + } + else + { + upState = "(未上报)"; + } + this.SimpleForm1.Title = "企业化工行业能源节约与生态环境保护汇总表" + report.MonthStr + report.YearStr + upState; + lbUnitName.Text = "填报项目:" + report.ProjectName; + if (report.FillingDate != null) + { + lbFillingDate.Text = "填报日期:" + string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + else + { + lbFillingDate.Text = "填报日期:"; + } + lbDutyPerson.Text = "负责人:" + report.DutyPerson; + //if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3) + //{ + // this.lbHandleMan.Hidden = true; + //} + //else + //{ + // this.lbHandleMan.Hidden = false; + // lbHandleMan.Text = "下一步办理人:" + report.UserName; + //} + var indexNames = ProjectChemicalReportItemService.GetIndexNames(); + var units = ProjectChemicalReportItemService.GetUnits(); + //之前月度合计值集合 + List reportItems = BLL.ProjectChemicalReportItemService.GetItems(report.ChemicalReportId); + List items = new List(); + foreach (var yearSumItem in reportItems) + { + Model.ChemicalReportItem item = new Model.ChemicalReportItem(); + item.ChemicalReportItemId = yearSumItem.ChemicalReportItemId; + item.IndexName = indexNames.First(x => x.Value == yearSumItem.SortIndex).Text; + item.Unit = units.First(x => x.Value == yearSumItem.SortIndex).Text; + item.SortIndex = yearSumItem.SortIndex; + item.BaseNumber = yearSumItem.BaseNumber; + item.LastYearValue = yearSumItem.LastYearValue; + item.ThisYearValue = yearSumItem.ThisYearValue; + item.Rate = yearSumItem.Rate; + items.Add(item); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + else + { + SetEmpty(); + } + this.GetButtonPower(); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭导入弹出窗口 + /// + /// + /// + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭查看审批信息弹出窗口 + /// + /// + /// + protected void Window4_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectChemicalReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnDelete.Hidden = false; + } + } + + var getReport = BLL.ProjectChemicalReportService.GetChemicalReportByProjectIdAndYearAndMonth(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + this.btnAudit1.Hidden = true; + this.btnAudit2.Hidden = true; + if (getReport != null) + { + this.btnNew.Hidden = true; + //if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入 + //{ + // if (getReport.HandleState == BLL.Const.HandleState_2) + // { + // this.btnAudit1.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_3) + // { + // this.btnAudit2.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_4) + // { + //this.btnUpdata.Hidden = false; + // } + //} + } + } + #endregion + + #region 增加、修改、审核、审批、上报、删除 + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectChemicalReportSave.aspx?UnitId={0}&&Year={1}&&Months={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpMonth.SelectedValue, "编辑 - "))); + } + + /// + /// 修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectChemicalReport report = BLL.ProjectChemicalReportService.GetChemicalReportByProjectIdAndYearAndMonth(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectChemicalReportSave.aspx?ChemicalReportId={0}", report.ChemicalReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审核 + /// + /// + /// + protected void btnAudit1_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectChemicalReport report = BLL.ProjectChemicalReportService.GetChemicalReportByProjectIdAndYearAndMonth(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectChemicalReportSave.aspx?ChemicalReportId={0}", report.ChemicalReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审批 + /// + /// + /// + protected void btnAudit2_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectChemicalReport report = BLL.ProjectChemicalReportService.GetChemicalReportByProjectIdAndYearAndMonth(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectChemicalReportSave.aspx?ChemicalReportId={0}", report.ChemicalReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 上报 + /// + /// + /// + protected void btnUpdata_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectChemicalReport report = BLL.ProjectChemicalReportService.GetChemicalReportByProjectIdAndYearAndMonth(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectChemicalReportSave.aspx?ChemicalReportId={0}&type=Updata", report.ChemicalReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectChemicalReport report = BLL.ProjectChemicalReportService.GetChemicalReportByProjectIdAndYearAndMonth(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ChemicalReportId, BLL.Const.ProjectChemicalReportMenuId, BLL.Const.BtnDelete); + BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.ChemicalReportId); + BLL.ProjectChemicalReportItemService.DeleteChemicalReportItemByChemicalReportId(report.ChemicalReportId); + BLL.ProjectChemicalReportService.DeleteChemicalReportByChemicalReportId(report.ChemicalReportId); + + SetEmpty(); + this.btnNew.Hidden = false; + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify("所选时间无报表记录!"); + } + } + #endregion + + #region 格式化字符串 + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertCompileDate(object CompileDate) + { + if (CompileDate != null) + { + return string.Format("{0:yyyy-MM-dd}", CompileDate); + } + return ""; + } + + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertDate(object ChemicalReportId) + { + if (ChemicalReportId != null) + { + Model.Environmental_ProjectChemicalReport report = BLL.ProjectChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId.ToString()); + if (report != null) + { + return report.Year + "年" + report.Month + "月"; + } + } + return ""; + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉框联动事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + var units = BLL.UnitService.GetUnitDropDownList(); + if (units != null && !string.IsNullOrEmpty(this.drpUnit.SelectedText)) + { + var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText); + if (unit != null) + { + drpUnit.SelectedValue = unit.UnitId; + } + } + + GetValue(); + } + #endregion + + #region 月份向前/向后 + /// + /// 前一个月 + /// + /// + /// + protected void BtnBulletLeft_Click(object sender, EventArgs e) + { + SetMonthChange("-"); + } + + /// + /// 后一个月 + /// + /// + /// + protected void BulletRight_Click(object sender, EventArgs e) + { + SetMonthChange("+"); + } + + /// + /// 月份加减变化 + /// + /// + private void SetMonthChange(string type) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + if (type == "+") + { + showDate = nowDate.Value.AddMonths(1); + } + else + { + showDate = nowDate.Value.AddMonths(-1); + } + + this.drpYear.SelectedValue = showDate.Year.ToString(); + drpMonth.SelectedValue = showDate.Month.ToString(); + ///值变化 + GetValue(); + } + } + #endregion + + #region 查看审批信息 + /// + /// 查看审批信息 + /// + /// + /// + protected void btnSee_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectChemicalReport report = BLL.ProjectChemicalReportService.GetChemicalReportByProjectIdAndYearAndMonth(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.ChemicalReportId, "查看 - "))); + } + else + { + ShowNotify("所选月份无记录!", MessageBoxIcon.Warning); + } + } + #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(); + MultiHeaderTable mht = new 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("lblNumber") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + sb.Append(""); + } + sb.Append("
{0}
"); + return sb.ToString(); + } + + #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 + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReport.aspx.designer.cs new file mode 100644 index 00000000..51dc6942 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReport.aspx.designer.cs @@ -0,0 +1,249 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental { + + + public partial class ProjectChemicalReport { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// RegionPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RegionPanel RegionPanel1; + + /// + /// Region2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Region Region2; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpMonth; + + /// + /// BtnBulletLeft 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletLeft; + + /// + /// BtnBulletRight 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletRight; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSee 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSee; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// btnAudit1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit1; + + /// + /// btnAudit2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit2; + + /// + /// lbUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbUnitName; + + /// + /// lbFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbFillingDate; + + /// + /// lbDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDutyPerson; + + /// + /// lbHandleMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbHandleMan; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window4; + + /// + /// Window5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window5; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReportSave.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReportSave.aspx new file mode 100644 index 00000000..c211fd1e --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReportSave.aspx @@ -0,0 +1,128 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectChemicalReportSave.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ProjectChemicalReportSave" %> + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReportSave.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReportSave.aspx.cs new file mode 100644 index 00000000..668ad704 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReportSave.aspx.cs @@ -0,0 +1,1708 @@ +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ProjectChemicalReportSave : PageBase + { + #region 定义变量 + /// + /// 报表主键Id + /// + public string ChemicalReportId + { + get + { + return (string)ViewState["ChemicalReportId"]; + } + set + { + ViewState["ChemicalReportId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List items = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + items.Clear(); + BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + string unitId = Request.QueryString["UnitId"]; + string year = Request.QueryString["Year"]; + string months = Request.QueryString["Months"]; + ChemicalReportId = Request.QueryString["ChemicalReportId"]; + if (!string.IsNullOrEmpty(Request.QueryString["type"])) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = false; + } + else + { + this.btnSave.Hidden = false; + this.btnUpdata.Hidden = true; + } + if (!String.IsNullOrEmpty(ChemicalReportId)) + { + items = BLL.ProjectChemicalReportItemService.GetShowItems(ChemicalReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + var report = BLL.ProjectChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId); + if (report != null) + { + //this.btnCopy.Hidden = true; + //if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.hfnbdId) + //{ + // this.btnSave.Hidden = false; + //} + if (report.UpState == BLL.Const.UpState_3) + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = true; + } + drpMonth.SelectedValue = report.Month.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + this.CurrUser.LoginProjectId = report.ProjectId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + } + } + else + { + //this.btnCopy.Hidden = false; + drpMonth.SelectedValue = months; + drpYear.SelectedValue = year; + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + txtDutyPerson.Text = this.CurrUser.UserName; + //增加明细集合 + GetNewItems(year, months); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + SetUnEditableRow(); + GetData(); + } + else + { + if (GetRequestEventArgument() == "UPDATE_SUMMARY") + { + GetData(); + } + } + } + #endregion + + #region 设置不可编辑行 + private void SetUnEditableRow() + { + if (Grid1.Rows.Count == 99) + { + Grid1.Rows[0].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[0].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[17].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[18].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[18].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[21].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[22].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[23].CellCssClasses[5] = "f-grid-cell-uneditable"; + //Grid1.Rows[33].CellCssClasses[4] = "f-grid-cell-uneditable"; + //Grid1.Rows[33].CellCssClasses[5] = "f-grid-cell-uneditable"; + Grid1.Rows[96].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[96].CellCssClasses[5] = "f-grid-cell-uneditable"; + } + var lastYearReport = ProjectChemicalReportService.GetChemicalReportByProjectIdYear(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); + if (lastYearReport.Count > 0) + { + var lastYearReportItems = ProjectChemicalReportItemService.GetLastYearItems(Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1); + Grid1.Rows[1].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[2].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[3].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[4].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[5].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[6].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[7].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[8].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[9].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[10].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[11].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[12].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[13].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[14].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "15").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[15].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[16].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[17].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[18].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "19").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[19].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[20].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[21].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[22].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[23].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[24].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[25].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[26].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[27].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[28].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[29].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[30].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[31].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[32].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[33].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[34].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[35].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[36].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[37].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[38].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[39].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[40].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[41].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[42].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[43].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[44].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[45].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[46].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[47].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[48].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[49].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[50].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[51].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[52].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[53].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[54].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[55].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[56].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[57].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[58].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "59").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[59].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[60].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[61].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "62").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[62].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "63").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[63].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "64").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[64].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "65").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[65].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "66").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[66].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "67").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[67].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "68").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[68].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "69").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[69].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "70").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[70].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "71").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[71].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "72").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[72].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "73").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[73].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "74").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[74].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "75").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[75].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "76").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[76].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "77").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[77].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "78").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[78].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "79").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[79].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "80").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[80].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "81").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[81].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "82").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[82].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "83").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[83].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "84").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[84].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "85").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[85].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "86").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[86].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "87").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[87].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "88").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[88].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "89").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[89].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "90").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[90].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "91").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[91].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "92").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[92].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "93").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[93].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "94").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[94].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "95").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[95].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "96").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[96].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "97").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[97].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "98").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + Grid1.Rows[98].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "99").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue)); + SetLastYearUnEditableRow(); + } + else + { + DateTime lastMonth = Convert.ToDateTime(drpYear.SelectedValue + "-" + drpMonth.SelectedValue + "-01").AddMonths(-1); + Environmental_ProjectChemicalReport lastMonthReport = ProjectChemicalReportService.GetChemicalReportByProjectIdDate(this.CurrUser.LoginProjectId, lastMonth.Year, lastMonth.Month); + if (lastMonthReport != null) + { + var lastMonthReportItems = BLL.ProjectChemicalReportItemService.GetItems(lastMonthReport.ChemicalReportId); + Grid1.Rows[1].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[2].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[3].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[4].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "05").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[5].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "06").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[6].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "07").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[7].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "08").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[8].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "09").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[9].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "10").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[10].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "11").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[11].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "12").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[12].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "13").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[13].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "14").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[14].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "15").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[15].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "16").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[16].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "17").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[17].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "18").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[18].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "19").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[19].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "20").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[20].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "21").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[21].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "22").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[22].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "23").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[23].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "24").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[24].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "25").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[25].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "26").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[26].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "27").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[27].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "28").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[28].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "29").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[29].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "30").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[30].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "31").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[31].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "32").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[32].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "33").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[33].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "34").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[34].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "35").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[35].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "36").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[36].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "37").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[37].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "38").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[38].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "39").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[39].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "40").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[40].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "41").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[41].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "42").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[42].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "43").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[43].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "44").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[44].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "45").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[45].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "46").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[46].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "47").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[47].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "48").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[48].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "49").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[49].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "50").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[50].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "51").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[51].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "52").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[52].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "53").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[53].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "54").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[54].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "55").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[55].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "56").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[56].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "57").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[57].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[58].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "59").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[59].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[60].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[61].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "62").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[62].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "63").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[63].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "64").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[64].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "65").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[65].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "66").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[66].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "67").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[67].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "68").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[68].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "69").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[69].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "70").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[70].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "71").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[71].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "72").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[72].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "73").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[73].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "74").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[74].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "75").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[75].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "76").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[76].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "77").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[77].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "78").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[78].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "79").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[79].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "80").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[80].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "81").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[81].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "82").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[82].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "83").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[83].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "84").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[84].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "85").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[85].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "86").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[86].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "87").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[87].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "88").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[88].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "89").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[89].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "90").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[90].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "91").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[91].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "92").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[92].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "93").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[93].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "94").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[94].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "95").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[95].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "96").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[96].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "97").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[97].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "98").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + Grid1.Rows[98].Values[4] = lastMonthReportItems.Where(x => x.SortIndex == "99").Sum(x => Funs.GetNewDecimalOrZero(x.LastYearValue)); + SetLastYearUnEditableRow(); + } + } + } + + private void SetLastYearUnEditableRow() + { + Grid1.Rows[1].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[2].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[3].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[4].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[5].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[6].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[7].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[8].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[9].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[10].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[11].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[12].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[13].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[14].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[16].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[18].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[20].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[24].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[25].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[26].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[27].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[28].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[29].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[30].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[31].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[32].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[33].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[34].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[35].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[36].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[37].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[38].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[39].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[40].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[41].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[42].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[43].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[44].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[45].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[46].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[47].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[48].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[49].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[50].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[51].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[52].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[53].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[54].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[55].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[56].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[57].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[58].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[59].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[60].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[61].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[62].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[63].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[64].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[65].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[66].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[67].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[68].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[69].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[70].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[71].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[72].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[73].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[74].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[75].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[76].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[77].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[78].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[79].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[80].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[81].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[82].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[83].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[84].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[85].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[86].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[87].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[88].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[89].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[90].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[91].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[92].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[93].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[94].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[95].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[96].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[97].CellCssClasses[4] = "f-grid-cell-uneditable"; + Grid1.Rows[98].CellCssClasses[4] = "f-grid-cell-uneditable"; + } + #endregion + + #region 计算方法 + /// + /// 计算方法 + /// + private void GetData() + { + decimal E6 = 0, F6 = 0, E7 = 0, F7 = 0, E8, F8, E9, F9, E10 = 0, F10 = 0, E11 = 0, F11 = 0, E12 = 0, F12 = 0, E13 = 0, F13 = 0, E14 = 0, F14 = 0, E15 = 0, F15 = 0, E16 = 0, F16 = 0, E17 = 0, F17 = 0, E18 = 0, F18 = 0, E19 = 0, F19 = 0, + E21 = 0, F21 = 0, E22 = 0, F22 = 0, E23 = 0, F23 = 0, E25 = 0, F25 = 0, E26 = 0, F26 = 0, E27 = 0, F27 = 0, E28 = 0, F28 = 0, E29, F29, E30, F30, E31, F31, E32, F32, E33, F33, E34, F34, E35, F35, E36, F36, E37, F37, E38, F38, E39, F39, E40, F40, E41, F41, + E42, F42, E43, F43, E44, F44, E45, F45, E46, F46, E47, F47, E48, F48, E49, F49, E50, F50, E51, F51, E52, F52, E53, F53, E54, F54, E55, F55, + E56, F56, E57, F57, E58, F58, E59, F59, E60, F60, E61, F61, E62, F62, E63, F63, E64, F64, E65, F65, E66, F66, E67, F67, E68, F68, E69, F69, + E70, F70, E71, F71, E72, F72, E73, F73, E74, F74, E75, F75, E76, F76, E77, F77, E78, F78, E79, F79, E80, F80, E81, F81, E82, F82, E83, F83, + E84, F84, E85, F85, E86, F86, E87, F87, E88, F88, E89, F89, E90, F90, E91, F91, E92, F92, E93, F93, E94, F94, E95, F95, E96, F96, E97, F97, + E98, F98, E99, F99, E100, F100, E102 = 0, F102 = 0, E103 = 0, F103 = 0; + JArray mergedData = Grid1.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + string sortIndex = values.Value("SortIndex"); + var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (item != null) + { + item.BaseNumber = System.Web.HttpUtility.HtmlDecode(values.Value("BaseNumber")); + item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); + item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); + + } + } + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + SetUnEditableRow(); + foreach (JObject mergedRow in mergedData) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + if (rowIndex == 1) + { + E6 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F6 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E6 > 0 && F6 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F6 - E6) * 100 / E6, 2).ToString() + "%"; + } + } + else if (rowIndex == 2) + { + E7 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F7 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E7 > 0 && F7 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F7 - E7) * 100 / E7, 2).ToString() + "%"; + } + } + else if (rowIndex == 3) + { + E8 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F8 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E8 > 0 && F8 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F8 - E8) * 100 / E8, 2).ToString() + "%"; + } + } + else if (rowIndex == 4) + { + E9 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F9 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E9 > 0 && F9 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F9 - E9) * 100 / E9, 2).ToString() + "%"; + } + } + else if (rowIndex == 5) + { + E10 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F10 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E10 > 0 && F10 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F10 - E10) * 100 / E10, 2).ToString() + "%"; + } + } + else if (rowIndex == 6) + { + E11 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F11 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E11 > 0 && F11 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F11 - E11) * 100 / E11, 2).ToString() + "%"; + } + } + else if (rowIndex == 7) + { + E12 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F12 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E12 > 0 && F12 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F12 - E12) * 100 / E12, 2).ToString() + "%"; + } + } + else if (rowIndex == 8) + { + E13 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F13 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E13 > 0 && F13 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F13 - E13) * 100 / E13, 2).ToString() + "%"; + } + } + else if (rowIndex == 9) + { + E14 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F14 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E14 > 0 && F14 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F14 - E14) * 100 / E14, 2).ToString() + "%"; + } + } + else if (rowIndex == 10) + { + E15 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F15 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E15 > 0 && F15 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F15 - E15) * 100 / E15, 2).ToString() + "%"; + } + } + else if (rowIndex == 11) + { + E16 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F16 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E16 > 0 && F16 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F16 - E16) * 100 / E16, 2).ToString() + "%"; + } + } + else if (rowIndex == 12) + { + E17 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F17 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E17 > 0 && F17 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F17 - E17) * 100 / E17, 2).ToString() + "%"; + } + } + else if (rowIndex == 13) + { + E18 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F18 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E18 > 0 && F18 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F18 - E18) * 100 / E18, 2).ToString() + "%"; + } + } + else if (rowIndex == 14) + { + E19 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F19 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E19 > 0 && F19 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F19 - E19) * 100 / E19, 2).ToString() + "%"; + } + } + else if (rowIndex == 16) + { + E21 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F21 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E21 > 0 && F21 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F21 - E21) * 100 / E21, 2).ToString() + "%"; + } + } + else if (rowIndex == 17) + { + E22 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F22 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E22 > 0 && F22 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F22 - E22) * 100 / E22, 2).ToString() + "%"; + } + } + else if (rowIndex == 18) + { + E23 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F23 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E23 > 0 && F23 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F23 - E23) * 100 / E23, 2).ToString() + "%"; + } + } + else if (rowIndex == 20) + { + E25 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F25 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E25 > 0 && F25 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F25 - E25) * 100 / E25, 2).ToString() + "%"; + } + } + else if (rowIndex == 21) + { + E26 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F26 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E26 > 0 && F26 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F26 - E26) * 100 / E26, 2).ToString() + "%"; + } + } + else if (rowIndex == 22) + { + E27 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F27 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E27 > 0 && F27 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F27 - E27) * 100 / E27, 2).ToString() + "%"; + } + } + else if (rowIndex == 23) + { + E28 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F28 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E28 > 0 && F28 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F28 - E28) * 100 / E28, 2).ToString() + "%"; + } + } + else if (rowIndex == 24) + { + E29 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F29 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E29 > 0 && F29 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F29 - E29) * 100 / E29, 2).ToString() + "%"; + } + } + else if (rowIndex == 25) + { + E30 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F30 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E30 > 0 && F30 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F30 - E30) * 100 / E30, 2).ToString() + "%"; + } + } + else if (rowIndex == 26) + { + E31 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F31 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E31 > 0 && F31 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F31 - E31) * 100 / E31, 2).ToString() + "%"; + } + } + else if (rowIndex == 27) + { + E32 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F32 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E32 > 0 && F32 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F32 - E32) * 100 / E32, 2).ToString() + "%"; + } + } + else if (rowIndex == 28) + { + E33 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F33 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E33 > 0 && F33 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F33 - E33) * 100 / E33, 2).ToString() + "%"; + } + } + else if (rowIndex == 29) + { + E34 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F34 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E34 > 0 && F34 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F34 - E34) * 100 / E34, 2).ToString() + "%"; + } + } + else if (rowIndex == 30) + { + E35 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F35 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E35 > 0 && F35 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F35 - E35) * 100 / E35, 2).ToString() + "%"; + } + } + else if (rowIndex == 31) + { + E36 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F36 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E36 > 0 && F36 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F36 - E36) * 100 / E36, 2).ToString() + "%"; + } + } + else if (rowIndex == 32) + { + E37 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F37 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E37 > 0 && F37 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F37 - E37) * 100 / E37, 2).ToString() + "%"; + } + } + else if (rowIndex == 33) + { + E38 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F38 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E38 > 0 && F38 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F38 - E38) * 100 / E38, 2).ToString() + "%"; + } + } + else if (rowIndex == 34) + { + E39 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F39 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E39 > 0 && F39 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F39 - E39) * 100 / E39, 2).ToString() + "%"; + } + } + else if (rowIndex == 35) + { + E40 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F40 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E40 > 0 && F40 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F40 - E40) * 100 / E40, 2).ToString() + "%"; + } + } + else if (rowIndex == 36) + { + E41 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F41 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E41 > 0 && F41 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F41 - E41) * 100 / E41, 2).ToString() + "%"; + } + } + else if (rowIndex == 37) + { + E42 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F42 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E42 > 0 && F42 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F42 - E42) * 100 / E42, 2).ToString() + "%"; + } + } + else if (rowIndex == 38) + { + E43 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F43 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E43 > 0 && F43 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F43 - E43) * 100 / E43, 2).ToString() + "%"; + } + } + else if (rowIndex == 39) + { + E44 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F44 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E44 > 0 && F44 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F44 - E44) * 100 / E44, 2).ToString() + "%"; + } + } + else if (rowIndex == 40) + { + E45 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F45 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E45 > 0 && F45 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F45 - E45) * 100 / E45, 2).ToString() + "%"; + } + } + else if (rowIndex == 41) + { + E46 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F46 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E46 > 0 && F46 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F46 - E46) * 100 / E46, 2).ToString() + "%"; + } + } + else if (rowIndex == 42) + { + E47 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F47 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E47 > 0 && F47 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F47 - E47) * 100 / E47, 2).ToString() + "%"; + } + } + else if (rowIndex == 43) + { + E48 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F48 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E48 > 0 && F48 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F48 - E48) * 100 / E48, 2).ToString() + "%"; + } + } + else if (rowIndex == 44) + { + E49 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F49 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E49 > 0 && F49 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F49 - E49) * 100 / E49, 2).ToString() + "%"; + } + } + else if (rowIndex == 45) + { + E50 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F50 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E50 > 0 && F50 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F50 - E50) * 100 / E50, 2).ToString() + "%"; + } + } + else if (rowIndex == 46) + { + E51 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F51 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E51 > 0 && F51 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F51 - E51) * 100 / E51, 2).ToString() + "%"; + } + } + else if (rowIndex == 47) + { + E52 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F52 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E52 > 0 && F52 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F52 - E52) * 100 / E52, 2).ToString() + "%"; + } + } + else if (rowIndex == 48) + { + E53 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F53 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E53 > 0 && F53 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F53 - E53) * 100 / E53, 2).ToString() + "%"; + } + } + else if (rowIndex == 49) + { + E54 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F54 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E54 > 0 && F54 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F54 - E54) * 100 / E54, 2).ToString() + "%"; + } + } + else if (rowIndex == 50) + { + E55 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F55 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E55 > 0 && F55 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F55 - E55) * 100 / E55, 2).ToString() + "%"; + } + } + else if (rowIndex == 51) + { + E56 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F56 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E56 > 0 && F56 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F56 - E56) * 100 / E56, 2).ToString() + "%"; + } + } + else if (rowIndex == 52) + { + E57 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F57 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E57 > 0 && F57 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F57 - E57) * 100 / E57, 2).ToString() + "%"; + } + } + else if (rowIndex == 53) + { + E58 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F58 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E58 > 0 && F58 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F58 - E58) * 100 / E58, 2).ToString() + "%"; + } + } + else if (rowIndex == 54) + { + E59 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F59 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E59 > 0 && F59 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F59 - E59) * 100 / E59, 2).ToString() + "%"; + } + } + else if (rowIndex == 55) + { + E60 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F60 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E60 > 0 && F60 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F60 - E60) * 100 / E60, 2).ToString() + "%"; + } + } + else if (rowIndex == 56) + { + E61 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F61 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E61 > 0 && F61 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F61 - E61) * 100 / E61, 2).ToString() + "%"; + } + } + else if (rowIndex == 57) + { + E62 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F62 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E62 > 0 && F62 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F62 - E62) * 100 / E62, 2).ToString() + "%"; + } + } + else if (rowIndex == 58) + { + E63 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F63 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E63 > 0 && F63 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F63 - E63) * 100 / E63, 2).ToString() + "%"; + } + } + else if (rowIndex == 59) + { + E64 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F64 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E64 > 0 && F64 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F64 - E64) * 100 / E64, 2).ToString() + "%"; + } + } + else if (rowIndex == 60) + { + E65 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F65 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E65 > 0 && F65 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F65 - E65) * 100 / E65, 2).ToString() + "%"; + } + } + else if (rowIndex == 61) + { + E66 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F66 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E66 > 0 && F66 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F66 - E66) * 100 / E66, 2).ToString() + "%"; + } + } + else if (rowIndex == 62) + { + E67 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F67 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E67 > 0 && F67 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F67 - E67) * 100 / E67, 2).ToString() + "%"; + } + } + else if (rowIndex == 63) + { + E68 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F68 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E68 > 0 && F68 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F68 - E68) * 100 / E68, 2).ToString() + "%"; + } + } + else if (rowIndex == 64) + { + E69 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F69 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E69 > 0 && F69 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F69 - E69) * 100 / E69, 2).ToString() + "%"; + } + } + else if (rowIndex == 65) + { + E70 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F70 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E70 > 0 && F70 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F70 - E70) * 100 / E70, 2).ToString() + "%"; + } + } + else if (rowIndex == 66) + { + E71 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F71 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E71 > 0 && F71 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F71 - E71) * 100 / E71, 2).ToString() + "%"; + } + } + else if (rowIndex == 67) + { + E72 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F72 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E72 > 0 && F72 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F72 - E72) * 100 / E72, 2).ToString() + "%"; + } + } + else if (rowIndex == 68) + { + E73 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F73 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E73 > 0 && F73 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F73 - E73) * 100 / E73, 2).ToString() + "%"; + } + } + else if (rowIndex == 69) + { + E74 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F74 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E74 > 0 && F74 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F74 - E74) * 100 / E74, 2).ToString() + "%"; + } + } + else if (rowIndex == 70) + { + E75 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F75 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E75 > 0 && F75 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F75 - E75) * 100 / E75, 2).ToString() + "%"; + } + } + else if (rowIndex == 71) + { + E76 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F76 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E76 > 0 && F76 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F76 - E76) * 100 / E76, 2).ToString() + "%"; + } + } + else if (rowIndex == 72) + { + E77 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F77 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E77 > 0 && F77 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F77 - E77) * 100 / E77, 2).ToString() + "%"; + } + } + else if (rowIndex == 73) + { + E78 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F78 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E78 > 0 && F78 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F78 - E78) * 100 / E78, 2).ToString() + "%"; + } + } + else if (rowIndex == 74) + { + E79 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F79 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E79 > 0 && F79 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F79 - E79) * 100 / E79, 2).ToString() + "%"; + } + } + else if (rowIndex == 75) + { + E80 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F80 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E80 > 0 && F80 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F80 - E80) * 100 / E80, 2).ToString() + "%"; + } + } + else if (rowIndex == 76) + { + E81 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F81 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E81 > 0 && F81 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F81 - E81) * 100 / E81, 2).ToString() + "%"; + } + } + else if (rowIndex == 77) + { + E82 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F82 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E82 > 0 && F82 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F82 - E82) * 100 / E82, 2).ToString() + "%"; + } + } + else if (rowIndex == 78) + { + E83 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F83 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E83 > 0 && F83 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F83 - E83) * 100 / E83, 2).ToString() + "%"; + } + } + else if (rowIndex == 79) + { + E84 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F84 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E84 > 0 && F84 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F84 - E84) * 100 / E84, 2).ToString() + "%"; + } + } + else if (rowIndex == 80) + { + E85 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F85 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E85 > 0 && F85 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F85 - E85) * 100 / E85, 2).ToString() + "%"; + } + } + else if (rowIndex == 81) + { + E86 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F86 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E86 > 0 && F86 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F86 - E86) * 100 / E86, 2).ToString() + "%"; + } + } + else if (rowIndex == 82) + { + E87 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F87 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E87 > 0 && F87 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F87 - E87) * 100 / E87, 2).ToString() + "%"; + } + } + else if (rowIndex == 83) + { + E88 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F88 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E88 > 0 && F88 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F88 - E88) * 100 / E88, 2).ToString() + "%"; + } + } + else if (rowIndex == 84) + { + E89 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F89 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E89 > 0 && F89 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F89 - E89) * 100 / E89, 2).ToString() + "%"; + } + } + else if (rowIndex == 85) + { + E90 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F90 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E90 > 0 && F90 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F90 - E90) * 100 / E90, 2).ToString() + "%"; + } + } + else if (rowIndex == 86) + { + E91 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F91 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E91 > 0 && F91 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F91 - E91) * 100 / E91, 2).ToString() + "%"; + } + } + else if (rowIndex == 87) + { + E92 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F92 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E92 > 0 && F92 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F92 - E92) * 100 / E92, 2).ToString() + "%"; + } + } + else if (rowIndex == 88) + { + E93 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F93 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E93 > 0 && F93 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F93 - E93) * 100 / E93, 2).ToString() + "%"; + } + } + else if (rowIndex == 89) + { + E94 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F94 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E94 > 0 && F94 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F94 - E94) * 100 / E94, 2).ToString() + "%"; + } + } + else if (rowIndex == 90) + { + E95 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F95 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E95 > 0 && F95 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F95 - E95) * 100 / E95, 2).ToString() + "%"; + } + } + else if (rowIndex == 91) + { + E96 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F96 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E96 > 0 && F96 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F96 - E96) * 100 / E96, 2).ToString() + "%"; + } + } + else if (rowIndex == 92) + { + E97 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F97 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E97 > 0 && F97 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F97 - E97) * 100 / E97, 2).ToString() + "%"; + } + } + else if (rowIndex == 93) + { + E98 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F98 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E98 > 0 && F98 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F98 - E98) * 100 / E98, 2).ToString() + "%"; + } + } + else if (rowIndex == 94) + { + E99 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F99 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E99 > 0 && F99 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F99 - E99) * 100 / E99, 2).ToString() + "%"; + } + } + else if (rowIndex == 95) + { + E100 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F100 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E100 > 0 && F100 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F100 - E100) * 100 / E100, 2).ToString() + "%"; + } + } + else if (rowIndex == 97) + { + E102 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F102 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E102 > 0 && F102 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F102 - E102) * 100 / E102, 2).ToString() + "%"; + } + } + else if (rowIndex == 98) + { + E103 = Funs.GetNewDecimalOrZero(values.Value("LastYearValue")); + F103 = Funs.GetNewDecimalOrZero(values.Value("ThisYearValue")); + if (E103 > 0 && F103 > 0) + { + this.Grid1.Rows[rowIndex].Values[6] = decimal.Round((F103 - E103) * 100 / E103, 2).ToString() + "%"; + } + } + } + if (E7 > 0 || E10 > 0 || E11 > 0 || E12 > 0 || E13 > 0 || E14 > 0 || E15 > 0 || E16 > 0 || E17 > 0 || E18 > 0 || E19 > 0) + { + this.Grid1.Rows[0].Values[4] = (E7 + (E10 * Convert.ToDecimal(0.9714) + E11 * Convert.ToDecimal(1.229) + E12 * Convert.ToDecimal(1.4286) + E13 * Convert.ToDecimal(1.4714) + E14 * Convert.ToDecimal(1.4714) + E15 * Convert.ToDecimal(1.4571) + E16 * Convert.ToDecimal(1.4286) + E17 * Convert.ToDecimal(13.3) + E18 * Convert.ToDecimal(0.0341) + E19) / 10000); + } + if (F7 > 0 || F10 > 0 || F11 > 0 || F12 > 0 || F13 > 0 || F14 > 0 || F15 > 0 || F16 > 0 || F17 > 0 || F18 > 0 || F19 > 0) + { + this.Grid1.Rows[0].Values[5] = (F7 + (F10 * Convert.ToDecimal(0.9714) + F11 * Convert.ToDecimal(1.229) + F12 * Convert.ToDecimal(1.4286) + F13 * Convert.ToDecimal(1.4714) + F14 * Convert.ToDecimal(1.4714) + F15 * Convert.ToDecimal(1.4571) + F16 * Convert.ToDecimal(1.4286) + F17 * Convert.ToDecimal(13.3) + F18 * Convert.ToDecimal(0.0341) + F19) / 10000); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && !string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString())) + { + this.Grid1.Rows[0].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()), 2).ToString() + "%"; + } + if (E6 > 0 && E21 > 0) + { + this.Grid1.Rows[15].Values[4] = decimal.Round(E6 * 10000 / E21, 4); + } + if (F6 > 0 && F21 > 0) + { + this.Grid1.Rows[15].Values[5] = decimal.Round(F6 * 10000 / F21, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[15].Values[4].ToString()) && !string.IsNullOrEmpty(this.Grid1.Rows[15].Values[5].ToString())) + { + this.Grid1.Rows[15].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[4].ToString()), 2).ToString() + "%"; + } + if (E6 > 0 && E25 > 0) + { + this.Grid1.Rows[19].Values[4] = decimal.Round(E6 * 10000 / E25, 4); + } + if (F6 > 0 && F25 > 0) + { + this.Grid1.Rows[19].Values[5] = decimal.Round(F6 * 10000 / F25, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[19].Values[4].ToString()) && !string.IsNullOrEmpty(this.Grid1.Rows[19].Values[5].ToString())) + { + this.Grid1.Rows[19].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[4].ToString()), 2).ToString() + "%"; + } + if (E102 > 0 && E103 > 0 && E21 > 0) + { + this.Grid1.Rows[96].Values[4] = decimal.Round((E102 + E103) / E21, 4); + } + if (F102 > 0 && F103 > 0 && F21 > 0) + { + this.Grid1.Rows[96].Values[5] = decimal.Round((F102 + F103) / F21, 4); + } + if (!string.IsNullOrEmpty(this.Grid1.Rows[96].Values[4].ToString()) && !string.IsNullOrEmpty(this.Grid1.Rows[96].Values[5].ToString())) + { + this.Grid1.Rows[96].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[96].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[96].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[96].Values[4].ToString()), 2).ToString() + "%"; + } + + + + + + + + + + + //this.Grid1.Rows[0].Values[15] = totalRateSum; + //this.Grid1.Rows[0].Values[16] = totalCompleteValueSumAll; + //this.Grid1.Rows[0].Values[17] = totalRateSumAll; + //this.Grid1.Rows[0].Values[19] = totalRealValueSum; + //this.Grid1.Rows[0].Values[20] = Funs.GetNewDecimalOrZero(firstValues.Value("RealValueTotalPart")) + totalRealValueSum; + //this.Grid1.Rows[0].Values[22] = totalCompleteValueSumAll - Funs.GetNewDecimalOrZero(firstValues.Value("PlanValueTotal")); + //this.Grid1.Rows[0].Values[23] = totalCompleteValueSumAll - (Funs.GetNewDecimalOrZero(firstValues.Value("RealValueTotalPart")) + totalRealValueSum); + } + #endregion + + #region 关闭窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + Model.Environmental_ProjectChemicalReport report = BLL.ProjectChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId); + this.btnSave.Hidden = false; + } + #endregion + + #region 保存、上报 + /// + /// 保存数据 + /// + /// + private void Save(string type) + { + //string ChemicalReportId = Request.QueryString["ChemicalReportId"]; + Model.Environmental_ProjectChemicalReport report = new Environmental_ProjectChemicalReport + { + ProjectId = this.CurrUser.LoginProjectId, + Year = Funs.GetNewIntOrZero(drpYear.SelectedValue), + Month = Funs.GetNewIntOrZero(drpMonth.SelectedValue) + }; + if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim())) + { + report.FillingDate = Convert.ToDateTime(txtFillingDate.Text.Trim()); + } + report.DutyPerson = txtDutyPerson.Text.Trim(); + if (String.IsNullOrEmpty(ChemicalReportId)) + { + Environmental_ProjectChemicalReport old = ProjectChemicalReportService.GetChemicalReportByProjectIdDate(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue)); + if (old == null) + { + report.ChemicalReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectChemicalReport)); + report.UpState = BLL.Const.UpState_2; + report.FillingMan = this.CurrUser.UserName; + BLL.ProjectChemicalReportService.AddChemicalReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ChemicalReportId, BLL.Const.ProjectChemicalReportMenuId, BLL.Const.BtnAdd); + } + else + { + ShowNotify("该月份记录已存在!", MessageBoxIcon.Warning); + return; + } + } + else + { + Model.Environmental_ProjectChemicalReport oldReport = BLL.ProjectChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId); + report.ChemicalReportId = ChemicalReportId; + report.UpState = BLL.Const.UpState_2; + BLL.ProjectChemicalReportService.UpdateChemicalReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ChemicalReportId, BLL.Const.ProjectChemicalReportMenuId, BLL.Const.BtnModify); + } + ChemicalReportId = report.ChemicalReportId; + BLL.ProjectChemicalReportItemService.DeleteChemicalReportItemByChemicalReportId(report.ChemicalReportId); + List mReportItemList = new List(); + GetItems(report.ChemicalReportId); + foreach (var item in items) + { + Model.Environmental_ProjectChemicalReportItem newItem = new Environmental_ProjectChemicalReportItem(); + newItem.ChemicalReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectChemicalReportItem)); + newItem.ChemicalReportId = report.ChemicalReportId; + newItem.SortIndex = System.Web.HttpUtility.HtmlDecode(item.SortIndex); + newItem.BaseNumber = System.Web.HttpUtility.HtmlDecode(item.BaseNumber); + newItem.LastYearValue = System.Web.HttpUtility.HtmlDecode(item.LastYearValue); + newItem.ThisYearValue = System.Web.HttpUtility.HtmlDecode(item.ThisYearValue); + newItem.Rate = System.Web.HttpUtility.HtmlDecode(item.Rate); + ProjectChemicalReportItemService.AddChemicalReportItem(newItem); + mReportItemList.Add(newItem); + } + if (type == "updata") //数据同步 + { + if (report.UpState == BLL.Const.UpState_2) + { + string code = CNCECHSSEWebService.UpChemicalReport(report.ChemicalReportId, this.CurrUser); + if (code == "1") + { + ShowNotify("同步成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + return; + } + else + { + Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); + } + } + else + { + ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning); + return; + } + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + Save("add"); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + protected void btnUpdata_Click(object sender, EventArgs e) + { + Save("updata"); + } + + protected void btnSubmit_Click(object sender, EventArgs e) + { + Save("submit"); + } + #endregion + + #region 增加本月明细 + private void GetItems(string ChemicalReportId) + { + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + int rowIndex = mergedRow.Value("index"); + string sortIndex = values.Value("SortIndex"); + var item = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (item != null) + { + item.LastYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("LastYearValue")); + item.ThisYearValue = System.Web.HttpUtility.HtmlDecode(values.Value("ThisYearValue")); + item.Rate = System.Web.HttpUtility.HtmlDecode(values.Value("Rate")); + } + } + } + #endregion + + #region 获取明细 + private void GetNewItems(string year, string months) + { + var indexNames = ProjectChemicalReportItemService.GetIndexNames(); + var units = ProjectChemicalReportItemService.GetUnits(); + foreach (var indexName in indexNames) + { + //增加明细集合 + Model.ChemicalReportItem item = new ChemicalReportItem + { + ChemicalReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectChemicalReportItem)), + IndexName = indexName.Text, + Unit = units.First(x => x.Value == indexName.Value).Text, + SortIndex = indexName.Value, + }; + //if (item.SortIndex == "18" || item.SortIndex == "19" || item.SortIndex == "22" || item.SortIndex == "23" || item.SortIndex == "24" || item.SortIndex == "34") + //{ + // item.LastYearValue = "×"; + // item.ThisYearValue = "×"; + // if (item.SortIndex == "34") + // { + // item.Rate = "─"; + // } + // else + // { + // item.Rate = "×"; + // } + //} + items.Add(item); + } + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉选择事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + items.Clear(); + if (this.CurrUser.LoginProjectId != BLL.Const._Null) + { + //GetNewItems(); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectChemicalReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + //this.btnCopy.Hidden = false; + } + //if (buttonList.Contains(BLL.Const.BtnSaveUp)) + //{ + // this.btnUpdata.Hidden = false; + //} + } + } + #endregion + + #region 复制上个月数据 + /// + /// 复制上个月的数据 + /// + /// + /// + protected void btnCopy_Click(object sender, EventArgs e) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + showDate = nowDate.Value.AddMonths(-1); + Model.Environmental_ProjectChemicalReport ChemicalReport = BLL.ProjectChemicalReportService.GetChemicalReportByProjectIdAndYearAndMonth(this.CurrUser.LoginProjectId, showDate.Year, showDate.Month); + if (ChemicalReport != null) + { + Model.Environmental_ProjectChemicalReport newChemicalReport = new Environmental_ProjectChemicalReport(); + this.ChemicalReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectChemicalReport)); + newChemicalReport.ChemicalReportId = this.ChemicalReportId; + newChemicalReport.ProjectId = this.CurrUser.LoginProjectId; + newChemicalReport.Year = Convert.ToInt32(this.drpYear.SelectedValue); + newChemicalReport.Month = Convert.ToInt32(this.drpMonth.SelectedValue); + newChemicalReport.FillingMan = this.CurrUser.UserName; + newChemicalReport.FillingDate = DateTime.Now; + newChemicalReport.DutyPerson = this.CurrUser.UserName; + newChemicalReport.UpState = BLL.Const.UpState_2; + BLL.ProjectChemicalReportService.AddChemicalReport(newChemicalReport); + + var oldItems = BLL.ProjectChemicalReportItemService.GetItems(ChemicalReport.ChemicalReportId); + if (oldItems.Count > 0) + { + foreach (var item in oldItems) + { + Model.Environmental_ProjectChemicalReportItem newItem = new Environmental_ProjectChemicalReportItem + { + ChemicalReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectChemicalReportItem)), + ChemicalReportId = this.ChemicalReportId, + SortIndex = item.SortIndex, + LastYearValue = item.LastYearValue, + ThisYearValue = item.ThisYearValue, + Rate = item.Rate, + }; + BLL.ProjectChemicalReportItemService.AddChemicalReportItem(newItem); + } + } + + GetValues(newChemicalReport.ChemicalReportId); + } + } + } + + /// + /// 获取复制的值绑定到文本中 + /// + private void GetValues(string ChemicalReportId) + { + var report = BLL.ProjectChemicalReportService.GetChemicalReportByChemicalReportId(ChemicalReportId); + if (report != null) + { + drpMonth.SelectedValue = report.Month.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + this.CurrUser.LoginProjectId = report.ProjectId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + items = BLL.ProjectChemicalReportItemService.GetShowItems(ChemicalReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReportSave.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReportSave.aspx.designer.cs new file mode 100644 index 00000000..351cc958 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectChemicalReportSave.aspx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental { + + + public partial class ProjectChemicalReportSave { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpMonth; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// txtFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtFillingDate; + + /// + /// txtDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDutyPerson; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// txtBaseNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBaseNumber; + + /// + /// txtLastYearValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtLastYearValue; + + /// + /// txtThisYearValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtThisYearValue; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReport.aspx new file mode 100644 index 00000000..33cf0841 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReport.aspx @@ -0,0 +1,168 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectEnergyReport.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ProjectEnergyReport" %> + + + + + + + 中央企业节能环保产业企业生产和服务业务情况报表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReport.aspx.cs new file mode 100644 index 00000000..f875e545 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReport.aspx.cs @@ -0,0 +1,651 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ProjectEnergyReport : PageBase + { + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + ////取上个报表时间 + DateTime showDate = System.DateTime.Now.AddMonths(-1); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + drpYear.SelectedValue = showDate.Year.ToString(); + GetValue(); + } + } + + private void SetEmpty() + { + this.SimpleForm1.Title = string.Empty; + lbUnitName.Text = "填报企业:"; + lbFillingDate.Text = "填报日期:"; + lbDutyPerson.Text = "负责人:"; + lbHandleMan.Text = string.Empty; + this.Grid1.DataSource = null; + this.Grid1.DataBind(); + } + #endregion + + #region 获取记录值 + private void GetValue() + { + int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + int Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue); + Model.View_Environmental_ProjectEnergyReport report = Funs.DB.View_Environmental_ProjectEnergyReport.FirstOrDefault(e => e.ProjectId == this.CurrUser.LoginProjectId && e.Quarters == Quarters && e.Year == year); + if (report != null) + { + string upState = string.Empty; + if (report.UpState == BLL.Const.UpState_3) + { + upState = "(已上报)"; + } + else + { + upState = "(未上报)"; + } + this.SimpleForm1.Title = "中央企业节能环保产业企业生产和服务业务情况报表" + report.QuartersStr + report.YearStr ; + lbUnitName.Text = "填报企业:" + report.ProjectName; + if (report.FillingDate != null) + { + lbFillingDate.Text = "填报日期:" + string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + else + { + lbFillingDate.Text = "填报日期:"; + } + lbDutyPerson.Text = "负责人:" + report.DutyPerson; + //if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3) + //{ + // this.lbHandleMan.Hidden = true; + //} + //else + //{ + // this.lbHandleMan.Hidden = false; + // lbHandleMan.Text = "下一步办理人:" + report.UserName; + //} + var businessCategorys = ProjectEnergyreportItemService.GetItems("Template"); + //之前月度合计值集合 + List reportItems = BLL.ProjectEnergyreportItemService.GetItems(report.EnergyReportId); + List newItemList = new List(); + foreach (var item in reportItems) + { + Model.Environmental_ProjectEnergyReportItem newItem = new Model.Environmental_ProjectEnergyReportItem(); + newItem.EnergyReportItemId = item.EnergyReportItemId; + newItem.EnergyReportId = item.EnergyReportId; + newItem.SortIndex = item.SortIndex; + newItem.BusinessCategory = item.BusinessCategory; + newItem.Throughput_BasePeriod = item.Throughput_BasePeriod; + newItem.Throughput_LastPeriod = item.Throughput_LastPeriod; + newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod; + newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement; + newItem.Yield_BasePeriod = item.Yield_BasePeriod; + newItem.Yield_LastPeriod = item.Yield_LastPeriod; + newItem.Yield_ThisPeriod = item.Yield_ThisPeriod; + newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement; + newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod; + newItem.OutputValue_LastYear = item.OutputValue_LastYear; + newItem.OutputValue_ThisYear = item.OutputValue_ThisYear; + newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod; + newItem.OperationScale_LastYear = item.OperationScale_LastYear; + newItem.OperationScale_ThisYear = item.OperationScale_ThisYear; + newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement; + newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod; + newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear; + newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear; + newItemList.Add(item); + } + Grid1.DataSource = newItemList; + Grid1.DataBind(); + } + else + { + SetEmpty(); + } + this.GetButtonPower(); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭导入弹出窗口 + /// + /// + /// + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + + /// + /// 关闭查看审批信息弹出窗口 + /// + /// + /// + protected void Window4_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectEnergyReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnDelete.Hidden = false; + } + } + + var getReport = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + this.btnAudit1.Hidden = true; + this.btnAudit2.Hidden = true; + if (getReport != null) + { + this.btnNew.Hidden = true; + //if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入 + //{ + // if (getReport.HandleState == BLL.Const.HandleState_2) + // { + // this.btnAudit1.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_3) + // { + // this.btnAudit2.Hidden = false; + // this.btnEdit.Hidden = true; + // } + // else if (getReport.HandleState == BLL.Const.HandleState_4) + // { + // } + //} + } + } + #endregion + + #region 增加、修改、审核、审批、上报、删除 + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectEnergyReportSave.aspx?UnitId={0}&&Year={1}&&Quarters={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - "))); + } + + /// + /// 修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectEnergyReport report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectEnergyReportSave.aspx?EnergyReportId={0}", report.EnergyReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审核 + /// + /// + /// + protected void btnAudit1_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectEnergyReport report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectEnergyReportSave.aspx?EnergyReportId={0}", report.EnergyReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 审批 + /// + /// + /// + protected void btnAudit2_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectEnergyReport report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectEnergyReportSave.aspx?EnergyReportId={0}", report.EnergyReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 上报 + /// + /// + /// + protected void btnUpdata_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectEnergyReport report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectEnergyReportSave.aspx?EnergyReportId={0}&type=Updata", report.EnergyReportId, "编辑 - "))); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + + /// + /// 删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectEnergyReport report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.EnergyReportId, BLL.Const.ProjectEnergyReportMenuId, BLL.Const.BtnDelete); + BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.EnergyReportId); + BLL.ProjectEnergyreportItemService.DeleteEnergyReportItemByChemicalReportId(report.EnergyReportId); + BLL.ProjectEnergyReportService.DeleteEnvironmental_ProjectEnergyReportById(report.EnergyReportId); + + SetEmpty(); + this.btnNew.Hidden = false; + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify("所选时间无报表记录!"); + } + } + #endregion + + #region 格式化字符串 + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertCompileDate(object CompileDate) + { + if (CompileDate != null) + { + return string.Format("{0:yyyy-MM-dd}", CompileDate); + } + return ""; + } + + /// + /// 把时间转换为文字形式 + /// + /// + /// + protected string ConvertDate(object EnergyReportId) + { + if (EnergyReportId != null) + { + Model.Environmental_ProjectEnergyReport report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportById(EnergyReportId.ToString()); + if (report != null) + { + return report.Year + "年" + report.Quarters + "月"; + } + } + return ""; + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉框联动事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + var units = BLL.UnitService.GetUnitDropDownList(); + if (units != null && !string.IsNullOrEmpty(this.drpUnit.SelectedText)) + { + var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText); + if (unit != null) + { + drpUnit.SelectedValue = unit.UnitId; + } + } + + GetValue(); + } + #endregion + + #region 月份向前/向后 + /// + /// 前一个月 + /// + /// + /// + protected void BtnBulletLeft_Click(object sender, EventArgs e) + { + SetQuartersChange("-"); + } + + /// + /// 后一个月 + /// + /// + /// + protected void BulletRight_Click(object sender, EventArgs e) + { + SetQuartersChange("+"); + } + + /// + /// 月份加减变化 + /// + /// + private void SetQuartersChange(string type) + { + DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString()); + if (nowDate.HasValue) + { + DateTime showDate = new DateTime(); + if (type == "+") + { + showDate = nowDate.Value.AddMonths(3); + } + else + { + showDate = nowDate.Value.AddMonths(-3); + } + + this.drpYear.SelectedValue = showDate.Year.ToString(); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + ///值变化 + GetValue(); + } + } + #endregion + + #region 查看审批信息 + /// + /// 查看审批信息 + /// + /// + /// + protected void btnSee_Click(object sender, EventArgs e) + { + Model.Environmental_ProjectEnergyReport report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (report != null) + { + PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.EnergyReportId, "查看 - "))); + } + else + { + ShowNotify("所选月份无记录!", MessageBoxIcon.Warning); + } + } + #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(); + MultiHeaderTable mht = new 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("lblNumber") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + sb.Append(""); + } + sb.Append("
{0}
"); + return sb.ToString(); + } + + #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 + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReport.aspx.designer.cs new file mode 100644 index 00000000..ae63c927 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReport.aspx.designer.cs @@ -0,0 +1,260 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental +{ + + + public partial class ProjectEnergyReport + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// RegionPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RegionPanel RegionPanel1; + + /// + /// Region2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Region Region2; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// BtnBulletLeft 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletLeft; + + /// + /// BtnBulletRight 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletRight; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSee 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSee; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// btnAudit1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit1; + + /// + /// btnAudit2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit2; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// lbUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbUnitName; + + /// + /// lbFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbFillingDate; + + /// + /// lbDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDutyPerson; + + /// + /// lbHandleMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbHandleMan; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window4; + + /// + /// Window5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window5; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReportSave.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReportSave.aspx new file mode 100644 index 00000000..5ee54736 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReportSave.aspx @@ -0,0 +1,241 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectEnergyReportSave.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Environmental.ProjectEnergyReportSave" %> + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReportSave.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReportSave.aspx.cs new file mode 100644 index 00000000..a853214b --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReportSave.aspx.cs @@ -0,0 +1,503 @@ +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ProjectEnergyReportSave : PageBase + { + #region 定义变量 + /// + /// 报表主键Id + /// + public string EnergyReportId + { + get + { + return (string)ViewState["EnergyReportId"]; + } + set + { + ViewState["EnergyReportId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List items = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (Request.Params["type"] != "-1") + { + this.GetButtonPower(); + } + items.Clear(); + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false); + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false); + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + string unitId = Request.QueryString["UnitId"]; + string year = Request.QueryString["Year"]; + string quarters = Request.QueryString["Quarters"]; + EnergyReportId = Request.QueryString["EnergyReportId"]; + if (!string.IsNullOrEmpty(Request.QueryString["type"])) + { + this.btnSave.Hidden = true; + } + else + { + this.btnSave.Hidden = false; + } + if (!String.IsNullOrEmpty(EnergyReportId)) + { + items = BLL.ProjectEnergyreportItemService.GetShowItems(EnergyReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + var report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportById(EnergyReportId); + if (report != null) + { + //this.btnCopy.Hidden = true; + //if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.hfnbdId) + //{ + // this.btnSave.Hidden = false; + //} + if (report.UpState == BLL.Const.UpState_3) + { + this.btnSave.Hidden = true; + } + drpQuarters.SelectedValue = report.Quarters.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + drpUnit.SelectedValue = report.UnitId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + } + } + else + { + //this.btnCopy.Hidden = false; + drpQuarters.SelectedValue = quarters; + drpYear.SelectedValue = year; + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + txtDutyPerson.Text = this.CurrUser.UserName; + //增加明细集合 + GetNewItems(year, quarters); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + + } + else + { + string arg = GetRequestEventArgument(); // 此函数所在文件:PageBase.cs + if (arg == "UPDATE_SUMMARY") + { + SaveData(); + } + } + + } + void SaveData() + { + List _EnergyReportItems = new List(); + + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + string sortIndex = values.Value("SortIndex"); + var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (newItem != null) + { + newItem.EnergyReportItemId = SQLHelper.GetNewID(); + newItem.EnergyReportId = EnergyReportId; + newItem.SortIndex = values.Value("SortIndex"); + newItem.BusinessCategory = values.Value("BusinessCategory"); + newItem.Throughput_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_BasePeriod")).ToString(); + newItem.Throughput_LastPeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_LastPeriod")).ToString(); + newItem.Throughput_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_ThisPeriod")).ToString(); + newItem.Throughput_UnitOfMeasurement = values.Value("Throughput_UnitOfMeasurement"); + newItem.Yield_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_BasePeriod")).ToString(); + newItem.Yield_LastPeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_LastPeriod")).ToString(); + newItem.Yield_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_ThisPeriod")).ToString(); + newItem.Yield_UnitOfMeasurement = values.Value("Yield_UnitOfMeasurement"); + newItem.OutputValue_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("OutputValue_BasePeriod")).ToString(); + newItem.OutputValue_LastYear = Funs.GetNewDecimalOrZero(values.Value("OutputValue_LastYear")).ToString(); + newItem.OutputValue_ThisYear = Funs.GetNewDecimalOrZero(values.Value("OutputValue_ThisYear")).ToString(); + newItem.OperationScale_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("OperationScale_BasePeriod")).ToString(); + newItem.OperationScale_LastYear = Funs.GetNewDecimalOrZero(values.Value("OperationScale_LastYear")).ToString(); + newItem.OperationScale_ThisYear = Funs.GetNewDecimalOrZero(values.Value("OperationScale_ThisYear")).ToString(); + newItem.OperationScale_UnitOfMeasurement = values.Value("OperationScale_UnitOfMeasurement"); + newItem.ServiceOperatingIncome_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_BasePeriod")).ToString(); + newItem.ServiceOperatingIncome_LastYear = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_LastYear")).ToString(); + newItem.ServiceOperatingIncome_ThisYear = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_ThisYear")).ToString(); + _EnergyReportItems.Add(newItem); + + } + } + this.Grid1.DataSource = _EnergyReportItems; + this.Grid1.DataBind(); + _EnergyReportItems.RemoveAll(x => x.SortIndex == "01"); + var q = (from x in _EnergyReportItems + group x by x.EnergyReportId into g + select new + { + g.Key, + Throughput_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Throughput_BasePeriod)), + Throughput_LastPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Throughput_LastPeriod)), + Throughput_ThisPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Throughput_ThisPeriod)), + Yield_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Yield_BasePeriod)), + Yield_LastPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Yield_LastPeriod)), + Yield_ThisPeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.Yield_ThisPeriod)), + OutputValue_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.OutputValue_BasePeriod)), + OutputValue_LastYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OutputValue_LastYear)), + OutputValue_ThisYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OutputValue_ThisYear)), + OperationScale_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.OperationScale_BasePeriod)), + OperationScale_LastYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OperationScale_LastYear)), + OperationScale_ThisYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.OperationScale_ThisYear)), + ServiceOperatingIncome_BasePeriod = g.Sum(x => Funs.GetNewDecimalOrZero(x.ServiceOperatingIncome_BasePeriod)), + ServiceOperatingIncome_LastYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.ServiceOperatingIncome_LastYear)), + ServiceOperatingIncome_ThisYear = g.Sum(x => Funs.GetNewDecimalOrZero(x.ServiceOperatingIncome_ThisYear)), + } + ).FirstOrDefault(); + this.Grid1.Rows[0].Values[4] = q.Throughput_BasePeriod; + this.Grid1.Rows[0].Values[5] = q.Throughput_LastPeriod; + this.Grid1.Rows[0].Values[6] = q.Throughput_ThisPeriod; + this.Grid1.Rows[0].Values[9] = q.Yield_BasePeriod; + this.Grid1.Rows[0].Values[10] = q.Yield_LastPeriod; + this.Grid1.Rows[0].Values[11] = q.Yield_ThisPeriod; + this.Grid1.Rows[0].Values[14] = q.OutputValue_BasePeriod; + this.Grid1.Rows[0].Values[15] = q.OutputValue_LastYear; + this.Grid1.Rows[0].Values[16] = q.OutputValue_ThisYear; + this.Grid1.Rows[0].Values[19] = q.OperationScale_BasePeriod; + this.Grid1.Rows[0].Values[20] = q.OperationScale_LastYear; + this.Grid1.Rows[0].Values[21] = q.OperationScale_ThisYear; + this.Grid1.Rows[0].Values[24] = q.ServiceOperatingIncome_BasePeriod; + this.Grid1.Rows[0].Values[25] = q.ServiceOperatingIncome_LastYear; + this.Grid1.Rows[0].Values[26] = q.ServiceOperatingIncome_ThisYear; + + } + + protected void Grid1_RowDataBound(object sender, GridRowEventArgs e) + { + Model.Environmental_ProjectEnergyReportItem a = (Model.Environmental_ProjectEnergyReportItem)e.DataItem; + e.DataItem.ToString(); + + //string SortIndex = Convert.ToString(row["SortIndex"]); + if (a.SortIndex == "01") + { + + for (int i = 0; i < e.CellCssClasses.Count(); i++) + { + e.CellCssClasses[i] = "f-grid-cell-uneditable"; + } + + } + } + + #endregion + + + + #region 关闭窗口 + /// + /// 关闭窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + var report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportById(EnergyReportId); + this.btnSave.Hidden = false; + } + #endregion + + #region 保存、上报 + /// + /// 保存数据 + /// + /// + private void Save(string type) + { + //string EnergyReportId = Request.QueryString["EnergyReportId"]; + Model.Environmental_ProjectEnergyReport report = new Environmental_ProjectEnergyReport + { + ProjectId=this.CurrUser.LoginProjectId, + Year = Funs.GetNewIntOrZero(drpYear.SelectedValue), + Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue) + }; + if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim())) + { + report.FillingDate = Convert.ToDateTime(txtFillingDate.Text.Trim()); + } + report.DutyPerson = txtDutyPerson.Text.Trim(); + if (String.IsNullOrEmpty(EnergyReportId)) + { + Environmental_ProjectEnergyReport old = ProjectEnergyReportService.GetEnergyReportByProjectIdDate(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue)); + if (old == null) + { + report.EnergyReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectEnergyReport)); + report.UpState = BLL.Const.UpState_2; + report.FillingMan = this.CurrUser.UserName; + BLL.ProjectEnergyReportService.AddEnvironmental_ProjectEnergyReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.EnergyReportId, BLL.Const.ProjectEnergyReportMenuId, BLL.Const.BtnAdd); + } + else + { + ShowNotify("该月份记录已存在!", MessageBoxIcon.Warning); + return; + } + } + else + { + Model.Environmental_ProjectEnergyReport oldReport = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportById(EnergyReportId); + report.EnergyReportId = EnergyReportId; + report.UpState = BLL.Const.UpState_2; + BLL.ProjectEnergyReportService.UpdateEnvironmental_ProjectEnergyReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.EnergyReportId, BLL.Const.ProjectEnergyReportMenuId, BLL.Const.BtnModify); + } + EnergyReportId = report.EnergyReportId; + BLL.ProjectEnergyreportItemService.DeleteEnergyReportItemByChemicalReportId(report.EnergyReportId); + GetItems(report.EnergyReportId); + ProjectEnergyreportItemService.AddBulkEnvironmental_ProjectEnergyReportItem(items); + if (type == "updata") //数据同步 + { + if (report.UpState == BLL.Const.UpState_2) + { + //string code = CNCECHSSEWebService.UpChemicalReport(report.EnergyReportId, this.CurrUser); + //if (code == "1") + //{ + // ShowNotify("同步成功!", MessageBoxIcon.Success); + // PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + // return; + //} + //else + //{ + // Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); + //} + } + else + { + ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning); + return; + } + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + Save("add"); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + protected void btnUpdata_Click(object sender, EventArgs e) + { + Save("updata"); + } + + protected void btnSubmit_Click(object sender, EventArgs e) + { + Save("submit"); + } + #endregion + + #region 增加本月明细 + private void GetItems(string EnergyReportId) + { + List newItemLists = new List(); + + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + string sortIndex = values.Value("SortIndex"); + var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex); + if (newItem != null) + { + newItem.EnergyReportItemId = SQLHelper.GetNewID(); + newItem.EnergyReportId = EnergyReportId; + newItem.SortIndex = values.Value("SortIndex"); + newItem.BusinessCategory = values.Value("BusinessCategory"); + newItem.Throughput_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_BasePeriod")).ToString(); + newItem.Throughput_LastPeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_LastPeriod")).ToString(); + newItem.Throughput_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value("Throughput_ThisPeriod")).ToString(); + newItem.Throughput_UnitOfMeasurement = values.Value("Throughput_UnitOfMeasurement"); + newItem.Yield_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_BasePeriod")).ToString(); + newItem.Yield_LastPeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_LastPeriod")).ToString(); + newItem.Yield_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value("Yield_ThisPeriod")).ToString(); + newItem.Yield_UnitOfMeasurement = values.Value("Yield_UnitOfMeasurement"); + newItem.OutputValue_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("OutputValue_BasePeriod")).ToString(); + newItem.OutputValue_LastYear = Funs.GetNewDecimalOrZero(values.Value("OutputValue_LastYear")).ToString(); + newItem.OutputValue_ThisYear = Funs.GetNewDecimalOrZero(values.Value("OutputValue_ThisYear")).ToString(); + newItem.OperationScale_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("OperationScale_BasePeriod")).ToString(); + newItem.OperationScale_LastYear = Funs.GetNewDecimalOrZero(values.Value("OperationScale_LastYear")).ToString(); + newItem.OperationScale_ThisYear = Funs.GetNewDecimalOrZero(values.Value("OperationScale_ThisYear")).ToString(); + newItem.OperationScale_UnitOfMeasurement = values.Value("OperationScale_UnitOfMeasurement"); + newItem.ServiceOperatingIncome_BasePeriod = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_BasePeriod")).ToString(); + newItem.ServiceOperatingIncome_LastYear = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_LastYear")).ToString(); + newItem.ServiceOperatingIncome_ThisYear = Funs.GetNewDecimalOrZero(values.Value("ServiceOperatingIncome_ThisYear")).ToString(); + newItemLists.Add(newItem); + } + } + items = newItemLists; + + } + #endregion + + #region 获取明细 + private void GetNewItems(string year, string months) + { + var indexNames = ProjectEnergyreportItemService.GetItems("Template"); + foreach (var indexName in indexNames) + { + //增加明细集合 + Model.Environmental_ProjectEnergyReportItem item = new Environmental_ProjectEnergyReportItem + { + EnergyReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectEnergyReportItem)), + BusinessCategory = indexName.BusinessCategory, + SortIndex = indexName.SortIndex, + }; + + items.Add(item); + } + } + #endregion + + #region 单位下拉选择事件 + /// + /// 单位下拉选择事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + items.Clear(); + if (drpUnit.SelectedValue != BLL.Const._Null) + { + //GetNewItems(); + } + Grid1.DataSource = items; + Grid1.DataBind(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectEnergyReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + //this.btnCopy.Hidden = false; + } + //if (buttonList.Contains(BLL.Const.BtnSaveUp)) + //{ + // this.btnUpdata.Hidden = false; + //} + } + } + #endregion + + #region 复制上个月数据 + /// + /// 复制上个月的数据 + /// + /// + /// + protected void btnCopy_Click(object sender, EventArgs e) + { + //DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue); + //if (nowDate.HasValue) + //{ + // DateTime showDate = new DateTime(); + // showDate = nowDate.Value.AddMonths(-1); + // Model.Environmental_ProjectEnergyReport ChemicalReport = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportByUnitIdAndYearAndMonth(this.drpUnit.SelectedValue, showDate.Year, showDate.Month); + // if (ChemicalReport != null) + // { + // Model.Environmental_ProjectEnergyReport newChemicalReport = new Environmental_ProjectEnergyReport(); + // this.EnergyReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectEnergyReport)); + // newChemicalReport.EnergyReportId = this.EnergyReportId; + // newChemicalReport.UnitId = this.drpUnit.SelectedValue; + // newChemicalReport.Year = Convert.ToInt32(this.drpYear.SelectedValue); + // newChemicalReport.Month = Convert.ToInt32(this.drpMonth.SelectedValue); + // newChemicalReport.FillingMan = this.CurrUser.UserName; + // newChemicalReport.FillingDate = DateTime.Now; + // newChemicalReport.DutyPerson = this.CurrUser.UserName; + // newChemicalReport.UpState = BLL.Const.UpState_2; + // BLL.ProjectEnergyReportService.ad(newChemicalReport); + + // var oldItems = BLL.ProjectEnergyreportItemService.GetItems(ChemicalReport.EnergyReportId); + // if (oldItems.Count > 0) + // { + // foreach (var item in oldItems) + // { + // Model.Environmental_ProjectEnergyReportItem newItem = new Environmental_ProjectEnergyReportItem + // { + // ChemicalReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectEnergyReportItem)), + // EnergyReportId = this.EnergyReportId, + // SortIndex = item.SortIndex, + // LastYearValue = item.LastYearValue, + // ThisYearValue = item.ThisYearValue, + // Rate = item.Rate, + // }; + // BLL.ProjectEnergyreportItemService.AddChemicalReportItem(newItem); + // } + // } + + // GetValues(newChemicalReport.EnergyReportId); + // } + //} + } + + /// + /// 获取复制的值绑定到文本中 + /// + private void GetValues(string EnergyReportId) + { + var report = BLL.ProjectEnergyReportService.GetEnvironmental_ProjectEnergyReportById(EnergyReportId); + if (report != null) + { + drpQuarters.SelectedValue = report.Quarters.ToString(); + drpYear.SelectedValue = report.Year.ToString(); + drpUnit.SelectedValue = report.UnitId; + if (report.FillingDate != null) + { + txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate); + } + txtDutyPerson.Text = report.DutyPerson; + items = BLL.ProjectEnergyreportItemService.GetShowItems(EnergyReportId); + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReportSave.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReportSave.aspx.designer.cs new file mode 100644 index 00000000..d3e59c85 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectEnergyReportSave.aspx.designer.cs @@ -0,0 +1,296 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental +{ + + + public partial class ProjectEnergyReportSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// txtFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtFillingDate; + + /// + /// txtDutyPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDutyPerson; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// txtThroughput_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtThroughput_BasePeriod; + + /// + /// txtThroughput_LastPeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtThroughput_LastPeriod; + + /// + /// txtThroughput_ThisPeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtThroughput_ThisPeriod; + + /// + /// txtThroughput_UnitOfMeasurement 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtThroughput_UnitOfMeasurement; + + /// + /// txtYield_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYield_BasePeriod; + + /// + /// txtYield_LastPeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYield_LastPeriod; + + /// + /// txtYield_ThisPeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYield_ThisPeriod; + + /// + /// txtYield_UnitOfMeasurement 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtYield_UnitOfMeasurement; + + /// + /// txtOutputValue_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOutputValue_BasePeriod; + + /// + /// txtOutputValue_LastYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOutputValue_LastYear; + + /// + /// txtOutputValue_ThisYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOutputValue_ThisYear; + + /// + /// txtOperationScale_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOperationScale_BasePeriod; + + /// + /// ttxOperationScale_LastYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox ttxOperationScale_LastYear; + + /// + /// txtOperationScale_ThisYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOperationScale_ThisYear; + + /// + /// txtOperationScale_UnitOfMeasurement 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtOperationScale_UnitOfMeasurement; + + /// + /// txtServiceOperatingIncome_BasePeriod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtServiceOperatingIncome_BasePeriod; + + /// + /// txtServiceOperatingIncome_LastYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtServiceOperatingIncome_LastYear; + + /// + /// txtServiceOperatingIncome_ThisYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtServiceOperatingIncome_ThisYear; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReport.aspx new file mode 100644 index 00000000..a53b90b7 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReport.aspx @@ -0,0 +1,118 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectOperationReport.aspx.cs" + Inherits="FineUIPro.Web.ZHGL.Environmental.ProjectOperationReport" %> + + + + + + + 中央企业节能环保企业基本情况和经营状况表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReport.aspx.cs new file mode 100644 index 00000000..fe27f549 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReport.aspx.cs @@ -0,0 +1,259 @@ +using BLL; + +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ProjectOperationReport : PageBase + { + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + + ////权限按钮方法 + this.GetButtonPower(); + + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, BLL.ConstValue.Group_0011, true); + + DateTime showDate = DateTime.Now.AddMonths(-3); + this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + this.drpYear.SelectedValue = showDate.Year.ToString(); + + this.btnNew.OnClientClick = Window1.GetShowReference("ProjectOperationReportEdit.aspx") + "return false;"; + if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) + { + Grid1.PageSize = this.CurrUser.PageSize.Value; + } + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = "select * from Environmental_ProjectOperationReport where 1=1 "; + + strSql += " AND ProjectId = '" + this.ProjectId + "'"; + + List listStr = new List(); + + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + strSql += " AND Year = @Year"; + listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue))); + } + if (this.drpQuarters.SelectedValue != BLL.Const._Null) + { + strSql += " AND Quarters = @Quarters "; + listStr.Add(new SqlParameter("@Quarters", Funs.GetNewInt(this.drpQuarters.SelectedValue))); + } + + 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 TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 改变索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 编辑 + /// + /// 双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + var operationReport = Funs.DB.Environmental_ProjectOperationReport.FirstOrDefault(s => s.BusinessReportId == id); + if (operationReport != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectOperationReportEdit.aspx?ProjectOperationReportId={0}", id, "编辑 - "))); + } + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var getD = Funs.DB.Environmental_ProjectOperationReport.FirstOrDefault(s => s.BusinessReportId == rowID); + if (getD != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, null, getD.BusinessReportId, BLL.Const.ProjectOperationReportMenuId, BLL.Const.BtnDelete); + + Funs.DB.Environmental_ProjectOperationReport.DeleteOnSubmit(getD); + Funs.DB.SubmitChanges(); + } + } + + this.BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(Grid1.SelectedRowID)) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/ReportPrint/ExReportPrint.aspx?reportId={0}&&replaceParameter={1}&&varValue={2}", Const.ProjectInformation_SafetyQuarterlyReportId, Grid1.SelectedRowID, "", "打印 - "))); + } + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectOperationReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReport.aspx.designer.cs new file mode 100644 index 00000000..4e2ac7ae --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReport.aspx.designer.cs @@ -0,0 +1,170 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental +{ + + + public partial class ProjectOperationReport + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// drpQuarters 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpQuarters; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReportEdit.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReportEdit.aspx new file mode 100644 index 00000000..a0b20286 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReportEdit.aspx @@ -0,0 +1,104 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectOperationReportEdit.aspx.cs" + Inherits="FineUIPro.Web.ZHGL.Environmental.ProjectOperationReportEdit" %> + + + + + + + 编辑环保与经营状况数据 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReportEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReportEdit.aspx.cs new file mode 100644 index 00000000..0ba9cbb1 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReportEdit.aspx.cs @@ -0,0 +1,262 @@ +using BLL; + +using Newtonsoft.Json.Linq; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Environmental +{ + public partial class ProjectOperationReportEdit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string ProjectOperationReportId + { + get + { + return (string)ViewState["ProjectOperationReportId"]; + } + set + { + ViewState["ProjectOperationReportId"] = value; + } + } + #endregion + + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true); + BLL.ConstValue.InitConstValueDropDownList(this.ddlQuarter, BLL.ConstValue.Group_0011, true); + + + this.ProjectOperationReportId = Request.Params["ProjectOperationReportId"]; + if (!string.IsNullOrEmpty(this.ProjectOperationReportId)) + { + var projectOperationReport = Funs.DB.Environmental_ProjectOperationReport.FirstOrDefault(s => s.BusinessReportId == this.ProjectOperationReportId); + + if (projectOperationReport != null) + { + this.ProjectId = projectOperationReport.ProjectId; + + #region 赋值 + if (projectOperationReport.Year != null) + { + this.drpYear.SelectedValue = projectOperationReport.Year.ToString(); + } + if (projectOperationReport.Quarters != null) + { + this.ddlQuarter.SelectedValue = projectOperationReport.Quarters.ToString(); + } + if (!string.IsNullOrWhiteSpace(projectOperationReport.FillingMan)) + { + this.txtFillingMan.Text = projectOperationReport.FillingMan.ToString(); + } + if (projectOperationReport.FillingDate != null) + { + this.txtFillingDate.Text = projectOperationReport.FillingDate.Value.ToString("yyyy-MM-dd"); + } + if (!string.IsNullOrWhiteSpace(projectOperationReport.Code)) + { + this.txtCode.Text = projectOperationReport.Code; + } + if (projectOperationReport.PersonNum != null) + { + this.txtPersonNum.Text = projectOperationReport.PersonNum.ToString(); + } + if (projectOperationReport.TotalAssets != null) + { + this.txtTotalAssets.Text = projectOperationReport.TotalAssets.ToString(); + } + if (projectOperationReport.TotalValue != null) + { + this.txtTotalValue.Text = projectOperationReport.TotalValue.ToString(); + } + if (projectOperationReport.NewInvestment != null) + { + this.txtNewInvestment.Text = projectOperationReport.NewInvestment.ToString(); + } + + #endregion + } + } + else + { + DateTime showDate = DateTime.Now.AddMonths(-3); + this.ddlQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString(); + this.drpYear.SelectedValue = showDate.Year.ToString(); + this.txtFillingMan.Text = this.CurrUser.UserName; + this.txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + DateTime startTime = Funs.GetQuarterlyMonths(this.drpYear.SelectedValue, this.ddlQuarter.SelectedValue); + DateTime endTime = startTime.AddMonths(3); + GetData(startTime, endTime); + } + } + } + #endregion + + #region 保存、提交 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.drpYear.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择年度", MessageBoxIcon.Warning); + return; + } + if (this.ddlQuarter.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择季度", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + Model.Environmental_ProjectOperationReport operationReport = new Model.Environmental_ProjectOperationReport + { + ProjectId = this.ProjectId + }; + + if (this.drpYear.SelectedValue != BLL.Const._Null) + { + operationReport.Year = Funs.GetNewInt(this.drpYear.SelectedValue); + } + if (this.ddlQuarter.SelectedValue != BLL.Const._Null) + { + operationReport.Quarters = Funs.GetNewInt(this.ddlQuarter.SelectedValue); + } + operationReport.FillingMan = this.txtFillingMan.Text; + operationReport.FillingDate = Funs.GetNewDateTime(this.txtFillingDate.Text); + + operationReport.Code = this.txtCode.Text.Trim(); + operationReport.PersonNum = Funs.GetNewInt(this.txtPersonNum.Text.Trim()); + operationReport.TotalAssets = Funs.GetNewDecimalOrZero(this.txtTotalAssets.Text.Trim()); + operationReport.TotalValue = Funs.GetNewDecimalOrZero(this.txtTotalValue.Text.Trim()); + operationReport.NewInvestment = Funs.GetNewDecimalOrZero(this.txtNewInvestment.Text.Trim()); + + if (!string.IsNullOrEmpty(this.ProjectOperationReportId)) + { + var model = Funs.DB.Environmental_ProjectOperationReport.FirstOrDefault(s => s.BusinessReportId == this.ProjectOperationReportId); + if (model != null) + { + model.Code = operationReport.Code; + model.PersonNum = operationReport.PersonNum; + model.TotalAssets = operationReport.TotalAssets; + model.TotalValue = operationReport.TotalValue; + model.NewInvestment = operationReport.NewInvestment; + model.Quarters = operationReport.Quarters; + model.Year = operationReport.Year; + model.FillingMan = operationReport.FillingMan; + model.FillingDate = operationReport.FillingDate; + + BLL.LogService.AddSys_Log(this.CurrUser, operationReport.Year.ToString() + "-" + operationReport.Quarters.ToString(), operationReport.BusinessReportId, BLL.Const.ProjectOperationReportMenuId, BLL.Const.BtnModify); + Funs.DB.SubmitChanges(); + } + } + else + { + var model = (from x in Funs.DB.Environmental_ProjectOperationReport + where x.ProjectId == operationReport.ProjectId && x.Year == operationReport.Year && x.Quarters == operationReport.Quarters + select x).FirstOrDefault(); + + if (model == null) + { + this.ProjectOperationReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectOperationReport)); + operationReport.BusinessReportId = this.ProjectOperationReportId; + + Funs.DB.Environmental_ProjectOperationReport.InsertOnSubmit(operationReport); + BLL.LogService.AddSys_Log(this.CurrUser, operationReport.Year.ToString() + "-" + operationReport.Quarters.ToString(), operationReport.BusinessReportId, + BLL.Const.ProjectOperationReportMenuId, BLL.Const.BtnAdd); + + Funs.DB.SubmitChanges(); + } + else + { + Alert.ShowInTop("该季度记录已存在", MessageBoxIcon.Warning); + return; + } + } + } + #endregion + + #region 年季度变化事件 + /// + /// 年季度变化事件 + /// + /// + /// + protected void drpYear_SelectedIndexChanged(object sender, EventArgs e) + { + if (this.drpYear.SelectedValue != BLL.Const._Null && this.ddlQuarter.SelectedValue != BLL.Const._Null) + { + DateTime startTime = Funs.GetQuarterlyMonths(this.drpYear.SelectedValue, this.ddlQuarter.SelectedValue); + DateTime endTime = startTime.AddMonths(3); + GetData(startTime, endTime); + } + } + #endregion + + #region 获取数据 + /// + /// 获取数据 + /// + /// + /// + private void GetData(DateTime startTime, DateTime endTime) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReportEdit.aspx.designer.cs new file mode 100644 index 00000000..f680298a --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ProjectOperationReportEdit.aspx.designer.cs @@ -0,0 +1,206 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Environmental +{ + + + public partial class ProjectOperationReportEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// ddlQuarter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlQuarter; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCode; + + /// + /// txtPersonNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtPersonNum; + + /// + /// GroupPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel2; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// txtTotalAssets 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtTotalAssets; + + /// + /// txtTotalValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtTotalValue; + + /// + /// txtNewInvestment 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtNewInvestment; + + /// + /// Form11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form11; + + /// + /// txtFillingMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtFillingMan; + + /// + /// txtFillingDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtFillingDate; + + /// + /// Label4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label4; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx new file mode 100644 index 00000000..c5266cac --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx @@ -0,0 +1,89 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EPSummaryReport.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Information.EPSummaryReport" %> + + + + + + + 生态环保工作总结报告 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.cs new file mode 100644 index 00000000..93a9149c --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.cs @@ -0,0 +1,364 @@ +using BLL; +using System; +using System.Linq; +using System.Web; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.Information +{ + public partial class EPSummaryReport : PageBase + { + + #region 定义变量 + /// + /// 主键 + /// + public string EPSummaryReportId + { + get + { + return (string)ViewState["EPSummaryReportId"]; + } + set + { + ViewState["EPSummaryReportId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.drpYear.DataTextField = "ConstText"; + drpYear.DataValueField = "ConstValue"; + drpYear.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0008); + drpYear.DataBind(); + this.drpUnit.DataTextField = "UnitName"; + drpUnit.DataValueField = "UnitId"; + drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + drpUnit.DataBind(); + this.drpUnit.Readonly = true; + drpYear.SelectedValue = System.DateTime.Now.Year.ToString(); + GetValue(); + } + } + #endregion + + #region 清空Label + /// + /// 清空文本框 + /// + private void SetEmpty() + { + this.SimpleForm1.Title = string.Empty; + lblUnitName.Text = string.Empty; + lblYearId.Text = string.Empty; + lblResponsiblePerson.Text = string.Empty; + lblResponsiblePersonTel.Text = string.Empty; + lblContactPerson.Text = string.Empty; + lblContactPersonTel.Text = string.Empty; + this.lblReportDate.Text = string.Empty; + this.txtValue.Text = HttpUtility.HtmlDecode("无数据"); + this.SimpleForm1.Title = "生态环保工作总结报告"; + } + #endregion + + #region 获取记录值 + private void GetValue() + { + this.SetEmpty(); + int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + Model.Information_EPSummaryReport report = Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.YearId == year); + if (report != null) + { + string upState = string.Empty; + if (report.UpState == BLL.Const.UpState_3) + { + upState = "(已上报)"; + } + else + { + upState = "(未上报)"; + } + this.SimpleForm1.Title = "生态环保工作总结报告" + upState; + if (!string.IsNullOrEmpty(report.UnitId)) + { + this.lblUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(report.UnitId); + } + this.lblYearId.Text = report.YearId.ToString(); + + this.GetTxetValue(report); + } + else + { + SetEmpty(); + } + this.GetButtonPower(); + } + + /// + /// 得到值 + /// + /// + private void GetTxetValue(Model.Information_EPSummaryReport report) + { + this.EPSummaryReportId = report.EPSummaryReportId; + var unit = BLL.UnitService.GetUnitByUnitId(report.UnitId); + string unitTypeName = string.Empty; + if (unit != null) + { + var unitType = BLL.UnitTypeService.GetUnitTypeById(unit.UnitTypeId); + if (unitType != null) + { + unitTypeName = unitType.UnitTypeName; + } + } + else + { + return; + } + this.lblResponsiblePerson.Text = report.ResponsiblePerson; + this.lblResponsiblePersonTel.Text = report.ResponsiblePersonTel; + this.lblContactPerson.Text = report.ContactPerson; + this.lblContactPersonTel.Text = report.ContactPersonTel; + this.lblReportDate.Text = report.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReportDate) : ""; + + string textvalue = string.Empty; + + textvalue = " 一、贯彻落实国家有关环保节能相关文件情况,落实集团公司有关环保节能工作部署情况。\r\n\r\n" + + report.Description1 + "\r\n\r\n" + + " 二、企业报告期环保节能主要指标完成情况,对增减幅度较大的指标或发生并购、重组等影响能源消耗及污染物排放的重大事项要进行特殊说明。\r\n\r\n" + + report.Description2 + "\r\n\r\n" + + " 三、企业任期环保节能考核指标完成情况。\r\n\r\n" + + report.Description3 + "\r\n\r\n" + + " 四、企业环保节能组织管理、统计监测、考核奖惩体系建设情况。\r\n\r\n" + + report.Description4 + "\r\n\r\n" + + " 五、企业本年度绿色发展规划、环保节能相关制度政策制定实施情况和节能环保资金投入情况。\r\n\r\n" + + report.Description5 + "\r\n\r\n" + + " 六、企业推进产业结构绿色转型升级进展情况,包括淘汰落后产能、传统产业优化升级、构建绿色产业链、绿色技术创新以及发展绿色金融、循环经济、节能环保战略性新兴产业等方面。\r\n\r\n" + + report.Description6 + "\r\n\r\n" + + " 七、企业环保节能工作采取的重大措施及取得的成果,包括能源结构调整、能源消费总量和强度控制、资源综合循环利用、污染防治、生态环境保护与修复、应对气候变化等方面。\r\n\r\n" + + report.Description7 + "\r\n\r\n" + + " 八、企业环保节能存在的主要问题与原因、下一阶段(年度)工作重点。\r\n\r\n" + + report.Description8 + "\r\n\r\n" + + " 九、本企业及所属企业发生的环保重大违法违规事件、各级政府有关部门对本企业环保节能年度检查、考核和奖惩情况等重要事项。\r\n\r\n" + + report.Description9; + + this.txtValue.Text = textvalue; + } + #endregion + + #region 增加、修改、删除、上报 + /// + /// 增加按钮 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EPSummaryReportEdit.aspx?UnitId={0}&&Year={1}", this.CurrUser.UnitId, this.drpYear.SelectedValue, "编辑 - "))); + } + + /// + /// 弹出编辑框 + /// + private void ShowEdit() + { + Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue)); + if (report == null) + { + Alert.ShowInTop("所选时间无报表记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EPSummaryReportEdit.aspx?EPSummaryReportId={0}", report.EPSummaryReportId, "编辑 - "))); + } + + /// + /// 编辑 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + ShowEdit(); + } + + /// + /// 上报 + /// + /// + /// + protected void btnUpdata_Click(object sender, EventArgs e) + { + ShowEdit(); + } + + /// + /// 删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue)); + if (report != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, this.lblYearId.Text, report.EPSummaryReportId, BLL.Const.EPSummaryReportMenuId, BLL.Const.BtnDelete); + + //BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.WorkSummaryReportId); + BLL.EPSummaryReportService.DeleteEPSummaryReportById(report.EPSummaryReportId); + + SetEmpty(); + this.btnNew.Hidden = false; + ShowNotify("删除数据成功!(表格数据已重新绑定)", MessageBoxIcon.Success); + } + else + { + ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭编辑弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + GetValue(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.EPSummaryReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnDelete.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnSaveUp)) + { + this.btnUpdata.Hidden = false; + } + //if (buttonList.Contains(BLL.Const.BtnIn)) + //{ + // this.btnImport.Hidden = false; + //} + //if (buttonList.Contains(BLL.Const.BtnPrint)) + //{ + // this.btnPrint.Hidden = false; + //} + int year = Funs.GetNewIntOrZero(drpYear.SelectedValue); + //int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue); + var report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(this.drpUnit.SelectedValue, year); + //this.btnAudit1.Hidden = true; + //this.btnAudit2.Hidden = true; + //this.btnUpdata.Hidden = true; + if (report != null) + { + this.btnNew.Hidden = true; + } + } + } + #endregion + + #region 单位下拉框联动事件 + /// + /// 单位下拉框联动事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + GetValue(); + } + + #endregion + + #region 上一年度、下一年度 + /// + /// 上一年度 + /// + /// + /// + protected void BtnBulletLeft_Click(object sender, EventArgs e) + { + int y = Convert.ToInt32(drpYear.SelectedValue) - 1; + drpYear.SelectedValue = y.ToString(); + GetValue(); + } + + /// + /// 下一年度 + /// + /// + /// + protected void BtnBulletRight_Click(object sender, EventArgs e) + { + int y = Convert.ToInt32(drpYear.SelectedValue) + 1; + drpYear.SelectedValue = y.ToString(); + GetValue(); + } + #endregion + + #region 查看未上报的项目 + /// + /// 查看未上报的项目 + /// + /// + /// + protected void btnView_Click(object sender, EventArgs e) + { + string info = string.Empty; + int date = Convert.ToInt32(this.drpYear.SelectedValue); + var projects = (from x in Funs.DB.Base_Project + where (x.ProjectState == BLL.Const.ProjectState_1 || x.ProjectState == null) + && x.StartDate.Value.Year <= date + select x).ToList(); + foreach (var item in projects) + { + var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date); + if (report == null) + { + info += item.ProjectCode + ":" + item.ProjectName + ",未填写报表;
"; + } + } + + if (!string.IsNullOrEmpty(info)) + { + Alert.ShowInTop(info + "项目报表未上报。", MessageBoxIcon.Warning); + } + else + { + ShowNotify("项目报表已上报", MessageBoxIcon.Success); + } + + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.designer.cs new file mode 100644 index 00000000..623c0c5e --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.designer.cs @@ -0,0 +1,231 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Information { + + + public partial class EPSummaryReport { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// RegionPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RegionPanel RegionPanel1; + + /// + /// Region2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Region Region2; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// BtnBulletLeft 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletLeft; + + /// + /// BtnBulletRight 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnBulletRight; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + + /// + /// btnView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnView; + + /// + /// lblUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblUnitName; + + /// + /// lblYearId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblYearId; + + /// + /// lblResponsiblePerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblResponsiblePerson; + + /// + /// lblResponsiblePersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblResponsiblePersonTel; + + /// + /// lblContactPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblContactPerson; + + /// + /// lblContactPersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblContactPersonTel; + + /// + /// lblReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblReportDate; + + /// + /// txtValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtValue; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx new file mode 100644 index 00000000..16cb3897 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx @@ -0,0 +1,144 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EPSummaryReportEdit.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Information.EPSummaryReportEdit" %> + + + + + + + 编辑生态环保工作总结报告 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.cs new file mode 100644 index 00000000..cdb76cb3 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.cs @@ -0,0 +1,306 @@ +using BLL; +using System; +using System.Linq; +using System.Web.UI.WebControls; + + +namespace FineUIPro.Web.ZHGL.Information +{ + public partial class EPSummaryReportEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string EPSummaryReportId + { + get + { + return (string)ViewState["EPSummaryReportId"]; + } + set + { + ViewState["EPSummaryReportId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlUnitId.DataTextField = "UnitName"; + this.ddlUnitId.DataValueField = "UnitId"; + this.ddlUnitId.DataSource = BLL.UnitService.GetThisUnitDropDownList(); + this.ddlUnitId.DataBind(); + + this.ddlYearId.DataTextField = "ConstText"; + ddlYearId.DataValueField = "ConstValue"; + ddlYearId.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0008); + ddlYearId.DataBind(); + + this.ddlUnitId.Readonly = true; + string unitId = Request.Params["UnitId"]; + string year = Request.QueryString["Year"]; + this.EPSummaryReportId = Request.Params["EPSummaryReportId"]; + if (!string.IsNullOrEmpty(this.EPSummaryReportId)) + { + var report = BLL.EPSummaryReportService.GetEPSummaryReportById(this.EPSummaryReportId); + if (report != null) + { + this.btnCopy.Hidden = true; + if (report.UpState == BLL.Const.UpState_3) //已上报 + { + this.btnSave.Hidden = true; + this.btnUpdata.Hidden = true; + } + #region 赋值 + if (!string.IsNullOrEmpty(report.UnitId)) + { + this.ddlUnitId.SelectedValue = report.UnitId; + } + this.ddlYearId.SelectedValue = report.YearId.ToString(); + this.txtReportDate.Text = report.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReportDate) : ""; + this.txtResponsiblePerson.Text = report.ResponsiblePerson; + this.txtResponsiblePersonTel.Text = report.ResponsiblePersonTel; + this.txtContactPerson.Text = report.ContactPerson; + this.txtContactPersonTel.Text = report.ContactPersonTel; + this.txtDescription1.Text = report.Description1; + this.txtDescription2.Text = report.Description2; + this.txtDescription3.Text = report.Description3; + this.txtDescription4.Text = report.Description4; + this.txtDescription5.Text = report.Description5; + this.txtDescription6.Text = report.Description6; + this.txtDescription7.Text = report.Description7; + this.txtDescription8.Text = report.Description8; + this.txtDescription9.Text = report.Description9; + #endregion + } + } + else + { + this.btnCopy.Hidden = false; + this.ddlUnitId.SelectedValue = unitId; + this.ddlYearId.SelectedValue = year; + this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + + #region 获取项目上报数据 + string description1 = string.Empty; + string description2 = string.Empty; + string description3 = string.Empty; + string description4 = string.Empty; + string description5 = string.Empty; + string description6 = string.Empty; + string description7= string.Empty; + string description8 = string.Empty; + string description9 = string.Empty; + + int date = Convert.ToInt32(this.ddlYearId.SelectedValue); + var projects = (from x in Funs.DB.Base_Project + where (x.ProjectState == BLL.Const.ProjectState_1 || x.ProjectState == null) + + && x.StartDate.Value.Year <= date + select x).ToList(); + foreach (var item in projects) + { + var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date); + if (report != null) + { + description1 += item.ProjectName + ":\r\n" + report.Description1 + "\r\n"; + description2 += item.ProjectName + ":\r\n" + report.Description2 + "\r\n"; + description3 += item.ProjectName + ":\r\n" + report.Description3 + "\r\n"; + description4 += item.ProjectName + ":\r\n" + report.Description4 + "\r\n"; + description5 += item.ProjectName + ":\r\n" + report.Description5 + "\r\n"; + description6 += item.ProjectName + ":\r\n" + report.Description6 + "\r\n"; + description7 += item.ProjectName + ":\r\n" + report.Description7 + "\r\n"; + description8 += item.ProjectName + ":\r\n" + report.Description8 + "\r\n"; + description9 += item.ProjectName + ":\r\n" + report.Description9 + "\r\n"; + } + } + this.txtDescription1.Text = description1; + this.txtDescription2.Text = description2; + this.txtDescription3.Text = description3; + this.txtDescription4.Text = description4; + this.txtDescription5.Text = description5; + this.txtDescription6.Text = description6; + this.txtDescription7.Text = description7; + this.txtDescription8.Text = description8; + this.txtDescription9.Text = description9; + #endregion + } + } + } + #endregion + + #region 保存数据 + private void Save(string type) + { + Model.Information_EPSummaryReport report = new Model.Information_EPSummaryReport(); + if (this.ddlUnitId.SelectedValue != BLL.Const._Null) + { + report.UnitId = this.ddlUnitId.SelectedValue; + } + else + { + ShowNotify("请选择单位!", MessageBoxIcon.Warning); + return; + } + if (this.ddlYearId.SelectedValue != BLL.Const._Null) + { + report.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue); + } + else + { + ShowNotify("请选择年度!", MessageBoxIcon.Warning); + return; + } + report.ResponsiblePerson = this.txtResponsiblePerson.Text.Trim(); + report.ResponsiblePersonTel = this.txtResponsiblePersonTel.Text.Trim(); + report.ContactPerson = this.txtContactPerson.Text.Trim(); + report.ContactPersonTel = this.txtContactPersonTel.Text.Trim(); + report.ReportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim()); + report.Description1 = this.txtDescription1.Text.Trim(); + report.Description2 = this.txtDescription2.Text.Trim(); + report.Description3 = this.txtDescription3.Text.Trim(); + report.Description4 = this.txtDescription4.Text.Trim(); + report.Description5 = this.txtDescription5.Text.Trim(); + report.Description6 = this.txtDescription6.Text.Trim(); + report.Description7 = this.txtDescription7.Text.Trim(); + report.Description8 = this.txtDescription8.Text.Trim(); + report.Description9 = this.txtDescription9.Text.Trim(); + if (string.IsNullOrEmpty(this.EPSummaryReportId)) + { + var s = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(this.ddlUnitId.SelectedValue, Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue)); + if (s != null) + { + ShowNotify("该单位的该年度的该生态环保工作总结报告已经存在,不能重复编制!", MessageBoxIcon.Warning); + return; + } + else + { + this.EPSummaryReportId = SQLHelper.GetNewID(typeof(Model.Information_EPSummaryReport)); + report.EPSummaryReportId = this.EPSummaryReportId; + report.UpState = BLL.Const.UpState_2; + BLL.EPSummaryReportService.AddEPSummaryReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, this.ddlYearId.SelectedText, report.EPSummaryReportId, BLL.Const.EPSummaryReportMenuId, BLL.Const.BtnAdd); + } + } + else + { + report.EPSummaryReportId = this.EPSummaryReportId; + report.UpState = BLL.Const.UpState_2; + BLL.EPSummaryReportService.UpdateEPSummaryReport(report); + BLL.LogService.AddSys_Log(this.CurrUser, this.ddlYearId.SelectedText, report.EPSummaryReportId, BLL.Const.EPSummaryReportMenuId, BLL.Const.BtnModify); + } + if (type == "updata") //保存并上报 + { + if (report.UpState == BLL.Const.UpState_2) + { + string code = CNCECHSSEWebService.UpEPSummaryReport(report.EPSummaryReportId, this.CurrUser); + if (code == "1") + { + ShowNotify("同步成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + return; + } + else + { + Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); + } + } + else + { + ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning); + return; + } + } + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + Save("add"); + } + + protected void btnUpdata_Click(object sender, EventArgs e) + { + Save("updata"); + } + #endregion + + #region 复制上个年度数据 + /// + /// 复制上个年度数据 + /// + /// + /// + protected void btnCopy_Click(object sender, EventArgs e) + { + int lastYear = 0; + int year = Convert.ToInt32(this.ddlYearId.SelectedValue); + + lastYear = year - 1; + + Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(this.ddlUnitId.SelectedValue, lastYear); + if (report != null) + { + Model.Information_EPSummaryReport newReport = new Model.Information_EPSummaryReport(); + this.EPSummaryReportId = SQLHelper.GetNewID(typeof(Model.Information_EPSummaryReport)); + newReport.EPSummaryReportId = this.EPSummaryReportId; + newReport.UnitId = this.ddlUnitId.SelectedValue; + newReport.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue); + newReport.ResponsiblePerson = report.ResponsiblePerson; + newReport.ResponsiblePersonTel = report.ResponsiblePersonTel; + newReport.ContactPerson = report.ContactPerson; + newReport.ContactPersonTel = report.ContactPersonTel; + newReport.ReportDate = report.ReportDate; + newReport.Description1 = report.Description1; + newReport.Description2 = report.Description2; + newReport.Description3 = report.Description3; + newReport.Description4 = report.Description4; + newReport.Description5 = report.Description5; + newReport.Description6 = report.Description6; + newReport.Description7 = report.Description7; + newReport.Description8 = report.Description8; + newReport.Description9 = report.Description9; + + newReport.UpState = BLL.Const.UpState_2; + BLL.EPSummaryReportService.AddEPSummaryReport(newReport); + + GetValues(newReport.EPSummaryReportId); + } + } + + /// + /// 赋值 + /// + private void GetValues(string ePSummaryReportId) + { + var report = BLL.EPSummaryReportService.GetEPSummaryReportById(ePSummaryReportId); + if (report != null) + { + this.txtDescription1.Text = report.Description1; + this.txtDescription2.Text = report.Description2; + this.txtDescription3.Text = report.Description3; + this.txtDescription4.Text = report.Description4; + this.txtDescription5.Text = report.Description5; + this.txtDescription6.Text = report.Description6; + this.txtDescription7.Text = report.Description7; + this.txtDescription8.Text = report.Description8; + this.txtDescription9.Text = report.Description9; + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.designer.cs new file mode 100644 index 00000000..b35baeae --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.designer.cs @@ -0,0 +1,303 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.Information { + + + public partial class EPSummaryReportEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// ddlUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlUnitId; + + /// + /// ddlYearId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlYearId; + + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReportDate; + + /// + /// txtResponsiblePerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtResponsiblePerson; + + /// + /// txtResponsiblePersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtResponsiblePersonTel; + + /// + /// txtContactPerson 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContactPerson; + + /// + /// txtContactPersonTel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContactPersonTel; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// txtDescription1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription1; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label2; + + /// + /// txtDescription2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription2; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label3; + + /// + /// txtDescription3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription3; + + /// + /// Label4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label4; + + /// + /// txtDescription4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription4; + + /// + /// Label5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label5; + + /// + /// txtDescription5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription5; + + /// + /// Label6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label6; + + /// + /// txtDescription6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription6; + + /// + /// Label7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label7; + + /// + /// txtDescription7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription7; + + /// + /// Label8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label8; + + /// + /// txtDescription8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription8; + + /// + /// Label9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label9; + + /// + /// txtDescription9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription9; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnCopy 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnCopy; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnUpdata 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdata; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/MillionsMonthlyReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Information/MillionsMonthlyReport.aspx index 6b41a6ef..2e3b6400 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Information/MillionsMonthlyReport.aspx +++ b/SGGL/FineUIPro.Web/ZHGL/Information/MillionsMonthlyReport.aspx @@ -5,13 +5,18 @@ - 百万工时安全统计月报表 + 企业安全数据统计月报 @@ -37,42 +42,42 @@ - - - + -