From 278225fac402abece5222bfddfc8e8b0c574129c Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Wed, 8 Mar 2023 11:45:40 +0800 Subject: [PATCH] =?UTF-8?q?2023-03-08=20=E5=AE=9E=E4=B8=9A=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SGGLDB_2023-03-08_子公司实业脚本.sql | 209 +++ SGGL/BLL/BLL.csproj | 5 + SGGL/BLL/BaseInfo/BaseFactoryService.cs | 167 +++ SGGL/BLL/Common/Const.cs | 6 + .../ActionPlanFormationService.cs | 12 +- .../BidApproveUserReviewService.cs | 6 +- .../BidDocumentsReviewService.cs | 19 +- .../BiddingManagement/SetSubReviewService.cs | 14 +- .../ContractCompile/ContractReviewService.cs | 35 +- SGGL/BLL/SysManage/UnitService.cs | 14 + .../DataSync/Hazard_RealTimeDeviceService.cs | 278 ++++ .../ZHGL/DataSync/SYHSEData_DataService.cs | 245 ++++ .../SYHSEData_HiddenDangerCheckService.cs | 153 +++ .../DataSync/SYHSEData_RiskControlService.cs | 147 +++ SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx | 121 ++ .../BaseInfo/BaseFactory.aspx.cs | 249 ++++ .../BaseInfo/BaseFactory.aspx.designer.cs | 161 +++ .../BaseInfo/BaseFactoryEdit.aspx | 58 + .../BaseInfo/BaseFactoryEdit.aspx.cs | 113 ++ .../BaseInfo/BaseFactoryEdit.aspx.designer.cs | 107 ++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 32 + .../ZHGL/DataSync/SYHSEData_Data.aspx | 131 ++ .../ZHGL/DataSync/SYHSEData_Data.aspx.cs | 249 ++++ .../DataSync/SYHSEData_Data.aspx.designer.cs | 161 +++ .../ZHGL/DataSync/SYHSEData_DataEdit.aspx | 282 +++++ .../ZHGL/DataSync/SYHSEData_DataEdit.aspx.cs | 334 +++++ .../SYHSEData_DataEdit.aspx.designer.cs | 476 +++++++ SGGL/FineUIPro.Web/common/Menu_CQMS.xml | 1 + SGGL/FineUIPro.Web/common/Menu_HJGL.xml | 10 +- SGGL/FineUIPro.Web/common/Menu_HSSE.xml | 1 + SGGL/FineUIPro.Web/common/Menu_Project.xml | 1 + SGGL/FineUIPro.Web/common/Menu_SysSet.xml | 1 + SGGL/FineUIPro.Web/common/Menu_ZHGL.xml | 11 + SGGL/Model/APIItem/SHHSE/NewSYHSEData.cs | 20 + .../NewSYHSEDataHiddenDangerCheckItem.cs | 47 + SGGL/Model/APIItem/SHHSE/NewSYHSEDataItem.cs | 167 +++ .../SHHSE/NewSYHSEDataRealTimeDeviceItem.cs | 83 ++ .../SHHSE/NewSYHSEDataRiskControlItem.cs | 29 + SGGL/Model/Model.cs | 1120 +++++++++++++++++ SGGL/Model/Model.csproj | 5 + 40 files changed, 5249 insertions(+), 31 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_2023-03-08_子公司实业脚本.sql create mode 100644 SGGL/BLL/BaseInfo/BaseFactoryService.cs create mode 100644 SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs create mode 100644 SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs create mode 100644 SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs create mode 100644 SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx create mode 100644 SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/BaseFactory.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx create mode 100644 SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx create mode 100644 SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_Data.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx create mode 100644 SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ZHGL/DataSync/SYHSEData_DataEdit.aspx.designer.cs create mode 100644 SGGL/Model/APIItem/SHHSE/NewSYHSEData.cs create mode 100644 SGGL/Model/APIItem/SHHSE/NewSYHSEDataHiddenDangerCheckItem.cs create mode 100644 SGGL/Model/APIItem/SHHSE/NewSYHSEDataItem.cs create mode 100644 SGGL/Model/APIItem/SHHSE/NewSYHSEDataRealTimeDeviceItem.cs create mode 100644 SGGL/Model/APIItem/SHHSE/NewSYHSEDataRiskControlItem.cs diff --git a/DataBase/版本日志/SGGLDB_2023-03-08_子公司实业脚本.sql b/DataBase/版本日志/SGGLDB_2023-03-08_子公司实业脚本.sql new file mode 100644 index 00000000..ef6e3a29 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_2023-03-08_子公司实业脚本.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/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index c07abc78..5b45a003 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -210,6 +210,7 @@ + @@ -646,6 +647,7 @@ + @@ -657,6 +659,9 @@ + + + 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 a510325d..57450334 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -765,6 +765,12 @@ /// 发起检查 /// public const string CheckInfoMenuId = "6090DD54-FE59-4011-92EE-9906C9BC69B6"; + public const string Base_FactoryMenuId = "CD167198-1667-4552-9876-E768C2542C30"; + /// + /// 实业 + /// + public const string SYHSEData_DataMenuId = "S89E5EC2-F725-4656-9110-5AF83C18FB6C"; + #region 系统设置 /// diff --git a/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanFormationService.cs b/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanFormationService.cs index fed13c2a..1a0b5602 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanFormationService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/ActionPlanFormationService.cs @@ -230,8 +230,8 @@ namespace BLL /// /// ActionPlanID /// - /// - public static Document Print( string Id) + /// + public static Document Print( string ActionPlanID) { string rootPath = Funs.RootPath; @@ -240,7 +240,7 @@ namespace BLL string uploadfilepath = string.Empty; string newUrl = string.Empty; string filePath = string.Empty; - var lwfirwork = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Id); + var lwfirwork = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(ActionPlanID); initTemplatePath = "File\\Word\\PHTGL\\施工招标实施计划审批表.docx"; if (lwfirwork != null) { @@ -259,9 +259,9 @@ namespace BLL } File.Copy(uploadfilepath, newUrl); ///更新书签 - var getFireWork = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Id); - var Act = PHTGL_ActionPlanReviewService.GetPHTGL_ActionPlanReviewByActionPlanID(Id); - var list = PHTGL_ActionPlanFormation_Sch1Service.GetListPHTGL_ActionPlanFormation_Sch1ById(Id); + var getFireWork = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(ActionPlanID); + var Act = PHTGL_ActionPlanReviewService.GetPHTGL_ActionPlanReviewByActionPlanID(ActionPlanID); + var list = PHTGL_ActionPlanFormation_Sch1Service.GetListPHTGL_ActionPlanFormation_Sch1ById(ActionPlanID); Document doc = new Aspose.Words.Document(newUrl); Bookmark txtActionPlanCode = doc.Range.Bookmarks["ActionPlanCode"]; diff --git a/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs index 52caaea5..46ffd521 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/BidApproveUserReviewService.cs @@ -122,7 +122,7 @@ namespace BLL return list; } - public static Document Print(string Id) + public static Document Print(string ApproveUserReviewById) { string rootPath = Funs.RootPath; @@ -140,7 +140,7 @@ namespace BLL } File.Copy(uploadfilepath, newUrl); ///更新书签 - var getFireWork = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(Id); + var getFireWork = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(ApproveUserReviewById); var Bid = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(getFireWork.BidDocumentsReviewId); var Act = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Bid.ActionPlanID); #region 评标小组成员名单 @@ -152,7 +152,7 @@ namespace BLL + @" FROM PHTGL_BidApproveUserReview_Sch1 AS APP " + @"where 1=1 AND ApproveUserReviewID = @ApproveUserReviewID "; List listStr = new List(); - listStr.Add(new SqlParameter("@ApproveUserReviewID", Id)); + listStr.Add(new SqlParameter("@ApproveUserReviewID", ApproveUserReviewById)); SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); diff --git a/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs index 9a260ba4..1f0fbaab 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs @@ -160,7 +160,12 @@ namespace BLL return list; } - public static Document Print(string Id) + /// + /// BidDocumentsReview + /// + /// + /// + public static Document Print(string BidDocumentsReviewId) { string rootPath = Funs.RootPath; @@ -169,7 +174,7 @@ namespace BLL string newUrl = string.Empty; string filePath = string.Empty; initTemplatePath = "File\\Word\\PHTGL\\招标文件审批表.docx"; - var lwfirwork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(Id); + var lwfirwork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(BidDocumentsReviewId); if (lwfirwork != null) { if (PHTGL_ActionPlanReviewService.IsSpecialProject(lwfirwork.ProjectId)) @@ -189,12 +194,12 @@ namespace BLL Document doc = new Aspose.Words.Document(newUrl); ///更新书签 - var getFireWork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(Id); + var getFireWork = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(BidDocumentsReviewId); var Act = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(getFireWork.ActionPlanID); - var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ConstructionManager); - var model_ControlManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ControlManager); - var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.Approval_Construction); - var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ProjectManager); + var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(BidDocumentsReviewId, getFireWork.ConstructionManager); + var model_ControlManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(BidDocumentsReviewId, getFireWork.ControlManager); + var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(BidDocumentsReviewId, getFireWork.Approval_Construction); + var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(BidDocumentsReviewId, getFireWork.ProjectManager); Dictionary Dic_File = new Dictionary(); Dic_File.Add("txtCode", string.Format("{0:yyyyMMdd}", Convert.ToDateTime(getFireWork.CreatTime))); diff --git a/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs index 862499b5..b01da437 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/SetSubReviewService.cs @@ -171,7 +171,7 @@ namespace BLL select x).ToList(); return list; } - public static Document Print(string Id) + public static Document Print(string SetSubReviewID) { string rootPath = Funs.RootPath; @@ -180,7 +180,7 @@ namespace BLL string newUrl = string.Empty; string filePath = string.Empty; string strSql = ""; - var getFireWork = PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewById(Id); + var getFireWork = PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewById(SetSubReviewID); var BidUser = PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(getFireWork.ApproveUserReviewID); var BidDoc = PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(BidUser.BidDocumentsReviewId); var Act = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(BidDoc.ActionPlanID); @@ -245,17 +245,17 @@ namespace BLL File.Copy(uploadfilepath, newUrl); List listStr = new List(); - listStr.Add(new SqlParameter("@SetSubReviewID", Id)); + listStr.Add(new SqlParameter("@SetSubReviewID", SetSubReviewID)); SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); tb.TableName = "Table"; Document doc = new Aspose.Words.Document(newUrl); doc.MailMerge.ExecuteWithRegions(tb); - var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ConstructionManager); - var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.ProjectManager); - var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.Approval_Construction); - var model_DeputyGeneralManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(Id, getFireWork.DeputyGeneralManager); + var model_ConstructionManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(SetSubReviewID, getFireWork.ConstructionManager); + var model_ProjectManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(SetSubReviewID, getFireWork.ProjectManager); + var model_Approval_Construction = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(SetSubReviewID, getFireWork.Approval_Construction); + var model_DeputyGeneralManager = PHTGL_ApproveService.GetPHTGL_ApproveByContractIdandUserId(SetSubReviewID, getFireWork.DeputyGeneralManager); Dictionary Dic_File = new Dictionary(); Dic_File.Add("txtSetSubReviewCode", getFireWork.SetSubReviewCode); diff --git a/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs b/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs index 006edb7c..0275bc1f 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs +++ b/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs @@ -633,16 +633,45 @@ namespace BLL case "4": break; case "5": - break; - case "6": break; } } + /// + /// ConfirmWay 4,5 + /// public static void PrintApprovalFormType_Act() { } - public static void PrintApprovalFormType_SetSub() + /// + /// ConfirmWay 1,2,3 + /// + public static void PrintApprovalFormType_SetSub(string ContractReviewId) { + + Model.PHTGL_Contract Contract =new Model.PHTGL_Contract(); //合同信息 + Model.PHTGL_SetSubReview SetSub = new Model.PHTGL_SetSubReview(); //确认分包商信息 + Model.PHTGL_BidApproveUserReview ApproveUser = new Model.PHTGL_BidApproveUserReview(); //评标小组名单信息 + Model.PHTGL_BidDocumentsReview BidDoc = new Model.PHTGL_BidDocumentsReview();//招标文件信息 + Model.PHTGL_ActionPlanReview ActPlan = new Model.PHTGL_ActionPlanReview();//实施计划信息 + + var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId); + Contract = BLL.ContractService.GetContractById(ReviewModel.ContractId); + SetSub = BLL.PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewBySetSubReviewCode(Contract.SetSubReviewCode); + ApproveUser = BLL.PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(SetSub.ApproveUserReviewID); + BidDoc = BLL.PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(ApproveUser.BidDocumentsReviewId); + ActPlan = BLL.PHTGL_ActionPlanReviewService.GetPHTGL_ActionPlanReviewById(BidDoc.ActionPlanReviewId); + + var Doc_ActPlan = PHTGL_ActionPlanFormationService.Print(ActPlan.ActionPlanID); + var Doc_BidDoc = PHTGL_BidDocumentsReviewService.Print(BidDoc.BidDocumentsReviewId); + var Doc_ApproveUser = PHTGL_BidApproveUserReviewService.Print(ApproveUser.ApproveUserReviewID); + var Doc_SetSub = PHTGL_SetSubReviewService.Print(SetSub.SetSubReviewID); + var Doc_Contract = Print(ContractReviewId); + + Doc_ActPlan.AppendDocument(Doc_BidDoc, ImportFormatMode.UseDestinationStyles); + Doc_ActPlan.AppendDocument(Doc_ApproveUser, ImportFormatMode.UseDestinationStyles); + Doc_ActPlan.AppendDocument(Doc_SetSub, ImportFormatMode.UseDestinationStyles); + Doc_ActPlan.AppendDocument(Doc_Contract, ImportFormatMode.UseDestinationStyles); + } public static void PrintApprovalFormType__Con() { diff --git a/SGGL/BLL/SysManage/UnitService.cs b/SGGL/BLL/SysManage/UnitService.cs index 0aff0f0e..15d73e67 100644 --- a/SGGL/BLL/SysManage/UnitService.cs +++ b/SGGL/BLL/SysManage/UnitService.cs @@ -345,6 +345,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; + } /// /// 获取单位简称 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..fd2eaa3c --- /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_SEDIN; + Item.CollCropCode = UnitService.GetUnitByUnitId(Const.UnitId_SEDIN).CollCropCode; + Item.UnitName= UnitService.GetUnitByUnitId(Const.UnitId_SEDIN).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..2e7fe1f1 --- /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.PersonId, 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..e6bd10c3 --- /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_SEDIN; + 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.PersonId, 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/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 4d90bb32..3938097a 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -215,6 +215,8 @@ + + @@ -1438,6 +1440,8 @@ + + @@ -5657,6 +5661,20 @@ AccidentType.aspx + + BaseFactory.aspx + ASPXCodeBehind + + + BaseFactory.aspx + + + BaseFactoryEdit.aspx + ASPXCodeBehind + + + BaseFactoryEdit.aspx + Certificate.aspx ASPXCodeBehind @@ -12626,6 +12644,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/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..eb025504 --- /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.PersonId, 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..307b9667 --- /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.PersonId, 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_CQMS.xml b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml index c460a9f5..a090e6ed 100644 --- a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml +++ b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml @@ -50,6 +50,7 @@ + diff --git a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml index 1ea05d70..6b877755 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml @@ -33,11 +33,6 @@ - - - - - @@ -46,6 +41,11 @@ + + + + + diff --git a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml index 23039e37..7cb44c71 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml @@ -100,6 +100,7 @@ + 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_SysSet.xml b/SGGL/FineUIPro.Web/common/Menu_SysSet.xml index 7bb24492..51d04b55 100644 --- a/SGGL/FineUIPro.Web/common/Menu_SysSet.xml +++ b/SGGL/FineUIPro.Web/common/Menu_SysSet.xml @@ -28,6 +28,7 @@ + diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index f83c931c..1946c763 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -15,6 +15,17 @@ + + + + + + + + + + + \ 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 bf3dc745..fc50ecb2 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -116,6 +116,9 @@ namespace Model partial void InsertBase_EmergencyType(Base_EmergencyType instance); partial void UpdateBase_EmergencyType(Base_EmergencyType instance); partial void DeleteBase_EmergencyType(Base_EmergencyType 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_GasProtectionMode(Base_GasProtectionMode instance); partial void UpdateBase_GasProtectionMode(Base_GasProtectionMode instance); partial void DeleteBase_GasProtectionMode(Base_GasProtectionMode instance); @@ -1256,6 +1259,15 @@ namespace Model partial void InsertSolution_SolutionTemplate(Solution_SolutionTemplate instance); partial void UpdateSolution_SolutionTemplate(Solution_SolutionTemplate instance); partial void DeleteSolution_SolutionTemplate(Solution_SolutionTemplate 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); @@ -1751,6 +1763,14 @@ namespace Model } } + public System.Data.Linq.Table Base_Factory + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Base_GasProtectionMode { get @@ -4807,6 +4827,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 @@ -15861,6 +15905,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_GasProtectionMode")] public partial class Base_GasProtectionMode : INotifyPropertyChanging, INotifyPropertyChanged { @@ -27332,6 +27659,8 @@ namespace Model private EntitySet _Unit; + private EntitySet _Base_Factory; + private EntitySet _Base_Project; private EntitySet _HJGL_Batch_NDE; @@ -27578,6 +27907,7 @@ namespace Model this._Accident_AccidentReportOtherItem = new EntitySet(new Action(this.attach_Accident_AccidentReportOtherItem), new Action(this.detach_Accident_AccidentReportOtherItem)); 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._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)); @@ -28231,6 +28561,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 { @@ -29519,6 +29862,18 @@ namespace Model entity.RegistUnit = 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(); @@ -64099,6 +64454,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); @@ -64169,6 +64532,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() @@ -64836,6 +65207,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; @@ -198629,6 +199080,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 071fdfcf..9e4737a2 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -143,6 +143,11 @@ + + + + +