diff --git a/.vs/实业/v17/.wsuo b/.vs/实业/v17/.wsuo new file mode 100644 index 00000000..ce6855b2 Binary files /dev/null and b/.vs/实业/v17/.wsuo differ diff --git a/DataBase/版本日志/SGGLDB_CD_2023-03-07_子公司实业脚本.sql b/DataBase/版本日志/SGGLDB_CD_2023-03-07_子公司实业脚本.sql new file mode 100644 index 00000000..ef6e3a29 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_CD_2023-03-07_子公司实业脚本.sql @@ -0,0 +1,209 @@ + +CREATE TABLE [dbo].[Base_Factory]( + [FactoryId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [FactoryCode] [nvarchar](100) NULL, + [FactoryName] [nvarchar](100) NULL, + [Address] [nvarchar](500) NULL, + CONSTRAINT [PK_Base_Factory] PRIMARY KEY CLUSTERED +( + [FactoryId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[Base_Factory] WITH CHECK ADD CONSTRAINT [FK_Base_Factory_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Base_Factory] CHECK CONSTRAINT [FK_Base_Factory_Base_Unit] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Factory', @level2type=N'COLUMN',@level2name=N'FactoryId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Factory', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Factory', @level2type=N'COLUMN',@level2name=N'FactoryCode' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Factory', @level2type=N'COLUMN',@level2name=N'FactoryName' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ַ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Factory', @level2type=N'COLUMN',@level2name=N'Address' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Factory' +GO + + + +CREATE TABLE [dbo].[SYHSEData_Data]( + [Id] [nvarchar](50) NOT NULL, + [FactoryId] [nvarchar](50) NULL, + [SafetyMnaHours] [int] NULL, + [GeneralRiskNum] [int] NULL, + [LowRiskNum] [int] NULL, + [MoreRiskNum] [int] NULL, + [GreatRiskNum] [int] NULL, + [ReportDate] [datetime] NULL, + CONSTRAINT [PK_SYHSEData_Data] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[SYHSEData_Data] WITH CHECK ADD CONSTRAINT [FK_SYHSEData_Data_Base_Factory] FOREIGN KEY([FactoryId]) +REFERENCES [dbo].[Base_Factory] ([FactoryId]) +GO + +ALTER TABLE [dbo].[SYHSEData_Data] CHECK CONSTRAINT [FK_SYHSEData_Data_Base_Factory] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_Data', @level2type=N'COLUMN',@level2name=N'Id' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_Data', @level2type=N'COLUMN',@level2name=N'FactoryId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ˹ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_Data', @level2type=N'COLUMN',@level2name=N'SafetyMnaHours' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'һ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_Data', @level2type=N'COLUMN',@level2name=N'GeneralRiskNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͷ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_Data', @level2type=N'COLUMN',@level2name=N'LowRiskNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ϴ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_Data', @level2type=N'COLUMN',@level2name=N'MoreRiskNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ش' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_Data', @level2type=N'COLUMN',@level2name=N'GreatRiskNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_Data', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵҵݱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_Data' +GO + + + +CREATE TABLE [dbo].[SYHSEData_RiskControl]( + [Id] [nvarchar](50) NOT NULL, + [FactoryId] [nvarchar](50) NULL, + [RiskControlName] [nvarchar](500) NULL, + [ReportDate] [datetime] NULL, + CONSTRAINT [PK_SYHSEData_RiskControl] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[SYHSEData_RiskControl] WITH CHECK ADD CONSTRAINT [FK_SYHSEData_RiskControl_Base_Factory] FOREIGN KEY([FactoryId]) +REFERENCES [dbo].[Base_Factory] ([FactoryId]) +GO + +ALTER TABLE [dbo].[SYHSEData_RiskControl] CHECK CONSTRAINT [FK_SYHSEData_RiskControl_Base_Factory] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_RiskControl', @level2type=N'COLUMN',@level2name=N'Id' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_RiskControl', @level2type=N'COLUMN',@level2name=N'FactoryId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'չܿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_RiskControl', @level2type=N'COLUMN',@level2name=N'RiskControlName' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_RiskControl', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'չܿر' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_RiskControl' +GO + + + +alter table Hazard_RealTimeDevice add Value nvarchar(50) null +alter table Hazard_RealTimeDevice add FactoryId nvarchar(50) null +alter table Hazard_RealTimeDevice add ReportDate datetime null +alter table Hazard_RealTimeDevice add ReceiveDate nvarchar(50) null +GO + + + + +CREATE TABLE [dbo].[SYHSEData_HiddenDangerCheck]( + [Id] [nvarchar](50) NOT NULL, + [FactoryId] [nvarchar](50) NULL, + [HiddenDangerName] [nvarchar](50) NULL, + [TotalNum] [int] NULL, + [OKNum] [int] NULL, + [ReportDate] [datetime] NULL, + CONSTRAINT [PK_SYHSEData_HiddenDangerCheck] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[SYHSEData_HiddenDangerCheck] WITH CHECK ADD CONSTRAINT [FK_SYHSEData_HiddenDangerCheck_Base_Factory] FOREIGN KEY([FactoryId]) +REFERENCES [dbo].[Base_Factory] ([FactoryId]) +GO + +ALTER TABLE [dbo].[SYHSEData_HiddenDangerCheck] CHECK CONSTRAINT [FK_SYHSEData_HiddenDangerCheck_Base_Factory] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_HiddenDangerCheck', @level2type=N'COLUMN',@level2name=N'Id' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_HiddenDangerCheck', @level2type=N'COLUMN',@level2name=N'FactoryId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_HiddenDangerCheck', @level2type=N'COLUMN',@level2name=N'HiddenDangerName' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_HiddenDangerCheck', @level2type=N'COLUMN',@level2name=N'TotalNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_HiddenDangerCheck', @level2type=N'COLUMN',@level2name=N'OKNum' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_HiddenDangerCheck', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ų' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYHSEData_HiddenDangerCheck' +GO + + + + +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('CD167198-1667-4552-9876-E768C2542C30','ʵҵϢ','BaseInfo/BaseFactory.aspx',20,'0','Menu_Project',1,1,1) +GO + + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('0CD166ED-11FC-443D-AC15-4AB80E5B1A41','CD167198-1667-4552-9876-E768C2542C30','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('3F74BCAB-AF0C-4B9F-83F6-460E95C7EDFA','CD167198-1667-4552-9876-E768C2542C30','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('B05D993D-2905-474B-9087-84EABADAD005','CD167198-1667-4552-9876-E768C2542C30','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('7AD48DC9-F962-4C71-9518-3193F0E8634A','CD167198-1667-4552-9876-E768C2542C30','',4) + GO +INSERT Sys_Menu (MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES ( N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'ʵҵ','ZHGL/DataSync/SYHSEData_Data.aspx',40,N'1E216BE3-DB22-4649-BD9A-0777B0DC03E6',N'Menu_ZHGL',1,1,1) +GO + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'7F8BA66D-DB63-4DBB-9EB6-73F0280CFA30',N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'',1) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'EB3B7C26-E1A0-4498-8089-35637CC6DF26',N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'޸',2) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'968693EE-8FE8-482A-AF0C-B08D919EF933',N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'ɾ',3) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'8C6B85C3-81C9-4F7E-95C4-576DB34F3B18',N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'',4) + +GO diff --git a/DataBase/菜单初始化脚本/0-4项目清单(Menu_Project).sql b/DataBase/菜单初始化脚本/0-4项目清单(Menu_Project).sql index bf645a64..5a414068 100644 --- a/DataBase/菜单初始化脚本/0-4项目清单(Menu_Project).sql +++ b/DataBase/菜单初始化脚本/0-4项目清单(Menu_Project).sql @@ -7,6 +7,19 @@ INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffi VALUES('B95DF6F0-EB0C-4120-BD56-A4453AB42059','Ŀб','ProjectData/ProjectList.aspx',10,'0','Menu_Project',1,1,1) GO +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('CD167198-1667-4552-9876-E768C2542C30','ʵҵϢ','BaseInfo/BaseFactory.aspx',20,'0','Menu_Project',1,1,1) +GO + + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('0CD166ED-11FC-443D-AC15-4AB80E5B1A41','CD167198-1667-4552-9876-E768C2542C30','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('3F74BCAB-AF0C-4B9F-83F6-460E95C7EDFA','CD167198-1667-4552-9876-E768C2542C30','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('B05D993D-2905-474B-9087-84EABADAD005','CD167198-1667-4552-9876-E768C2542C30','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('7AD48DC9-F962-4C71-9518-3193F0E8634A','CD167198-1667-4552-9876-E768C2542C30','',4) + GO --INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) --VALUES('B95DF6F0-EB0C-4120-BD56-A4453AB42059','ĿʩۺϢ','ProjectData/ProjectInformation.aspx',20,'0','Menu_Project',1,1,1) --GO diff --git a/DataBase/菜单初始化脚本/0-8综合管理(Menu_ZHGL).sql b/DataBase/菜单初始化脚本/0-8综合管理(Menu_ZHGL).sql index 26335c38..449b7ab5 100644 --- a/DataBase/菜单初始化脚本/0-8综合管理(Menu_ZHGL).sql +++ b/DataBase/菜单初始化脚本/0-8综合管理(Menu_ZHGL).sql @@ -396,6 +396,18 @@ GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('214A1AE1-816E-4DDA-8E6E-04EB35F02A12','现场人员','ZHGL/RealName/OnPost.aspx',40,'D78C6E54-4240-4E82-B9B5-8ED76CF62981','Menu_ZHGL',1,1,1) GO + + + +INSERT Sys_Menu (MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES ( N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'实业数据','ZHGL/DataSync/SYHSEData_Data.aspx',40,N'1E216BE3-DB22-4649-BD9A-0777B0DC03E6',N'Menu_ZHGL',1,1,1) +GO + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'7F8BA66D-DB63-4DBB-9EB6-73F0280CFA30',N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'增加',1) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'EB3B7C26-E1A0-4498-8089-35637CC6DF26',N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'修改',2) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'968693EE-8FE8-482A-AF0C-B08D919EF933',N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'删除',3) + INSERT Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES ( N'8C6B85C3-81C9-4F7E-95C4-576DB34F3B18',N'S89E5EC2-F725-4656-9110-5AF83C18FB6C',N'保存',4) + +GO ----本部综合管理 --INSERT INTO Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) --VALUES('A57CBE1D-B9F4-4FB6-A428-10197734AAB6','数据统计','',30,'0','Menu_ZHGL',1,0,1) diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 31434b9c..9e18c528 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -182,6 +182,7 @@ + @@ -770,6 +771,7 @@ + @@ -781,6 +783,8 @@ + + @@ -818,6 +822,7 @@ + diff --git a/SGGL/BLL/BaseInfo/BaseFactoryService.cs b/SGGL/BLL/BaseInfo/BaseFactoryService.cs new file mode 100644 index 00000000..e490be6d --- /dev/null +++ b/SGGL/BLL/BaseInfo/BaseFactoryService.cs @@ -0,0 +1,167 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class Base_FactoryService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetBase_FactoryByModle(Model.Base_Factory table) + { + var q = from x in db.Base_Factory + where + (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) && + (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && + (string.IsNullOrEmpty(table.FactoryCode) || x.FactoryCode.Contains(table.FactoryCode)) && + (string.IsNullOrEmpty(table.FactoryName) || x.FactoryName.Contains(table.FactoryName)) && + (string.IsNullOrEmpty(table.Address) || x.Address.Contains(table.Address)) + select x + ; + + return q.ToList(); + } + public static List GetBase_FactoryList() + { + var q = (from x in db.Base_Factory orderby x.FactoryCode select x).ToList(); + + + return q; + } + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.Base_Factory table, Grid Grid1) + { + var q = GetBase_FactoryByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.FactoryId, + x.UnitId, + x.FactoryCode, + x.FactoryName, + x.Address, + + }; + } + #endregion + + public static Model.Base_Factory GetBase_FactoryById(string FactoryId) + { + return db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId); + } + public static string GetBase_FactoryNameById(object FactoryId) + { + string name = string.Empty; + if (FactoryId!=null) + { + var model = db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId.ToString()); + if (model != null) + { + name = model.FactoryName; + } + + } + return name; + } + public static Model.Base_Factory GetBase_FactoryByCode(string FactoryCode) + { + return db.Base_Factory.FirstOrDefault(x => x.FactoryCode == FactoryCode); + } + public static void AddBase_Factory(Model.Base_Factory newtable) + { + + Model.Base_Factory table = new Model.Base_Factory + { + FactoryId = newtable.FactoryId, + UnitId = newtable.UnitId, + FactoryCode = newtable.FactoryCode, + FactoryName = newtable.FactoryName, + Address = newtable.Address, + }; + db.Base_Factory.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkBase_Factory(List newtables) + { + + db.Base_Factory.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + + public static void UpdateBase_Factory(Model.Base_Factory newtable) + { + + Model.Base_Factory table = db.Base_Factory.FirstOrDefault(x => x.FactoryId == newtable.FactoryId); + if (table != null) + { + table.FactoryId = newtable.FactoryId; + table.UnitId = newtable.UnitId; + table.FactoryCode = newtable.FactoryCode; + table.FactoryName = newtable.FactoryName; + table.Address = newtable.Address; + db.SubmitChanges(); + } + + } + public static void DeleteBase_FactoryById(string FactoryId) + { + + Model.Base_Factory table = db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId); + if (table != null) + { + db.Base_Factory.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLBase_Factory() + { + if (db.Base_Factory != null) + { + db.Base_Factory.DeleteAllOnSubmit(db.Base_Factory); + db.SubmitChanges(); + } + } + public static void InitBase_FactoryDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "FactoryId"; + dropName.DataTextField = "FactoryName"; + dropName.DataSource = GetBase_FactoryList(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 4a1d0a83..1e1423c6 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -344,6 +344,8 @@ namespace BLL /// 温度设置 /// public const string HJGL_TemperatureSetMenuId = "A083BF37-745F-409F-9C3A-BC2FBC755757"; + + public const string Base_FactoryMenuId = "CD167198-1667-4552-9876-E768C2542C30"; #endregion #region 人员管理 @@ -5789,6 +5791,12 @@ namespace BLL /// 实业数据 /// public const string SYHSEData_SYHSEMenuId = "64EE5EC2-F725-4656-9110-5AF83C18FB6C"; + /// + /// 实业 + /// + public const string SYHSEData_DataMenuId = "S89E5EC2-F725-4656-9110-5AF83C18FB6C"; + + #endregion #region 数据同步状态 diff --git a/SGGL/BLL/SysManage/SysConstSetService.cs b/SGGL/BLL/SysManage/SysConstSetService.cs index 743ec221..57e847fe 100644 --- a/SGGL/BLL/SysManage/SysConstSetService.cs +++ b/SGGL/BLL/SysManage/SysConstSetService.cs @@ -83,6 +83,7 @@ newSysSet5.SetValue = token; } newSysSet5.SetName = "token"; + newSysSet5.SetId = 99; Funs.DB.Sys_Set.InsertOnSubmit(newSysSet5); Funs.DB.SubmitChanges(); } @@ -106,6 +107,7 @@ newSysSet5.SetValue = ExpirationTime; } newSysSet5.SetName = "token失效时间"; + newSysSet5.SetId = 98; Funs.DB.Sys_Set.InsertOnSubmit(newSysSet5); Funs.DB.SubmitChanges(); } diff --git a/SGGL/BLL/SysManage/UnitService.cs b/SGGL/BLL/SysManage/UnitService.cs index 60d738d0..1a1920b9 100644 --- a/SGGL/BLL/SysManage/UnitService.cs +++ b/SGGL/BLL/SysManage/UnitService.cs @@ -332,6 +332,20 @@ namespace BLL } return name; } + public static string GetUnitNameByUnitId(object unitId) + { + string name = string.Empty; + if (unitId != null) + { + var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitId == unitId.ToString()); + if (unit != null) + { + name = unit.UnitName; + } + } + + return name; + } public static string GetInstallationNameByUnitId(string installationId) { string name = string.Empty; diff --git a/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs b/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs new file mode 100644 index 00000000..ba6f0cad --- /dev/null +++ b/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs @@ -0,0 +1,278 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class HazardRealtimedeviceService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetHazard_RealTimeDeviceByModle(Model.Hazard_RealTimeDevice table) + { + var q = from x in db.Hazard_RealTimeDevice + where + (string.IsNullOrEmpty(table.ID) || x.ID.Contains(table.ID)) && + (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && + (string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName)) && + (string.IsNullOrEmpty(table.HazardName) || x.HazardName.Contains(table.HazardName)) && + (string.IsNullOrEmpty(table.HazardLevel) || x.HazardLevel.Contains(table.HazardLevel)) && + (string.IsNullOrEmpty(table.DeviceCode) || x.DeviceCode.Contains(table.DeviceCode)) && + (string.IsNullOrEmpty(table.DeviceName) || x.DeviceName.Contains(table.DeviceName)) && + (string.IsNullOrEmpty(table.DeviceType) || x.DeviceType.Contains(table.DeviceType)) && + (string.IsNullOrEmpty(table.SphereType) || x.SphereType.Contains(table.SphereType)) && + (string.IsNullOrEmpty(table.TemperatureType) || x.TemperatureType.Contains(table.TemperatureType)) && + (string.IsNullOrEmpty(table.DesignTemperantureMax) || x.DesignTemperantureMax.Contains(table.DesignTemperantureMax)) && + (string.IsNullOrEmpty(table.DesignTemperantureMin) || x.DesignTemperantureMin.Contains(table.DesignTemperantureMin)) && + (string.IsNullOrEmpty(table.PressureType) || x.PressureType.Contains(table.PressureType)) && + (string.IsNullOrEmpty(table.DesignPressure) || x.DesignPressure.Contains(table.DesignPressure)) && + (string.IsNullOrEmpty(table.DesignPressureMax) || x.DesignPressureMax.Contains(table.DesignPressureMax)) && + (string.IsNullOrEmpty(table.Medium) || x.Medium.Contains(table.Medium)) && + (string.IsNullOrEmpty(table.MediumForm) || x.MediumForm.Contains(table.MediumForm)) && + (string.IsNullOrEmpty(table.MediumLevelMax) || x.MediumLevelMax.Contains(table.MediumLevelMax)) && + (string.IsNullOrEmpty(table.Reserves) || x.Reserves.Contains(table.Reserves)) && + (string.IsNullOrEmpty(table.StandardCode) || x.StandardCode.Contains(table.StandardCode)) && + (string.IsNullOrEmpty(table.StandardName) || x.StandardName.Contains(table.StandardName)) && + (string.IsNullOrEmpty(table.StandardType) || x.StandardType.Contains(table.StandardType)) && + (string.IsNullOrEmpty(table.StandardDes) || x.StandardDes.Contains(table.StandardDes)) && + (string.IsNullOrEmpty(table.MeasurementUnit) || x.MeasurementUnit.Contains(table.MeasurementUnit)) && + (string.IsNullOrEmpty(table.MeterMax) || x.MeterMax.Contains(table.MeterMax)) && + (string.IsNullOrEmpty(table.MeterMin) || x.MeterMin.Contains(table.MeterMin)) && + (string.IsNullOrEmpty(table.ThresholdLow1) || x.ThresholdLow1.Contains(table.ThresholdLow1)) && + (string.IsNullOrEmpty(table.ThresholdLow2) || x.ThresholdLow2.Contains(table.ThresholdLow2)) && + (string.IsNullOrEmpty(table.ThresholdMax1) || x.ThresholdMax1.Contains(table.ThresholdMax1)) && + (string.IsNullOrEmpty(table.ThresholdMax2) || x.ThresholdMax2.Contains(table.ThresholdMax2)) && + (string.IsNullOrEmpty(table.BitNum) || x.BitNum.Contains(table.BitNum)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && + (string.IsNullOrEmpty(table.Value) || x.Value.Contains(table.Value)) && + (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) && + (string.IsNullOrEmpty(table.ReceiveDate) || x.ReceiveDate.Contains(table.ReceiveDate)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.Hazard_RealTimeDevice table, Grid Grid1) + { + var q = GetHazard_RealTimeDeviceByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.ID, + x.UnitId, + x.UnitName, + x.HazardName, + x.HazardLevel, + x.DeviceCode, + x.DeviceName, + x.DeviceType, + x.SphereType, + x.TemperatureType, + x.DesignTemperantureMax, + x.DesignTemperantureMin, + x.PressureType, + x.DesignPressure, + x.DesignPressureMax, + x.Medium, + x.MediumForm, + x.MediumLevelMax, + x.Reserves, + x.StandardCode, + x.StandardName, + x.StandardType, + x.StandardDes, + x.MeasurementUnit, + x.MeterMax, + x.MeterMin, + x.ThresholdLow1, + x.ThresholdLow2, + x.ThresholdMax1, + x.ThresholdMax2, + x.BitNum, + x.DateTime, + x.ProjectId, + x.Value, + x.FactoryId, + x.ReportDate, + x.ReceiveDate, + + }; + } + #endregion + + public static Model.Hazard_RealTimeDevice GetHazard_RealTimeDeviceById(string ID) + { + return db.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == ID); + } + + + public static void AddHazard_RealTimeDevice(Model.Hazard_RealTimeDevice newtable) + { + + Model.Hazard_RealTimeDevice table = new Model.Hazard_RealTimeDevice + { + ID = newtable.ID, + UnitId = newtable.UnitId, + UnitName = newtable.UnitName, + HazardName = newtable.HazardName, + HazardLevel = newtable.HazardLevel, + DeviceCode = newtable.DeviceCode, + DeviceName = newtable.DeviceName, + DeviceType = newtable.DeviceType, + SphereType = newtable.SphereType, + TemperatureType = newtable.TemperatureType, + DesignTemperantureMax = newtable.DesignTemperantureMax, + DesignTemperantureMin = newtable.DesignTemperantureMin, + PressureType = newtable.PressureType, + DesignPressure = newtable.DesignPressure, + DesignPressureMax = newtable.DesignPressureMax, + Medium = newtable.Medium, + MediumForm = newtable.MediumForm, + MediumLevelMax = newtable.MediumLevelMax, + Reserves = newtable.Reserves, + StandardCode = newtable.StandardCode, + StandardName = newtable.StandardName, + StandardType = newtable.StandardType, + StandardDes = newtable.StandardDes, + MeasurementUnit = newtable.MeasurementUnit, + MeterMax = newtable.MeterMax, + MeterMin = newtable.MeterMin, + ThresholdLow1 = newtable.ThresholdLow1, + ThresholdLow2 = newtable.ThresholdLow2, + ThresholdMax1 = newtable.ThresholdMax1, + ThresholdMax2 = newtable.ThresholdMax2, + BitNum = newtable.BitNum, + DateTime = newtable.DateTime, + ProjectId = newtable.ProjectId, + Value = newtable.Value, + FactoryId = newtable.FactoryId, + ReportDate = newtable.ReportDate, + ReceiveDate = newtable.ReceiveDate, + }; + db.Hazard_RealTimeDevice.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkHazard_RealTimeDevice(List newtables) + { + + db.Hazard_RealTimeDevice.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + + public static void UpdateHazard_RealTimeDevice(Model.Hazard_RealTimeDevice newtable) + { + + Model.Hazard_RealTimeDevice table = db.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == newtable.ID); + if (table != null) + { + table.ID = newtable.ID; + table.UnitId = newtable.UnitId; + table.UnitName = newtable.UnitName; + table.HazardName = newtable.HazardName; + table.HazardLevel = newtable.HazardLevel; + table.DeviceCode = newtable.DeviceCode; + table.DeviceName = newtable.DeviceName; + table.DeviceType = newtable.DeviceType; + table.SphereType = newtable.SphereType; + table.TemperatureType = newtable.TemperatureType; + table.DesignTemperantureMax = newtable.DesignTemperantureMax; + table.DesignTemperantureMin = newtable.DesignTemperantureMin; + table.PressureType = newtable.PressureType; + table.DesignPressure = newtable.DesignPressure; + table.DesignPressureMax = newtable.DesignPressureMax; + table.Medium = newtable.Medium; + table.MediumForm = newtable.MediumForm; + table.MediumLevelMax = newtable.MediumLevelMax; + table.Reserves = newtable.Reserves; + table.StandardCode = newtable.StandardCode; + table.StandardName = newtable.StandardName; + table.StandardType = newtable.StandardType; + table.StandardDes = newtable.StandardDes; + table.MeasurementUnit = newtable.MeasurementUnit; + table.MeterMax = newtable.MeterMax; + table.MeterMin = newtable.MeterMin; + table.ThresholdLow1 = newtable.ThresholdLow1; + table.ThresholdLow2 = newtable.ThresholdLow2; + table.ThresholdMax1 = newtable.ThresholdMax1; + table.ThresholdMax2 = newtable.ThresholdMax2; + table.BitNum = newtable.BitNum; + table.DateTime = newtable.DateTime; + table.ProjectId = newtable.ProjectId; + table.Value = newtable.Value; + table.FactoryId = newtable.FactoryId; + table.ReportDate = newtable.ReportDate; + table.ReceiveDate = newtable.ReceiveDate; + db.SubmitChanges(); + } + + } + public static void DeleteHazard_RealTimeDeviceById(string ID) + { + + Model.Hazard_RealTimeDevice table = db.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == ID); + if (table != null) + { + db.Hazard_RealTimeDevice.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLHazard_RealTimeDevice() + { + if (db.Hazard_RealTimeDevice != null) + { + db.Hazard_RealTimeDevice.DeleteAllOnSubmit(db.Hazard_RealTimeDevice); + db.SubmitChanges(); + } + } + public static List GetHazard_RealTimeDeviceByDate(DateTime? reportDate) + { + var q = from x in db.Hazard_RealTimeDevice + where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 + select x; + return q.ToList(); + } + public static void DeleteHazard_RealTimeDeviceByDate(DateTime? reportDate) + { + + var table = db.Hazard_RealTimeDevice.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); + if (table != null) + { + db.Hazard_RealTimeDevice.DeleteAllOnSubmit(table); + db.SubmitChanges(); + } + + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs new file mode 100644 index 00000000..d26fa414 --- /dev/null +++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs @@ -0,0 +1,245 @@ +using FineUIPro; +using Model; +using Newtonsoft.Json; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class SYHSEData_DataService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetSYHSEData_DataByModle(Model.SYHSEData_Data table) + { + var q = from x in db.SYHSEData_Data + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.SYHSEData_Data table, Grid Grid1) + { + var q = GetSYHSEData_DataByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.Id, + x.FactoryId, + x.SafetyMnaHours, + x.GeneralRiskNum, + x.LowRiskNum, + x.MoreRiskNum, + x.GreatRiskNum, + x.ReportDate, + + }; + } + #endregion + public static bool IsReportByDate(DateTime dateTime) + { + var result = false; + var q = (from x in Funs.DB.SYHSEData_Data + where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date) + select x).ToList(); + if (q != null && q.Count > 0) + { + result = true; + } + return result; + } + public static Model.ReturnData PushCNCEC(string Id) + { + string baseurl = "/api/SYHSEData/SaveNewSYHSEData"; + var item = GetItemById(Id); + string str = JsonConvert.SerializeObject(item); + var responeData = BLL.ServerService.PushCNCEC(str, baseurl); + return responeData; + } + public static Model.NewSYHSEData GetItemById(string Id) + { + var data=GetSYHSEData_DataById(Id); + var data_realtime = HazardRealtimedeviceService.GetHazard_RealTimeDeviceByDate(data.ReportDate); + var data_hidden= SyhsedataHiddendangercheckService.GetSYHSEData_HiddenDangerCheckByDate(data.ReportDate); + var data_risk= SyhsedataRiskcontrolService.GetSYHSEData_RiskControlByDate(data.ReportDate); + + + NewSYHSEData APIData = new NewSYHSEData(); + var APIDataList_Item= new List(); + var APIDataList_Relatime= new List(); + var APIDataList_Hidden= new List(); + var APIDataList_Risk= new List(); + + foreach (var tb in data_realtime) + { + var q = new NewSYHSEDataRealTimeDeviceItem() + { + Id=tb.ID, + HazardName=tb.HazardName, + HazardLevel=tb.HazardLevel, + DeviceName=tb.DeviceName, + Medium=tb.Medium, + MeasurementUnit=tb.MeasurementUnit, + DateTime=tb.DateTime.ToString(), + Value=tb.Value, + + }; + + APIDataList_Relatime.Add(q); + } + + foreach (var tb in data_hidden) + { + var q = new NewSYHSEDataHiddenDangerCheckItem() + { + Id=tb.Id, + HiddenDangerName=tb.HiddenDangerName, + TotalNum=tb.TotalNum.HasValue ? tb.TotalNum.Value:0, + OKNum=tb.OKNum.HasValue ? tb.OKNum.Value : 0, + + }; + APIDataList_Hidden.Add(q); + } + + foreach (var tb in data_risk) + { + + var q = new NewSYHSEDataRiskControlItem() + { + Id=tb.Id, + RiskControlName=tb.RiskControlName, + + }; + APIDataList_Risk.Add(q); + } + + NewSYHSEDataItem Item = new NewSYHSEDataItem(); + Item.Id = data.Id; + Item.ReportDate=data.ReportDate.ToString(); + Item.UnitId = Const.UnitId_CD; + Item.CollCropCode = UnitService.GetUnitByUnitId(Const.UnitId_CD).CollCropCode; + Item.UnitName= UnitService.GetUnitByUnitId(Const.UnitId_CD).UnitName; + Item.FactoryId = data.FactoryId; + Item.FactoryCode = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).FactoryCode; + Item.FactoryName = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).FactoryName; + Item.Address = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).Address; + Item.SafetyMnaHours = data.SafetyMnaHours.HasValue ? data.SafetyMnaHours.Value : 0; + Item.GeneralRiskNum = data.GeneralRiskNum.HasValue ? data.GeneralRiskNum.Value : 0; + Item.LowRiskNum = data.LowRiskNum.HasValue ? data.LowRiskNum.Value : 0; + Item.MoreRiskNum = data.MoreRiskNum.HasValue ? data.MoreRiskNum.Value : 0; + Item.GreatRiskNum = data.GreatRiskNum.HasValue ? data.GreatRiskNum.Value : 0; + Item.NewSYHSEDataRiskControlItems = APIDataList_Risk; + Item.NewSYHSEDataRealTimeDeviceItems = APIDataList_Relatime; + Item.NewSYHSEDataHiddenDangerCheckItems = APIDataList_Hidden; + + APIDataList_Item.Add(Item); + + APIData.NewSYHSEDataItems = APIDataList_Item; + + return APIData; + } + + public static Model.SYHSEData_Data GetSYHSEData_DataById(string Id) + { + return db.SYHSEData_Data.FirstOrDefault(x => x.Id == Id); + } + + + public static void AddSYHSEData_Data(Model.SYHSEData_Data newtable) + { + + Model.SYHSEData_Data table = new Model.SYHSEData_Data + { + Id = newtable.Id, + FactoryId = newtable.FactoryId, + SafetyMnaHours = newtable.SafetyMnaHours, + GeneralRiskNum = newtable.GeneralRiskNum, + LowRiskNum = newtable.LowRiskNum, + MoreRiskNum = newtable.MoreRiskNum, + GreatRiskNum = newtable.GreatRiskNum, + ReportDate = newtable.ReportDate, + }; + db.SYHSEData_Data.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkSYHSEData_Data(List newtables) + { + + db.SYHSEData_Data.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + + public static void UpdateSYHSEData_Data(Model.SYHSEData_Data newtable) + { + + Model.SYHSEData_Data table = db.SYHSEData_Data.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.FactoryId = newtable.FactoryId; + table.SafetyMnaHours = newtable.SafetyMnaHours; + table.GeneralRiskNum = newtable.GeneralRiskNum; + table.LowRiskNum = newtable.LowRiskNum; + table.MoreRiskNum = newtable.MoreRiskNum; + table.GreatRiskNum = newtable.GreatRiskNum; + table.ReportDate = newtable.ReportDate; + db.SubmitChanges(); + } + + } + public static void DeleteSYHSEData_DataById(string Id) + { + + Model.SYHSEData_Data table = db.SYHSEData_Data.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + db.SYHSEData_Data.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLSYHSEData_Data() + { + if (db.SYHSEData_Data != null) + { + db.SYHSEData_Data.DeleteAllOnSubmit(db.SYHSEData_Data); + db.SubmitChanges(); + } + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs new file mode 100644 index 00000000..1c17e777 --- /dev/null +++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs @@ -0,0 +1,153 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class SyhsedataHiddendangercheckService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetSYHSEData_HiddenDangerCheckByModle(Model.SYHSEData_HiddenDangerCheck table) + { + var q = from x in db.SYHSEData_HiddenDangerCheck + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) && + (string.IsNullOrEmpty(table.HiddenDangerName) || x.HiddenDangerName.Contains(table.HiddenDangerName)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.SYHSEData_HiddenDangerCheck table, Grid Grid1) + { + var q = GetSYHSEData_HiddenDangerCheckByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.Id, + x.FactoryId, + x.HiddenDangerName, + x.TotalNum, + x.OKNum, + x.ReportDate, + + }; + } + #endregion + + public static Model.SYHSEData_HiddenDangerCheck GetSYHSEData_HiddenDangerCheckById(string Id) + { + return db.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == Id); + } + + + public static void AddSYHSEData_HiddenDangerCheck(Model.SYHSEData_HiddenDangerCheck newtable) + { + + Model.SYHSEData_HiddenDangerCheck table = new Model.SYHSEData_HiddenDangerCheck + { + Id = newtable.Id, + FactoryId = newtable.FactoryId, + HiddenDangerName = newtable.HiddenDangerName, + TotalNum = newtable.TotalNum, + OKNum = newtable.OKNum, + ReportDate = newtable.ReportDate, + }; + db.SYHSEData_HiddenDangerCheck.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkSYHSEData_HiddenDangerCheck(List newtables) + { + + db.SYHSEData_HiddenDangerCheck.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + + public static void UpdateSYHSEData_HiddenDangerCheck(Model.SYHSEData_HiddenDangerCheck newtable) + { + + Model.SYHSEData_HiddenDangerCheck table = db.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.FactoryId = newtable.FactoryId; + table.HiddenDangerName = newtable.HiddenDangerName; + table.TotalNum = newtable.TotalNum; + table.OKNum = newtable.OKNum; + table.ReportDate = newtable.ReportDate; + db.SubmitChanges(); + } + + } + public static void DeleteSYHSEData_HiddenDangerCheckById(string Id) + { + + Model.SYHSEData_HiddenDangerCheck table = db.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + db.SYHSEData_HiddenDangerCheck.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLSYHSEData_HiddenDangerCheck() + { + if (db.SYHSEData_HiddenDangerCheck != null) + { + db.SYHSEData_HiddenDangerCheck.DeleteAllOnSubmit(db.SYHSEData_HiddenDangerCheck); + db.SubmitChanges(); + } + } + public static List GetSYHSEData_HiddenDangerCheckByDate(DateTime? reportDate) + { + var q = from x in db.SYHSEData_HiddenDangerCheck + where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 + select x; + return q.ToList(); + } + public static void DeleteSYHSEData_HiddenDangerCheckByDate(DateTime? reportDate) + { + + var table = db.SYHSEData_HiddenDangerCheck.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); + if (table != null) + { + db.SYHSEData_HiddenDangerCheck.DeleteAllOnSubmit(table); + db.SubmitChanges(); + } + + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs new file mode 100644 index 00000000..cf013d66 --- /dev/null +++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs @@ -0,0 +1,147 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class SyhsedataRiskcontrolService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetSYHSEData_RiskControlByModle(Model.SYHSEData_RiskControl table) + { + var q = from x in db.SYHSEData_RiskControl + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) && + (string.IsNullOrEmpty(table.RiskControlName) || x.RiskControlName.Contains(table.RiskControlName)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.SYHSEData_RiskControl table, Grid Grid1) + { + var q = GetSYHSEData_RiskControlByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.Id, + x.FactoryId, + x.RiskControlName, + x.ReportDate, + + }; + } + #endregion + + public static Model.SYHSEData_RiskControl GetSYHSEData_RiskControlById(string Id) + { + return db.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == Id); + } + + + public static void AddSYHSEData_RiskControl(Model.SYHSEData_RiskControl newtable) + { + + Model.SYHSEData_RiskControl table = new Model.SYHSEData_RiskControl + { + Id = newtable.Id, + FactoryId = newtable.FactoryId, + RiskControlName = newtable.RiskControlName, + ReportDate = newtable.ReportDate, + }; + db.SYHSEData_RiskControl.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkSYHSEData_RiskControl(List newtables) + { + + db.SYHSEData_RiskControl.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + + public static void UpdateSYHSEData_RiskControl(Model.SYHSEData_RiskControl newtable) + { + + Model.SYHSEData_RiskControl table = db.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.FactoryId = newtable.FactoryId; + table.RiskControlName = newtable.RiskControlName; + table.ReportDate = newtable.ReportDate; + db.SubmitChanges(); + } + + } + public static void DeleteSYHSEData_RiskControlById(string Id) + { + + Model.SYHSEData_RiskControl table = db.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + db.SYHSEData_RiskControl.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + + public static void DeleteALLSYHSEData_RiskControl() + { + if (db.SYHSEData_RiskControl != null) + { + db.SYHSEData_RiskControl.DeleteAllOnSubmit(db.SYHSEData_RiskControl); + db.SubmitChanges(); + } + } + public static List GetSYHSEData_RiskControlByDate(DateTime? reportDate) + { + var q = from x in db.SYHSEData_RiskControl + where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 + select x; + return q.ToList(); + } + public static void DeleteSYHSEData_RiskControlByDate(DateTime? reportDate) + { + + var table = db.SYHSEData_RiskControl.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); + if (table != null) + { + db.SYHSEData_RiskControl.DeleteAllOnSubmit(table); + db.SubmitChanges(); + } + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx b/SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx new file mode 100644 index 00000000..f6b20c39 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx @@ -0,0 +1,121 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BaseFactory.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.BaseFactory" %> + + + + + + + + 实业工厂表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx.cs new file mode 100644 index 00000000..2e48f266 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx.cs @@ -0,0 +1,249 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class BaseFactory : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + Model.Base_Factory table = new Model.Base_Factory(); + var tb = BLL.Base_FactoryService.getListData(table, Grid1); + Grid1.RecordCount = Base_FactoryService.count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + Grid1.DataSource = tb; + Grid1.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + /// + /// 新增 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("BaseFactoryEdit.aspx?FactoryId={0}", string.Empty, "增加 - "))); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string ID = Grid1.SelectedRowID; + var model = BLL.Base_FactoryService.GetBase_FactoryById(ID); + if (model != null) ///已上报时不能删除 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("BaseFactoryEdit.aspx?FactoryId={0}", ID, "编辑 - "))); + } + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + /// + /// 批量删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.Base_FactoryService.GetBase_FactoryById(rowID); + if (model != null) + { + BLL.Base_FactoryService.DeleteBase_FactoryById(rowID); + } + } + + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.Base_FactoryMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + + #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; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + 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("lblNumber") 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/BaseInfo/BaseFactory.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx.designer.cs new file mode 100644 index 00000000..5fecdb83 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class BaseFactory + { + + /// + /// 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; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// 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; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx new file mode 100644 index 00000000..4e4b03e2 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx @@ -0,0 +1,58 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BaseFactoryEdit.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.BaseFactoryEdit" %> + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs new file mode 100644 index 00000000..d64f9d66 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs @@ -0,0 +1,113 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class BaseFactoryEdit: PageBase + { + #region + /// + /// 主键 + /// + public string FactoryId + { + get + { + return (string)ViewState["FactoryId"]; + } + set + { + ViewState["FactoryId"] = value; + } + } + #endregion + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + ////权限按钮方法 + this.GetButtonPower(); + this.FactoryId = Request.Params["FactoryId"]; + if (!string.IsNullOrEmpty(this.FactoryId)) + { + Model.Base_Factory model = BLL.Base_FactoryService.GetBase_FactoryById(this.FactoryId); + if (model != null) + { + this.txtFactoryCode.Text = model.FactoryCode; + this.txtFactoryName.Text = model.FactoryName; + this.txtAddress.Text = model.Address; + + } + } + } + } + + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (!IsSaveCode()) + { + ShowNotify("编号重复,请注意!", MessageBoxIcon.Warning); + return; + } + Model.Base_Factory table = new Model.Base_Factory(); + table.UnitId = BLL.Const.UnitId_CD; + table.FactoryCode = this.txtFactoryCode.Text; + table.FactoryName = this.txtFactoryName.Text; + table.Address = this.txtAddress.Text; + if (string.IsNullOrEmpty(this.FactoryId)) + { + table.FactoryId = SQLHelper.GetNewID(typeof(Model.Base_Factory)); + BLL.Base_FactoryService.AddBase_Factory(table); + + } + else + { + table.FactoryId = this.FactoryId; + BLL.Base_FactoryService.UpdateBase_Factory(table); + } + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + protected bool IsSaveCode() + { + bool result = true; + var model = BLL.Base_FactoryService.GetBase_FactoryByCode(this.txtFactoryCode.Text); + if(model != null && model.FactoryId !=this.FactoryId) + { + result=false; + } + return result; + } + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.Base_FactoryMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + } + } + } + #endregion + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.designer.cs new file mode 100644 index 00000000..8671a426 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.designer.cs @@ -0,0 +1,107 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class BaseFactoryEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtFactoryCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtFactoryCode; + + /// + /// txtFactoryName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtFactoryName; + + /// + /// txtAddress 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAddress; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 76bba262..31ff2189 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -1715,3 +1715,185 @@ IP地址:::1 出错时间:02/23/2023 10:40:22 + +错误信息开始=====> +错误类型:HttpException +错误信息:文件“/BaseInfo/Base_FactoryEdit.aspx”不存在。 +错误堆栈: + 在 System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) + 在 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) + 在 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) + 在 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) + 在 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) + 在 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) + 在 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) + 在 System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) + 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +出错时间:03/07/2023 19:28:11 +出错文件:http://localhost:8119/BaseInfo/Base_FactoryEdit.aspx?FactoryId= +IP地址:::1 + +出错时间:03/07/2023 19:28:11 + + +错误信息开始=====> +错误类型:HttpException +错误信息:文件“/BaseInfo/Base_FactoryEdit.aspx”不存在。 +错误堆栈: + 在 System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) + 在 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) + 在 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) + 在 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) + 在 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) + 在 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) + 在 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) + 在 System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) + 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +出错时间:03/07/2023 19:28:59 +出错文件:http://localhost:8119/BaseInfo/Base_FactoryEdit.aspx?FactoryId= +IP地址:::1 + +出错时间:03/07/2023 19:28:59 + + +错误信息开始=====> +错误类型:MissingMethodException +错误信息:找不到方法:“Model.Base_Factory BLL.Base_FactoryService.GetBase_FactoryByCode(System.String)”。 +错误堆栈: + 在 FineUIPro.Web.BaseInfo.BaseFactoryEdit.IsSaveCode() + 在 FineUIPro.Web.BaseInfo.BaseFactoryEdit.btnSave_Click(Object sender, EventArgs e) + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:03/07/2023 19:39:59 +出错文件:http://localhost:8119/BaseInfo/BaseFactoryEdit.aspx?FactoryId= +IP地址:::1 +操作人员:JT + +出错时间:03/07/2023 19:39:59 + + +错误信息开始=====> +错误类型:MissingMethodException +错误信息:找不到方法:“Model.Base_Factory BLL.Base_FactoryService.GetBase_FactoryByCode(System.String)”。 +错误堆栈: + 在 FineUIPro.Web.BaseInfo.BaseFactoryEdit.IsSaveCode() + 在 FineUIPro.Web.BaseInfo.BaseFactoryEdit.btnSave_Click(Object sender, EventArgs e) + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:03/07/2023 19:40:25 +出错文件:http://localhost:8119/BaseInfo/BaseFactoryEdit.aspx?FactoryId= +IP地址:::1 +操作人员:JT + +出错时间:03/07/2023 19:40:25 + + +错误信息开始=====> +错误类型:DuplicateKeyException +错误信息:不能添加其键已在使用中的实体。 +错误堆栈: + 在 System.Data.Linq.ChangeProcessor.TrackUntrackedObjects(MetaType type, Object item, Dictionary`2 visited) + 在 System.Data.Linq.ChangeProcessor.TrackUntrackedObjects() + 在 System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) + 在 System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) + 在 System.Data.Linq.DataContext.SubmitChanges() + 在 BLL.SysConstSetService.SetToken(String token) 位置 D:\诺必达\成达\SGGL_CD\SGGL\BLL\SysManage\SysConstSetService.cs:行号 87 + 在 FineUIPro.Web.SysManage.SysConstSet.btnApply_Click(Object sender, EventArgs e) 位置 D:\诺必达\成达\SGGL_CD\SGGL\FineUIPro.Web\SysManage\SysConstSet.aspx.cs:行号 1175 + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:03/07/2023 22:38:31 +出错文件:http://localhost:8119/SysManage/SysConstSet.aspx +IP地址:::1 +操作人员:JT + +出错时间:03/07/2023 22:38:31 + + +错误信息开始=====> +错误类型:DuplicateKeyException +错误信息:不能添加其键已在使用中的实体。 +错误堆栈: + 在 System.Data.Linq.ChangeProcessor.TrackUntrackedObjects(MetaType type, Object item, Dictionary`2 visited) + 在 System.Data.Linq.ChangeProcessor.TrackUntrackedObjects() + 在 System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) + 在 System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) + 在 System.Data.Linq.DataContext.SubmitChanges() + 在 BLL.SysConstSetService.SetToken(String token) 位置 D:\诺必达\成达\SGGL_CD\SGGL\BLL\SysManage\SysConstSetService.cs:行号 87 + 在 FineUIPro.Web.SysManage.SysConstSet.btnApply_Click(Object sender, EventArgs e) 位置 D:\诺必达\成达\SGGL_CD\SGGL\FineUIPro.Web\SysManage\SysConstSet.aspx.cs:行号 1175 + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:03/07/2023 22:40:55 +出错文件:http://localhost:8119/SysManage/SysConstSet.aspx +IP地址:::1 +操作人员:JT + +出错时间:03/07/2023 22:40:55 + + +错误信息开始=====> +错误类型:DuplicateKeyException +错误信息:不能添加其键已在使用中的实体。 +错误堆栈: + 在 System.Data.Linq.ChangeProcessor.TrackUntrackedObjects(MetaType type, Object item, Dictionary`2 visited) + 在 System.Data.Linq.ChangeProcessor.TrackUntrackedObjects() + 在 System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) + 在 System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) + 在 System.Data.Linq.DataContext.SubmitChanges() + 在 BLL.SysConstSetService.SetToken(String token) 位置 D:\诺必达\成达\SGGL_CD\SGGL\BLL\SysManage\SysConstSetService.cs:行号 87 + 在 FineUIPro.Web.SysManage.SysConstSet.btnApply_Click(Object sender, EventArgs e) 位置 D:\诺必达\成达\SGGL_CD\SGGL\FineUIPro.Web\SysManage\SysConstSet.aspx.cs:行号 1175 + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:03/07/2023 22:41:36 +出错文件:http://localhost:8119/SysManage/SysConstSet.aspx +IP地址:::1 +操作人员:JT + +出错时间:03/07/2023 22:41:36 + + +错误信息开始=====> +错误类型:DuplicateKeyException +错误信息:不能添加其键已在使用中的实体。 +错误堆栈: + 在 System.Data.Linq.ChangeProcessor.TrackUntrackedObjects(MetaType type, Object item, Dictionary`2 visited) + 在 System.Data.Linq.ChangeProcessor.TrackUntrackedObjects() + 在 System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) + 在 System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) + 在 System.Data.Linq.DataContext.SubmitChanges() + 在 BLL.SysConstSetService.SetTokenExpirationTime(String ExpirationTime) + 在 FineUIPro.Web.SysManage.SysConstSet.btnApply_Click(Object sender, EventArgs e) 位置 D:\诺必达\成达\SGGL_CD\SGGL\FineUIPro.Web\SysManage\SysConstSet.aspx.cs:行号 1176 + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:03/07/2023 22:43:33 +出错文件:http://localhost:8119/SysManage/SysConstSet.aspx +IP地址:::1 +操作人员:JT + +出错时间:03/07/2023 22:43:33 + diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 32768de5..ffe7ea47 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -220,6 +220,8 @@ + + @@ -1829,6 +1831,8 @@ + + @@ -6047,6 +6051,20 @@ AccidentType.aspx + + BaseFactory.aspx + ASPXCodeBehind + + + BaseFactory.aspx + + + BaseFactoryEdit.aspx + ASPXCodeBehind + + + BaseFactoryEdit.aspx + Certificate.aspx ASPXCodeBehind @@ -15542,6 +15560,20 @@ Project_SYHSEData_SYHSEEdit.aspx + + SYHSEData_Data.aspx + ASPXCodeBehind + + + SYHSEData_Data.aspx + + + SYHSEData_DataEdit.aspx + ASPXCodeBehind + + + SYHSEData_DataEdit.aspx + SYHSEData_SYHSE.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/Web.config b/SGGL/FineUIPro.Web/Web.config index 583b67aa..0e031171 100644 --- a/SGGL/FineUIPro.Web/Web.config +++ b/SGGL/FineUIPro.Web/Web.config @@ -27,8 +27,8 @@ - - + + @@ -159,7 +159,11 @@ - + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx new file mode 100644 index 00000000..ada86ceb --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx @@ -0,0 +1,131 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SYHSEData_Data.aspx.cs" Inherits="FineUIPro.Web.ZHGL.DataSync.SYHSEData_Data" %> + + + + + + + + 实业数据表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx.cs new file mode 100644 index 00000000..2b90eef0 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx.cs @@ -0,0 +1,249 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.DataSync +{ + public partial class SYHSEData_Data :PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + Model.SYHSEData_Data table = new Model.SYHSEData_Data(); + var tb = BLL.SYHSEData_DataService.getListData(table, Grid1); + Grid1.RecordCount = SYHSEData_DataService.count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + Grid1.DataSource = tb; + Grid1.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + /// + /// 新增 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SYHSEData_DataEdit.aspx?Id={0}", string.Empty, "增加 - "))); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string ID = Grid1.SelectedRowID; + var model = BLL.SYHSEData_DataService.GetSYHSEData_DataById(ID); + if (model != null) ///已上报时不能删除 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SYHSEData_DataEdit.aspx?Id={0}", ID, "编辑 - "))); + } + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + /// + /// 批量删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.SYHSEData_DataService.GetSYHSEData_DataById(rowID); + if (model != null) + { + BLL.SYHSEData_DataService.DeleteSYHSEData_DataById(rowID); + } + } + + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SYHSEData_DataMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + + #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; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + 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("lblNumber") 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/ZHGL/DataSync/SYHSEData_Data.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx.designer.cs new file mode 100644 index 00000000..100bf637 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.DataSync +{ + + + public partial class SYHSEData_Data + { + + /// + /// 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; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// 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; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx new file mode 100644 index 00000000..0a57ab67 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx @@ -0,0 +1,282 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SYHSEData_DataEdit.aspx.cs" Inherits="FineUIPro.Web.ZHGL.DataSync.SYHSEData_DataEdit" %> + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx.cs new file mode 100644 index 00000000..30dff4e9 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx.cs @@ -0,0 +1,334 @@ +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using RestSharp.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ZHGL.DataSync +{ + public partial class SYHSEData_DataEdit : PageBase + { + #region + /// + /// 主键 + /// + public string Id + { + get + { + return (string)ViewState["Id"]; + } + set + { + ViewState["Id"] = value; + } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + ////权限按钮方法 + this.GetButtonPower(); + this.Id = Request.Params["Id"]; + BLL.Base_FactoryService.InitBase_FactoryDownList(DropFactory, true); + if (!string.IsNullOrEmpty(this.Id)) + { + // Model.SYHSEData_Data model = BLL.SYHSEData_DataService.GetSYHSEData_DataById(this.Id); + + Model.SYHSEData_Data model = BLL.SYHSEData_DataService.GetSYHSEData_DataById(this.Id); + if (model != null) + { + //this.txtUnitId.Text = model.UnitId; + if (!string.IsNullOrEmpty(model.FactoryId)) + { + DropFactory.SelectedValue=model.FactoryId; + + } + if (model.ReportDate != null) + { + this.txtReportDate.SelectedDate = model.ReportDate; + } + if (model.SafetyMnaHours.HasValue) + { + this.txtSafetyMnaHours.Text = model.SafetyMnaHours.Value.ToString(); + } + if (model.GeneralRiskNum.HasValue) + { + this.txtGeneralRiskNum.Text = model.GeneralRiskNum.Value.ToString(); + } + if (model.LowRiskNum.HasValue) + { + this.txtLowRiskNum.Text = model.LowRiskNum.Value.ToString(); + } + if (model.MoreRiskNum.HasValue) + { + this.txtMoreRiskNum.Text = model.MoreRiskNum.Value.ToString(); + } + if (model.GreatRiskNum.HasValue) + { + this.txtGreatRiskNum.Text = model.GreatRiskNum.Value.ToString(); + } + + } + } + else + { + txtReportDate.SelectedDate = DateTime.Now; + + } + BindGrid(); + #region Grid1 + // 删除选中单元格的客户端脚本 + string deleteScript_Realtimedevice = GetDeleteScript_Realtimedevice(); + string deleteScript_Hidden = GetDeleteScript_Hidden(); + string deleteScript_Risk = GetDeleteScript_Risk(); + + JObject defaultObj_Realtimedevice = new JObject + { + { "HazardName", "" }, + { "HazardLevel", "" }, + { "DeviceName", "" }, + { "Medium", "" }, + { "MeasurementUnit", "" }, + { "DateTime", "" }, + { "Value", "" } + }; + // 在第一行新增一条数据 + btnNew_Realtimedevice.OnClientClick = Grid_Realtimedevice.GetAddNewRecordReference(defaultObj_Realtimedevice, true); + // 删除选中行按钮 + btnDelete_Realtimedevice.OnClientClick = Grid_Realtimedevice.GetNoSelectionAlertReference("请选择一条记录!") + deleteScript_Realtimedevice; + + JObject defaultObj_Hidden = new JObject + { + { "HiddenDangerName", "" }, + { "TotalNum", "" }, + { "OKNum", "" } + }; + // 在第一行新增一条数据 + btnNew_Hidden.OnClientClick = Grid_Hidden.GetAddNewRecordReference(defaultObj_Hidden, true); + // 删除选中行按钮 + btnDelete_Hidden.OnClientClick = Grid_Hidden.GetNoSelectionAlertReference("请选择一条记录!") + deleteScript_Hidden; + + JObject defaultObj_Risk = new JObject + { + { "RiskControlName", "" } + }; + // 在第一行新增一条数据 + btnNew_Risk.OnClientClick = Grid_Risk.GetAddNewRecordReference(defaultObj_Risk, true); + // 删除选中行按钮 + btnDelete_Risk.OnClientClick = Grid_Risk.GetNoSelectionAlertReference("请选择一条记录!") + deleteScript_Risk; + + + #endregion + + } + } + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (txtReportDate.SelectedDate == null) + { + + ShowNotify("请选择上报日期!"); + return; + + } + if (DropFactory.SelectedValue==Const._Null) + { + + ShowNotify("请选择实业!"); + return; + + } + Model.SYHSEData_Data table = new Model.SYHSEData_Data(); + table.FactoryId = this.DropFactory.SelectedValue; + table.ReportDate = this.txtReportDate.SelectedDate; + table.SafetyMnaHours = Funs.GetNewInt(this.txtSafetyMnaHours.Text); + table.GeneralRiskNum = Funs.GetNewInt(this.txtGeneralRiskNum.Text); + table.LowRiskNum = Funs.GetNewInt(this.txtLowRiskNum.Text); + table.MoreRiskNum = Funs.GetNewInt(this.txtMoreRiskNum.Text); + table.GreatRiskNum = Funs.GetNewInt(this.txtGreatRiskNum.Text); + if (string.IsNullOrEmpty(this.Id)) + { + table.Id = SQLHelper.GetNewID(typeof(Model.SYHSEData_Data)); + BLL.SYHSEData_DataService.AddSYHSEData_Data(table); + + } + else + { + table.Id = this.Id; + BLL.SYHSEData_DataService.UpdateSYHSEData_Data(table); + } + + BLL.HazardRealtimedeviceService.DeleteHazard_RealTimeDeviceByDate(table.ReportDate); + JArray EditorArr_Realtimedevice = Grid_Realtimedevice.GetMergedData(); + if (EditorArr_Realtimedevice.Count > 0) + { + Model.Hazard_RealTimeDevice defect = new Model.Hazard_RealTimeDevice(); + + for (int i = 0; i < EditorArr_Realtimedevice.Count; i++) + { + JObject objects = (JObject)EditorArr_Realtimedevice[i]; + defect.ID = SQLHelper.GetNewID(typeof(Model.Hazard_RealTimeDevice)); + defect.ReportDate = table.ReportDate; + defect.FactoryId = DropFactory.SelectedValue; + defect.HazardName = objects["values"]["HazardName"].ToString(); + defect.HazardLevel = objects["values"]["HazardLevel"].ToString(); + defect.DeviceName = objects["values"]["DeviceName"].ToString(); + defect.Medium = objects["values"]["Medium"].ToString(); + defect.MeasurementUnit = objects["values"]["MeasurementUnit"].ToString(); + defect.Value = objects["values"]["Value"].ToString(); + defect.DateTime =DateTime.Parse(objects["values"]["DateTime"].ToString()) ; + //defect.HazardLevel = Funs.GetNewInt(objects["values"]["HazardLevel"].ToString()); + + BLL.HazardRealtimedeviceService.AddHazard_RealTimeDevice(defect); + } + } + + + + BLL.SyhsedataHiddendangercheckService.DeleteSYHSEData_HiddenDangerCheckByDate(table.ReportDate); + JArray EditorArr_Hidden = Grid_Hidden.GetMergedData(); + if (EditorArr_Hidden.Count > 0) + { + Model.SYHSEData_HiddenDangerCheck defect = new Model.SYHSEData_HiddenDangerCheck(); + + for (int i = 0; i < EditorArr_Hidden.Count; i++) + { + JObject objects = (JObject)EditorArr_Hidden[i]; + defect.Id = SQLHelper.GetNewID(typeof(Model.SYHSEData_HiddenDangerCheck)); + defect.ReportDate = table.ReportDate; + defect.FactoryId = DropFactory.SelectedValue; + defect.HiddenDangerName = objects["values"]["HiddenDangerName"].ToString(); + defect.TotalNum = Funs.GetNewInt(objects["values"]["TotalNum"].ToString()); + defect.OKNum = Funs.GetNewInt(objects["values"]["OKNum"].ToString()); + + BLL.SyhsedataHiddendangercheckService.AddSYHSEData_HiddenDangerCheck(defect); + } + } + + + + BLL.SyhsedataRiskcontrolService.DeleteSYHSEData_RiskControlByDate(table.ReportDate); + JArray EditorArr_Risk = Grid_Risk.GetMergedData(); + if (EditorArr_Risk.Count > 0) + { + Model.SYHSEData_RiskControl defect = new Model.SYHSEData_RiskControl(); + + for (int i = 0; i < EditorArr_Risk.Count; i++) + { + JObject objects = (JObject)EditorArr_Risk[i]; + defect.Id = SQLHelper.GetNewID(typeof(Model.SYHSEData_RiskControl)); + defect.ReportDate = table.ReportDate; + defect.FactoryId = DropFactory.SelectedValue; + defect.RiskControlName = objects["values"]["RiskControlName"].ToString(); + BLL.SyhsedataRiskcontrolService.AddSYHSEData_RiskControl(defect); + } + } + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + + private void BindGrid() + { + if (!string.IsNullOrEmpty(this.Id)) + { + Model.SYHSEData_Data model = BLL.SYHSEData_DataService.GetSYHSEData_DataById(this.Id); + if (model != null) + { + var dt_Realtimedevice = BLL.HazardRealtimedeviceService.GetHazard_RealTimeDeviceByDate(model.ReportDate); + Grid_Realtimedevice.RecordCount = dt_Realtimedevice.Count; + Grid_Realtimedevice.DataSource = dt_Realtimedevice; + Grid_Realtimedevice.DataBind(); + + var dt_Hidden= SyhsedataHiddendangercheckService.GetSYHSEData_HiddenDangerCheckByDate(model.ReportDate); + Grid_Hidden.RecordCount = dt_Hidden.Count; + Grid_Hidden.DataSource = dt_Hidden; + Grid_Hidden.DataBind(); + + var dt_Risk = SyhsedataRiskcontrolService.GetSYHSEData_RiskControlByDate(model.ReportDate); + Grid_Risk.RecordCount = dt_Risk.Count; + Grid_Risk.DataSource = dt_Risk; + Grid_Risk.DataBind(); + } + + } + + } + protected void txtReportDate_DateSelect(object sender, EventArgs e) + { + if (txtReportDate.SelectedDate != null) + { + DateTime dt = (DateTime)txtReportDate.SelectedDate; + if (BLL.SYHSEData_DataService.IsReportByDate(dt)) + { + txtReportDate.SelectedDate = null; + ShowNotify("该日期已上报!"); + + } + } + } + protected void btnSyn_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.Id)) + { + var responedata = SYHSEData_DataService.PushCNCEC(Id); + if (responedata.code == 1) + { + ShowNotify("上报成功!"); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + + } + else + { + ShowNotify(responedata.message); + // PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + } + + + } + private string GetDeleteScript_Realtimedevice() + { + return Confirm.GetShowReference("确定删除当前数据吗?", String.Empty, MessageBoxIcon.Question, Grid_Realtimedevice.GetDeleteSelectedRowsReference(), String.Empty); + } + private string GetDeleteScript_Hidden() + { + return Confirm.GetShowReference("确定删除当前数据吗?", String.Empty, MessageBoxIcon.Question, Grid_Hidden.GetDeleteSelectedRowsReference(), String.Empty); + } + private string GetDeleteScript_Risk() + { + return Confirm.GetShowReference("确定删除当前数据吗?", String.Empty, MessageBoxIcon.Question, Grid_Risk.GetDeleteSelectedRowsReference(), String.Empty); + } + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SYHSEData_DataMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx.designer.cs new file mode 100644 index 00000000..6080da25 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx.designer.cs @@ -0,0 +1,476 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.DataSync +{ + + + public partial class SYHSEData_DataEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Form6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form6; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// GroupPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// DropFactory 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList DropFactory; + + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReportDate; + + /// + /// GroupPanel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel2; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtSafetyMnaHours 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSafetyMnaHours; + + /// + /// GroupPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel3; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// txtGeneralRiskNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtGeneralRiskNum; + + /// + /// txtLowRiskNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtLowRiskNum; + + /// + /// txtMoreRiskNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtMoreRiskNum; + + /// + /// txtGreatRiskNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtGreatRiskNum; + + /// + /// GroupPanel6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel6; + + /// + /// Form7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form7; + + /// + /// Grid_Realtimedevice 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid_Realtimedevice; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// btnNew_Realtimedevice 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew_Realtimedevice; + + /// + /// btnDelete_Realtimedevice 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete_Realtimedevice; + + /// + /// txtHazardName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtHazardName; + + /// + /// txtHazardLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtHazardLevel; + + /// + /// txtDeviceName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDeviceName; + + /// + /// txtMedium 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMedium; + + /// + /// txtMeasurementUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMeasurementUnit; + + /// + /// txtDateTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtDateTime; + + /// + /// txtValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue; + + /// + /// GroupPanel5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel5; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// Grid_Hidden 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid_Hidden; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnNew_Hidden 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew_Hidden; + + /// + /// btnDelete_Hidden 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete_Hidden; + + /// + /// txtHiddenDangerName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtHiddenDangerName; + + /// + /// txtTotalNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtTotalNum; + + /// + /// txtOKNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOKNum; + + /// + /// GroupPanel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel4; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// Grid_Risk 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid_Risk; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// btnNew_Risk 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew_Risk; + + /// + /// btnDelete_Risk 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete_Risk; + + /// + /// txtRiskControlName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRiskControlName; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnSyn 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSyn; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml index 3971c608..0567390d 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml @@ -31,8 +31,8 @@ - + diff --git a/SGGL/FineUIPro.Web/common/Menu_Project.xml b/SGGL/FineUIPro.Web/common/Menu_Project.xml index 1999ded1..0dc9c199 100644 --- a/SGGL/FineUIPro.Web/common/Menu_Project.xml +++ b/SGGL/FineUIPro.Web/common/Menu_Project.xml @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index 50c6ae1f..e11ced99 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -61,5 +61,6 @@ + \ No newline at end of file diff --git a/SGGL/Model/APIItem/SHHSE/NewSYHSEData.cs b/SGGL/Model/APIItem/SHHSE/NewSYHSEData.cs new file mode 100644 index 00000000..7bd6fb0b --- /dev/null +++ b/SGGL/Model/APIItem/SHHSE/NewSYHSEData.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class NewSYHSEData + { + /// + /// 实业数据项集合 + /// + public List NewSYHSEDataItems + { + get; + set; + } + } +} diff --git a/SGGL/Model/APIItem/SHHSE/NewSYHSEDataHiddenDangerCheckItem.cs b/SGGL/Model/APIItem/SHHSE/NewSYHSEDataHiddenDangerCheckItem.cs new file mode 100644 index 00000000..208e807a --- /dev/null +++ b/SGGL/Model/APIItem/SHHSE/NewSYHSEDataHiddenDangerCheckItem.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class NewSYHSEDataHiddenDangerCheckItem + { + /// + /// ID + /// + public string Id + { + get; + set; + } + + /// + /// 隐患名称 + /// + public string HiddenDangerName + { + get; + set; + } + + /// + /// 当日总数 + /// + public int TotalNum + { + get; + set; + } + + /// + /// 当日整改数 + /// + public int OKNum + { + get; + set; + } + } +} diff --git a/SGGL/Model/APIItem/SHHSE/NewSYHSEDataItem.cs b/SGGL/Model/APIItem/SHHSE/NewSYHSEDataItem.cs new file mode 100644 index 00000000..e106f37f --- /dev/null +++ b/SGGL/Model/APIItem/SHHSE/NewSYHSEDataItem.cs @@ -0,0 +1,167 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + /// + /// 实业数据项 + /// + public class NewSYHSEDataItem + { + /// + /// ID + /// + public string Id + { + get; + set; + } + + /// + /// 上报日期 + /// + public string ReportDate + { + get; + set; + } + + /// + /// 单位Id + /// + public string UnitId + { + get; + set; + } + + /// + /// 社会统一信用码 + /// + public string CollCropCode + { + get; + set; + } + + /// + /// 单位名称 + /// + public string UnitName + { + get; + set; + } + + /// + /// 实业ID + /// + public string FactoryId + { + get; + set; + } + + /// + /// 实业编号 + /// + public string FactoryCode + { + get; + set; + } + + /// + /// 实业名称 + /// + public string FactoryName + { + get; + set; + } + + /// + /// 地址 + /// + public string Address + { + get; + set; + } + + /// + /// 安全人工时 + /// + public int SafetyMnaHours + { + get; + set; + } + + /// + /// 一般风险数 + /// + public int GeneralRiskNum + { + get; + set; + } + + /// + /// 低风险数 + /// + public int LowRiskNum + { + get; + set; + } + + /// + /// 较大风险数 + /// + public int MoreRiskNum + { + get; + set; + } + + /// + /// 重大风险数 + /// + public int GreatRiskNum + { + get; + set; + } + + /// + /// 风险管控 + /// + public List NewSYHSEDataRiskControlItems + { + get; + set; + } + + /// + /// 重大危险源 + /// + public List NewSYHSEDataRealTimeDeviceItems + { + get; + set; + } + + /// + /// 隐患排查 + /// + public List NewSYHSEDataHiddenDangerCheckItems + { + get; + set; + } + } +} diff --git a/SGGL/Model/APIItem/SHHSE/NewSYHSEDataRealTimeDeviceItem.cs b/SGGL/Model/APIItem/SHHSE/NewSYHSEDataRealTimeDeviceItem.cs new file mode 100644 index 00000000..aaef15d3 --- /dev/null +++ b/SGGL/Model/APIItem/SHHSE/NewSYHSEDataRealTimeDeviceItem.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class NewSYHSEDataRealTimeDeviceItem + { + /// + /// ID + /// + public string Id + { + get; + set; + } + + /// + /// 风险名称 + /// + public string HazardName + { + get; + set; + } + + /// + /// 风险等级 + /// + public string HazardLevel + { + get; + set; + } + + /// + /// 设备名称 + /// + public string DeviceName + { + get; + set; + } + + /// + /// 介质 + /// + public string Medium + { + get; + set; + } + + /// + /// 测量单位 + /// + public string MeasurementUnit + { + get; + set; + } + + /// + /// 时间 + /// + public string DateTime + { + get; + set; + } + + /// + /// 评价值 + /// + public string Value + { + get; + set; + } + } +} diff --git a/SGGL/Model/APIItem/SHHSE/NewSYHSEDataRiskControlItem.cs b/SGGL/Model/APIItem/SHHSE/NewSYHSEDataRiskControlItem.cs new file mode 100644 index 00000000..bcfe6d95 --- /dev/null +++ b/SGGL/Model/APIItem/SHHSE/NewSYHSEDataRiskControlItem.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class NewSYHSEDataRiskControlItem + { + /// + /// ID + /// + public string Id + { + get; + set; + } + + /// + /// 风险名称 + /// + public string RiskControlName + { + get; + set; + } + } +} diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 25c45812..e61443a2 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -116,6 +116,9 @@ namespace Model partial void InsertBase_ExpertType(Base_ExpertType instance); partial void UpdateBase_ExpertType(Base_ExpertType instance); partial void DeleteBase_ExpertType(Base_ExpertType instance); + partial void InsertBase_Factory(Base_Factory instance); + partial void UpdateBase_Factory(Base_Factory instance); + partial void DeleteBase_Factory(Base_Factory instance); partial void InsertBase_Format(Base_Format instance); partial void UpdateBase_Format(Base_Format instance); partial void DeleteBase_Format(Base_Format instance); @@ -1925,6 +1928,15 @@ namespace Model partial void InsertSupervise_UpCheckReportItem2(Supervise_UpCheckReportItem2 instance); partial void UpdateSupervise_UpCheckReportItem2(Supervise_UpCheckReportItem2 instance); partial void DeleteSupervise_UpCheckReportItem2(Supervise_UpCheckReportItem2 instance); + partial void InsertSYHSEData_Data(SYHSEData_Data instance); + partial void UpdateSYHSEData_Data(SYHSEData_Data instance); + partial void DeleteSYHSEData_Data(SYHSEData_Data instance); + partial void InsertSYHSEData_HiddenDangerCheck(SYHSEData_HiddenDangerCheck instance); + partial void UpdateSYHSEData_HiddenDangerCheck(SYHSEData_HiddenDangerCheck instance); + partial void DeleteSYHSEData_HiddenDangerCheck(SYHSEData_HiddenDangerCheck instance); + partial void InsertSYHSEData_RiskControl(SYHSEData_RiskControl instance); + partial void UpdateSYHSEData_RiskControl(SYHSEData_RiskControl instance); + partial void DeleteSYHSEData_RiskControl(SYHSEData_RiskControl instance); partial void InsertSYHSEData_SYHSE(SYHSEData_SYHSE instance); partial void UpdateSYHSEData_SYHSE(SYHSEData_SYHSE instance); partial void DeleteSYHSEData_SYHSE(SYHSEData_SYHSE instance); @@ -2537,6 +2549,14 @@ namespace Model } } + public System.Data.Linq.Table Base_Factory + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Base_Format { get @@ -7393,6 +7413,30 @@ namespace Model } } + public System.Data.Linq.Table SYHSEData_Data + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table SYHSEData_HiddenDangerCheck + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table SYHSEData_RiskControl + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table SYHSEData_SYHSE { get @@ -20010,6 +20054,289 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_Factory")] + public partial class Base_Factory : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _FactoryId; + + private string _UnitId; + + private string _FactoryCode; + + private string _FactoryName; + + private string _Address; + + private EntityRef _Base_Unit; + + private EntitySet _SYHSEData_Data; + + private EntitySet _SYHSEData_HiddenDangerCheck; + + private EntitySet _SYHSEData_RiskControl; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnFactoryIdChanging(string value); + partial void OnFactoryIdChanged(); + partial void OnUnitIdChanging(string value); + partial void OnUnitIdChanged(); + partial void OnFactoryCodeChanging(string value); + partial void OnFactoryCodeChanged(); + partial void OnFactoryNameChanging(string value); + partial void OnFactoryNameChanged(); + partial void OnAddressChanging(string value); + partial void OnAddressChanged(); + #endregion + + public Base_Factory() + { + this._Base_Unit = default(EntityRef); + this._SYHSEData_Data = new EntitySet(new Action(this.attach_SYHSEData_Data), new Action(this.detach_SYHSEData_Data)); + this._SYHSEData_HiddenDangerCheck = new EntitySet(new Action(this.attach_SYHSEData_HiddenDangerCheck), new Action(this.detach_SYHSEData_HiddenDangerCheck)); + this._SYHSEData_RiskControl = new EntitySet(new Action(this.attach_SYHSEData_RiskControl), new Action(this.detach_SYHSEData_RiskControl)); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FactoryId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string FactoryId + { + get + { + return this._FactoryId; + } + set + { + if ((this._FactoryId != value)) + { + this.OnFactoryIdChanging(value); + this.SendPropertyChanging(); + this._FactoryId = value; + this.SendPropertyChanged("FactoryId"); + this.OnFactoryIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")] + public string UnitId + { + get + { + return this._UnitId; + } + set + { + if ((this._UnitId != value)) + { + if (this._Base_Unit.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnUnitIdChanging(value); + this.SendPropertyChanging(); + this._UnitId = value; + this.SendPropertyChanged("UnitId"); + this.OnUnitIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FactoryCode", DbType="NVarChar(100)")] + public string FactoryCode + { + get + { + return this._FactoryCode; + } + set + { + if ((this._FactoryCode != value)) + { + this.OnFactoryCodeChanging(value); + this.SendPropertyChanging(); + this._FactoryCode = value; + this.SendPropertyChanged("FactoryCode"); + this.OnFactoryCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FactoryName", DbType="NVarChar(100)")] + public string FactoryName + { + get + { + return this._FactoryName; + } + set + { + if ((this._FactoryName != value)) + { + this.OnFactoryNameChanging(value); + this.SendPropertyChanging(); + this._FactoryName = value; + this.SendPropertyChanged("FactoryName"); + this.OnFactoryNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(500)")] + public string Address + { + get + { + return this._Address; + } + set + { + if ((this._Address != value)) + { + this.OnAddressChanging(value); + this.SendPropertyChanging(); + this._Address = value; + this.SendPropertyChanged("Address"); + this.OnAddressChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_Factory_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)] + public Base_Unit Base_Unit + { + get + { + return this._Base_Unit.Entity; + } + set + { + Base_Unit previousValue = this._Base_Unit.Entity; + if (((previousValue != value) + || (this._Base_Unit.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_Unit.Entity = null; + previousValue.Base_Factory.Remove(this); + } + this._Base_Unit.Entity = value; + if ((value != null)) + { + value.Base_Factory.Add(this); + this._UnitId = value.UnitId; + } + else + { + this._UnitId = default(string); + } + this.SendPropertyChanged("Base_Unit"); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYHSEData_Data_Base_Factory", Storage="_SYHSEData_Data", ThisKey="FactoryId", OtherKey="FactoryId", DeleteRule="NO ACTION")] + public EntitySet SYHSEData_Data + { + get + { + return this._SYHSEData_Data; + } + set + { + this._SYHSEData_Data.Assign(value); + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYHSEData_HiddenDangerCheck_Base_Factory", Storage="_SYHSEData_HiddenDangerCheck", ThisKey="FactoryId", OtherKey="FactoryId", DeleteRule="NO ACTION")] + public EntitySet SYHSEData_HiddenDangerCheck + { + get + { + return this._SYHSEData_HiddenDangerCheck; + } + set + { + this._SYHSEData_HiddenDangerCheck.Assign(value); + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYHSEData_RiskControl_Base_Factory", Storage="_SYHSEData_RiskControl", ThisKey="FactoryId", OtherKey="FactoryId", DeleteRule="NO ACTION")] + public EntitySet SYHSEData_RiskControl + { + get + { + return this._SYHSEData_RiskControl; + } + set + { + this._SYHSEData_RiskControl.Assign(value); + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + private void attach_SYHSEData_Data(SYHSEData_Data entity) + { + this.SendPropertyChanging(); + entity.Base_Factory = this; + } + + private void detach_SYHSEData_Data(SYHSEData_Data entity) + { + this.SendPropertyChanging(); + entity.Base_Factory = null; + } + + private void attach_SYHSEData_HiddenDangerCheck(SYHSEData_HiddenDangerCheck entity) + { + this.SendPropertyChanging(); + entity.Base_Factory = this; + } + + private void detach_SYHSEData_HiddenDangerCheck(SYHSEData_HiddenDangerCheck entity) + { + this.SendPropertyChanging(); + entity.Base_Factory = null; + } + + private void attach_SYHSEData_RiskControl(SYHSEData_RiskControl entity) + { + this.SendPropertyChanging(); + entity.Base_Factory = this; + } + + private void detach_SYHSEData_RiskControl(SYHSEData_RiskControl entity) + { + this.SendPropertyChanging(); + entity.Base_Factory = null; + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_Format")] public partial class Base_Format : INotifyPropertyChanging, INotifyPropertyChanged { @@ -36008,6 +36335,8 @@ namespace Model private EntitySet _ActionPlan_ActionPlanSummary; + private EntitySet _Base_Factory; + private EntitySet _Base_Project; private EntitySet _HJGL_Batch_NDE; @@ -36393,6 +36722,7 @@ namespace Model this._Accident_NoFourLetoff = new EntitySet(new Action(this.attach_Accident_NoFourLetoff), new Action(this.detach_Accident_NoFourLetoff)); this._Unit = new EntitySet(new Action(this.attach_Unit), new Action(this.detach_Unit)); this._ActionPlan_ActionPlanSummary = new EntitySet(new Action(this.attach_ActionPlan_ActionPlanSummary), new Action(this.detach_ActionPlan_ActionPlanSummary)); + this._Base_Factory = new EntitySet(new Action(this.attach_Base_Factory), new Action(this.detach_Base_Factory)); this._Base_Project = new EntitySet(new Action(this.attach_Base_Project), new Action(this.detach_Base_Project)); this._HJGL_Batch_NDE = new EntitySet(new Action(this.attach_HJGL_Batch_NDE), new Action(this.detach_HJGL_Batch_NDE)); this._Batch_NDECheck_CheckUnit_Base_Unit = new EntitySet(new Action(this.attach_Batch_NDECheck_CheckUnit_Base_Unit), new Action(this.detach_Batch_NDECheck_CheckUnit_Base_Unit)); @@ -37147,6 +37477,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_Factory_Base_Unit", Storage="_Base_Factory", ThisKey="UnitId", OtherKey="UnitId", DeleteRule="NO ACTION")] + public EntitySet Base_Factory + { + get + { + return this._Base_Factory; + } + set + { + this._Base_Factory.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_Project_Base_Unit", Storage="_Base_Project", ThisKey="UnitId", OtherKey="UnitId", DeleteRule="NO ACTION")] public EntitySet Base_Project { @@ -39331,6 +39674,18 @@ namespace Model entity.Base_Unit = null; } + private void attach_Base_Factory(Base_Factory entity) + { + this.SendPropertyChanging(); + entity.Base_Unit = this; + } + + private void detach_Base_Factory(Base_Factory entity) + { + this.SendPropertyChanging(); + entity.Base_Unit = null; + } + private void attach_Base_Project(Base_Project entity) { this.SendPropertyChanging(); @@ -140763,6 +141118,14 @@ namespace Model private string _ProjectId; + private string _Value; + + private string _FactoryId; + + private System.Nullable _ReportDate; + + private string _ReceiveDate; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -140833,6 +141196,14 @@ namespace Model partial void OnDateTimeChanged(); partial void OnProjectIdChanging(string value); partial void OnProjectIdChanged(); + partial void OnValueChanging(string value); + partial void OnValueChanged(); + partial void OnFactoryIdChanging(string value); + partial void OnFactoryIdChanged(); + partial void OnReportDateChanging(System.Nullable value); + partial void OnReportDateChanged(); + partial void OnReceiveDateChanging(string value); + partial void OnReceiveDateChanged(); #endregion public Hazard_RealTimeDevice() @@ -141500,6 +141871,86 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value", DbType="NVarChar(50)")] + public string Value + { + get + { + return this._Value; + } + set + { + if ((this._Value != value)) + { + this.OnValueChanging(value); + this.SendPropertyChanging(); + this._Value = value; + this.SendPropertyChanged("Value"); + this.OnValueChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FactoryId", DbType="NVarChar(50)")] + public string FactoryId + { + get + { + return this._FactoryId; + } + set + { + if ((this._FactoryId != value)) + { + this.OnFactoryIdChanging(value); + this.SendPropertyChanging(); + this._FactoryId = value; + this.SendPropertyChanged("FactoryId"); + this.OnFactoryIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReportDate", DbType="DateTime")] + public System.Nullable ReportDate + { + get + { + return this._ReportDate; + } + set + { + if ((this._ReportDate != value)) + { + this.OnReportDateChanging(value); + this.SendPropertyChanging(); + this._ReportDate = value; + this.SendPropertyChanged("ReportDate"); + this.OnReportDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReceiveDate", DbType="NVarChar(50)")] + public string ReceiveDate + { + get + { + return this._ReceiveDate; + } + set + { + if ((this._ReceiveDate != value)) + { + this.OnReceiveDateChanging(value); + this.SendPropertyChanging(); + this._ReceiveDate = value; + this.SendPropertyChanged("ReceiveDate"); + this.OnReceiveDateChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -305673,6 +306124,675 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SYHSEData_Data")] + public partial class SYHSEData_Data : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Id; + + private string _FactoryId; + + private System.Nullable _SafetyMnaHours; + + private System.Nullable _GeneralRiskNum; + + private System.Nullable _LowRiskNum; + + private System.Nullable _MoreRiskNum; + + private System.Nullable _GreatRiskNum; + + private System.Nullable _ReportDate; + + private EntityRef _Base_Factory; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnIdChanging(string value); + partial void OnIdChanged(); + partial void OnFactoryIdChanging(string value); + partial void OnFactoryIdChanged(); + partial void OnSafetyMnaHoursChanging(System.Nullable value); + partial void OnSafetyMnaHoursChanged(); + partial void OnGeneralRiskNumChanging(System.Nullable value); + partial void OnGeneralRiskNumChanged(); + partial void OnLowRiskNumChanging(System.Nullable value); + partial void OnLowRiskNumChanged(); + partial void OnMoreRiskNumChanging(System.Nullable value); + partial void OnMoreRiskNumChanged(); + partial void OnGreatRiskNumChanging(System.Nullable value); + partial void OnGreatRiskNumChanged(); + partial void OnReportDateChanging(System.Nullable value); + partial void OnReportDateChanged(); + #endregion + + public SYHSEData_Data() + { + this._Base_Factory = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Id + { + get + { + return this._Id; + } + set + { + if ((this._Id != value)) + { + this.OnIdChanging(value); + this.SendPropertyChanging(); + this._Id = value; + this.SendPropertyChanged("Id"); + this.OnIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FactoryId", DbType="NVarChar(50)")] + public string FactoryId + { + get + { + return this._FactoryId; + } + set + { + if ((this._FactoryId != value)) + { + if (this._Base_Factory.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnFactoryIdChanging(value); + this.SendPropertyChanging(); + this._FactoryId = value; + this.SendPropertyChanged("FactoryId"); + this.OnFactoryIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SafetyMnaHours", DbType="Int")] + public System.Nullable SafetyMnaHours + { + get + { + return this._SafetyMnaHours; + } + set + { + if ((this._SafetyMnaHours != value)) + { + this.OnSafetyMnaHoursChanging(value); + this.SendPropertyChanging(); + this._SafetyMnaHours = value; + this.SendPropertyChanged("SafetyMnaHours"); + this.OnSafetyMnaHoursChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeneralRiskNum", DbType="Int")] + public System.Nullable GeneralRiskNum + { + get + { + return this._GeneralRiskNum; + } + set + { + if ((this._GeneralRiskNum != value)) + { + this.OnGeneralRiskNumChanging(value); + this.SendPropertyChanging(); + this._GeneralRiskNum = value; + this.SendPropertyChanged("GeneralRiskNum"); + this.OnGeneralRiskNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LowRiskNum", DbType="Int")] + public System.Nullable LowRiskNum + { + get + { + return this._LowRiskNum; + } + set + { + if ((this._LowRiskNum != value)) + { + this.OnLowRiskNumChanging(value); + this.SendPropertyChanging(); + this._LowRiskNum = value; + this.SendPropertyChanged("LowRiskNum"); + this.OnLowRiskNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MoreRiskNum", DbType="Int")] + public System.Nullable MoreRiskNum + { + get + { + return this._MoreRiskNum; + } + set + { + if ((this._MoreRiskNum != value)) + { + this.OnMoreRiskNumChanging(value); + this.SendPropertyChanging(); + this._MoreRiskNum = value; + this.SendPropertyChanged("MoreRiskNum"); + this.OnMoreRiskNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GreatRiskNum", DbType="Int")] + public System.Nullable GreatRiskNum + { + get + { + return this._GreatRiskNum; + } + set + { + if ((this._GreatRiskNum != value)) + { + this.OnGreatRiskNumChanging(value); + this.SendPropertyChanging(); + this._GreatRiskNum = value; + this.SendPropertyChanged("GreatRiskNum"); + this.OnGreatRiskNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReportDate", DbType="DateTime")] + public System.Nullable ReportDate + { + get + { + return this._ReportDate; + } + set + { + if ((this._ReportDate != value)) + { + this.OnReportDateChanging(value); + this.SendPropertyChanging(); + this._ReportDate = value; + this.SendPropertyChanged("ReportDate"); + this.OnReportDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYHSEData_Data_Base_Factory", Storage="_Base_Factory", ThisKey="FactoryId", OtherKey="FactoryId", IsForeignKey=true)] + public Base_Factory Base_Factory + { + get + { + return this._Base_Factory.Entity; + } + set + { + Base_Factory previousValue = this._Base_Factory.Entity; + if (((previousValue != value) + || (this._Base_Factory.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_Factory.Entity = null; + previousValue.SYHSEData_Data.Remove(this); + } + this._Base_Factory.Entity = value; + if ((value != null)) + { + value.SYHSEData_Data.Add(this); + this._FactoryId = value.FactoryId; + } + else + { + this._FactoryId = default(string); + } + this.SendPropertyChanged("Base_Factory"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SYHSEData_HiddenDangerCheck")] + public partial class SYHSEData_HiddenDangerCheck : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Id; + + private string _FactoryId; + + private string _HiddenDangerName; + + private System.Nullable _TotalNum; + + private System.Nullable _OKNum; + + private System.Nullable _ReportDate; + + private EntityRef _Base_Factory; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnIdChanging(string value); + partial void OnIdChanged(); + partial void OnFactoryIdChanging(string value); + partial void OnFactoryIdChanged(); + partial void OnHiddenDangerNameChanging(string value); + partial void OnHiddenDangerNameChanged(); + partial void OnTotalNumChanging(System.Nullable value); + partial void OnTotalNumChanged(); + partial void OnOKNumChanging(System.Nullable value); + partial void OnOKNumChanged(); + partial void OnReportDateChanging(System.Nullable value); + partial void OnReportDateChanged(); + #endregion + + public SYHSEData_HiddenDangerCheck() + { + this._Base_Factory = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Id + { + get + { + return this._Id; + } + set + { + if ((this._Id != value)) + { + this.OnIdChanging(value); + this.SendPropertyChanging(); + this._Id = value; + this.SendPropertyChanged("Id"); + this.OnIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FactoryId", DbType="NVarChar(50)")] + public string FactoryId + { + get + { + return this._FactoryId; + } + set + { + if ((this._FactoryId != value)) + { + if (this._Base_Factory.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnFactoryIdChanging(value); + this.SendPropertyChanging(); + this._FactoryId = value; + this.SendPropertyChanged("FactoryId"); + this.OnFactoryIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiddenDangerName", DbType="NVarChar(50)")] + public string HiddenDangerName + { + get + { + return this._HiddenDangerName; + } + set + { + if ((this._HiddenDangerName != value)) + { + this.OnHiddenDangerNameChanging(value); + this.SendPropertyChanging(); + this._HiddenDangerName = value; + this.SendPropertyChanged("HiddenDangerName"); + this.OnHiddenDangerNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalNum", DbType="Int")] + public System.Nullable TotalNum + { + get + { + return this._TotalNum; + } + set + { + if ((this._TotalNum != value)) + { + this.OnTotalNumChanging(value); + this.SendPropertyChanging(); + this._TotalNum = value; + this.SendPropertyChanged("TotalNum"); + this.OnTotalNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OKNum", DbType="Int")] + public System.Nullable OKNum + { + get + { + return this._OKNum; + } + set + { + if ((this._OKNum != value)) + { + this.OnOKNumChanging(value); + this.SendPropertyChanging(); + this._OKNum = value; + this.SendPropertyChanged("OKNum"); + this.OnOKNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReportDate", DbType="DateTime")] + public System.Nullable ReportDate + { + get + { + return this._ReportDate; + } + set + { + if ((this._ReportDate != value)) + { + this.OnReportDateChanging(value); + this.SendPropertyChanging(); + this._ReportDate = value; + this.SendPropertyChanged("ReportDate"); + this.OnReportDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYHSEData_HiddenDangerCheck_Base_Factory", Storage="_Base_Factory", ThisKey="FactoryId", OtherKey="FactoryId", IsForeignKey=true)] + public Base_Factory Base_Factory + { + get + { + return this._Base_Factory.Entity; + } + set + { + Base_Factory previousValue = this._Base_Factory.Entity; + if (((previousValue != value) + || (this._Base_Factory.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_Factory.Entity = null; + previousValue.SYHSEData_HiddenDangerCheck.Remove(this); + } + this._Base_Factory.Entity = value; + if ((value != null)) + { + value.SYHSEData_HiddenDangerCheck.Add(this); + this._FactoryId = value.FactoryId; + } + else + { + this._FactoryId = default(string); + } + this.SendPropertyChanged("Base_Factory"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SYHSEData_RiskControl")] + public partial class SYHSEData_RiskControl : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Id; + + private string _FactoryId; + + private string _RiskControlName; + + private System.Nullable _ReportDate; + + private EntityRef _Base_Factory; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnIdChanging(string value); + partial void OnIdChanged(); + partial void OnFactoryIdChanging(string value); + partial void OnFactoryIdChanged(); + partial void OnRiskControlNameChanging(string value); + partial void OnRiskControlNameChanged(); + partial void OnReportDateChanging(System.Nullable value); + partial void OnReportDateChanged(); + #endregion + + public SYHSEData_RiskControl() + { + this._Base_Factory = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Id + { + get + { + return this._Id; + } + set + { + if ((this._Id != value)) + { + this.OnIdChanging(value); + this.SendPropertyChanging(); + this._Id = value; + this.SendPropertyChanged("Id"); + this.OnIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FactoryId", DbType="NVarChar(50)")] + public string FactoryId + { + get + { + return this._FactoryId; + } + set + { + if ((this._FactoryId != value)) + { + if (this._Base_Factory.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnFactoryIdChanging(value); + this.SendPropertyChanging(); + this._FactoryId = value; + this.SendPropertyChanged("FactoryId"); + this.OnFactoryIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RiskControlName", DbType="NVarChar(500)")] + public string RiskControlName + { + get + { + return this._RiskControlName; + } + set + { + if ((this._RiskControlName != value)) + { + this.OnRiskControlNameChanging(value); + this.SendPropertyChanging(); + this._RiskControlName = value; + this.SendPropertyChanged("RiskControlName"); + this.OnRiskControlNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReportDate", DbType="DateTime")] + public System.Nullable ReportDate + { + get + { + return this._ReportDate; + } + set + { + if ((this._ReportDate != value)) + { + this.OnReportDateChanging(value); + this.SendPropertyChanging(); + this._ReportDate = value; + this.SendPropertyChanged("ReportDate"); + this.OnReportDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYHSEData_RiskControl_Base_Factory", Storage="_Base_Factory", ThisKey="FactoryId", OtherKey="FactoryId", IsForeignKey=true)] + public Base_Factory Base_Factory + { + get + { + return this._Base_Factory.Entity; + } + set + { + Base_Factory previousValue = this._Base_Factory.Entity; + if (((previousValue != value) + || (this._Base_Factory.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_Factory.Entity = null; + previousValue.SYHSEData_RiskControl.Remove(this); + } + this._Base_Factory.Entity = value; + if ((value != null)) + { + value.SYHSEData_RiskControl.Add(this); + this._FactoryId = value.FactoryId; + } + else + { + this._FactoryId = default(string); + } + this.SendPropertyChanged("Base_Factory"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SYHSEData_SYHSE")] public partial class SYHSEData_SYHSE : INotifyPropertyChanging, INotifyPropertyChanged { diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index 15cc81a8..4982201c 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -139,6 +139,11 @@ + + + + +