diff --git a/.vs/SGGL_CWCEC/v17/.wsuo b/.vs/SGGL_CWCEC/v17/.wsuo index f2ca5eea..166cc64d 100644 Binary files a/.vs/SGGL_CWCEC/v17/.wsuo and b/.vs/SGGL_CWCEC/v17/.wsuo differ diff --git a/DataBase/版本日志/SGGLDB_WH_2023-05-22.sql b/DataBase/版本日志/SGGLDB_WH_2023-05-22.sql new file mode 100644 index 00000000..629df264 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2023-05-22.sql @@ -0,0 +1,333 @@ + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('F734733B-4DB4-4DB7-9A0C-894C876BDB76','ְHSEƶ','HSSE/ActionPlan/SubManageRule.aspx',13,'7944B1C6-636B-4AD8-980C-A2F6D44883D3','Menu_HSSE',0,1,1) + GO + --ְHSEƶȰť + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('1D420DC1-34AE-493E-8F2D-CAEA41DF64C9','F734733B-4DB4-4DB7-9A0C-894C876BDB76','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('BF1C0D7A-267E-41B4-8D8E-A99371FC1B3A','F734733B-4DB4-4DB7-9A0C-894C876BDB76','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('266F6D4F-193B-4CD6-9D3E-5AFD06679B72','F734733B-4DB4-4DB7-9A0C-894C876BDB76','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('CA237F10-32FC-4BA7-BD05-1FF9E5D6EC65','F734733B-4DB4-4DB7-9A0C-894C876BDB76','',4) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('D8F410DF-6043-4F71-A1AB-03A623D19824','F734733B-4DB4-4DB7-9A0C-894C876BDB76','',5) + GO + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('609F0D64-ABB8-4F5C-9646-FC1DFC8BAB85','Э빵ͨ','DocManage/DocManage.aspx',10,'0','Menu_Doc',0,1,1) +GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('446DC128-39C7-4C18-BFA7-8DD44CFDCD3B','609F0D64-ABB8-4F5C-9646-FC1DFC8BAB85','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('445656DA-132D-41F3-A921-1A9BF4269CEB','609F0D64-ABB8-4F5C-9646-FC1DFC8BAB85','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('6EEB512C-1650-4B3D-B442-772DE10234AD','609F0D64-ABB8-4F5C-9646-FC1DFC8BAB85','',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('A1AFBD64-32F8-4A92-A832-B656C5DFB679','609F0D64-ABB8-4F5C-9646-FC1DFC8BAB85','ɾ',4) + GO + insert into Sys_Menu( MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType ,IsOffice,IsEnd,IsUsed ) + values('F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','ĵ','BaseInfo/DocType.aspx',170,'5196A6FD-4BF1-46B3-8D24-9A3CE5BB4760','Menu_SysSet',1,1,1) + GO + insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('27DasEC6-5D58-4B06-BF3F-C62E1D361074','F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','',1) + insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('7EB2ESDA-0DEE-45D2-81BA-A49F9F8D556E','F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','޸',2) + insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('EF174SDA-1E96-4523-9CD5-5040D2442DC6','F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','ɾ',3) + insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('124B7659-5F18-49F3-8D30-BF8652383027','F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','',4) + GO + update Sys_Menu set MenuName='HSSE¹(δ)' where MenuId='9A9D6805-6C98-46E4-943E-130C4A3EB9A2' + Go +/****** Object: Table [dbo].[ActionPlan_SubManagerRule] Script Date: 2023/5/22 14:15:28 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +SET ANSI_PADDING ON +GO + +CREATE TABLE [dbo].[ActionPlan_SubManagerRule]( + [ManagerRuleId] [nvarchar](50) NOT NULL, + [ManageRuleCode] [nvarchar](50) NULL, + [ProjectId] [nvarchar](50) NULL, + [ManageRuleName] [nvarchar](50) NULL, + [ManageRuleTypeId] [nvarchar](50) NULL, + [VersionNo] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + [CompileMan] [nvarchar](50) NULL, + [AttachUrl] [nvarchar](2000) NULL, + [Remark] [nvarchar](1000) NULL, + [IsIssue] [bit] NULL, + [IssueDate] [datetime] NULL, + [Flag] [bit] NULL, + [State] [char](1) NOT NULL, + [SeeFile] [nvarchar](max) NULL, + CONSTRAINT [PK_ActionPlan_SubManagerRule] PRIMARY KEY CLUSTERED +( + [ManagerRuleId] 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].[ActionPlan_SubManagerRule] WITH CHECK ADD CONSTRAINT [FK_ActionPlan_SubManagerRule_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[ActionPlan_SubManagerRule] CHECK CONSTRAINT [FK_ActionPlan_SubManagerRule_Base_Project] +GO + +ALTER TABLE [dbo].[ActionPlan_SubManagerRule] WITH CHECK ADD CONSTRAINT [FK_ActionPlan_SubManagerRule_Sys_User] FOREIGN KEY([CompileMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[ActionPlan_SubManagerRule] CHECK CONSTRAINT [FK_ActionPlan_SubManagerRule_Sys_User] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'涨' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule', @level2type=N'COLUMN',@level2name=N'ManageRuleCode' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule', @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'ActionPlan_SubManagerRule', @level2type=N'COLUMN',@level2name=N'ManageRuleName' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'汾' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule', @level2type=N'COLUMN',@level2name=N'VersionNo' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule', @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'ActionPlan_SubManagerRule', @level2type=N'COLUMN',@level2name=N'CompileMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'(true-false-δ)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule', @level2type=N'COLUMN',@level2name=N'IsIssue' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule', @level2type=N'COLUMN',@level2name=N'IssueDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ǣ0-μ̣1-μ̣' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule', @level2type=N'COLUMN',@level2name=N'Flag' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'״̬0--±, 1--, 2--ֳHSSE, 3--ĿHSSE, 4--Ŀ5--ɣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule', @level2type=N'COLUMN',@level2name=N'State' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule', @level2type=N'COLUMN',@level2name=N'SeeFile' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ְ̰ȫ涨' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ActionPlan_SubManagerRule' +GO + + +drop table Base_DocType +drop table Doc_DocManage +drop table Doc_DocManageApprove +/****** Object: Table [dbo].[Base_DocType] Script Date: 2023/5/22 15:49:58 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +CREATE TABLE [dbo].[Base_DocType]( + [DocTypeId] [nvarchar](50) NOT NULL, + [DocTypeCode] [nvarchar](50) NULL, + [DocTypeName] [nvarchar](50) NULL, + [CodeRule] [nvarchar](200) NULL, + CONSTRAINT [PK_Base_DocType] PRIMARY KEY CLUSTERED +( + [DocTypeId] 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'Base_DocType', @level2type=N'COLUMN',@level2name=N'DocTypeId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_DocType', @level2type=N'COLUMN',@level2name=N'DocTypeCode' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_DocType', @level2type=N'COLUMN',@level2name=N'DocTypeName' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_DocType' +GO + + + +/****** Object: Table [dbo].[Doc_DocManage] Script Date: 2023/5/22 15:41:32 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +SET ANSI_PADDING ON +GO + +CREATE TABLE [dbo].[Doc_DocManage]( + [DocId] [nvarchar](50) NOT NULL, + [DocCode] [nvarchar](50) NULL, + [DocName] [nvarchar](100) NULL, + [DocTypeId] [nvarchar](50) NULL, + [CNProfessionalId] [nvarchar](50) NULL, + [ProjectId] [nvarchar](50) NULL, + [DocContent] [nvarchar](2000) NULL, + [SendUnitId] [nvarchar](50) NULL, + [ReceivUnitIds] [nvarchar](500) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + [State] [char](1) NULL, + [AcceptMan] [nvarchar](1000) NULL, + [DepartId] [nvarchar](50) NULL, + [FinishTime] [datetime] NULL, + [ProjectSubjectId] [nvarchar](50) NULL, + [CopyMan] [nvarchar](1000) NULL, + CONSTRAINT [PK_Doc_DocManage] PRIMARY KEY CLUSTERED +( + [DocId] 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].[Doc_DocManage] WITH CHECK ADD CONSTRAINT [FK_Doc_DocManage_Base_CNProfessional] FOREIGN KEY([CNProfessionalId]) +REFERENCES [dbo].[Base_CNProfessional] ([CNProfessionalId]) +GO + +ALTER TABLE [dbo].[Doc_DocManage] CHECK CONSTRAINT [FK_Doc_DocManage_Base_CNProfessional] +GO + +ALTER TABLE [dbo].[Doc_DocManage] WITH CHECK ADD CONSTRAINT [FK_Doc_DocManage_Base_DocType] FOREIGN KEY([DocTypeId]) +REFERENCES [dbo].[Base_DocType] ([DocTypeId]) +GO + +ALTER TABLE [dbo].[Doc_DocManage] CHECK CONSTRAINT [FK_Doc_DocManage_Base_DocType] +GO + +ALTER TABLE [dbo].[Doc_DocManage] WITH CHECK ADD CONSTRAINT [FK_Doc_DocManage_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[Doc_DocManage] CHECK CONSTRAINT [FK_Doc_DocManage_Base_Project] +GO + +ALTER TABLE [dbo].[Doc_DocManage] WITH CHECK ADD CONSTRAINT [FK_Doc_DocManage_Base_Unit] FOREIGN KEY([SendUnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Doc_DocManage] CHECK CONSTRAINT [FK_Doc_DocManage_Base_Unit] +GO + +ALTER TABLE [dbo].[Doc_DocManage] WITH CHECK ADD CONSTRAINT [FK_Doc_DocManage_Sys_User] FOREIGN KEY([CompileMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[Doc_DocManage] CHECK CONSTRAINT [FK_Doc_DocManage_Sys_User] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĵId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage', @level2type=N'COLUMN',@level2name=N'DocId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage', @level2type=N'COLUMN',@level2name=N'DocCode' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage', @level2type=N'COLUMN',@level2name=N'DocName' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĵId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage', @level2type=N'COLUMN',@level2name=N'DocTypeId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'רҵId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage', @level2type=N'COLUMN',@level2name=N'CNProfessionalId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage', @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'Doc_DocManage', @level2type=N'COLUMN',@level2name=N'DocContent' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'͵λId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage', @level2type=N'COLUMN',@level2name=N'SendUnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'յλIds' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage', @level2type=N'COLUMN',@level2name=N'ReceivUnitIds' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage', @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'Doc_DocManage', @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'Doc_DocManage', @level2type=N'COLUMN',@level2name=N'State' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManage' +GO + + + +CREATE TABLE [dbo].[Doc_DocManageApprove]( + [DocManageApproveId] [nvarchar](50) NOT NULL, + [DocId] [nvarchar](50) NULL, + [ApproveMan] [nvarchar](50) NULL, + [ApproveDate] [datetime] NULL, + [IsAgree] [bit] NULL, + [ApproveIdea] [nvarchar](500) NULL, + [Type] [varchar](50) NULL, + CONSTRAINT [PK_Doc_DocManageApprove] PRIMARY KEY CLUSTERED +( + [DocManageApproveId] 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].[Doc_DocManageApprove] WITH CHECK ADD CONSTRAINT [FK_Doc_DocManageApprove_Doc_DocManage] FOREIGN KEY([DocId]) +REFERENCES [dbo].[Doc_DocManage] ([DocId]) +GO + +ALTER TABLE [dbo].[Doc_DocManageApprove] CHECK CONSTRAINT [FK_Doc_DocManageApprove_Doc_DocManage] +GO + +ALTER TABLE [dbo].[Doc_DocManageApprove] WITH CHECK ADD CONSTRAINT [FK_Doc_DocManageApprove_Sys_User] FOREIGN KEY([ApproveMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[Doc_DocManageApprove] CHECK CONSTRAINT [FK_Doc_DocManageApprove_Sys_User] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManageApprove', @level2type=N'COLUMN',@level2name=N'DocManageApproveId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManageApprove', @level2type=N'COLUMN',@level2name=N'DocId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManageApprove', @level2type=N'COLUMN',@level2name=N'ApproveMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManageApprove', @level2type=N'COLUMN',@level2name=N'ApproveDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ƿͬ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManageApprove', @level2type=N'COLUMN',@level2name=N'IsAgree' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManageApprove', @level2type=N'COLUMN',@level2name=N'ApproveIdea' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Doc_DocManageApprove' +GO + + diff --git a/DataBase/菜单初始化脚本/0-1系统设置(Menu_SysSet).sql b/DataBase/菜单初始化脚本/0-1系统设置(Menu_SysSet).sql index 97f9411c..0459d502 100644 --- a/DataBase/菜单初始化脚本/0-1系统设置(Menu_SysSet).sql +++ b/DataBase/菜单初始化脚本/0-1系统设置(Menu_SysSet).sql @@ -235,6 +235,15 @@ GO insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('124B7659-5F18-49F3-8D30-BF8680830827','3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B','',4) GO + insert into Sys_Menu( MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType ,IsOffice,IsEnd,IsUsed ) + values('F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','ĵ','BaseInfo/DocType.aspx',170,'5196A6FD-4BF1-46B3-8D24-9A3CE5BB4760','Menu_SysSet',1,1,1) + GO + insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('27D8CEC6-5D58-4B06-BF3F-C62E1D361074','F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','',1) + insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('7EB2E0FA-0DEE-45D2-81BA-A49F9F8D556E','F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','޸',2) + insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('CBEF171A-1E96-4523-9CD5-5040D2C42DC6','F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','ɾ',3) + insert into Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) values('124B7659-5F18-49F3-8D30-BF8680830827','F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64','',4) + GO + /**********/ INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('A93BA810-3511-4BB2-9C10-9663351DF79F','','',20,'D363BD9D-4DEC-45D8-89C8-B0E49DEF61B4','Menu_SysSet',1,0,1) diff --git a/DataBase/菜单初始化脚本/1-3安全管理(Menu_HSSE).sql b/DataBase/菜单初始化脚本/1-3安全管理(Menu_HSSE).sql index 3b5776ad..5c09d145 100644 --- a/DataBase/菜单初始化脚本/1-3安全管理(Menu_HSSE).sql +++ b/DataBase/菜单初始化脚本/1-3安全管理(Menu_HSSE).sql @@ -108,7 +108,21 @@ GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('78c1b689-3802-4ed6-a446-baf94eec5188','ec0942af-b1ae-4676-8442-4be3a5e22ea0','',5) GO - + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('F734733B-4DB4-4DB7-9A0C-894C876BDB76','ְHSEƶ','HSSE/ActionPlan/SubManageRule.aspx',13,'7944B1C6-636B-4AD8-980C-A2F6D44883D3','Menu_HSSE',0,1,1) + GO + --ְHSEƶȰť + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('1D420DC1-34AE-493E-8F2D-CAEA41DF64C9','F734733B-4DB4-4DB7-9A0C-894C876BDB76','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('BF1C0D7A-267E-41B4-8D8E-A99371FC1B3A','F734733B-4DB4-4DB7-9A0C-894C876BDB76','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('266F6D4F-193B-4CD6-9D3E-5AFD06679B72','F734733B-4DB4-4DB7-9A0C-894C876BDB76','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('CA237F10-32FC-4BA7-BD05-1FF9E5D6EC65','F734733B-4DB4-4DB7-9A0C-894C876BDB76','',4) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('D8F410DF-6043-4F71-A1AB-03A623D19824','F734733B-4DB4-4DB7-9A0C-894C876BDB76','',5) + GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('703D90A7-C40B-4753-943B-8A59AABDC043','涨嵥','HSSE/ActionPlan/ManagerRuleList.aspx',20,'7944B1C6-636B-4AD8-980C-A2F6D44883D3','Menu_HSSE',0,1,1) GO diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 0088b85c..582d2550 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -156,6 +156,7 @@ + @@ -296,6 +297,8 @@ + + @@ -359,6 +362,7 @@ + diff --git a/SGGL/BLL/BaseInfo/DocTypeService.cs b/SGGL/BLL/BaseInfo/DocTypeService.cs new file mode 100644 index 00000000..2362c4e0 --- /dev/null +++ b/SGGL/BLL/BaseInfo/DocTypeService.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public static class DocTypeService + { + public static Model.SGGLDB db = Funs.DB; + + /// + /// 根据主键获取信息 + /// + /// + /// + public static Model.Base_DocType GetDocTypeById(string docTypeID) + { + return Funs.DB.Base_DocType.FirstOrDefault(e => e.DocTypeId == docTypeID); + } + + /// + /// 添加 + /// + /// + public static void AddDocType(Model.Base_DocType docType) + { + Model.SGGLDB db = Funs.DB; + Model.Base_DocType newDocType = new Model.Base_DocType + { + DocTypeId = docType.DocTypeId, + DocTypeCode = docType.DocTypeCode, + DocTypeName = docType.DocTypeName, + CodeRule = docType.CodeRule, + }; + + db.Base_DocType.InsertOnSubmit(newDocType); + db.SubmitChanges(); + } + + /// + /// 修改 + /// + /// + public static void UpdateDocType(Model.Base_DocType docType) + { + Model.SGGLDB db = Funs.DB; + Model.Base_DocType newDocType = db.Base_DocType.FirstOrDefault(e => e.DocTypeId == docType.DocTypeId); + if (newDocType != null) + { + newDocType.DocTypeCode = docType.DocTypeCode; + newDocType.DocTypeName = docType.DocTypeName; + newDocType.CodeRule = docType.CodeRule; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除信息 + /// + /// + public static void DeleteDocTypeById(string docTypeID) + { + Model.SGGLDB db = Funs.DB; + Model.Base_DocType docType = db.Base_DocType.FirstOrDefault(e => e.DocTypeId == docTypeID); + { + db.Base_DocType.DeleteOnSubmit(docType); + db.SubmitChanges(); + } + } + + /// + /// 获取类别下拉项 + /// + /// + public static List GetDocTypeList() + { + var list = (from x in Funs.DB.Base_DocType orderby x.DocTypeCode select x).ToList(); + return list; + } + + /// + /// 类型表下拉框 + /// + /// 下拉框名字 + /// 是否显示请选择 + public static void InitDocTypeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "DocTypeId"; + dropName.DataTextField = "DocTypeName"; + dropName.DataSource = GetDocTypeList(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + + public static Model.Base_DocType GetDocTypeByName(string name) + { + return Funs.DB.Base_DocType.FirstOrDefault(e => e.DocTypeName == name); + } + + /// + /// 根据主键获取类别名称 + /// + /// + /// + public static string GetDocTypeNameById(string docTypeID) + { + string name = string.Empty; + var docType = Funs.DB.Base_DocType.FirstOrDefault(e => e.DocTypeId == docTypeID); + if (docType != null) + { + name = docType.DocTypeName; + } + return name; + } + } +} diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 70cb028d..52ce47fc 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -742,6 +742,10 @@ namespace BLL /// 意见收集 /// public const string Menu_Opinion = "Menu_Opinion"; + /// + /// 文档管理 + /// + public const string Menu_Doc = "Menu_Doc"; #endregion #endregion @@ -784,8 +788,12 @@ namespace BLL /// HSSE项目管理规定发布 /// public const string ActionPlan_ProjectManagerRuleMenuId = "ec0942af-b1ae-4676-8442-4be3a5e22ea0"; + /// + /// HSS分包商管理规定发布 + /// + public const string ActionPlan_SubManagerRuleMenuId = "F734733B-4DB4-4DB7-9A0C-894C876BDB76"; + - #region 本部检查 /// @@ -839,6 +847,10 @@ namespace BLL /// 问题类型 /// public const string QuestionTypeMenuId = "3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B"; + /// + /// 文档类别 + /// + public const string DocTypeMenuId = "F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64"; #endregion #region 基础信息 @@ -2852,7 +2864,6 @@ namespace BLL public const string OpinionCollectionMenuId = "D801290C-1FD9-4467-AFF9-7D788C6344B1"; #endregion - #region 模版文件原始的虚拟路径 /// /// Excel附件路径 @@ -3213,6 +3224,22 @@ namespace BLL public const string State_C = "-2"; #endregion + #region 文档流程定义 + /// + /// 待提交 + /// + public const string Doc_State_0 = "0"; + /// + /// 进行中 + /// + public const string Doc_State_1 = "1"; + /// + /// 已闭环 + /// + public const string Doc_State_2 = "2"; + #endregion + + #region 分流管理流程定义 /// /// 重新整理 @@ -5274,6 +5301,17 @@ namespace BLL public const string UndergroundPipeCompletionMenuId = "C7037A5D-D8A6-4C1C-A5B8-2083C31C0A7B"; #endregion + #region 文档管理 + /// + /// 文档管理 + /// + public const string DocManageMenuId = "609F0D64-ABB8-4F5C-9646-FC1DFC8BAB85"; + /// + /// 文档查找 + /// + public const string DocFindMenuId = "AE22BF25-CE08-477C-B135-543F1F4D4749"; + #endregion + /// /// 设备专业Id /// diff --git a/SGGL/BLL/DocManage/DocManageApproveService.cs b/SGGL/BLL/DocManage/DocManageApproveService.cs new file mode 100644 index 00000000..7bab829b --- /dev/null +++ b/SGGL/BLL/DocManage/DocManageApproveService.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class DocManageApproveService + { + public static Model.SGGLDB db = Funs.DB; + + /// + /// 获取工程联络单模板列表 + /// + /// + /// + /// + public static DataTable GetListData(string docId) + { + var db = Funs.DB; + var q = (from x in db.Doc_DocManageApprove + where x.DocId == docId && x.ApproveDate != null && x.Type == null + orderby x.ApproveDate + select new + { + x.DocManageApproveId, + x.DocId, + ApproveMan = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(), + ApproveDate = (string.Format("{0:d}", x.ApproveDate)), + RoleName = (from m in db.Sys_Role join n in db.Sys_User on m.RoleId equals n.RoleId where n.UserId == x.ApproveMan select m.RoleName).First(), + x.IsAgree, + x.ApproveIdea, + x.Type + }); + return Funs.LINQToDataTable(q); + } + + /// + /// 根据文档审批编号获取一个文档审批信息 + /// + /// 文档编号 + /// 一个文档审批实体 + public static Model.Doc_DocManageApprove GetDocManageApproveByApproveId(string approveId) + { + return db.Doc_DocManageApprove.FirstOrDefault(x => x.DocManageApproveId == approveId); + } + + /// + /// 根据文档编号获取一个文档审批信息 + /// + /// 文档编号 + /// 一个文档审批实体 + public static Model.Doc_DocManageApprove GetDocManageApproveByDocId(string DocId) + { + return db.Doc_DocManageApprove.FirstOrDefault(x => x.DocId == DocId && x.ApproveDate == null && x.Type == null); + } + /// + /// 根据文档编号获取一个文档通知信息 + /// + /// + /// + public static Model.Doc_DocManageApprove GetNoticeDocManageApproveByDocId(string DocId, string userId) + { + return db.Doc_DocManageApprove.FirstOrDefault(x => x.DocId == DocId && x.ApproveDate == null && x.Type == "s" && x.ApproveMan == userId); + } + /// + /// 增加文档审批信息 + /// + /// 文档审批实体 + public static string AddDocManageApprove(Model.Doc_DocManageApprove approve) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + string newKeyID = SQLHelper.GetNewID(typeof(Model.Doc_DocManageApprove)); + Model.Doc_DocManageApprove newApprove = new Model.Doc_DocManageApprove(); + newApprove.DocManageApproveId = newKeyID; + newApprove.DocId = approve.DocId; + newApprove.ApproveMan = approve.ApproveMan; + newApprove.ApproveDate = approve.ApproveDate; + newApprove.ApproveIdea = approve.ApproveIdea; + newApprove.IsAgree = approve.IsAgree; + newApprove.Type = approve.Type; + db.Doc_DocManageApprove.InsertOnSubmit(newApprove); + db.SubmitChanges(); + return newKeyID; + } + } + + /// + /// 修改文档审批信息 + /// + /// 文档审批实体 + public static void UpdateDocManageApprove(Model.Doc_DocManageApprove approve) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + Model.Doc_DocManageApprove newApprove = db.Doc_DocManageApprove.First(e => e.DocManageApproveId == approve.DocManageApproveId && e.ApproveDate == null); + newApprove.DocId = approve.DocId; + newApprove.ApproveMan = approve.ApproveMan; + newApprove.ApproveDate = approve.ApproveDate; + newApprove.ApproveIdea = approve.ApproveIdea; + newApprove.IsAgree = approve.IsAgree; + newApprove.Type = approve.Type; + db.SubmitChanges(); + } + } + + /// + /// 根据文档编号删除对应的所有文档审批信息 + /// + /// 文档编号 + public static void DeleteDocManageApprovesByDocId(string DocId) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var q = (from x in db.Doc_DocManageApprove where x.DocId == DocId select x).ToList(); + db.Doc_DocManageApprove.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/DocManage/DocManageService.cs b/SGGL/BLL/DocManage/DocManageService.cs new file mode 100644 index 00000000..3fc5a202 --- /dev/null +++ b/SGGL/BLL/DocManage/DocManageService.cs @@ -0,0 +1,205 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.UI.WebControls; + +namespace BLL +{ + public class DocManageService + { + + /// + /// 根据文档信息Id获取一个文档信息 + /// + /// 文档信息Id + /// 一个文档信息实体 + public static Model.Doc_DocManage GetDocByDocId(string DocId) + { + return Funs.DB.Doc_DocManage.FirstOrDefault(x => x.DocId == DocId); + } + + public static void AddDoc(Model.Doc_DocManage Doc) + { + Model.SGGLDB db = Funs.DB; + Model.Doc_DocManage newDoc = new Model.Doc_DocManage(); + newDoc.DocId = Doc.DocId; + newDoc.DocCode = Doc.DocCode; + newDoc.DocName = Doc.DocName; + newDoc.DocTypeId = Doc.DocTypeId; + newDoc.CNProfessionalId = Doc.CNProfessionalId; + newDoc.ProjectId = Doc.ProjectId; + newDoc.DocContent = Doc.DocContent; + newDoc.SendUnitId = Doc.SendUnitId; + newDoc.ReceivUnitIds = Doc.ReceivUnitIds; + newDoc.CompileMan = Doc.CompileMan; + newDoc.AcceptMan = Doc.AcceptMan; + newDoc.CompileDate = Doc.CompileDate; + newDoc.State = Doc.State; + newDoc.AcceptMan= Doc.AcceptMan; + newDoc.DepartId = Doc.DepartId; + newDoc.FinishTime = Doc.FinishTime; + newDoc.ProjectSubjectId = Doc.ProjectSubjectId; + db.Doc_DocManage.InsertOnSubmit(newDoc); + db.SubmitChanges(); + } + + /// + /// 修改文档信息信息 + /// + /// 文档信息实体 + public static void UpdateDoc(Model.Doc_DocManage Doc) + { + Model.SGGLDB db = Funs.DB; + Model.Doc_DocManage newDoc = db.Doc_DocManage.First(e => e.DocId == Doc.DocId); + newDoc.DocCode = Doc.DocCode; + newDoc.DocName = Doc.DocName; + newDoc.DocTypeId = Doc.DocTypeId; + newDoc.CNProfessionalId = Doc.CNProfessionalId; + newDoc.DocContent = Doc.DocContent; + newDoc.SendUnitId = Doc.SendUnitId; + newDoc.ReceivUnitIds = Doc.ReceivUnitIds; + newDoc.State = Doc.State; + newDoc.CompileMan = Doc.CompileMan; + newDoc.AcceptMan= Doc.AcceptMan; + newDoc.CompileDate = Doc.CompileDate; + newDoc.AcceptMan=Doc.AcceptMan; + newDoc.DepartId = Doc.DepartId; + newDoc.FinishTime = Doc.FinishTime; + newDoc.ProjectSubjectId = Doc.ProjectSubjectId; + newDoc.CopyMan = Doc.CopyMan; + db.SubmitChanges(); + } + + /// + /// 根据文档信息Id删除一个文档信息信息 + /// + /// 文档信息Id + public static void DeleteDoc(string DocId) + { + Model.SGGLDB db = Funs.DB; + Model.Doc_DocManage Doc = db.Doc_DocManage.First(e => e.DocId == DocId); + + db.Doc_DocManage.DeleteOnSubmit(Doc); + db.SubmitChanges(); + } + + /// + /// 根据项目Id获取单位名称下拉选择项 + /// + /// + /// + public static ListItem[] GetDocStateList() + { + ListItem[] list = new ListItem[3]; + list[0] = new ListItem("待提交", BLL.Const.Doc_State_0); + list[1] = new ListItem("进行中", BLL.Const.Doc_State_1); + list[2] = new ListItem("已闭环", BLL.Const.Doc_State_2); + return list; + } + + /// + /// 文档状态下拉框 + /// + /// 下拉框名字 + /// 是否显示请选择 + public static void InitDocState(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "Value"; + dropName.DataTextField = "Text"; + dropName.DataSource = GetDocStateList(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + + // + //获取审批状态 + // + // + // + public static string ConvertState(object state) + { + if (state != null) + { + if (state.ToString() == BLL.Const.Doc_State_0) + { + return "待提交"; + } + else if (state.ToString() == BLL.Const.Doc_State_1) + { + return "进行中"; + } + else if (state.ToString() == BLL.Const.Doc_State_2) + { + return "已闭环"; + } + } + return ""; + } + + // + //获取办理人姓名 + // + // + // + public static string ConvertMan(object DocId) + { + if (DocId != null) + { + Model.Doc_DocManageApprove a = DocManageApproveService.GetDocManageApproveByDocId(DocId.ToString()); + if (a != null) + { + if (a.ApproveMan != null) + { + return UserService.GetUserByUserId(a.ApproveMan).UserName; + } + } + else + { + return ""; + } + } + return ""; + } + + /// + /// 根据id获取打印所需要的参数键值对 + /// + /// + /// + public static Dictionary GetPairs(string DocId) + { + Model.Doc_DocManage doc = DocManageService.GetDocByDocId(DocId); + //txtDepart.Text=DepartService.getDepartNameById(doc.DepartId); + string CompileDate = ""; + string FinishTime = ""; + if (doc.CompileDate != null) + { + CompileDate = string.Format("{0:d}", doc.CompileDate); + } + if (doc.FinishTime != null) + { + FinishTime = string.Format("{0:d}", doc.FinishTime); + } + + Dictionary keyValuePairs = new Dictionary(); + /* keyValuePairs.Add("DocCode", doc.DocCode); + keyValuePairs.Add("SendUnitName", BLL.UnitService.GetUnitNameByUnitId(doc.SendUnitId)); + keyValuePairs.Add("DocTypeName", BLL.DocTypeService.GetDocTypeNameById(doc.DocTypeId)); + keyValuePairs.Add("ProSubjectName", ProjectSubjectService.GetProjectSubjectNameById(doc.ProjectSubjectId)); + keyValuePairs.Add("CNProfessionalName", BLL.CNProfessionalService.GetCNProfessionalNameById(doc.CNProfessionalId)); + keyValuePairs.Add("CompileManName", BLL.UserService.GetUserNameByUserId(doc.CompileMan)); + keyValuePairs.Add("DocName", doc.DocName); + keyValuePairs.Add("CompileDate", CompileDate); + keyValuePairs.Add("FinishTime", FinishTime); + keyValuePairs.Add("ReceivUnit", BLL.UnitService.getUnitNamesUnitIds(doc.ReceivUnitIds)); + keyValuePairs.Add("DocContent", doc.DocContent);*/ + return keyValuePairs; + + } + } +} diff --git a/SGGL/BLL/HSSE/ActionPlan/ActionPlan_SubManagerRuleService .cs b/SGGL/BLL/HSSE/ActionPlan/ActionPlan_SubManagerRuleService .cs new file mode 100644 index 00000000..b991bfd4 --- /dev/null +++ b/SGGL/BLL/HSSE/ActionPlan/ActionPlan_SubManagerRuleService .cs @@ -0,0 +1,131 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public static class ActionPlan_SubManagerRuleService + { + /// + /// 根据主键获取管理规定 + /// + /// + /// + public static Model.ActionPlan_SubManagerRule GetManagerRuleById(string managerRuleId) + { + return Funs.DB.ActionPlan_SubManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId); + } + + /// + /// 根据名称获取已发布管理规定的集合 + /// + /// + /// + public static List GetIsIssueManagerRulesByName(string managerRuleName) + { + return (from x in Funs.DB.ActionPlan_SubManagerRule where x.ManageRuleName == managerRuleName && x.IsIssue == true orderby x.IssueDate select x).ToList(); + } + + /// + /// 根据日期获取管理规定集合 + /// + /// 开始时间 + /// 结束时间 + /// 项目号 + /// 管理规定集合 + public static List GetManagerRuleListsByDate(DateTime startTime, DateTime endTime, string projectId) + { + return (from x in Funs.DB.ActionPlan_SubManagerRule where x.CompileDate >= startTime && x.CompileDate <= endTime && x.ProjectId == projectId orderby x.CompileDate select x).ToList(); + } + + /// + /// 根据整理人获取管理规定 + /// + /// + /// + public static List GetManageRuleByCompileMan(string compileMan) + { + return (from x in Funs.DB.ActionPlan_SubManagerRule where x.CompileMan == compileMan select x).ToList(); + } + + /// + /// 添加管理规定 + /// + /// + public static void AddManageRule(Model.ActionPlan_SubManagerRule manageRule) + { + Model.ActionPlan_SubManagerRule newManageRule = new Model.ActionPlan_SubManagerRule + { + ManagerRuleId = manageRule.ManagerRuleId, + ManageRuleCode = manageRule.ManageRuleCode, + ProjectId = manageRule.ProjectId, + ManageRuleName = manageRule.ManageRuleName, + ManageRuleTypeId = manageRule.ManageRuleTypeId, + VersionNo = manageRule.VersionNo, + AttachUrl = manageRule.AttachUrl, + Remark = manageRule.Remark, + CompileMan = manageRule.CompileMan, + CompileDate = manageRule.CompileDate, + Flag = manageRule.Flag, + State = manageRule.State, + SeeFile = manageRule.SeeFile + }; + Funs.DB.ActionPlan_SubManagerRule.InsertOnSubmit(newManageRule); + Funs.DB.SubmitChanges(); + + ////增加一条编码记录 + BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ActionPlan_SubManagerRuleMenuId, manageRule.ProjectId, null, manageRule.ManagerRuleId, manageRule.CompileDate); + } + + /// + /// 修改管理规定 + /// + /// + public static void UpdateManageRule(Model.ActionPlan_SubManagerRule manageRule) + { + Model.ActionPlan_SubManagerRule newManageRule = Funs.DB.ActionPlan_SubManagerRule.FirstOrDefault(e => e.ManagerRuleId == manageRule.ManagerRuleId); + if (newManageRule != null) + { + newManageRule.ManageRuleName = manageRule.ManageRuleName; + newManageRule.ManageRuleTypeId = manageRule.ManageRuleTypeId; + newManageRule.VersionNo = manageRule.VersionNo; + newManageRule.AttachUrl = manageRule.AttachUrl; + newManageRule.Remark = manageRule.Remark; + newManageRule.CompileMan = manageRule.CompileMan; + newManageRule.CompileDate = manageRule.CompileDate; + newManageRule.IsIssue = manageRule.IsIssue; + newManageRule.IssueDate = manageRule.IssueDate; + newManageRule.Flag = manageRule.Flag; + newManageRule.State = manageRule.State; + newManageRule.SeeFile = manageRule.SeeFile; + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除管理规定 + /// + /// + public static void DeleteManageRuleById(string managerRuleId) + { + Model.ActionPlan_SubManagerRule manageRule = Funs.DB.ActionPlan_SubManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId); + if (manageRule != null) + { + if (!string.IsNullOrEmpty(manageRule.AttachUrl)) + { + BLL.UploadFileService.DeleteFile(Funs.RootPath, manageRule.AttachUrl); + } + ///删除编码表记录 + CodeRecordsService.DeleteCodeRecordsByDataId(managerRuleId); + ////删除附件表 + CommonService.DeleteAttachFileById(manageRule.ManagerRuleId); + ////删除审核流程表 + CommonService.DeleteFlowOperateByID(manageRule.ManagerRuleId); + Funs.DB.ActionPlan_SubManagerRule.DeleteOnSubmit(manageRule); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/SysManage/UserService.cs b/SGGL/BLL/SysManage/UserService.cs index 03721d6b..e2154ec2 100644 --- a/SGGL/BLL/SysManage/UserService.cs +++ b/SGGL/BLL/SysManage/UserService.cs @@ -597,6 +597,52 @@ namespace BLL } } + /// + /// Ŀź͵λIdȡûѡ + /// + /// + public static List GetUserListByProjectIdAndUnitIdAndNotCopyManId(string projectId, string unitId, string notCopyManId) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + List list = new List(); + if (!string.IsNullOrEmpty(projectId)) + { + if (!string.IsNullOrEmpty(unitId)) + { + list = (from x in db.Sys_User + join y in db.Project_ProjectUser + on x.UserId equals y.UserId + join z in db.Base_Depart on x.DepartId equals z.DepartId + where y.ProjectId == projectId && x.UnitId == unitId && x.IsPost == true && y.IsPost == true && x.UserId != notCopyManId + orderby z.DepartCode, x.UserName + select x).ToList(); + } + else + { + list = (from x in db.Sys_User + join y in db.Project_ProjectUser + on x.UserId equals y.UserId + join z in db.Base_Depart on x.DepartId equals z.DepartId + where y.ProjectId == projectId && x.IsPost == true && y.IsPost == true && x.UserId != notCopyManId + orderby z.DepartCode, x.UserName + select x).ToList(); + } + + } + else + { + list = (from x in db.Sys_User + join z in db.Base_Depart on x.DepartId equals z.DepartId + where x.UnitId == unitId && x.IsPost == true && x.UserId != notCopyManId + orderby z.DepartCode, x.UserName + select x).ToList(); + } + return list; + } + } + + #region û /// /// û diff --git a/SGGL/FineUIPro.Web/AttachFile/Look.aspx.cs b/SGGL/FineUIPro.Web/AttachFile/Look.aspx.cs index 8f69c8ea..8eb46670 100644 --- a/SGGL/FineUIPro.Web/AttachFile/Look.aspx.cs +++ b/SGGL/FineUIPro.Web/AttachFile/Look.aspx.cs @@ -13,8 +13,8 @@ namespace FineUIPro.Web.AttachFile this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); var url = Request.Params["fileUrl"]; - // var Baseurl = "https://view.officeapps.live.com/op/embed.aspx?src="; - var Baseurl = "https://view.xdocin.com/view?src="; + var Baseurl = "https://view.officeapps.live.com/op/embed.aspx?src="; + // var Baseurl = "https://view.xdocin.com/view?src="; var Fileurl = Funs.SGGLUrl + url.Replace(Funs.RootPath, ""); var newurl = ""; var FiletExtension = Path.GetExtension(url); diff --git a/SGGL/FineUIPro.Web/BaseInfo/DocType.aspx b/SGGL/FineUIPro.Web/BaseInfo/DocType.aspx new file mode 100644 index 00000000..33f16ca5 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/DocType.aspx @@ -0,0 +1,173 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DocType.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.DocType" %> + + + + + + 文档类别 + + + + +
+ + + + + + + + + + + + + <%-- + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/DocType.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/DocType.aspx.cs new file mode 100644 index 00000000..84941c98 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/DocType.aspx.cs @@ -0,0 +1,286 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using BLL; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class DocType : PageBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + ////权限按钮方法 + this.GetButtonPower(); + Funs.DropDownPageSize(this.ddlPageSize); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + //SolutionTempleteTypeService.InitSolutionTempleteDropDownList(drpSolutionTempleteType, true); + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @" select DocTypeId ,DocTypeCode ,DocTypeName,CodeRule from Base_DocType "; + DataTable tb = SQLHelper.GetDataTableRunText(strSql, null); + Grid1.RecordCount = tb.Rows.Count; + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + } + + /// + /// 分页 + /// + /// + private List GetPagedDataTable(int pageIndex, int pageSize) + { + List source = (from x in Funs.DB.Base_DocType orderby x.DocTypeCode select x).ToList(); + List paged = new List(); + + int rowbegin = pageIndex * pageSize; + int rowend = (pageIndex + 1) * pageSize; + if (rowend > source.Count()) + { + rowend = source.Count(); + } + + for (int i = rowbegin; i < rowend; i++) + { + paged.Add(source[i]); + } + + return paged; + } + + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 分页下拉选择 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (judgementDelete(hfFormID.Text, true)) + { + var getDocType = BLL.DocTypeService.GetDocTypeById(hfFormID.Text); + if (getDocType != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, getDocType.DocTypeCode, getDocType.DocTypeId, BLL.Const.DocTypeMenuId, BLL.Const.BtnDelete); + BLL.DocTypeService.DeleteDocTypeById(hfFormID.Text); + + // 重新绑定表格,并模拟点击[新增按钮] + BindGrid(); + PageContext.RegisterStartupScript("onNewButtonClick();"); + } + } + } + + /// + /// 右键删除事件 + /// + /// + /// + 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(); + if (judgementDelete(rowID, true)) + { + var getDocType = BLL.DocTypeService.GetDocTypeById(rowID); + if (getDocType != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, getDocType.DocTypeCode, getDocType.DocTypeId, BLL.Const.DocTypeMenuId, BLL.Const.BtnDelete); + BLL.DocTypeService.DeleteDocTypeById(rowID); + } + } + } + BindGrid(); + PageContext.RegisterStartupScript("onNewButtonClick();"); + } + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!"); + return; + } + string Id = Grid1.SelectedRowID; + var DocType = BLL.DocTypeService.GetDocTypeById(Id); + if (DocType != null) + { + this.txtDocTypeCode.Text = DocType.DocTypeCode; + this.txtDocTypeName.Text = DocType.DocTypeName; + this.txtCodeRule.Text = DocType.CodeRule; + hfFormID.Text = Id; + this.btnDelete.Enabled = true; + } + } + + protected void Grid1_FilterChange(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + string strRowID = hfFormID.Text; + Model.Base_DocType newDocType = new Model.Base_DocType + { + DocTypeCode = this.txtDocTypeCode.Text.Trim(), + DocTypeName = this.txtDocTypeName.Text.Trim(), + CodeRule = txtCodeRule.Text.Trim() + }; + //if (drpSolutionTempleteType.SelectedValue != BLL.Const._Null) { + // newDocType.SolutionTempleteTypeCode = drpSolutionTempleteType.SelectedValue; + //} + if (string.IsNullOrEmpty(strRowID)) + { + newDocType.DocTypeId = SQLHelper.GetNewID(typeof(Model.Base_DocType)); + BLL.DocTypeService.AddDocType(newDocType); + BLL.LogService.AddSys_Log(this.CurrUser, newDocType.DocTypeCode, newDocType.DocTypeId, BLL.Const.DocTypeMenuId, BLL.Const.BtnAdd); + } + else + { + newDocType.DocTypeId = strRowID; + BLL.DocTypeService.UpdateDocType(newDocType); + BLL.LogService.AddSys_Log(this.CurrUser, newDocType.DocTypeCode, newDocType.DocTypeId, BLL.Const.DocTypeMenuId, BLL.Const.BtnModify); + } + this.SimpleForm1.Reset(); + // 重新绑定表格,并点击当前编辑或者新增的行 + BindGrid(); + PageContext.RegisterStartupScript(String.Format("F('{0}').selectRow('{1}');", Grid1.ClientID, newDocType.DocTypeId)); + } + + private void retText() + { + this.hfFormID.Text = string.Empty; + this.txtDocTypeCode.Text = string.Empty; + this.txtDocTypeName.Text = string.Empty; + this.txtCodeRule.Text = string.Empty; + } + + /// + /// 判断是否可删除 + /// + /// + /// + /// + private bool judgementDelete(string id, bool isShow) + { + string content = string.Empty; + //if (Funs.DB.Technique_SpecialScheme.FirstOrDefault(x => x.DocTypeID == id) != null) + //{ + // content = "该专业方案类别已在【专业方案】中使用,不能删除!"; + //} + if (string.IsNullOrEmpty(content)) + { + return true; + } + else + { + if (isShow) + { + Alert.ShowInTop(content); + } + return false; + } + } + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DocTypeMenuId); + 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.btnDelete.Hidden = false; + this.btnMenuDelete.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + } + } + } + #endregion + + #region 验证文档类别名称、编号是否存在 + /// + /// 验证专项方案类型名称、编号是否存在 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + var q = Funs.DB.Base_DocType.FirstOrDefault(x => x.DocTypeCode == this.txtDocTypeCode.Text.Trim() && (x.DocTypeId != hfFormID.Text || (hfFormID.Text == null && x.DocTypeId != null))); + if (q != null) + { + ShowNotify("输入的文档类别编号已存在!", MessageBoxIcon.Warning); + } + + var q2 = Funs.DB.Base_DocType.FirstOrDefault(x => x.DocTypeName == this.txtDocTypeName.Text.Trim() && (x.DocTypeId != hfFormID.Text || (hfFormID.Text == null && x.DocTypeId != null))); + if (q2 != null) + { + ShowNotify("输入的文档类别名称已存在!", MessageBoxIcon.Warning); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/DocType.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/DocType.aspx.designer.cs new file mode 100644 index 00000000..43c98604 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/DocType.aspx.designer.cs @@ -0,0 +1,195 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo { + + + public partial class DocType { + + /// + /// 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; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.SimpleForm SimpleForm1; + + /// + /// hfFormID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hfFormID; + + /// + /// txtDocTypeCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDocTypeCode; + + /// + /// txtDocTypeName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDocTypeName; + + /// + /// txtCodeRule 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCodeRule; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// 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/Comprehensive/InspectionPerson.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx index 1516968c..a9bde66e 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx @@ -6,6 +6,18 @@ 人员报验 +
@@ -17,7 +29,7 @@ runat="server" BoxFlex="1" DataKeyNames="InspectionPersonId" AllowCellEditing="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="InspectionPersonId" AllowSorting="true" SortField="InspectionPersonCode" SortDirection="DESC" OnSort="Grid1_Sort" OnRowCommand="Grid1_RowCommand" - AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" + AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" OnRowDataBound="Grid1_RowDataBound" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true" OnPreRowDataBound="Grid1_PreRowDataBound"> diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.cs index 74436717..2f30e7f4 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.cs @@ -1,4 +1,5 @@ -using BLL; +using Aspose.Words.Tables; +using BLL; using System; using System.Collections.Generic; using System.Data; @@ -295,7 +296,30 @@ namespace FineUIPro.Web.Comprehensive lbfAction1.Enabled = false; } } + protected void Grid1_RowDataBound(object sender, GridRowEventArgs e) + { + DataRowView row = e.DataItem as DataRowView; + + string ValidityDate = row["ValidityDate"].ToString(); + if (!string.IsNullOrEmpty(ValidityDate)) + { + if (DateTime.Compare(DateTime.Parse(ValidityDate).AddDays(-15), DateTime.Now) < 0) + { + // Grid1.Rows[e.RowIndex].RowCssClass = "Red"; + //过期为红色 + e.RowCssClass = "Red"; + + } + } + else + { + e.RowCssClass = "Yellow"; + + + } + + } /// /// Grid行点击事件 /// @@ -338,5 +362,7 @@ namespace FineUIPro.Web.Comprehensive return "编制"; } + + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DocManage/DocFind.aspx b/SGGL/FineUIPro.Web/DocManage/DocFind.aspx new file mode 100644 index 00000000..09f3254c --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocFind.aspx @@ -0,0 +1,125 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DocFind.aspx.cs" Inherits="FineUIPro.Web.DocManage.DocFind" %> + + + + + + 项目分项 + + + + + + + + + + + + + + + + + + + + + + <%-- + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + --%> + + + + + + diff --git a/SGGL/FineUIPro.Web/DocManage/DocFind.aspx.cs b/SGGL/FineUIPro.Web/DocManage/DocFind.aspx.cs new file mode 100644 index 00000000..840300dc --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocFind.aspx.cs @@ -0,0 +1,232 @@ +using System; +using System.Collections.Generic; +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; +using BLL; +using System.IO; + +namespace FineUIPro.Web.DocManage +{ + public partial class DocFind : PageBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + + // 绑定表格 + BindGrid(); + // btnNew.OnClientClick = Window1.GetShowReference("ProjectSubItemEdit.aspx") + "return false;"; + } + } + #region 绑定数据与查看数据 + /// + /// 绑定数据 + /// + public void BindGrid() + { + DataTable tb = BindData(); + Grid1.RecordCount = tb.Rows.Count; + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + } + protected DataTable BindData() + { + string strSql = @"SELECT AttachFileDetaiId + ,ToKeyId + ,Name + ,AliasName + ,Type + ,AttachUrl + ,Classify + ,SourcePath + ,HtmlPath + ,Content + ,size + ,UploadTime + ,U.UserName + FROM dbo.AttachFileDetail as Att + left join Sys_User U on att.UploadMan=U.UserId + left join Doc_DocManage doc on doc.DocId =Att.ToKeyId + where doc.ProjectId=@ProjectId "; + + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId)); + strSql += " AND (doc.ReceivUnitIds like @ReceivUnitId or doc.SendUnitId = @SendUnitId )"; + if (string.IsNullOrEmpty(this.CurrUser.UnitId)) + { + return new DataTable(); + } + listStr.Add(new SqlParameter("@SendUnitId", this.CurrUser.UnitId)); + listStr.Add(new SqlParameter("@ReceivUnitId", "%" + this.CurrUser.UnitId + "%")); + + if (!string.IsNullOrEmpty(this.txtkeyword.Text.Trim())) + { + if (ListFindType.SelectedValue == "Name") + { + strSql += " AND AliasName like @keyword"; + + } + else + { + strSql += " AND Content like @keyword"; + + + } + listStr.Add(new SqlParameter("@keyword", "%" + this.txtkeyword.Text.Trim() + "%")); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + return tb; + } + + private void LookData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + var model = AttachFileDetailService.GetAttachFileDetaiIdById(Grid1.SelectedRowID); + if (!string.IsNullOrEmpty(model.SourcePath)) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("..{0}", model.SourcePath, "查看 - "))); + + } + } + + #endregion + + #region 右键菜单事件 + protected void btnMenuView_Click(object sender, EventArgs e) + { + LookData(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DocFindMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + // this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + // this.btnMenuModify.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + //this.btnMenuDel.Hidden = false; + } + } + } + #endregion + + #region 下拉列表事件 + protected void DropProjectSubject_SelectedIndexChanged(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 表格事件 + + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + LookData(); + } + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + if (e.CommandName == "Preview") + { + var model = BLL.AttachFileDetailService.GetAttachFileDetaiIdById(e.RowID); + if (model != null) + { + string savedName = model.Name; + string xnUrl = model.AttachUrl; + string url = Funs.RootPath + xnUrl; + + FileInfo info = new FileInfo(url); + if (!info.Exists || string.IsNullOrEmpty(savedName)) + { + url = Funs.RootPath + "Images//Null.jpg"; + info = new FileInfo(url); + } + var FiletExtension = Path.GetExtension(savedName); + bool isSupportType = AttachFileDetailService.IsSupportFileType(FiletExtension); + if (isSupportType) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", model.HtmlPath, "查看 -"))); + } + else + { + ShowNotify("不支持预览", MessageBoxIcon.Warning); + + } + } + } + } + + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + + #region 按钮事件 + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + /// + /// 重置 + /// + /// + /// + protected void btnRset_Click(object sender, EventArgs e) + { + txtkeyword.Text = ""; + BindGrid(); + } + + #endregion + + #region 窗体事件 + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DocManage/DocFind.aspx.designer.cs b/SGGL/FineUIPro.Web/DocManage/DocFind.aspx.designer.cs new file mode 100644 index 00000000..a4995dc6 --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocFind.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DocManage +{ + + + public partial class DocFind + { + + /// + /// 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; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// txtkeyword 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtkeyword; + + /// + /// ListFindType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList ListFindType; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// 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; + + /// + /// btnMenuView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuView; + } +} diff --git a/SGGL/FineUIPro.Web/DocManage/DocManage.aspx b/SGGL/FineUIPro.Web/DocManage/DocManage.aspx new file mode 100644 index 00000000..7d08815a --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocManage.aspx @@ -0,0 +1,215 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DocManage.aspx.cs" Inherits="FineUIPro.Web.DocManage.DocManage" %> + + + + + + + 文档管理 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- --%> + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DocManage/DocManage.aspx.cs b/SGGL/FineUIPro.Web/DocManage/DocManage.aspx.cs new file mode 100644 index 00000000..2aa68430 --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocManage.aspx.cs @@ -0,0 +1,343 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.DocManage +{ + public partial class DocManage : PageBase + { + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = CommonService.GetAllButtonList(CurrUser.LoginProjectId, CurrUser.UserId, Const.DocManageMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(Const.BtnAdd)) + { + btnNew.Hidden = false; + + } + if (buttonList.Contains(Const.BtnModify)) + { + btnMenuModify.Hidden = false; + // btnPrint.Hidden = false; + } + if (buttonList.Contains(Const.BtnDelete)) + { + btnMenuDel.Hidden = false; + } + } + } + #endregion + /// + /// 文档主键 + /// + public string DocId + { + get + { + return (string)ViewState["DocId"]; + } + set + { + ViewState["DocId"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + UnitService.GetUnit(drpSendUnit, CurrUser.LoginProjectId, true); + UnitService.GetUnit(drpReceivUnit, CurrUser.LoginProjectId, true); + UserService.InitUserDropDownList(drpCompileMan, CurrUser.LoginProjectId, true); + UserService.InitUserDropDownList(drpAcceptMan, CurrUser.LoginProjectId, true); + DocTypeService.InitDocTypeDropDownList(drpDocType, true); + //CNProfessionalService.InitCNProfessionalDownList(drpCNProfessional, true); + DocManageService.InitDocState(this.drpState, true); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + btnNew.OnClientClick = Window1.GetShowReference("DocManageEdit.aspx") + "return false;"; + GetButtonPower(); + BindData(); + + } + } + + private void BindData() + { + string strSql = @"SELECT doc.DocId,doc.ProjectId,doc.DocCode,doc.DocName,doc.ProjectSubjectId,unit.UnitName as SendUnitName,doc.ReceivUnitIds,docType.DocTypeName," + + @" doc.CompileMan,doc.CompileDate,CNProfessional.ProfessionalName,doc.State,u.userName" + + @" FROM Doc_DocManage doc " + + @" left join Base_Unit unit on unit.unitId=doc.SendUnitId " + + @" left join Base_DocType docType on docType.DocTypeId=doc.DocTypeId " + + @" left join Base_CNProfessional CNProfessional on CNProfessional.CNProfessionalId=doc.CNProfessionalId " + + @" left join sys_User u on u.userId = doc.CompileMan" + + @" where doc.ProjectId=@ProjectId"; + + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId)); + strSql += " AND (doc.CompileDate>=@startTime or @startTime='') and (doc.CompileDate<=@endTime or @endTime='') "; + listStr.Add(new SqlParameter("@startTime", !string.IsNullOrEmpty(txtStartTime.Text.Trim()) ? txtStartTime.Text.Trim() + " 00:00:00" : "")); + listStr.Add(new SqlParameter("@endTime", !string.IsNullOrEmpty(txtEndTime.Text.Trim()) ? txtEndTime.Text.Trim() + " 23:59:59" : "")); + var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId); + if (unit != null && unit.UnitTypeId != BLL.Const.ProjectUnitType_4) + { + strSql += " AND (doc.ReceivUnitIds like @ReceivUnitId or doc.SendUnitId = @SendUnitId )"; + if (string.IsNullOrEmpty(this.CurrUser.UnitId)) + { + return; + } + listStr.Add(new SqlParameter("@SendUnitId", this.CurrUser.UnitId)); + listStr.Add(new SqlParameter("@ReceivUnitId", "%" + this.CurrUser.UnitId + "%")); + } + if (drpSendUnit.SelectedValue != Const._Null) + { + strSql += " AND doc.SendUnitId=@unitId"; + listStr.Add(new SqlParameter("@unitId", drpSendUnit.SelectedValue)); + } + if (drpReceivUnit.SelectedValue != Const._Null) + { + strSql += " AND doc.ReceivUnitIds like @unitId2"; + listStr.Add(new SqlParameter("@unitId2", "%" + drpReceivUnit.SelectedValue + "%")); + } + if (drpDocType.SelectedValue != Const._Null) + { + strSql += " AND doc.DocTypeId=@DocTypeId"; + listStr.Add(new SqlParameter("@DocTypeId", drpDocType.SelectedValue)); + } + //if (drpCNProfessional.SelectedValue != Const._Null) + //{ + // strSql += " AND doc.CNProfessionalId=@CNProfessionalId "; + // listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessional.SelectedValue)); + //} + if (drpState.SelectedValue != Const._Null) + { + strSql += " AND doc.State=@State"; + listStr.Add(new SqlParameter("@State", drpState.SelectedValue)); + } + if (drpCompileMan.SelectedValue != Const._Null) + { + strSql += " AND doc.CompileMan=@CompileMan"; + listStr.Add(new SqlParameter("@CompileMan", drpCompileMan.SelectedValue)); + } + if (drpAcceptMan.SelectedValue != Const._Null) + { + strSql += " AND doc.AcceptMan like @AcceptMan"; + listStr.Add(new SqlParameter("@AcceptMan", "%" + drpAcceptMan.SelectedValue + "%")); + } + + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = GetPagedDataTable(Grid1, tb); + Grid1.RecordCount = tb.Rows.Count; + Grid1.DataSource = table; + Grid1.DataBind(); + for (int i = 0; i < Grid1.Rows.Count; i++) + { + string rowID = Grid1.Rows[i].DataKeys[0].ToString(); + Model.Doc_DocManage doc = BLL.DocManageService.GetDocByDocId(rowID); + if (doc != null) + { + if (doc.State != BLL.Const.Doc_State_2 && doc.FinishTime.Value.AddDays(-1) == DateTime.Now.Date) + { + Grid1.Rows[i].CellCssClasses[8] = "Yellow";//未确认 + } + else if (doc.State != BLL.Const.Doc_State_2 && doc.FinishTime.Value < DateTime.Now.Date) + { + Grid1.Rows[i].CellCssClasses[8] = "Red";//未确认 + } + } + } + } + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + //Grid1.PageIndex = e.NewPageIndex; + BindData(); + } + +/* private void Print(string DocId) + { + var model = DocManageService.GetDocByDocId(DocId); + if (model.State != Const.Doc_State_2) + { + ShowNotify("当前状态未闭环无法打印", MessageBoxIcon.Warning); + return; + } + DataTable dt = new DataTable(); + dt = DocManageApproveService.GetListData(DocId); + if (dt.Columns.Count == 0) + { + dt.Columns.Add("RoleName", typeof(String)); + dt.Columns.Add("ApproveMan", typeof(String)); + dt.Columns.Add("ApproveDate", typeof(String)); + dt.Columns.Add("ApproveIdea", typeof(String)); + + } + var keyValuePairs = BLL.DocManageService.GetPairs(DocId); + dt.TableName = "Table1"; + + BLL.Common.FastReport.ResetData(); + BLL.Common.FastReport.AddFastreportTable(dt); + BLL.Common.FastReport.AddFastreportParameter(keyValuePairs); + string initTemplatePath = "File/Fastreport/新疆文件管理流转表.frx"; + string rootPath = Server.MapPath("~/"); + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + + } + }*/ + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + string itemId = Grid1.DataKeys[e.RowIndex][0].ToString(); + if (e.CommandName == "AttachUrl") + { + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/DocManage&menuId={1}&type=-1", itemId, Const.DocManageMenuId))); + + // PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/Fileuploader.aspx?toKeyId={0}&path=FileUpload/DocManage&type=-1", itemId, "查看 - "))); + }/* + else if (e.CommandName == "Print") + { + Print(itemId); + }*/ + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindData(); + } + + protected void btnQuery_Click(object sender, EventArgs e) + { + BindData(); + } + + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindData(); + } + + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + DocId = Grid1.SelectedRowID.Split(',')[0]; + Model.Doc_DocManage doc = DocManageService.GetDocByDocId(DocId); + Model.Doc_DocManageApprove approve = DocManageApproveService.GetDocManageApproveByDocId(DocId); + + if (doc.State == Const.Doc_State_2) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DocManageView.aspx?DocId={0}", DocId, "编辑 - "))); + return; + } + if (approve != null) + { + if (!string.IsNullOrEmpty(approve.ApproveMan)) + { + if (CurrUser.UserId == approve.ApproveMan || CurrUser.UserId == Const.sysglyId || CurrUser.UserId == Const.hfnbdId) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DocManageEdit.aspx?DocId={0}", DocId, "编辑 - "))); + } + else + { + Alert.ShowInTop("您不是当前办理人,无法操作!", MessageBoxIcon.Warning); + return; + } + } + } + else + { + Alert.ShowInTop("您不是当前办理人,无法操作!", MessageBoxIcon.Warning); + return; + } + } + + protected void btnMenuModify_Click(object sender, EventArgs e) + { + Grid1_RowDoubleClick(null, null); + } + /*protected void btnbtnPrint_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + DocId = Grid1.SelectedRowID.Split(',')[0]; + Print(DocId); + }*/ + protected void btnMenuView_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + DocId = Grid1.SelectedRowID.Split(',')[0]; + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DocManageView.aspx?DocId={0}", DocId, "查看 - "))); + } + + protected void btnMenuDel_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + DocId = Grid1.SelectedRowID.Split(',')[0]; + var code = DocManageService.GetDocByDocId(DocId).DocCode; + //BLL.AttachFileService.DeleteAttachFile(Funs.RootPath, DocId, Const.DocManageMenuId);//删除附件 + // AttachFileDetailService.DeleteFileByToKeyId(DocId);//删除附件 + DocManageApproveService.DeleteDocManageApprovesByDocId(DocId); + DocManageService.DeleteDoc(DocId); + LogService.AddSys_Log(CurrUser, code, DocId, Const.DocManageMenuId, "删除文档"); + BindData(); + Alert.ShowInTop("删除成功!", MessageBoxIcon.Success); + } + + protected void btnRset_Click(object sender, EventArgs e) + { + txtStartTime.Text = ""; + txtEndTime.Text = ""; + drpSendUnit.SelectedIndex = 0; + drpReceivUnit.SelectedIndex = 0; + drpDocType.SelectedIndex = 0; + //drpCNProfessional.SelectedIndex = 0; + drpState.SelectedIndex = 0; + BindData(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DocManage/DocManage.aspx.designer.cs b/SGGL/FineUIPro.Web/DocManage/DocManage.aspx.designer.cs new file mode 100644 index 00000000..af5b20cf --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocManage.aspx.designer.cs @@ -0,0 +1,305 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DocManage +{ + + + public partial class DocManage + { + + /// + /// 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; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpSendUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpSendUnit; + + /// + /// drpCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCompileMan; + + /// + /// txtStartTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStartTime; + + /// + /// txtEndTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndTime; + + /// + /// drpReceivUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpReceivUnit; + + /// + /// drpAcceptMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpAcceptMan; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// drpDocType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpDocType; + + /// + /// drpState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpState; + + /// + /// btnQuery 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery; + + /// + /// btnRset 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRset; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label3; + + /// + /// Label4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label4; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + + /// + /// btnMenuView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuView; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } +} diff --git a/SGGL/FineUIPro.Web/DocManage/DocManageEdit.aspx b/SGGL/FineUIPro.Web/DocManage/DocManageEdit.aspx new file mode 100644 index 00000000..778f5cd2 --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocManageEdit.aspx @@ -0,0 +1,216 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DocManageEdit.aspx.cs" Inherits="FineUIPro.Web.DocManage.DocManageEdit" %> + + + + + + + 文档 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DocManage/DocManageEdit.aspx.cs b/SGGL/FineUIPro.Web/DocManage/DocManageEdit.aspx.cs new file mode 100644 index 00000000..6688dd7d --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocManageEdit.aspx.cs @@ -0,0 +1,710 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Aspose.Words; +using System.Text; +using System.Web.Security; +using System.Collections; + +namespace FineUIPro.Web.DocManage +{ + public partial class DocManageEdit : PageBase + { + /// + /// 主键 + /// + public string DocId + { + get + { + return (string)ViewState["DocId"]; + } + set + { + ViewState["DocId"] = value; + } + } + + /// + /// 办理类型 + /// + public string State + { + get + { + return (string)ViewState["State"]; + } + set + { + ViewState["State"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + UnitService.GetUnit(drpSendUnit, CurrUser.LoginProjectId, true); + UnitService.GetUnit(txtReceivUnit, CurrUser.LoginProjectId, true); + //DepartService.InitDepartDropDownList(drpDepart, this.CurrUser.UnitId, true); + UnitWorkService.InitUnitWorkDownList(drpProSubject, CurrUser.LoginProjectId,true); + DocTypeService.InitDocTypeDropDownList(drpDocType, true); + //CNProfessionalService.InitCNProfessionalDownList(drpCNProfessional, true); + Options.Hidden = true; + rblIsAgree.Visible = false; + DocId = Request.Params["DocId"]; + BindForm(); + InitCopyMan(); + } + } + + private void InitCopyMan() + { + this.trCopyMan.Nodes.Clear(); + this.trCopyMan.ShowBorder = false; + this.trCopyMan.ShowHeader = false; + this.trCopyMan.EnableIcons = true; + this.trCopyMan.AutoScroll = true; + this.trCopyMan.EnableSingleClickExpand = true; + TreeNode rootNode = new TreeNode + { + Text = "抄送人员", + NodeID = "0", + EnableCheckBox = false, + EnableCheckEvent = false, + Expanded = true + }; + this.trCopyMan.Nodes.Add(rootNode); + var units = BLL.UnitService.GetUnitByProjectIdList(this.CurrUser.LoginProjectId); + string notCopyManId = this.CurrUser.UserId; + string exitCopyMan = string.Empty; + if (!string.IsNullOrEmpty(DocId)) + { + Model.Doc_DocManage doc = BLL.DocManageService.GetDocByDocId(DocId); + if (doc != null) + { + notCopyManId = doc.CompileMan; + exitCopyMan = doc.CopyMan ?? string.Empty; + } + } + foreach (var unit in units) + { + TreeNode newNode = new TreeNode(); + newNode.Text = unit.UnitName; + newNode.NodeID = unit.UnitId; + newNode.CommandName = "Unit"; + newNode.EnableExpandEvent = true; + newNode.EnableCheckBox = true; + newNode.EnableCheckEvent = true; + newNode.Expanded = true; + rootNode.Nodes.Add(newNode); + var users = BLL.UserService.GetUserListByProjectIdAndUnitIdAndNotCopyManId(this.CurrUser.LoginProjectId, unit.UnitId, notCopyManId); + //var remove = users.FirstOrDefault(x => x.UserId == notCopyManId); + //users.Remove(remove); + foreach (var user in users) + { + TreeNode newNode2 = new TreeNode(); + if (!string.IsNullOrEmpty(user.DepartId)) + { + newNode2.Text = BLL.DepartService.getDepartNameById(user.DepartId) + "—" + user.UserName; + } + else + { + newNode2.Text = user.UserName; + } + newNode2.NodeID = user.UserId; + newNode2.CommandName = "User"; + newNode2.EnableExpandEvent = true; + newNode2.EnableCheckBox = true; + newNode2.EnableCheckEvent = true; + if (exitCopyMan.Contains(user.UserId)) + { + newNode2.EnableCheckBox = false; + newNode2.EnableCheckEvent = false; + if (!string.IsNullOrEmpty(user.DepartId)) + { + newNode2.Text = BLL.DepartService.getDepartNameById(user.DepartId) + "—" + user.UserName + "(已抄送)"; + } + else + { + newNode2.Text = user.UserName + "(已抄送)"; + } + } + newNode.Nodes.Add(newNode2); + } + } + } + + #region 全选、全不选 + /// + /// 全选、全不选 + /// + /// + /// + protected void trCopyMan_NodeCheck(object sender, FineUIPro.TreeCheckEventArgs e) + { + if (e.Checked) + { + this.trCopyMan.CheckAllNodes(e.Node.Nodes); + SetCheckParentNode(e.Node); + } + else + { + this.trCopyMan.UncheckAllNodes(e.Node.Nodes); + } + } + + /// + /// 选中父节点 + /// + /// + private void SetCheckParentNode(TreeNode node) + { + if (node.ParentNode != null && node.ParentNode.NodeID != "0") + { + node.ParentNode.Checked = true; + if (node.ParentNode.ParentNode.NodeID != "0") + { + SetCheckParentNode(node.ParentNode); + } + } + } + #endregion + + #region 绑定数据 + public void BindForm() + { + if (!string.IsNullOrEmpty(DocId)) + { + hdDocId.Text = DocId; + Model.Doc_DocManage doc = DocManageService.GetDocByDocId(DocId); + + txtDocCode.Text = doc.DocCode; + txtDocName.Text = doc.DocName; + if (!string.IsNullOrEmpty(doc.SendUnitId)) + { + drpSendUnit.SelectedValue = doc.SendUnitId; + // DepartService.InitDepartDropDownList(drpDepart, doc.SendUnitId, true); + } + else + { + drpSendUnit.SelectedValue = ""; + } + //if (!string.IsNullOrEmpty(doc.DepartId)) + //{ + // drpDepart.SelectedValue = doc.DepartId; + //} + //else + //{ + // if (doc.State != Const.Doc_State_0) + // { + // drpDepart.AutoSelectFirstItem = false; + // drpDepart.SelectedValue = ""; + // } + + //} + if (!string.IsNullOrEmpty(doc.ProjectSubjectId)) + { + drpProSubject.SelectedValue = doc.ProjectSubjectId; + } + else + { + if (doc.State != Const.Doc_State_0) + { + drpProSubject.AutoSelectFirstItem = false; + drpProSubject.SelectedValue = ""; + } + + } + if (!string.IsNullOrEmpty(doc.DocTypeId)) + { + drpDocType.SelectedValue = doc.DocTypeId; + } + else + { + if (doc.State != Const.Doc_State_0) + { + drpDocType.AutoSelectFirstItem = false; + drpDocType.SelectedValue = ""; + } + + + } + //if (!string.IsNullOrEmpty(doc.CNProfessionalId)) + //{ + // drpCNProfessional.SelectedValue = doc.CNProfessionalId; + //} + //else + //{ + // if (doc.State != Const.Doc_State_0) + // { + // drpCNProfessional.AutoSelectFirstItem = false; + // drpCNProfessional.SelectedValue = ""; + // } + + //} + txtCompileMan.Text = BLL.UserService.GetUserNameByUserId(doc.CompileMan); + if (doc.CompileDate != null) + { + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", doc.CompileDate); + } + if (doc.FinishTime != null) + { + this.txtFinishTime.Text = string.Format("{0:yyyy-MM-dd}", doc.FinishTime); + } + txtDocContent.Text = doc.DocContent; + if (!string.IsNullOrEmpty(doc.State)) + { + State = doc.State; + if (doc.State == BLL.Const.Doc_State_1 && this.CurrUser.UserId != doc.CompileMan) + { + + CCfile.Hidden = true; + Options.Hidden = false; + txtDocCode.Readonly = true; + txtDocName.Readonly = true; + drpSendUnit.Readonly = true; + //drpDepart.Readonly = true; + drpDocType.Readonly = true; + //drpCNProfessional.Readonly = true; + txtCompileMan.Readonly = true; + txtCompileDate.Readonly = true; + txtFinishTime.Readonly = true; + txtDocContent.Readonly = true; + drpProSubject.Readonly = true; + + } + else if (doc.State == BLL.Const.Doc_State_1 && this.CurrUser.UserId == doc.CompileMan) + { + Options.Hidden = false; + } + } + else + { + State = Const.Doc_State_0; + Options.Hidden = true; + rblIsAgree.Visible = false; + } + BindGrid(); + } + else + { + State = Const.Doc_State_0; + plApprove2.Hidden = true; + this.txtCompileMan.Text = this.CurrUser.UserName; + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + drpSendUnit.SelectedValue = this.CurrUser.UnitId; + } + + } + public void BindGrid() + { + var data = DocManageApproveService.GetListData(DocId); + gvApprove.DataSource = data; + gvApprove.DataBind(); + } + + #endregion + + + protected void drpHandleType_SelectedIndexChanged(object sender, EventArgs e) + { + if (drpHandleMan.Items.Count > 0) + { + drpHandleMan.SelectedIndex = 0; + } + + if (drpHandleType.SelectedValue == Const.Doc_State_2) + { + txtReceivUnit.Enabled = false; + txtReceivUnit.Required = false; + txtReceivUnit.SelectedIndex = 0; + drpHandleMan.Enabled = false; + drpHandleMan.Required = false; + + } + else + { + txtReceivUnit.Enabled = true; + txtReceivUnit.Required = true; + + drpHandleMan.Enabled = true; + drpHandleMan.Required = true; + } + } + public void submitPauseNotice() + { + SavePauseNotice(); + Model.Doc_DocManage doc = DocManageService.GetDocByDocId(DocId); + + if (!string.IsNullOrEmpty(DocId)) + { + Model.Doc_DocManageApprove approve1 = DocManageApproveService.GetDocManageApproveByDocId(DocId); //获取当前审批人 + if (doc.State == Const.Doc_State_0) + { + DocManageApproveService.DeleteDocManageApprovesByDocId(DocId); + approve1 = DocManageApproveService.GetDocManageApproveByDocId(DocId); + } + doc.State = drpHandleType.SelectedValue.Trim(); + if (approve1 != null) + { + approve1.ApproveDate = DateTime.Now; + approve1.ApproveIdea = txtOpinions.Text.Trim(); + DocManageApproveService.UpdateDocManageApprove(approve1); + if (doc.State == Const.Doc_State_1) + { + Model.Doc_DocManageApprove approve = new Model.Doc_DocManageApprove(); + approve.DocId = doc.DocId; + if (drpHandleMan.SelectedValue != BLL.Const._Null) + { + approve.ApproveMan = drpHandleMan.SelectedValue; + if (string.IsNullOrEmpty(doc.AcceptMan)) + { + doc.AcceptMan = doc.AcceptMan + drpHandleMan.SelectedValue; + + } + else + { + doc.AcceptMan = doc.AcceptMan + "," + drpHandleMan.SelectedValue; + + } + if (!string.IsNullOrEmpty(doc.ReceivUnitIds) && !doc.ReceivUnitIds.Contains(txtReceivUnit.SelectedValue)) + { + doc.ReceivUnitIds = doc.ReceivUnitIds + "," + txtReceivUnit.SelectedValue; + + } + else if (string.IsNullOrEmpty(doc.ReceivUnitIds)) + { + doc.ReceivUnitIds = txtReceivUnit.SelectedValue; + } + + } + DocManageApproveService.AddDocManageApprove(approve); + } + } + else + { + Model.Doc_DocManageApprove approve = new Model.Doc_DocManageApprove(); + approve.DocId = doc.DocId; + if (drpHandleMan.SelectedValue != BLL.Const._Null) + { + approve.ApproveMan = drpHandleMan.SelectedValue; + if (string.IsNullOrEmpty(doc.AcceptMan)) + { + doc.AcceptMan = doc.AcceptMan + drpHandleMan.SelectedValue; + + } + else + { + doc.AcceptMan = doc.AcceptMan + "," + drpHandleMan.SelectedValue; + + } + if (!string.IsNullOrEmpty(doc.ReceivUnitIds) && !doc.ReceivUnitIds.Contains(txtReceivUnit.SelectedValue)) + { + doc.ReceivUnitIds = doc.ReceivUnitIds + "," + txtReceivUnit.SelectedValue; + + } + else if (string.IsNullOrEmpty(doc.ReceivUnitIds)) + { + doc.ReceivUnitIds = txtReceivUnit.SelectedValue; + } + + } + DocManageApproveService.AddDocManageApprove(approve); + } + + DocManageService.UpdateDoc(doc); + } + NoticeCreateUser(DocId); + NoticeCopyMan(DocId); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + LogService.AddSys_Log(CurrUser, doc.DocCode, DocId, Const.DocManageMenuId, "编辑文档"); + } + /// + /// 保存文档 + /// + private void SavePauseNotice() + { + Model.Doc_DocManage doc = new Model.Doc_DocManage(); + doc.DocCode = txtDocCode.Text.Trim(); + doc.DocName = txtDocName.Text.Trim(); + doc.ProjectId = CurrUser.LoginProjectId; + if (drpSendUnit.SelectedValue != BLL.Const._Null) + { + doc.SendUnitId = drpSendUnit.SelectedValue; + } + //if (drpDepart.SelectedValue != BLL.Const._Null) + //{ + // doc.DepartId = drpDepart.SelectedValue; + //} + if (drpProSubject.SelectedValue != BLL.Const._Null) + { + doc.ProjectSubjectId = drpProSubject.SelectedValue; + } + if (drpDocType.SelectedValue != BLL.Const._Null) + { + doc.DocTypeId = drpDocType.SelectedValue; + } + //if (drpCNProfessional.SelectedValue != BLL.Const._Null) + //{ + // doc.CNProfessionalId = drpCNProfessional.SelectedValue; + //} + //else + //{ + // var model = BLL.CNProfessionalService.GetCNProfessionalByName("通用"); + // if (model != null) + // { + // doc.CNProfessionalId = model.CNProfessionalId; + + // } + //} + doc.CompileDate = Funs.GetNewDateTimeOrNow(this.txtCompileDate.Text.Trim()); + doc.FinishTime = Funs.GetNewDateTimeOrNow(this.txtFinishTime.Text.Trim()); + + doc.DocContent = txtDocContent.Text.Trim(); + + if (!string.IsNullOrEmpty(DocId)) + { + var model = DocManageService.GetDocByDocId(DocId); + string state = model.State; + doc.DocId = DocId; + doc.State = string.IsNullOrEmpty(state) ? Const.Doc_State_0 : state; + doc.CompileMan = model.CompileMan; + doc.ReceivUnitIds = model.ReceivUnitIds; + doc.AcceptMan = model.AcceptMan; + doc.CopyMan = model.CopyMan; + DocManageService.UpdateDoc(doc); + } + else + { + if (!string.IsNullOrEmpty(hdDocId.Text)) + { + doc.DocId = hdDocId.Text; + } + else + { + doc.DocId = SQLHelper.GetNewID(typeof(Model.Doc_DocManage)); + } + DocId = doc.DocId; + doc.CompileMan = CurrUser.UserId; + doc.State = Const.Doc_State_0; + DocManageService.AddDoc(doc); + + Model.Doc_DocManageApprove approve1 = new Model.Doc_DocManageApprove(); + approve1.DocId = doc.DocId; + approve1.ApproveMan = CurrUser.UserId; + DocManageApproveService.AddDocManageApprove(approve1); + } + //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + LogService.AddSys_Log(CurrUser, doc.DocCode, DocId, Const.DocManageMenuId, "编辑文档"); + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.UserId, Const.DocManageMenuId, Const.BtnSave)) + { + SavePauseNotice(); + + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + + } + } + /// + /// 闭环时推送通知到提出者 + /// + /// + public void NoticeCreateUser(string DocId) + { + var model = DocManageService.GetDocByDocId(DocId); + if (model != null) + { + if (model.State == Const.Doc_State_2) + { + Model.Doc_DocManageApprove approve = new Model.Doc_DocManageApprove(); + approve.DocId = model.DocId; + approve.ApproveMan = model.CompileMan; + approve.Type = "s"; + DocManageApproveService.AddDocManageApprove(approve); + + } + + } + } + /// + /// 推送通知到抄送人员 + /// + /// + public void NoticeCopyMan(string DocId) + { + TreeNode[] nodes = this.trCopyMan.GetCheckedNodes(); + string copyMan = string.Empty; + if (nodes.Length > 0) + { + foreach (TreeNode tn in nodes) + { + if (tn.CommandName == "User") + { + Model.Doc_DocManageApprove approve = new Model.Doc_DocManageApprove(); + approve.DocId = DocId; + approve.ApproveMan = tn.NodeID; + approve.Type = "s"; + DocManageApproveService.AddDocManageApprove(approve); + copyMan += tn.NodeID + ","; + } + } + } + if (!string.IsNullOrEmpty(copyMan)) + { + copyMan = copyMan.Substring(0, copyMan.Length - 1); + } + Model.Doc_DocManage doc = BLL.DocManageService.GetDocByDocId(DocId); + if (doc != null) + { + if (string.IsNullOrEmpty(doc.CopyMan)) + { + doc.CopyMan = copyMan; + } + else + { + doc.CopyMan = doc.CopyMan + "," + copyMan; + } + BLL.DocManageService.UpdateDoc(doc); + } + } + protected void btnSubmit_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.UserId, Const.DocManageMenuId, Const.BtnSave)) + { + if (this.drpHandleType.SelectedValue != BLL.Const.Doc_State_2 && string.IsNullOrEmpty(this.txtReceivUnit.SelectedValue)) + { + Alert.ShowInTop("请选择单位后再提交!", MessageBoxIcon.Warning); + return; + } + if (this.drpHandleType.SelectedValue != BLL.Const.Doc_State_2 && this.drpHandleMan.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择办理人后再提交!", MessageBoxIcon.Warning); + return; + } + if (Options.Hidden == false && string.IsNullOrEmpty(this.txtOpinions.Text.Trim())) + { + Alert.ShowInTop("请输入办理意见!", MessageBoxIcon.Warning); + return; + } + //if ( this.drpDepart.SelectedValue == BLL.Const._Null) + //{ + // Alert.ShowInTop("请选择部门后再提交!", MessageBoxIcon.Warning); + // return; + //} + submitPauseNotice(); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + protected void imgfile_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(hdDocId.Text)) //新增记录 + { + hdDocId.Text = SQLHelper.GetNewID(typeof(Model.Doc_DocManage)); + } + //string SourcePath = Request.RawUrl; + string SourcePath = "/DocManage/DocManageView.aspx?DocId=" + hdDocId.Text; + //SourcePath= SourcePath.Replace("DocManageEdit", "DocManageView"); + string Classify = "文档管理-文档管理"; + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/DocManage&menuId={1}", hdDocId.Text, Const.DocManageMenuId))); + //PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/DocManage&SourcePath={1}&Classify={2}", hdDocId.Text, SourcePath, Classify))); + } + /// + /// 总包的操作 + /// + public void NotEdit() + { + txtDocCode.Enabled = false; + txtDocName.Enabled = false; + drpSendUnit.Enabled = false; + txtReceivUnit.Enabled = false; + drpDocType.Enabled = false; + // drpCNProfessional.Enabled = false; + txtCompileMan.Enabled = false; + txtCompileDate.Enabled = false; + txtDocContent.Enabled = false; + } + + protected void txtReceivUnit_TextChanged(object sender, EventArgs e) + { + UserService.InitUserProjectIdUnitIdDropDownList(drpHandleMan, CurrUser.LoginProjectId, this.txtReceivUnit.SelectedValue, true); + if (this.drpHandleMan.Items.Count >= 2) + { + this.drpHandleMan.SelectedIndex = 1; + } + else + { + this.drpHandleMan.SelectedIndex = 0; + } + } + protected void ChangeDocCode(object sender, EventArgs e) + { + //string Code = "AAAA-BBBB-CCCC-DD-EEE-FFFF"; + if (drpDocType.SelectedValue == Const._Null) + { + return; + } + var Typemodel = DocTypeService.GetDocTypeById(drpDocType.SelectedValue); + if (string.IsNullOrEmpty(Typemodel.CodeRule)) + { + ShowNotify("请维护当前类型编码规则", MessageBoxIcon.Warning); + txtDocCode.Text = ""; + return; + } + string CodeRule = Typemodel.CodeRule; + string[] CodeList = CodeRule.Split('-'); + if (CodeList == null && CodeList.Length != 6) + { + ShowNotify("请维护当前类型编码规则", MessageBoxIcon.Warning); + txtDocCode.Text = ""; + + return; + } + CodeList[0] = "CWCEC"; + if (drpSendUnit.SelectedValue != Const._Null) + { + CodeList[1] = UnitService.GetUnitCodeByUnitId(drpSendUnit.SelectedValue); + } + + if (drpProSubject.SelectedValue != Const._Null && !string.IsNullOrEmpty(drpProSubject.SelectedValue)) + { + CodeList[2] = UnitWorkService.getUnitWorkByUnitWorkId(drpProSubject.SelectedValue).UnitWorkCode; + + } + else + { + CodeList[2] = "0000"; + + } + //if (drpDepart.SelectedValue!=Const._Null) + //{ + // CodeList[3] = DepartService.GetDepartById(drpDepart.SelectedValue).DepartCode; + //} + + ArrayList al = new ArrayList(CodeList); + al.RemoveAt(5); + CodeList = (string[])al.ToArray(typeof(string)); + + string Code = string.Join("-", CodeList); + Code += "-"; + txtDocCode.Text = SQLHelper.RunProcNewIdByProjectId("SpGetNewCode5ByProjectId", "dbo.Doc_DocManage", "DocCode", CurrUser.LoginProjectId, Code); + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DocManage/DocManageEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/DocManage/DocManageEdit.aspx.designer.cs new file mode 100644 index 00000000..1f3b5796 --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocManageEdit.aspx.designer.cs @@ -0,0 +1,350 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DocManage +{ + + + public partial class DocManageEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// ContentPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel2; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtDocCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDocCode; + + /// + /// drpDocType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpDocType; + + /// + /// drpSendUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpSendUnit; + + /// + /// drpProSubject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProSubject; + + /// + /// txtCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileMan; + + /// + /// txtDocName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDocName; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// txtFinishTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtFinishTime; + + /// + /// txtDocContent 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDocContent; + + /// + /// CCfile 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel CCfile; + + /// + /// imgfile 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgfile; + + /// + /// Options 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow Options; + + /// + /// txtOpinions 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtOpinions; + + /// + /// next 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow next; + + /// + /// ContentPanel5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel5; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// rblIsAgree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rblIsAgree; + + /// + /// drpHandleType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList drpHandleType; + + /// + /// txtReceivUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList txtReceivUnit; + + /// + /// drpHandleMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpHandleMan; + + /// + /// trCopyMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree trCopyMan; + + /// + /// plApprove2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow plApprove2; + + /// + /// gvApprove 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvApprove; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdDocId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdDocId; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnSubmit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSubmit; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdId; + + /// + /// hdAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdAttachUrl; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/DocManage/DocManageView.aspx b/SGGL/FineUIPro.Web/DocManage/DocManageView.aspx new file mode 100644 index 00000000..a561b1d7 --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocManageView.aspx @@ -0,0 +1,167 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DocManageView.aspx.cs" Inherits="FineUIPro.Web.DocManage.DocManageView" %> + + + + + + + 文档 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DocManage/DocManageView.aspx.cs b/SGGL/FineUIPro.Web/DocManage/DocManageView.aspx.cs new file mode 100644 index 00000000..89934393 --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocManageView.aspx.cs @@ -0,0 +1,159 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Aspose.Words; +using System.Text; +using System.Web.Security; + +namespace FineUIPro.Web.DocManage +{ + public partial class DocManageView : PageBase + { + /// + /// 主键 + /// + public string DocId + { + get + { + return (string)ViewState["DocId"]; + } + set + { + ViewState["DocId"] = value; + } + } + + /// + /// 办理类型 + /// + public string State + { + get + { + return (string)ViewState["State"]; + } + set + { + ViewState["State"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + string Type = Request.Params["Type"]; + DocId = Request.Params["DocId"]; + if (!string.IsNullOrEmpty(DocId)) + { + hdDocId.Text = DocId; + Model.Doc_DocManage doc = DocManageService.GetDocByDocId(DocId); + txtDocCode.Text = doc.DocCode; + txtDocName.Text = doc.DocName; + txtSendUnit.Text = BLL.UnitService.GetUnitNameByUnitId(doc.SendUnitId); + txtReceivUnit.Text = BLL.UnitService.getUnitNamesUnitIds(doc.ReceivUnitIds); + txtDocType.Text = BLL.DocTypeService.GetDocTypeNameById(doc.DocTypeId); + txtCompileMan.Text = BLL.UserService.GetUserNameByUserId(doc.CompileMan); + txtProSubject.Text = UnitWorkService.GetNameById(doc.ProjectSubjectId); + // txtCNProfessional.Text = BLL.CNProfessionalService.GetCNProfessionalNameById(doc.CNProfessionalId); + //txtDepart.Text=DepartService.getDepartNameById(doc.DepartId); + + if (doc.CompileDate != null) + { + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", doc.CompileDate); + } + if (doc.FinishTime != null) + { + this.txtFinishTime.Text = string.Format("{0:yyyy-MM-dd}", doc.FinishTime); + } + txtDocContent.Text = doc.DocContent; + if (!string.IsNullOrEmpty(doc.State)) + { + State = doc.State; + } + else + { + State = Const.Doc_State_0; + } + BindGrid(); + if (!string.IsNullOrEmpty(Type) && Type == "notice") + { + var q = DocManageApproveService.GetNoticeDocManageApproveByDocId(DocId, this.CurrUser.UserId); + if (q != null && q.ApproveMan == this.CurrUser.UserId) + { + q.ApproveDate = DateTime.Now; + + DocManageApproveService.UpdateDocManageApprove(q); + } + + } + + } + } + } + + public void BindGrid() + { + var data = DocManageApproveService.GetListData(DocId); + gvApprove.DataSource = data; + gvApprove.DataBind(); + } + + protected void imgfile_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(hdDocId.Text)) //新增记录 + { + hdDocId.Text = SQLHelper.GetNewID(typeof(Model.Doc_DocManage)); + } + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/DocManage&menuId={1}&type=-1", hdDocId.Text, Const.DocManageMenuId))); + + // PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/Fileuploader.aspx?toKeyId={0}&path=FileUpload/DocManage&menuId={1}&type=-1", hdDocId.Text, Const.DocManageMenuId))); + } + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + + + } + +/* protected void btnPrint_Click(object sender, EventArgs e) + { + var model = DocManageService.GetDocByDocId(DocId); + if (model.State != Const.Doc_State_2) + { + ShowNotify("当前状态未闭环无法打印", MessageBoxIcon.Warning); + return; + } + DataTable dt = new DataTable(); + dt = DocManageApproveService.GetListData(DocId); + if (dt.Columns.Count == 0) + { + dt.Columns.Add("RoleName", typeof(String)); + dt.Columns.Add("ApproveMan", typeof(String)); + dt.Columns.Add("ApproveDate", typeof(String)); + dt.Columns.Add("ApproveIdea", typeof(String)); + + } + var keyValuePairs = BLL.DocManageService.GetPairs(DocId); + dt.TableName = "Table1"; + + BLL.Common.FastReport.ResetData(); + BLL.Common.FastReport.AddFastreportTable(dt); + BLL.Common.FastReport.AddFastreportParameter(keyValuePairs); + string initTemplatePath = "File/Fastreport/新疆文件管理流转表.frx"; + string rootPath = Server.MapPath("~/"); + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + + } + } +*/ } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DocManage/DocManageView.aspx.designer.cs b/SGGL/FineUIPro.Web/DocManage/DocManageView.aspx.designer.cs new file mode 100644 index 00000000..a423bafd --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/DocManageView.aspx.designer.cs @@ -0,0 +1,242 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DocManage +{ + + + public partial class DocManageView + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// ContentPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel2; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtDocCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDocCode; + + /// + /// txtDocType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDocType; + + /// + /// txtSendUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSendUnit; + + /// + /// txtProSubject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProSubject; + + /// + /// txtReceivUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtReceivUnit; + + /// + /// txtDocName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDocName; + + /// + /// txtCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileMan; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileDate; + + /// + /// txtFinishTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtFinishTime; + + /// + /// txtDocContent 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDocContent; + + /// + /// plApprove2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow plApprove2; + + /// + /// gvApprove 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvApprove; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdDocId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdDocId; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdId; + + /// + /// hdAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdAttachUrl; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + } +} diff --git a/SGGL/FineUIPro.Web/DocManage/FileCabinet.aspx b/SGGL/FineUIPro.Web/DocManage/FileCabinet.aspx new file mode 100644 index 00000000..221da37e --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/FileCabinet.aspx @@ -0,0 +1,206 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileCabinet.aspx.cs" Inherits="FineUIPro.Web.DocManage.FileCabinet" %> + + + + + + + 文件柜 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DocManage/FileCabinet.aspx.cs b/SGGL/FineUIPro.Web/DocManage/FileCabinet.aspx.cs new file mode 100644 index 00000000..a0019afb --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/FileCabinet.aspx.cs @@ -0,0 +1,325 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.DocManage +{ + public partial class FileCabinet : PageBase + { + + + public string TreeCommand + { + get + { + return (string)ViewState["TreeCommand"]; + } + set + { + ViewState["TreeCommand"] = value; + } + } + #region 页面加载 + /// + /// 页面加载 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + InitTreeMenu(); + } + } + #endregion + + #region 加载树 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + if (string.IsNullOrEmpty(this.CurrUser.UnitId)) + { + return; + } + this.tree1.Nodes.Clear(); + this.tree1.ShowBorder = false; + this.tree1.ShowHeader = false; + this.tree1.EnableIcons = true; + this.tree1.AutoScroll = true; + this.tree1.EnableSingleClickExpand = true; + if (RadioType.SelectedValue == "Unit") + { + List base_Unit = new List(); + // base_Unit = BLL.UnitService.GetUnitListByProjectId(this.CurrUser.LoginProjectId); + + var list = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId); + base_Unit.Add(list); + foreach (var q in base_Unit) //二级树 + { + TreeNode newNode = new TreeNode(); + newNode.Text = q.UnitName; + newNode.NodeID = q.UnitId; + newNode.CommandName = "Unit"; + newNode.EnableExpandEvent = true; + newNode.EnableClickEvent = true; + this.tree1.Nodes.Add(newNode); + //TreeNode emptyNode = new TreeNode(); + //emptyNode.Text = ""; + //emptyNode.NodeID = ""; + //newNode.Nodes.Add(emptyNode); + } + } + else + { + var DocTypeList= DocTypeService.GetDocTypeList(); + + foreach (var q in DocTypeList) + { + TreeNode newNode = new TreeNode(); + newNode.Text = q.DocTypeName; + newNode.NodeID = q.DocTypeId; + newNode.CommandName = "DocType"; + newNode.EnableExpandEvent = true; + newNode.EnableClickEvent = true; + this.tree1.Nodes.Add(newNode); + } + } + } + #endregion + + #region Tree事件 + /// + /// Tree点击事件 + /// + /// + /// + protected void tree1_NodeCommand(object sender, TreeCommandEventArgs e) + { + TreeCommand = e.CommandName; + BindGrid(); + } + + protected void tree1_NodeExpand(object sender, TreeNodeEventArgs e) + { + e.Node.Nodes.Clear(); + if (e.Node.CommandName == "Unit") //展开部门 + { + var DepartList= DepartService.GetDepartList(e.Node.NodeID); + foreach (var depart in DepartList) + { + TreeNode newNode1 = new TreeNode(); + newNode1.Text = depart.DepartName; + newNode1.NodeID = depart.DepartId; + newNode1.CommandName = "Depart"; + newNode1.EnableExpandEvent = true; + newNode1.EnableClickEvent = true; + e.Node.Nodes.Add(newNode1); + } + } + + } + #endregion + + #region 绑定数据 + private void BindGrid() + { + string strSql = @"SELECT doc.DocId,doc.ProjectId,doc.DocCode,doc.DocName,unit.UnitName as SendUnitName,doc.ReceivUnitIds,docType.DocTypeName," + + @" doc.CompileMan,doc.CompileDate,CNProfessional.ProfessionalName,doc.State,u.userName" + + @" FROM Doc_DocManage doc " + + @" left join Base_Unit unit on unit.unitId=doc.SendUnitId " + + @" left join Base_DocType docType on docType.DocTypeId=doc.DocTypeId " + + @" left join Base_CNProfessional CNProfessional on CNProfessional.CNProfessionalId=doc.CNProfessionalId " + + @" left join sys_User u on u.userId = doc.CompileMan" + + @" where doc.ProjectId=@ProjectId"; + + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId)); + if (TreeCommand== "Unit" && !string.IsNullOrEmpty(tree1.SelectedNodeID)) + { + strSql += " AND doc.SendUnitId=@unitId"; + listStr.Add(new SqlParameter("@unitId", tree1.SelectedNodeID)); + } + else if (TreeCommand== "Depart" && !string.IsNullOrEmpty(tree1.SelectedNodeID)) + { + strSql += " AND doc.DepartId=@DepartId"; + listStr.Add(new SqlParameter("@DepartId", tree1.SelectedNodeID)); + } + else if (TreeCommand== "DocType") + { + + //ReceivUnitIds SendUnitId + strSql += " AND (doc.ReceivUnitIds like @ReceivUnitId or doc.SendUnitId = @SendUnitId )"; + listStr.Add(new SqlParameter("@SendUnitId", this.CurrUser.UnitId)); + listStr.Add(new SqlParameter("@ReceivUnitId", "%" + this.CurrUser.UnitId + "%")); + strSql += " AND doc.DocTypeId=@DocTypeId"; + listStr.Add(new SqlParameter("@DocTypeId", tree1.SelectedNodeID)); + + } + + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = GetPagedDataTable(Grid1, tb); + Grid1.RecordCount = tb.Rows.Count; + Grid1.DataSource = table; + Grid1.DataBind(); + } + + #endregion + + #region 表格事件 + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// Grid1排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../DocManage/DocManageView.aspx?DocId={0}", Grid1.SelectedRowID, "查看 - "))); + + + } + /// + /// 行点击事件 + /// + /// + /// + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + string id = e.RowID; + if (e.CommandName.Equals("AttachUrl")) + { + string menuId = Const.ProjectControlPointMenuId; + PageContext.RegisterStartupScript(WindowAtt.GetShowReference( + String.Format("../AttachFile/Fileuploader.aspx?type=-1&source=1&toKeyId={0}&path=FileUpload/BreakdownProject&menuId={1}", id, menuId))); + } + else if (e.CommandName == "Print") + { + Print(id); + } + } + + #endregion + private void Print(string DocId) + { + var model = DocManageService.GetDocByDocId(DocId); + if (model.State != Const.Doc_State_2) + { + ShowNotify("当前状态未闭环无法打印", MessageBoxIcon.Warning); + return; + } + DataTable dt = new DataTable(); + dt = DocManageApproveService.GetListData(DocId); + if (dt.Columns.Count == 0) + { + dt.Columns.Add("RoleName", typeof(String)); + dt.Columns.Add("ApproveMan", typeof(String)); + dt.Columns.Add("ApproveDate", typeof(String)); + dt.Columns.Add("ApproveIdea", typeof(String)); + + } + var keyValuePairs = BLL.DocManageService.GetPairs(DocId); + dt.TableName = "Table1"; + + BLL.Common.FastReport.ResetData(); + BLL.Common.FastReport.AddFastreportTable(dt); + BLL.Common.FastReport.AddFastreportParameter(keyValuePairs); + string initTemplatePath = "File/Fastreport/新疆文件管理流转表.frx"; + string rootPath = Server.MapPath("~/"); + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + + } + } + + + #region 右键菜单事件 + protected void btnMenuView_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../DocManage/DocManageView.aspx?DocId={0}", 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.ProjectControlPointMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + // this.btnNew.Hidden = false; + } + } + } + #endregion + + protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) + { + InitTreeMenu(); + + } + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DocManage/FileCabinet.aspx.designer.cs b/SGGL/FineUIPro.Web/DocManage/FileCabinet.aspx.designer.cs new file mode 100644 index 00000000..7a095ba8 --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/FileCabinet.aspx.designer.cs @@ -0,0 +1,224 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DocManage +{ + + + public partial class FileCabinet + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// RadioType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList RadioType; + + /// + /// tree1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tree1; + + /// + /// hdSelectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdSelectId; + + /// + /// hdUnitWorkId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdUnitWorkId; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label3; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuView; + } +} diff --git a/SGGL/FineUIPro.Web/DocManage/PersonalFileCabinet.aspx b/SGGL/FineUIPro.Web/DocManage/PersonalFileCabinet.aspx new file mode 100644 index 00000000..48a57f97 --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/PersonalFileCabinet.aspx @@ -0,0 +1,216 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonalFileCabinet.aspx.cs" Inherits="FineUIPro.Web.DocManage.PersonalFileCabinet" %> + + + + + + + 文件柜 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DocManage/PersonalFileCabinet.aspx.cs b/SGGL/FineUIPro.Web/DocManage/PersonalFileCabinet.aspx.cs new file mode 100644 index 00000000..40b43c96 --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/PersonalFileCabinet.aspx.cs @@ -0,0 +1,287 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.DocManage +{ + public partial class PersonalFileCabinet : PageBase + { + #region 页面加载 + /// + /// 页面加载 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + InitTreeMenu(); + } + } + #endregion + + #region 加载树 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + if (string.IsNullOrEmpty(this.CurrUser.UnitId)) + { + return; + } + this.tree1.Nodes.Clear(); + this.tree1.ShowBorder = false; + this.tree1.ShowHeader = false; + this.tree1.EnableIcons = true; + this.tree1.AutoScroll = true; + this.tree1.EnableSingleClickExpand = true; + if (RadioType.SelectedValue == "Unit") + { + List base_Unit = new List(); + var list = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId); //非业主 + base_Unit.Add(list); + + foreach (var q in base_Unit) + { + TreeNode newNode = new TreeNode(); + newNode.Text = q.UnitName; + newNode.NodeID = q.UnitId; + newNode.CommandName = "Unit"; + newNode.EnableExpandEvent = true; + newNode.EnableClickEvent = true; + this.tree1.Nodes.Add(newNode); + } + + } + else + { + var DocTypeList = DocTypeService.GetDocTypeList(); + + foreach (var q in DocTypeList) + { + TreeNode newNode = new TreeNode(); + newNode.Text = q.DocTypeName; + newNode.NodeID = q.DocTypeId; + newNode.EnableExpandEvent = true; + newNode.EnableClickEvent = true; + this.tree1.Nodes.Add(newNode); + + } + + } + + } + #endregion + + #region Tree点击事件 + /// + /// Tree点击事件 + /// + /// + /// + protected void tree1_NodeCommand(object sender, TreeCommandEventArgs e) + { + BindGrid(); + } + #endregion + + + + + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// Grid1排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + + private void BindGrid() + { + string strSql = @"SELECT doc.DocId,doc.ProjectId,doc.DocCode,doc.DocName,unit.UnitName as SendUnitName,doc.ReceivUnitIds,docType.DocTypeName," + + @" doc.CompileMan,doc.CompileDate,CNProfessional.ProfessionalName,doc.State,u.userName" + + @" FROM Doc_DocManage doc " + + @" left join Base_Unit unit on unit.unitId=doc.SendUnitId " + + @" left join Base_DocType docType on docType.DocTypeId=doc.DocTypeId " + + @" left join Base_CNProfessional CNProfessional on CNProfessional.CNProfessionalId=doc.CNProfessionalId " + + @" left join sys_User u on u.userId = doc.CompileMan" + + @" where doc.ProjectId=@ProjectId"; + + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId)); + if (RadioType.SelectedValue == "Unit" && !string.IsNullOrEmpty(tree1.SelectedNodeID)) + { + strSql += " AND doc.SendUnitId=@unitId"; + listStr.Add(new SqlParameter("@unitId", tree1.SelectedNodeID)); + + } + else if (RadioType.SelectedValue == "DocType" && !string.IsNullOrEmpty(tree1.SelectedNodeID)) + { + strSql += " AND doc.DocTypeId=@DocTypeId"; + listStr.Add(new SqlParameter("@DocTypeId", tree1.SelectedNodeID)); + } + if (RadioList2.SelectedValue=="Send") + { + strSql += " AND doc.CompileMan=@CompileMan"; + listStr.Add(new SqlParameter("@CompileMan", this.CurrUser.UserId)); + } + else + { + strSql += " AND doc.AcceptMan like @AcceptMan"; + listStr.Add(new SqlParameter("@AcceptMan", "%"+this.CurrUser.UserId+"%")); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = GetPagedDataTable(Grid1, tb); + Grid1.RecordCount = tb.Rows.Count; + + Grid1.DataSource = table; + Grid1.DataBind(); + } + + + #region 行点击事件 + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + string id = e.RowID; + if (e.CommandName.Equals("AttachUrl")) + { + string menuId = Const.ProjectControlPointMenuId; + PageContext.RegisterStartupScript(WindowAtt.GetShowReference( + String.Format("../AttachFile/Fileuploader.aspx?type=-1&source=1&toKeyId={0}&path=FileUpload/BreakdownProject&menuId={1}", id, menuId))); + } + else if (e.CommandName == "Print") + { + Print(id); + } + } + #endregion + private void Print(string DocId) + { + var model = DocManageService.GetDocByDocId(DocId); + if (model.State != Const.Doc_State_2) + { + ShowNotify("当前状态未闭环无法打印", MessageBoxIcon.Warning); + return; + } + DataTable dt = new DataTable(); + dt = DocManageApproveService.GetListData(DocId); + if (dt.Columns.Count == 0) + { + dt.Columns.Add("RoleName", typeof(String)); + dt.Columns.Add("ApproveMan", typeof(String)); + dt.Columns.Add("ApproveDate", typeof(String)); + dt.Columns.Add("ApproveIdea", typeof(String)); + + } + var keyValuePairs = BLL.DocManageService.GetPairs(DocId); + dt.TableName = "Table1"; + + BLL.Common.FastReport.ResetData(); + BLL.Common.FastReport.AddFastreportTable(dt); + BLL.Common.FastReport.AddFastreportParameter(keyValuePairs); + string initTemplatePath = "File/Fastreport/新疆文件管理流转表.frx"; + string rootPath = Server.MapPath("~/"); + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + + } + } + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectControlPointMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + // this.btnNew.Hidden = false; + } + } + } + #endregion + + protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) + { + InitTreeMenu(); + } + + protected void RadioList2_SelectedIndexChanged(object sender, EventArgs e) + { + BindGrid(); + + } + + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../DocManage/DocManageView.aspx?DocId={0}", Grid1.SelectedRowID, "查看 - "))); + + } + + #region 右键菜单事件 + protected void btnMenuView_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../DocManage/DocManageView.aspx?DocId={0}", Grid1.SelectedRowID, "查看 - "))); + + } + + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DocManage/PersonalFileCabinet.aspx.designer.cs b/SGGL/FineUIPro.Web/DocManage/PersonalFileCabinet.aspx.designer.cs new file mode 100644 index 00000000..04e5ec2a --- /dev/null +++ b/SGGL/FineUIPro.Web/DocManage/PersonalFileCabinet.aspx.designer.cs @@ -0,0 +1,242 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DocManage +{ + + + public partial class PersonalFileCabinet + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// RadioType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList RadioType; + + /// + /// tree1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tree1; + + /// + /// hdSelectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdSelectId; + + /// + /// hdUnitWorkId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdUnitWorkId; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// RadioList2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList RadioList2; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label3; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuView; + } +} diff --git a/SGGL/FineUIPro.Web/FileUpload/DocManage/2023-05/638203739946845291_GPEC智慧施工平台开发尾项截止4月23.docx b/SGGL/FineUIPro.Web/FileUpload/DocManage/2023-05/638203739946845291_GPEC智慧施工平台开发尾项截止4月23.docx new file mode 100644 index 00000000..2c64878d Binary files /dev/null and b/SGGL/FineUIPro.Web/FileUpload/DocManage/2023-05/638203739946845291_GPEC智慧施工平台开发尾项截止4月23.docx differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 67b920bd..6bc45976 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -212,6 +212,7 @@ + @@ -530,6 +531,9 @@ + + + @@ -715,6 +719,9 @@ + + + @@ -6003,6 +6010,13 @@ DesignProfessionalView.aspx + + DocType.aspx + ASPXCodeBehind + + + DocType.aspx + EmergencyType.aspx ASPXCodeBehind @@ -8075,6 +8089,27 @@ HSEDataCollect.aspx + + DocManage.aspx + ASPXCodeBehind + + + DocManage.aspx + + + DocManageEdit.aspx + ASPXCodeBehind + + + DocManageEdit.aspx + + + DocManageView.aspx + ASPXCodeBehind + + + DocManageView.aspx + AbsenceDuty.aspx ASPXCodeBehind @@ -9373,6 +9408,27 @@ ProjectManageRuleView.aspx + + SubManageRule.aspx + ASPXCodeBehind + + + SubManageRule.aspx + + + SubManageRuleEdit.aspx + ASPXCodeBehind + + + SubManageRuleEdit.aspx + + + SubManageRuleView.aspx + ASPXCodeBehind + + + SubManageRuleView.aspx + CarManager.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ManagerRuleList.aspx b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ManagerRuleList.aspx index 3c0e7e64..b4cb3c53 100644 --- a/SGGL/FineUIPro.Web/HSSE/ActionPlan/ManagerRuleList.aspx +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/ManagerRuleList.aspx @@ -20,10 +20,11 @@ - + + listStr = new List(); strSql += " AND ManagerRule.ProjectId = @ProjectId"; if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值 diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRule.aspx b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRule.aspx new file mode 100644 index 00000000..065a546f --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRule.aspx @@ -0,0 +1,127 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SubManageRule.aspx.cs" Inherits="FineUIPro.Web.HSSE.ActionPlan.SubManageRule" %> + + + + + + 项目安全管理制度 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRule.aspx.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRule.aspx.cs new file mode 100644 index 00000000..5960ba6c --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRule.aspx.cs @@ -0,0 +1,495 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using BLL; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.HSSE.ActionPlan +{ + public partial class SubManageRule : PageBase + { + /// + /// 页面 + /// + public int? PageSize + { + get + { + return (int?)ViewState["PageSize"]; + } + set + { + ViewState["PageSize"] = value; + } + } + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.GetButtonPower(); + this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!"); + this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的  行数据吗?", Grid1.GetSelectedCountReference()); + // 绑定表格 + BindGrid(); + } + } + + /// + /// 加载数据 + /// + private void BindGrid() + { + string strSql = @"SELECT ManagerRule.ManagerRuleId,ManagerRule.ProjectId,ManageRuleCode, + ManagerRule.ManageRuleName, + ManagerRule.VersionNo, + ManagerRule.CompileMan, + ManagerRule.CompileDate, + ManagerRule.AttachUrl, + ManagerRule.IsIssue, + (CASE WHEN LEN(ManagerRule.Remark) > 25 THEN LEFT(ManagerRule.Remark,25)+'...' ELSE ManagerRule.Remark END) AS ShortRemark, + (CASE WHEN ManagerRule.State = 0 OR ManagerRule.State IS NULL THEN '待['+OperateUser.UserName+']提交' WHEN ManagerRule.State = 2 THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName, + ManagerRule.Remark, + ManagerRule.State, + ManagerRule.IssueDate, + ManageRuleType.ManageRuleTypeName AS ManageRuleTypeName + FROM ActionPlan_SubManagerRule AS ManagerRule + LEFT JOIN Sys_FlowOperate AS FlowOperate ON ManagerRule.ManagerRuleId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1 + LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId + LEFT JOIN Sys_User AS Users ON Users.UserId = ManagerRule.CompileMan + LEFT JOIN dbo.Base_ManageRuleType AS ManageRuleType ON ManageRuleType.ManageRuleTypeId=ManagerRule.ManageRuleTypeId + WHERE 1 =1 "; + List listStr = new List(); + strSql += " AND ManagerRule.ProjectId = @ProjectId"; + if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值 + { + listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"])); + strSql += " AND ManagerRule.State = @State"; ///状态为已完成 + listStr.Add(new SqlParameter("@State", BLL.Const.State_2)); + } + else + { + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + } + if (!string.IsNullOrEmpty(this.txtManageRuleCode.Text.Trim())) + { + strSql += " AND ManageRuleCode LIKE @ManageRuleCode"; + listStr.Add(new SqlParameter("@ManageRuleCode", "%" + this.txtManageRuleCode.Text.Trim() + "%")); + } + if (!string.IsNullOrEmpty(this.txtManageRuleName.Text.Trim())) + { + strSql += " AND ManageRuleName LIKE @ManageRuleName"; + listStr.Add(new SqlParameter("@ManageRuleName", "%" + this.txtManageRuleName.Text.Trim() + "%")); + } + if (this.cbIssue.SelectedValueArray.Length == 1) + { + ///是否发布 + string selectValue = String.Join(", ", this.cbIssue.SelectedValueArray); + if (selectValue == "1") + { + strSql += " AND ManagerRule.IsIssue = 1 "; + } + else + { + strSql += " AND (ManagerRule.IsIssue = 0 OR ManagerRule.IsIssue IS NULL) "; + } + } + + 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 Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + this.DeleteData(); + } + + /// + /// 删除方法 + /// + private void DeleteData() + { + this.PageSize = this.Grid1.PageIndex; + if (Grid1.SelectedRowIndexArray.Length > 0) + { + bool isShow = false; + if (Grid1.SelectedRowIndexArray.Length == 1) + { + isShow = true; + } + foreach (string id in Grid1.SelectedRowIDArray) + { + string rowID = id; + if (this.judgementDelete(rowID, isShow)) + { + var manageRule = BLL.ActionPlan_SubManagerRuleService.GetManagerRuleById(rowID); + if (manageRule != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, manageRule.ManageRuleCode, manageRule.ManagerRuleId, BLL.Const.ActionPlan_SubManagerRuleMenuId, Const.BtnDelete); + BLL.ActionPlan_SubManagerRuleService.DeleteManageRuleById(rowID); + } + + BindGrid(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + } + } + } + } + + /// + /// 判断是否可删除 + /// + /// + /// + /// + private bool judgementDelete(string rowID, bool isShow) + { + string content = string.Empty; + if (string.IsNullOrEmpty(content)) + { + return true; + } + else + { + if (isShow) + { + Alert.ShowInTop(content); + } + return false; + } + } + #endregion + + #region 编辑 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + this.PageSize = this.Grid1.PageIndex; + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + string managerRuleId = Grid1.SelectedRowID; + + var managerRule = BLL.ActionPlan_SubManagerRuleService.GetManagerRuleById(managerRuleId); + if (managerRule != null) + { + if (this.btnMenuEdit.Hidden || managerRule.State == BLL.Const.State_2) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面 + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SubManageRuleView.aspx?ManagerRuleId={0}", managerRuleId, "查看 - "))); + } + else + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SubManageRuleEdit.aspx?ManagerRuleId={0}", managerRuleId, "编辑 - "))); + } + } + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 编制 + /// + /// 点击编制 + /// + /// + /// + protected void btnCompile_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SubManageRuleEdit.aspx", "编辑 - "))); + } + #endregion + + #region 发布 + /// + /// 发布 + /// + /// + /// + protected void btnMenuIssuance_Click(object sender, EventArgs e) + { + string strShowNotify = string.Empty; + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string managerRuleId = Grid1.DataKeys[rowIndex][0].ToString(); + Model.ActionPlan_SubManagerRule managerRule = BLL.ActionPlan_SubManagerRuleService.GetManagerRuleById(managerRuleId); + if (managerRule != null) + { + if (managerRule.State == BLL.Const.State_2) + { + List issuanceManagerRules = BLL.ActionPlan_SubManagerRuleService.GetIsIssueManagerRulesByName(managerRule.ManageRuleName); + if (issuanceManagerRules.Count == 0) //无对应版本的管理规定 + { + managerRule.VersionNo = "V1.0"; + managerRule.IsIssue = true; + managerRule.IssueDate = DateTime.Now; + BLL.ActionPlan_SubManagerRuleService.UpdateManageRule(managerRule); + } + else //存在对应版本的管理规定 + { + string maxVersionNo = issuanceManagerRules[issuanceManagerRules.Count - 1].VersionNo; + managerRule.VersionNo = "V" + (Convert.ToInt32(maxVersionNo.Substring(1, maxVersionNo.LastIndexOf(".") - 1)) + 1) + ".0"; + managerRule.IsIssue = true; + managerRule.IssueDate = DateTime.Now; + BLL.ActionPlan_SubManagerRuleService.UpdateManageRule(managerRule); + } + } + else + { + strShowNotify += "管理规定:" + managerRule.ManageRuleName + ";"; + + } + } + } + } + + this.BindGrid(); + if (!string.IsNullOrEmpty(strShowNotify)) + { + + Alert.ShowInTop(strShowNotify + "尚未审批完成,无法发布!", MessageBoxIcon.Warning); + } + else + { + ShowNotify("发布成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ActionPlan_SubManagerRuleMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnCompile.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + //if (buttonList.Contains(BLL.Const.BtnAuditing)) + //{ + // this.btnMenuAudit.Hidden = false; + //} + if (buttonList.Contains(BLL.Const.BtnIssuance)) + { + this.btnMenuIssuance.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + if (this.PageSize.HasValue) + { + this.ddlPageSize.SelectedValue = this.PageSize.ToString(); + } + + BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, string.Empty, BLL.Const.ActionPlan_SubManagerRuleMenuId, Const.BtnQuery); + } + #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; + this.Grid1.PageSize = 500; + BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + +#pragma warning disable CS0108 // “ManagerRule.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。 + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) +#pragma warning restore CS0108 // “ManagerRule.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。 + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("labNumber") as AspNet.Label).Text; + } + if (column.ColumnID == "tfManageRuleCode") + { + html = (row.FindControl("lblManageRuleCode") as AspNet.Label).Text; + } + if (column.ColumnID == "tfOldManageRuleCode") + { + html = (row.FindControl("lblOldManageRuleCode") as AspNet.Label).Text; + } + if (column.ColumnID == "tfManageRuleName") + { + html = (row.FindControl("lblManageRuleName") as AspNet.Label).Text; + } + if (column.ColumnID == "tfManageRuleTypeName") + { + html = (row.FindControl("lblManageRuleTypeName") as AspNet.Label).Text; + } + if (column.ColumnID == "tfShortRemark") + { + html = (row.FindControl("lblRemark") as AspNet.Label).Text; + } + if (column.ColumnID == "tfState") + { + html = (row.FindControl("lblState") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRule.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRule.aspx.designer.cs new file mode 100644 index 00000000..6c78dd21 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRule.aspx.designer.cs @@ -0,0 +1,224 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.ActionPlan +{ + + + public partial class SubManageRule + { + + /// + /// 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; + + /// + /// cbIssue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBoxList cbIssue; + + /// + /// txtManageRuleCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtManageRuleCode; + + /// + /// txtManageRuleName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtManageRuleName; + + /// + /// txtManageRuleTypeName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtManageRuleTypeName; + + /// + /// btnQuery 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery; + + /// + /// btnCompile 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnCompile; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblManageRuleName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblManageRuleName; + + /// + /// lblState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblState; + + /// + /// 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; + + /// + /// btnMenuIssuance 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuIssuance; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleEdit.aspx b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleEdit.aspx new file mode 100644 index 00000000..5b7e20ad --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleEdit.aspx @@ -0,0 +1,83 @@ +<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="SubManageRuleEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.ActionPlan.SubManageRuleEdit" %> + +<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" + TagPrefix="uc1" %> + + + + + 编辑管理规定 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleEdit.aspx.cs new file mode 100644 index 00000000..f1db233c --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleEdit.aspx.cs @@ -0,0 +1,216 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using BLL; + +namespace FineUIPro.Web.HSSE.ActionPlan +{ + public partial class SubManageRuleEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ProjectManageRuleId + { + get + { + return (string)ViewState["ProjectManageRuleId"]; + } + set + { + ViewState["ProjectManageRuleId"] = value; + } + } + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + /// + /// 附件路径 + /// + public string FullAttachUrl + { + get + { + return (string)ViewState["FullAttachUrl"]; + } + set + { + ViewState["FullAttachUrl"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.ProjectId = this.CurrUser.LoginProjectId; + if (Request.Params["type"] == "see") //查看 + { + this.btnSave.Hidden = true; + } + //加载管理规定类别下拉选项 + this.ddlManageRuleTypeId.DataTextField = "ManageRuleTypeName"; + this.ddlManageRuleTypeId.DataValueField = "ManageRuleTypeId"; + this.ddlManageRuleTypeId.DataSource = BLL.ManageRuleTypeService.GetManageRuleTypeList(); + ddlManageRuleTypeId.DataBind(); + Funs.FineUIPleaseSelect(this.ddlManageRuleTypeId); + this.ProjectManageRuleId = Request.Params["ManagerRuleId"]; + if (!string.IsNullOrEmpty(this.ProjectManageRuleId)) + { + var managerRule = BLL.ActionPlan_SubManagerRuleService.GetManagerRuleById(this.ProjectManageRuleId); + if (managerRule != null) + { + this.ProjectId = managerRule.ProjectId; + this.txtManageRuleCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.ProjectManageRuleId); + this.txtManageRuleName.Text = managerRule.ManageRuleName; + this.txtSeeFile.Text = HttpUtility.HtmlDecode(managerRule.SeeFile); + if (!string.IsNullOrEmpty(managerRule.ManageRuleTypeId)) + { + this.ddlManageRuleTypeId.SelectedValue = managerRule.ManageRuleTypeId; + } + } + } + ///初始化审核菜单 + this.ctlAuditFlow.MenuId = BLL.Const.ActionPlan_SubManagerRuleMenuId; + this.ctlAuditFlow.DataId = this.ProjectManageRuleId; + this.ctlAuditFlow.ProjectId = this.ProjectId; + this.ctlAuditFlow.UnitId = this.CurrUser.UnitId; + } + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + /// + /// 提交按钮 + /// + /// + /// + protected void btnSubmit_Click(object sender, EventArgs e) + { + this.SaveData(BLL.Const.BtnSubmit); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + /// + /// 保存数据 + /// + private void SaveData(string type) + { + Model.ActionPlan_SubManagerRule newManagerRule = new Model.ActionPlan_SubManagerRule(); + newManagerRule.ManageRuleCode = this.txtManageRuleCode.Text.Trim(); + newManagerRule.ManageRuleName = this.txtManageRuleName.Text.Trim(); + newManagerRule.SeeFile = HttpUtility.HtmlEncode(this.txtSeeFile.Text); + if (this.ddlManageRuleTypeId.SelectedValue != BLL.Const._Null) + { + newManagerRule.ManageRuleTypeId = this.ddlManageRuleTypeId.SelectedValue; + } + newManagerRule.AttachUrl = this.FullAttachUrl; + newManagerRule.State = BLL.Const.State_0; + if (type == BLL.Const.BtnSubmit) + { + newManagerRule.State = this.ctlAuditFlow.NextStep; + } + var manageRule = BLL.ActionPlan_SubManagerRuleService.GetManagerRuleById(this.ProjectManageRuleId); + if (manageRule == null) + { + if (string.IsNullOrEmpty(this.ProjectManageRuleId)) + { + newManagerRule.ManagerRuleId = SQLHelper.GetNewID(typeof(Model.ActionPlan_SubManagerRule)); + } + else + { + newManagerRule.ManagerRuleId = this.ProjectManageRuleId; + } + newManagerRule.ProjectId = this.CurrUser.LoginProjectId; + newManagerRule.CompileDate = DateTime.Now; + newManagerRule.CompileMan = this.CurrUser.UserId; + newManagerRule.IsIssue = false; + newManagerRule.Flag = true; + BLL.ActionPlan_SubManagerRuleService.AddManageRule(newManagerRule); + ////保存流程审核数据 + this.ctlAuditFlow.btnSaveData(this.CurrUser.LoginProjectId, BLL.Const.ActionPlan_ManagerRuleMenuId, newManagerRule.ManagerRuleId, true, newManagerRule.ManageRuleName, "../ActionPlan/ManagerRuleView.aspx?ManagerRuleId={0}"); + } + else + { + newManagerRule.ManagerRuleId = manageRule.ManagerRuleId; + newManagerRule.ProjectId = manageRule.ProjectId; + newManagerRule.CompileDate = manageRule.CompileDate; + newManagerRule.CompileMan = manageRule.CompileMan; + newManagerRule.IsIssue = manageRule.IsIssue; + newManagerRule.Flag = manageRule.Flag; + BLL.ActionPlan_SubManagerRuleService.UpdateManageRule(newManagerRule); + } + + BLL.LogService.AddSys_Log(this.CurrUser, newManagerRule.ManageRuleCode, newManagerRule.ManagerRuleId, BLL.Const.ActionPlan_SubManagerRuleMenuId, Const.BtnModify); + ////保存流程审核数据 + this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ActionPlan_SubManagerRuleMenuId, this.ProjectManageRuleId, (type == BLL.Const.BtnSubmit ? true : false), newManagerRule.ManageRuleName, "../ActionPlan/ProjectManagerRuleView.aspx?ManagerRuleId={0}"); + } + #endregion + + #region 附件上传 + /// + /// 上传附件 + /// + /// + /// + protected void btnAttachUrl_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.ProjectManageRuleId)) + { + this.ProjectManageRuleId = SQLHelper.GetNewID(typeof(Model.ActionPlan_SubManagerRule)); + } + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ActionPlanManagerRule&menuId={1}", ProjectManageRuleId, BLL.Const.ActionPlan_SubManagerRuleMenuId))); + } + #endregion + + #region 验证管理规定名称是否存在 + /// + /// 验证管理规定名称是否存在 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + var standard = Funs.DB.ActionPlan_SubManagerRule.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.ManageRuleName == this.txtManageRuleName.Text.Trim()); + if (standard != null) + { + ShowNotify("输入的文件名称已存在!", MessageBoxIcon.Warning); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleEdit.aspx.designer.cs new file mode 100644 index 00000000..664c1ad7 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleEdit.aspx.designer.cs @@ -0,0 +1,170 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.ActionPlan +{ + + + public partial class SubManageRuleEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtManageRuleName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtManageRuleName; + + /// + /// txtManageRuleCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtManageRuleCode; + + /// + /// ddlManageRuleTypeId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlManageRuleTypeId; + + /// + /// txtSeeFile 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HtmlEditor txtSeeFile; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ctlAuditFlow 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.FlowOperateControl ctlAuditFlow; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// hdProjectManageRuleId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdProjectManageRuleId; + + /// + /// btnAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttachUrl; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnSubmit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSubmit; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleView.aspx b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleView.aspx new file mode 100644 index 00000000..1a435188 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleView.aspx @@ -0,0 +1,74 @@ +<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="SubManageRuleView.aspx.cs" Inherits="FineUIPro.Web.HSSE.ActionPlan.SubManageRuleView" %> + +<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" + TagPrefix="uc1" %> + + + + + 管理规定 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleView.aspx.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleView.aspx.cs new file mode 100644 index 00000000..11a09368 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleView.aspx.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using BLL; + +namespace FineUIPro.Web.HSSE.ActionPlan +{ + public partial class SubManageRuleView : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ProjectManageRuleId + { + get + { + return (string)ViewState["ProjectManageRuleId"]; + } + set + { + ViewState["ProjectManageRuleId"] = value; + } + } + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + /// + /// 附件路径 + /// + public string FullAttachUrl + { + get + { + return (string)ViewState["FullAttachUrl"]; + } + set + { + ViewState["FullAttachUrl"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.ProjectId = this.CurrUser.LoginProjectId; + this.ProjectManageRuleId = Request.Params["ManagerRuleId"]; + if (!string.IsNullOrEmpty(this.ProjectManageRuleId)) + { + var managerRule = BLL.ActionPlan_SubManagerRuleService.GetManagerRuleById(this.ProjectManageRuleId); + if (managerRule != null) + { + this.ProjectId = managerRule.ProjectId; + this.txtManageRuleCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.ProjectManageRuleId); + this.txtManageRuleName.Text = managerRule.ManageRuleName; + this.txtSeeFile.Text = HttpUtility.HtmlDecode(managerRule.SeeFile); + var manag = BLL.ManageRuleTypeService.GetManageRuleTypeById(managerRule.ManageRuleTypeId); + if (manag != null) + { + this.ddlManageRuleTypeId.Text = manag.ManageRuleTypeName; + } + } + } + ///初始化审核菜单 + this.ctlAuditFlow.MenuId = BLL.Const.ActionPlan_CompanyManagerRuleMenuId; + this.ctlAuditFlow.DataId = this.ProjectManageRuleId; + this.ctlAuditFlow.ProjectId = this.ProjectId; + this.ctlAuditFlow.UnitId = this.CurrUser.UnitId; + } + } + #endregion + #region 附件上传 + /// + /// 上传附件 + /// + /// + /// + protected void btnAttachUrl_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.ProjectManageRuleId)) + { + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ActionPlanManagerRule&menuId={1}&type=-1", ProjectManageRuleId, BLL.Const.ActionPlan_SubManagerRuleMenuId))); + } + + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleView.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleView.aspx.designer.cs new file mode 100644 index 00000000..abe16ac6 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/ActionPlan/SubManageRuleView.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.ActionPlan +{ + + + public partial class SubManageRuleView + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtManageRuleName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtManageRuleName; + + /// + /// txtManageRuleCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtManageRuleCode; + + /// + /// ddlManageRuleTypeId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox ddlManageRuleTypeId; + + /// + /// txtSeeFile 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HtmlEditor txtSeeFile; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ctlAuditFlow 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.FlowOperateControl ctlAuditFlow; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// btnAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttachUrl; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/RiskAnalysisChart.aspx.cs b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/RiskAnalysisChart.aspx.cs index f1922c4f..a05af7f7 100644 --- a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/RiskAnalysisChart.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/RiskAnalysisChart.aspx.cs @@ -74,7 +74,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection rowTime["已整改"] = unitHazad.Where(x => x.States == "3" || x.States == "2").Count(); dtTime.Rows.Add(rowTime); } - this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "单位巡检分析", this.drpChartType.SelectedValue, 1130, 450, this.ckbShow.Checked)); + this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "单位巡检分析", this.drpChartType.SelectedValue, 1100, 300, this.ckbShow.Checked)); } else //饼形图 { diff --git a/SGGL/FineUIPro.Web/common/Menu_Doc.xml b/SGGL/FineUIPro.Web/common/Menu_Doc.xml new file mode 100644 index 00000000..0a714bec --- /dev/null +++ b/SGGL/FineUIPro.Web/common/Menu_Doc.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml index 5554d3e0..1a55169b 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml @@ -11,6 +11,7 @@ + diff --git a/SGGL/FineUIPro.Web/common/Menu_SysSet.xml b/SGGL/FineUIPro.Web/common/Menu_SysSet.xml index 72bacc30..2876a6e9 100644 --- a/SGGL/FineUIPro.Web/common/Menu_SysSet.xml +++ b/SGGL/FineUIPro.Web/common/Menu_SysSet.xml @@ -23,6 +23,7 @@ + diff --git a/SGGL/FineUIPro.Web/indexProject.aspx b/SGGL/FineUIPro.Web/indexProject.aspx index 1d21c20e..e9b98ade 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx +++ b/SGGL/FineUIPro.Web/indexProject.aspx @@ -254,6 +254,11 @@ EnablePostBack="true" EnableDefaultState="true" EnableDefaultCorner="false" ID="btnOpinion"> +
  • + + +