diff --git a/DataBase/版本日志/SGGLDB_V2026-04-25-xiaj(不符合项基础设置).sql b/DataBase/版本日志/SGGLDB_V2026-04-25-xiaj(不符合项基础设置).sql new file mode 100644 index 00000000..52a30ad4 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-04-25-xiaj(不符合项基础设置).sql @@ -0,0 +1,139 @@ + + +--ò˵ + +IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436341263') +BEGIN +INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) +VALUES (N'1AFAEEB9-B93C-4472-B81E-081436341263', N'', N'', 50, N'D363BD9D-4DEC-45D8-89C8-B0E49DEF61B4', N'Menu_SysSet', 1,0, 1); +END +GO + +IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436341001') +BEGIN +INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) +VALUES (N'1AFAEEB9-B93C-4472-B81E-081436341001', N'ȫ', N'BaseInfo/SafetyProblemClassify.aspx', 10, N'1AFAEEB9-B93C-4472-B81E-081436341263', N'Menu_SysSet', 1,1, 1); +INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) +VALUES (N'1AFAEEB9-B93C-4472-B81E-081436341002', N'ȫ', N'BaseInfo/SafetyProblemNature.aspx', 20, N'1AFAEEB9-B93C-4472-B81E-081436341263', N'Menu_SysSet', 1,1, 1); +INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) +VALUES (N'1AFAEEB9-B93C-4472-B81E-081436342001', N'', N'BaseInfo/QualityProblemClassify.aspx', 110, N'1AFAEEB9-B93C-4472-B81E-081436341263', N'Menu_SysSet', 1,1, 1); +INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) +VALUES (N'1AFAEEB9-B93C-4472-B81E-081436342002', N'', N'BaseInfo/QualityProblemNature.aspx', 120, N'1AFAEEB9-B93C-4472-B81E-081436341263', N'Menu_SysSet', 1,1, 1); +END +GO + + +IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436341001') +BEGIN +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'DCAC5651-BBCD-4F4E-9CBA-C9E8B6090001', N'1AFAEEB9-B93C-4472-B81E-081436341001', N'', 1); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'DCAC5651-BBCD-4F4E-9CBA-C9E8B6090002', N'1AFAEEB9-B93C-4472-B81E-081436341001', N'޸', 2); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'DCAC5651-BBCD-4F4E-9CBA-C9E8B6090003', N'1AFAEEB9-B93C-4472-B81E-081436341001', N'ɾ', 3); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'DCAC5651-BBCD-4F4E-9CBA-C9E8B6090004', N'1AFAEEB9-B93C-4472-B81E-081436341001', N'', 4); +END +GO + +IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436341002') +BEGIN +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'ECAC5651-BBCD-4F4E-9CBA-C9E8B6090001', N'1AFAEEB9-B93C-4472-B81E-081436341002', N'', 1); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'ECAC5651-BBCD-4F4E-9CBA-C9E8B6090002', N'1AFAEEB9-B93C-4472-B81E-081436341002', N'޸', 2); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'ECAC5651-BBCD-4F4E-9CBA-C9E8B6090003', N'1AFAEEB9-B93C-4472-B81E-081436341002', N'ɾ', 3); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'ECAC5651-BBCD-4F4E-9CBA-C9E8B6090004', N'1AFAEEB9-B93C-4472-B81E-081436341002', N'', 4); +END +GO + +IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436342001') +BEGIN +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'FCAC5651-BBCD-4F4E-9CBA-C9E8B6090001', N'1AFAEEB9-B93C-4472-B81E-081436342001', N'', 1); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'FCAC5651-BBCD-4F4E-9CBA-C9E8B6090002', N'1AFAEEB9-B93C-4472-B81E-081436342001', N'޸', 2); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'FCAC5651-BBCD-4F4E-9CBA-C9E8B6090003', N'1AFAEEB9-B93C-4472-B81E-081436342001', N'ɾ', 3); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'FCAC5651-BBCD-4F4E-9CBA-C9E8B6090004', N'1AFAEEB9-B93C-4472-B81E-081436342001', N'', 4); +END +GO + + + +IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436342002') +BEGIN +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'CCAC5651-BBCD-4F4E-9CBA-C9E8B6090001', N'1AFAEEB9-B93C-4472-B81E-081436342002', N'', 1); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'CCAC5651-BBCD-4F4E-9CBA-C9E8B6090002', N'1AFAEEB9-B93C-4472-B81E-081436342002', N'޸', 2); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'CCAC5651-BBCD-4F4E-9CBA-C9E8B6090003', N'1AFAEEB9-B93C-4472-B81E-081436342002', N'ɾ', 3); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'CCAC5651-BBCD-4F4E-9CBA-C9E8B6090004', N'1AFAEEB9-B93C-4472-B81E-081436342002', N'', 4); +END +GO + + + + + + +--ȫ +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_SafetyProblemClassify') AND type = N'U') +BEGIN +CREATE TABLE [dbo].[Base_SafetyProblemClassify]( + [ClassifyId] [nvarchar](50) NOT NULL, + [ClassifyCode] [nvarchar](50) NOT NULL, + [ClassifyName] [nvarchar](100) NOT NULL, + CONSTRAINT [PK_Base_SafetyProblemClassify] PRIMARY KEY CLUSTERED +( + [ClassifyId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] +) ON [PRIMARY] +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassify', @level2type=N'COLUMN',@level2name=N'ClassifyId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassify', @level2type=N'COLUMN',@level2name=N'ClassifyCode' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassify', @level2type=N'COLUMN',@level2name=N'ClassifyName' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassify' +END + +GO + + + +--ȫ +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_SafetyProblemClassifyItem') AND type = N'U') +BEGIN +CREATE TABLE [dbo].[Base_SafetyProblemClassifyItem]( + [ClassifyItemId] [nvarchar](50) NOT NULL, + [ClassifyId] [nvarchar](50) NULL, + [ClassifyItemCode] [nvarchar](50) NULL, + [ClassifyItemName] [nvarchar](100) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileManName] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + CONSTRAINT [PK_Base_SafetyProblemClassifyItem] PRIMARY KEY CLUSTERED +( + [ClassifyItemId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] +) ON [PRIMARY] + +ALTER TABLE [dbo].[Base_SafetyProblemClassifyItem] WITH CHECK ADD CONSTRAINT [FK_Base_SafetyProblemClassifyItem_Classify] FOREIGN KEY([ClassifyId]) +REFERENCES [dbo].[Base_SafetyProblemClassify] ([ClassifyId]) +ALTER TABLE [dbo].[Base_SafetyProblemClassifyItem] CHECK CONSTRAINT [FK_Base_SafetyProblemClassifyItem_Classify] +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyItemId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyItemCode' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyItemName' + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem' +END + +GO + + + + diff --git a/DataBase/版本日志/SGGLDB_V2026-04-28-xiaj(危害因素调整).sql b/DataBase/版本日志/SGGLDB_V2026-04-28-xiaj(危害因素调整).sql new file mode 100644 index 00000000..62ea3ae0 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-04-28-xiaj(危害因素调整).sql @@ -0,0 +1,41 @@ + + +ALTER TABLE HazardFactor_Safety +ALTER COLUMN Hazard NVARCHAR(2000); + +ALTER TABLE HazardFactor_Safety +ALTER COLUMN NetRiskControlMeasures NVARCHAR(2000); + +ALTER TABLE HazardFactor_Safety +ALTER COLUMN AdditionalControlMeasures NVARCHAR(2000); + +ALTER TABLE HazardFactor_Safety +ALTER COLUMN ProjectId NVARCHAR(50) null; + +ALTER TABLE HazardFactor_Safety +ADD UnitId NVARCHAR(50) null; +ALTER TABLE HazardFactor_Safety +ADD UnitProjectName NVARCHAR(200) null; + + + + +ALTER TABLE HazardFactor_OccHealth +ALTER COLUMN Hazard NVARCHAR(2000); + +ALTER TABLE HazardFactor_OccHealth +ALTER COLUMN NetRiskControlMeasures NVARCHAR(2000); + +ALTER TABLE HazardFactor_OccHealth +ALTER COLUMN AdditionalControlMeasures NVARCHAR(2000); + + +ALTER TABLE HazardFactor_OccHealth +ALTER COLUMN ProjectId NVARCHAR(50) null; + +ALTER TABLE HazardFactor_OccHealth +ADD UnitId NVARCHAR(50) null; +ALTER TABLE HazardFactor_OccHealth +ADD UnitProjectName NVARCHAR(200) null; + + diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 4214a94c..7ca7c572 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -255,6 +255,8 @@ + + diff --git a/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs b/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs new file mode 100644 index 00000000..682642d4 --- /dev/null +++ b/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs @@ -0,0 +1,112 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 安全问题分类 + /// + public class SafetyProblemClassifyItemService + { + + /// + /// 根据主键获取安全问题分类明细信息 + /// + /// + /// + public static Model.Base_SafetyProblemClassifyItem GetClassifyItemById(string ItemId) + { + Model.CNPCDB db = Funs.DB; + return db.Base_SafetyProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == ItemId); + } + + /// + /// 添加安全问题分类明细 + /// + /// + public static void AddClassifyItem(Model.Base_SafetyProblemClassifyItem model) + { + Model.CNPCDB db = Funs.DB; + Model.Base_SafetyProblemClassifyItem newModel = new Model.Base_SafetyProblemClassifyItem(); + newModel.ClassifyItemId = model.ClassifyItemId; + newModel.ClassifyId = model.ClassifyId; + newModel.ClassifyItemCode = model.ClassifyItemCode; + newModel.ClassifyItemName = model.ClassifyItemName; + newModel.CompileMan = model.CompileMan; + newModel.CompileManName = model.CompileManName; + newModel.CompileDate = model.CompileDate; + db.Base_SafetyProblemClassifyItem.InsertOnSubmit(newModel); + db.SubmitChanges(); + } + + /// + /// 修改安全问题分类明细 + /// + /// + public static void UpdateClassifyItem(Model.Base_SafetyProblemClassifyItem model) + { + Model.CNPCDB db = Funs.DB; + Model.Base_SafetyProblemClassifyItem newModel = db.Base_SafetyProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == model.ClassifyItemId); + if (newModel != null) + { + newModel.ClassifyId = model.ClassifyId; + newModel.ClassifyItemCode = model.ClassifyItemCode; + newModel.ClassifyItemName = model.ClassifyItemName; + newModel.CompileMan = model.CompileMan; + newModel.CompileManName = model.CompileManName; + newModel.CompileDate = model.CompileDate; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除明细信息 + /// + /// + public static void DeleteClassifyItemById(string companyTrainItemId) + { + Model.CNPCDB db = Funs.DB; + Model.Base_SafetyProblemClassifyItem model = db.Base_SafetyProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == companyTrainItemId); + if (model != null) + { + db.Base_SafetyProblemClassifyItem.DeleteOnSubmit(model); + db.SubmitChanges(); + } + } + + + /// + /// 教材库下拉框 + /// + /// 下拉框名字 + /// 职务Id + /// 是否显示请选择 + public static void InitClassifyItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease) + { + dropName.DataValueField = "ClassifyItemId"; + dropName.DataTextField = "ClassifyItemName"; + dropName.DataSource = GetClassifyItemList(workPostId); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + + /// + /// 获取下拉项 + /// + /// + /// + public static List GetClassifyItemList(string classifyId) + { + var lst = (from x in Funs.DB.Base_SafetyProblemClassifyItem orderby x.ClassifyItemCode select x).ToList(); + if (!string.IsNullOrWhiteSpace(classifyId)) + { + lst = lst.Where(x => x.ClassifyId == classifyId).ToList(); + } + return lst; + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs b/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs new file mode 100644 index 00000000..1e7301c8 --- /dev/null +++ b/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs @@ -0,0 +1,136 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 安全问题分类主表 + /// + public class SafetyProblemClassifyService + { + + /// + /// 根据主键获取安全问题分类 + /// + /// + /// + public static Model.Base_SafetyProblemClassify GetClassifyById(string Id) + { + var db = Funs.DB; + return db.Base_SafetyProblemClassify.FirstOrDefault(e => e.ClassifyId == Id); + } + + /// + /// 添加安全问题分类 + /// + /// + public static void AddClassify(Model.Base_SafetyProblemClassify Classify) + { + var db = Funs.DB; + Model.Base_SafetyProblemClassify newModel = new Model.Base_SafetyProblemClassify(); + newModel.ClassifyId = Classify.ClassifyId; + newModel.ClassifyCode = Classify.ClassifyCode; + newModel.ClassifyName = Classify.ClassifyName; + db.Base_SafetyProblemClassify.InsertOnSubmit(newModel); + db.SubmitChanges(); + } + + /// + /// 修改安全问题分类 + /// + /// + public static void UpdateClassify(Model.Base_SafetyProblemClassify Classify) + { + var db = Funs.DB; + Model.Base_SafetyProblemClassify newModel = db.Base_SafetyProblemClassify.FirstOrDefault(e => e.ClassifyId == Classify.ClassifyId); + if (newModel != null) + { + newModel.ClassifyCode = Classify.ClassifyCode; + newModel.ClassifyName = Classify.ClassifyName; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除安全问题分类 + /// + /// + public static void DeleteClassify(string Id) + { + var db = Funs.DB; + Model.Base_SafetyProblemClassify Classify = db.Base_SafetyProblemClassify.FirstOrDefault(e => e.ClassifyId == Id); + if (Classify != null) + { + var getItems = from x in Funs.DB.Base_SafetyProblemClassifyItem + where x.ClassifyId == Classify.ClassifyId + select x; + if (getItems.Count() > 0) + { + db.Base_SafetyProblemClassifyItem.DeleteAllOnSubmit(getItems); + } + db.Base_SafetyProblemClassify.DeleteOnSubmit(Classify); + db.SubmitChanges(); + } + } + + ///// + ///// 是否可删除资源节点 + ///// + ///// + ///// true-可以,false-不可以 + //public static bool IsDeleteClassify(string Id) + //{ + // bool isDelete = true; + // var Training = BLL.SafetyProblemClassifyService.GetClassifyById(Id); + // if (Training != null) + // { + // if (Training.IsEndLever == true) + // { + // var detailCout = Funs.DB.Training_ClassifyItem.FirstOrDefault(x => x.ClassifyId == Id); + // if (detailCout != null) + // { + // isDelete = false; + // } + // } + // else + // { + // var supItemSetCount = BLL.SafetyProblemClassifyService.GetClassifyBySupItem(Id); + // if (supItemSetCount.Count() > 0) + // { + // isDelete = false; + // } + // } + // } + // return isDelete; + //} + + /// + /// 查询所有安全问题分类 + /// + /// 安全问题分类的集合 + public static List GetClassify() + { + return (from x in Funs.DB.Base_SafetyProblemClassify + orderby x.ClassifyCode + select x).ToList(); + } + + /// + /// 类型下拉框(末级) + /// + /// + /// + /// + public static void InitClassifyIsEndDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "ClassifyId"; + dropName.DataTextField = "ClassifyName"; + dropName.DataSource = GetClassify(); + 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 f00d310b..40361a51 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -1797,6 +1797,26 @@ namespace BLL public const string ProjectProjectMapMenuId = "F266456A-991F-45A3-BCD6-CF2515D71E39"; #endregion + #region 不符合项 + + /// + /// 安全问题分类 + /// + public const string SafetyProblemClassifyMenuId = "1AFAEEB9-B93C-4472-B81E-081436341001"; + /// + /// 安全问题性质 + /// + public const string SafetyProblemNatureMenuId = "1AFAEEB9-B93C-4472-B81E-081436341002"; + /// + /// 质量问题分类 + /// + public const string QualityProblemClassifyMenuId = "1AFAEEB9-B93C-4472-B81E-081436342001"; + /// + /// 质量问题性质 + /// + public const string QualityProblemNatureMenuId = "1AFAEEB9-B93C-4472-B81E-081436342002"; + + #endregion #region 岗位培训 diff --git a/SGGL/BLL/ReportManage/HazardFactor/HazardFactorOccHealthService.cs b/SGGL/BLL/ReportManage/HazardFactor/HazardFactorOccHealthService.cs index 1867d309..963a29a3 100644 --- a/SGGL/BLL/ReportManage/HazardFactor/HazardFactorOccHealthService.cs +++ b/SGGL/BLL/ReportManage/HazardFactor/HazardFactorOccHealthService.cs @@ -28,6 +28,8 @@ namespace BLL { ID = model.ID, ProjectId = model.ProjectId, + UnitId = model.UnitId, + UnitProjectName = model.UnitProjectName, Year = model.Year, Month = model.Month, State = model.State, diff --git a/SGGL/BLL/ReportManage/HazardFactor/HazardFactorSafetyService.cs b/SGGL/BLL/ReportManage/HazardFactor/HazardFactorSafetyService.cs index fdaefb33..a6dfbb38 100644 --- a/SGGL/BLL/ReportManage/HazardFactor/HazardFactorSafetyService.cs +++ b/SGGL/BLL/ReportManage/HazardFactor/HazardFactorSafetyService.cs @@ -28,6 +28,8 @@ namespace BLL { ID = model.ID, ProjectId = model.ProjectId, + UnitId = model.UnitId, + UnitProjectName = model.UnitProjectName, Year = model.Year, Month = model.Month, State = model.State, diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx new file mode 100644 index 00000000..9014f542 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx @@ -0,0 +1,154 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemClassify.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.SafetyProblemClassify" %> + + + + + + 安全问题分类 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs new file mode 100644 index 00000000..c99e5009 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs @@ -0,0 +1,541 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Text; +using System.Web; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class SafetyProblemClassify : PageBase + { + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.GetButtonPower(); + InitTreeMenu(); + } + } + #endregion + + #region 加载树 + /// + /// 初始化树 + /// + private void InitTreeMenu() + { + trObj.Nodes.Clear(); + trObj.ShowBorder = false; + trObj.ShowHeader = false; + trObj.EnableIcons = true; + trObj.AutoScroll = true; + trObj.EnableSingleClickExpand = true; + TreeNode rootNode = new TreeNode + { + Text = "安全问题分类", + NodeID = "0", + Expanded = true + }; + this.trObj.Nodes.Add(rootNode); + BoundTree(rootNode.Nodes, "0"); + } + + private void BoundTree(TreeNodeCollection nodes, string menuId) + { + var dt = GetNewTraining(); + if (dt.Count() > 0) + { + TreeNode tn = null; + foreach (var dr in dt) + { + tn = new TreeNode + { + Text = dr.ClassifyName, + NodeID = dr.ClassifyId, + EnableClickEvent = true, + ToolTip = dr.ClassifyName + }; + nodes.Add(tn); + } + } + } + + /// + /// 得到菜单方法 + /// + /// + /// + private List GetNewTraining() + { + return (from x in Funs.DB.Base_SafetyProblemClassify orderby x.ClassifyCode select x).ToList(); ; + } + #endregion + + #region 增加、修改、删除安全问题分类类别 + /// + /// 增加安全问题分类类别 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + if (this.trObj.SelectedNode != null) + { + if (this.trObj.SelectedNode.NodeID == "0") //根节点或者非末级节点,可以增加 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyProblemClassifySave.aspx", this.trObj.SelectedNode.NodeID, "编辑 - "))); + } + else + { + ShowNotify("选择的项已是末级!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请选择树节点!", MessageBoxIcon.Warning); + } + } + + /// + /// 修改安全问题分类类别 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (this.trObj.SelectedNode != null) + { + if (this.trObj.SelectedNode.NodeID != "0") //非根节点可以编辑 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyProblemClassifySave.aspx?ClassifyId={0}", this.trObj.SelectedNode.NodeID, "编辑 - "))); + } + else + { + ShowNotify("根节点无法编辑!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请选择树节点!", MessageBoxIcon.Warning); + } + } + + /// + /// 删除安全问题分类类别 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (this.trObj.SelectedNode != null) + { + var q = BLL.SafetyProblemClassifyService.GetClassifyById(this.trObj.SelectedNode.NodeID); + + if (q != null) + { + BLL.SafetyProblemClassifyService.DeleteClassify(this.trObj.SelectedNode.NodeID); + InitTreeMenu(); + } + else + { + ShowNotify("存在下级菜单或已增加资源数据或者为内置项,不允许删除!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请选择删除项!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 树点击事件 + /// + /// 树点击事件 + /// + /// + /// + protected void trObj_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 下拉触发事件 + + /// + /// 适用岗位下拉触发事件 + /// + /// + /// + protected void drp_SelectedIndexChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + if (this.trObj.SelectedNode != null && !string.IsNullOrEmpty(this.trObj.SelectedNode.NodeID)) + { + StringBuilder sb = new StringBuilder(); + sb.Append("SELECT item.ClassifyItemId,item.ClassifyId,item.ClassifyItemCode,item.ClassifyItemName,item.CompileMan, item.CompileDate "); + sb.Append("FROM dbo.Base_SafetyProblemClassifyItem AS item "); + sb.Append("WHERE item.ClassifyId=@ClassifyId "); + + List listStr = new List + { + new SqlParameter("@ClassifyId", this.trObj.SelectedNode.NodeID) + }; + if (!string.IsNullOrEmpty(this.txtClassifyItemCode.Text.Trim())) + { + sb.Append("AND ClassifyItemCode LIKE @ClassifyItemCode "); + listStr.Add(new SqlParameter("@ClassifyItemCode", "%" + this.txtClassifyItemCode.Text.Trim() + "%")); + } + if (!string.IsNullOrEmpty(this.txtClassifyItemName.Text.Trim())) + { + sb.Append("AND ClassifyItemName LIKE @ClassifyItemName "); + listStr.Add(new SqlParameter("@ClassifyItemName", "%" + this.txtClassifyItemName.Text.Trim() + "%")); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + } + } + #endregion + + #region 弹出窗关闭事件 + protected void Window1_Close(object sender, EventArgs e) + { + InitTreeMenu(); + } + + protected void Window2_Close(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 排序、分页 + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 增加、修改、删除明细信息 + #region 新增明细 + /// + /// 新增明细 + /// + /// + /// + protected void btnNewDetail_Click(object sender, EventArgs e) + { + if (this.trObj.SelectedNode != null) + { + if (this.trObj.SelectedNode.Nodes.Count == 0) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SafetyProblemClassifyItemSave.aspx?ClassifyId={0}", this.trObj.SelectedNode.NodeID, "编辑 - "))); + } + else + { + ShowNotify("请选择末级节点!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请选择树节点!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 编辑明细 + protected void btnEditDetail_Click(object sender, EventArgs e) + { + this.EditData(); + } + + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + + string itemId = Grid1.SelectedRowID; + //itemId = itemId.Substring(0, itemId.IndexOf("_")); + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SafetyProblemClassifyItemSave.aspx?ClassifyItemId={0}", itemId, "编辑 - "))); + } + #endregion + + #region 删除明细 + // 删除数据 + protected void btnDeleteDetail_Click(object sender, EventArgs e) + { + this.DeleteData(); + } + + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + this.DeleteData(); + } + + /// + /// 删除方法 + /// + private void DeleteData() + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + //rowID = rowID.Substring(0, rowID.IndexOf("_")); + + var getD = BLL.SafetyProblemClassifyItemService.GetClassifyItemById(rowID); + if (getD != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, getD.ClassifyItemCode, getD.ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId, BLL.Const.BtnDelete); + BLL.SafetyProblemClassifyItemService.DeleteClassifyItemById(rowID); + } + } + + BindGrid(); + ShowNotify("删除数据成功!"); + } + } + #endregion + #endregion + + #region 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyProblemClassifyMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + this.btnNewDetail.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnEdit.Hidden = false; + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnDelete.Hidden = false; + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + + + /// + /// 导出 + /// + /// + /// + 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 = Grid1.RecordCount; + BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + #region 导出方法 + ///// + ///// 导出方法 + ///// + ///// + ///// + //public static string GetGridTableHtml(Grid grid, int count) + //{ + // StringBuilder sb = new StringBuilder(); + // sb.Append(""); + // sb.Append(""); + // sb.Append(""); + // foreach (GridColumn column in grid.Columns) + // { + // if (column.ColumnIndex < count) + // { + // sb.AppendFormat("", column.HeaderText); + // } + // } + // sb.Append(""); + // foreach (GridRow row in grid.Rows) + // { + // sb.Append(""); + // foreach (GridColumn column in grid.Columns) + // { + // if (column.ColumnIndex < count) + // { + // string html = row.Values[column.ColumnIndex].ToString(); + // if (column.ColumnID == "tfNumber" && (row.FindControl("lbNumber") as AspNet.Label) != null) + // { + // html = (row.FindControl("lbNumber") as AspNet.Label).Text; + // } + // if (column.ColumnID == "tfCompanyTrainingItemCode" && (row.FindControl("lbCompanyTrainingItemCode") as AspNet.Label) != null) + // { + // html = (row.FindControl("lbCompanyTrainingItemCode") as AspNet.Label).Text; + // } + // if (column.ColumnID == "tfCompanyTrainingItemName" && (row.FindControl("lbCompanyTrainingItemName") as AspNet.Label) != null) + // { + // html = (row.FindControl("lbCompanyTrainingItemName") as AspNet.Label).Text; + // } + // if (column.ColumnID == "tfCompileMan" && (row.FindControl("lbCompileMan") as AspNet.Label) != null) + // { + // html = (row.FindControl("lbCompileMan") as AspNet.Label).Text; + // } + // if (column.ColumnID == "tfCompileDate" && (row.FindControl("lbCompileDate") as AspNet.Label) != null) + // { + // html = (row.FindControl("lbCompileDate") as AspNet.Label).Text; + // } + // sb.AppendFormat("", html); + // } + // } + + // sb.Append(""); + // } + + // sb.Append("
{0}
{0}
"); + + // return sb.ToString(); + //} + #endregion + + ///// + ///// 行事件 + ///// + ///// + ///// + //protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + //{ + // if (e.CommandName == "Attach") + // { + // string attUrl = this.Grid1.Rows[e.RowIndex].Values[this.Grid1.Columns.Count - 1].ToString(); + // try + // { + + // string url = Funs.RootPath + attUrl; + // FileInfo info = new FileInfo(url); + // string savedName = Path.GetFileName(url); + // if (!info.Exists || string.IsNullOrEmpty(savedName)) + // { + // url = Funs.RootPath + "Images//Null.jpg"; + // info = new FileInfo(url); + // } + + // if (Path.GetExtension(savedName) == ".mp4" || Path.GetExtension(savedName).ToLower() == ".mp4" || Path.GetExtension(savedName) == ".m4v") + // { + // string mpUrl = HttpUtility.UrlEncode(attUrl.Replace('\\', '/')); + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/player.aspx?url={0}", attUrl.Replace('\\', '/'), "播放 - "), "播放视频", 700, 560)); + // } + // else + // { + // string fileName = Path.GetFileName(url); + // long fileSize = info.Length; + // System.Web.HttpContext.Current.Response.Clear(); + // //System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + // System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream"; + // System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + // System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + // System.Web.HttpContext.Current.Response.TransmitFile(url, 0, fileSize); + // System.Web.HttpContext.Current.Response.Flush(); + // System.Web.HttpContext.Current.Response.End(); + // } + // } + // catch (Exception) + // { + + // } + // } + //} + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.designer.cs new file mode 100644 index 00000000..619b097a --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class SafetyProblemClassify + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// trObj 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree trObj; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// txtClassifyItemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyItemCode; + + /// + /// txtClassifyItemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyItemName; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNewDetail 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNewDetail; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// 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/SafetyProblemClassifyItemSave.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx new file mode 100644 index 00000000..9ea6d47d --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx @@ -0,0 +1,107 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemClassifyItemSave.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.SafetyProblemClassifyItemSave" %> + + + + + 编辑安全问题分类 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs new file mode 100644 index 00000000..8e425cb1 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs @@ -0,0 +1,235 @@ +using System; +using System.Linq; +using Model; +using BLL; +using System.Collections.Generic; +using Microsoft.Office.Interop.Excel; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class SafetyProblemClassifyItemSave : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ClassifyItemId + { + get + { + return (string)ViewState["ClassifyItemId"]; + } + set + { + ViewState["ClassifyItemId"] = value; + } + } + + /// + /// 主表主键 + /// + public string ClassifyId + { + get + { + return (string)ViewState["ClassifyId"]; + } + set + { + ViewState["ClassifyId"] = value; + } + } + #endregion + + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + btnClose.OnClientClick = ActiveWindow.GetHideReference(); + //BoundTree(treeTestTraining.Nodes, "0"); + //BindEnumrableToDropDownList(); + this.ClassifyItemId = Request.QueryString["ClassifyItemId"]; + this.ClassifyId = Request.QueryString["ClassifyId"]; + if (!string.IsNullOrEmpty(this.ClassifyItemId)) + { + var model = SafetyProblemClassifyItemService.GetClassifyItemById(this.ClassifyItemId); + if (model != null) + { + this.ClassifyId = model.ClassifyId; + this.txtClassifyItemCode.Text = model.ClassifyItemCode; + this.txtClassifyItemName.Text = model.ClassifyItemName; + this.txtCompileMan.Text = model.CompileManName; + if (model.CompileDate != null) + { + txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate); + } + } + } + else + { + var model = BLL.CompanyTrainingService.GetCompanyTrainingById(this.ClassifyId); + if (model != null) + { + this.txtCompileMan.Text = this.CurrUser.UserName; + this.txtClassifyItemName.Text = model.CompanyTrainingName; + //this.txtClassifyItemCode.Text = SQLHelper.RunProcNewId("SpGetNewCode3", "Base_SafetyProblemClassifyItem", "ClassifyItemCode", model.ClassifyItemCode + "-"); + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + } + } + } + } + + #endregion + private List GetNewTraining(string parentId) + { + return (from x in Funs.DB.Training_TestTraining + where x.SupTrainingId == parentId + orderby x.TrainingCode + select x).ToList(); + } + //private void BoundTree(TreeNodeCollection nodes, string parentId) + //{ + // var dt = GetNewTraining(parentId); + // if (dt.Count() > 0) + // { + // TreeNode tn = null; + // foreach (var dr in dt) + // { + // string name = dr.TrainingName; + // if (!string.IsNullOrEmpty(dr.TrainingCode)) + // { + // name = "[" + dr.TrainingCode + "]" + dr.TrainingName; + // } + // tn = new TreeNode + // { + + // Text = name, + // NodeID = dr.TrainingId, + // EnableClickEvent = true, + // ToolTip = dr.TrainingName + // }; + // nodes.Add(tn); + // ///是否存在下级节点 + // var sup = Funs.DB.Training_TestTraining.FirstOrDefault(x => x.SupTrainingId == tn.NodeID); + // if (sup != null) + // { + // BoundTree(tn.Nodes, tn.NodeID); + // } + // } + // } + //} + + #region 保存 + /// + /// 保存数据 + /// + private void SaveData(bool isClose) + { + Model.Base_SafetyProblemClassifyItem newModel = new Base_SafetyProblemClassifyItem + { + ClassifyItemCode = this.txtClassifyItemCode.Text.Trim(), + ClassifyItemName = this.txtClassifyItemName.Text.Trim(), + CompileMan = this.CurrUser.UserId, + CompileManName = this.CurrUser.UserName, + }; + + if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim())) + { + newModel.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim()); + } + if (!string.IsNullOrEmpty(this.ClassifyItemId)) + { + newModel.ClassifyItemId = this.ClassifyItemId; + BLL.SafetyProblemClassifyItemService.UpdateClassifyItem(newModel); + BLL.LogService.AddSys_Log(this.CurrUser, newModel.ClassifyItemCode, newModel.ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId, BLL.Const.BtnModify); + } + else + { + newModel.ClassifyId = this.ClassifyId; + this.ClassifyItemId = SQLHelper.GetNewID(typeof(Model.Base_SafetyProblemClassifyItem)); + newModel.ClassifyItemId = this.ClassifyItemId; + BLL.SafetyProblemClassifyItemService.AddClassifyItem(newModel); + BLL.LogService.AddSys_Log(this.CurrUser, newModel.ClassifyItemCode, newModel.ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId, BLL.Const.BtnAdd); + } + if (isClose) + { + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + } + + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + SaveData(true); + } + #endregion + + #region 验证安全问题分类是否存在 + /// + /// 验证安全问题分类是否存在 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + var q = Funs.DB.Base_SafetyProblemClassifyItem.FirstOrDefault(x => x.ClassifyId == this.ClassifyId && x.ClassifyItemName == this.txtClassifyItemName.Text.Trim() && (x.ClassifyItemId != this.ClassifyItemId || (this.ClassifyItemId == null && x.ClassifyItemId != null))); + if (q != null) + { + ShowNotify("输入的安全问题分类已存在!", MessageBoxIcon.Warning); + } + } + #endregion + + //#region 上传附件资源 + ///// + ///// 上传附件资源 + ///// + ///// + ///// + //protected void btnUploadResources_Click(object sender, EventArgs e) + //{ + // if (this.btnSave.Hidden) + // { + // PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CompanyTraining&menuId={1}&type=-1", ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId))); + // } + // else + // { + // if (string.IsNullOrEmpty(this.ClassifyItemId)) + // { + // SaveData(false); + // } + // PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CompanyTraining&menuId={1}", ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId))); + // } + //} + //#endregion + + #region 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyProblemClassifyMenuId); + 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/SafetyProblemClassifyItemSave.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.designer.cs new file mode 100644 index 00000000..e80dfac6 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.designer.cs @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class SafetyProblemClassifyItemSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtClassifyItemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyItemCode; + + /// + /// txtClassifyItemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyItemName; + + /// + /// txtCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileMan; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifySave.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifySave.aspx new file mode 100644 index 00000000..1ffee6c3 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifySave.aspx @@ -0,0 +1,45 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemClassifySave.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.SafetyProblemClassifySave" %> + + + + + 编辑安全问题分类 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifySave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifySave.aspx.cs new file mode 100644 index 00000000..329f45dc --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifySave.aspx.cs @@ -0,0 +1,132 @@ +using System; +using System.Linq; +using BLL; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class SafetyProblemClassifySave : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ClassifyId + { + get + { + return (string)ViewState["ClassifyId"]; + } + set + { + ViewState["ClassifyId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + btnClose.OnClientClick = ActiveWindow.GetHideReference(); + + this.ClassifyId = Request.QueryString["ClassifyId"]; + if (!string.IsNullOrEmpty(ClassifyId)) + { + var q = BLL.SafetyProblemClassifyService.GetClassifyById(ClassifyId); + if (q != null) + { + this.txtClassifyCode.Text = q.ClassifyCode; + this.txtClassifyName.Text = q.ClassifyName; + } + } + } + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + var obj = Funs.DB.Base_SafetyProblemClassify.FirstOrDefault(x => x.ClassifyCode == this.txtClassifyCode.Text.Trim() && x.ClassifyId != this.ClassifyId); + if (obj != null) + { + ShowNotify("输入的编号已存在!", MessageBoxIcon.Warning); + return; + } + obj = Funs.DB.Base_SafetyProblemClassify.FirstOrDefault(x => x.ClassifyName == this.txtClassifyName.Text.Trim() && x.ClassifyId != this.ClassifyId); + if (obj != null) + { + ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning); + return; + } + + + Model.Base_SafetyProblemClassify model = new Model.Base_SafetyProblemClassify(); + model.ClassifyCode = this.txtClassifyCode.Text.Trim(); + model.ClassifyName = this.txtClassifyName.Text.Trim(); + if (!string.IsNullOrEmpty(this.ClassifyId)) + { + model.ClassifyId = this.ClassifyId; + BLL.SafetyProblemClassifyService.UpdateClassify(model); + } + else + { + this.ClassifyId = SQLHelper.GetNewID(typeof(Model.Base_SafetyProblemClassify)); + model.ClassifyId = this.ClassifyId; + BLL.SafetyProblemClassifyService.AddClassify(model); + } + // 2. 关闭本窗体,然后刷新父窗体 + // PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + // 2. 关闭本窗体,然后回发父窗体 + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + //PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(trainingId) + ActiveWindow.GetHideReference()); + } + #endregion + + #region 验证安全问题分类名称是否存在 + /// + /// 验证安全问题分类名称是否存在 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + var model = Funs.DB.Base_SafetyProblemClassify.FirstOrDefault(x => x.ClassifyName == this.txtClassifyName.Text.Trim() && (x.ClassifyId != this.ClassifyId || this.ClassifyId == null)); + if (model != null) + { + ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyProblemClassifyMenuId); + 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/SafetyProblemClassifySave.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifySave.aspx.designer.cs new file mode 100644 index 00000000..ac7bfdb9 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifySave.aspx.designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class SafetyProblemClassifySave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtClassifyCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyCode; + + /// + /// txtClassifyName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyName; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index eab72340..0eec5bbe 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -244,6 +244,9 @@ + + + @@ -7760,6 +7763,27 @@ CNProfessionalView.aspx + + SafetyProblemClassifyItemSave.aspx + ASPXCodeBehind + + + SafetyProblemClassifyItemSave.aspx + + + SafetyProblemClassifySave.aspx + ASPXCodeBehind + + + SafetyProblemClassifySave.aspx + + + SafetyProblemClassify.aspx + ASPXCodeBehind + + + SafetyProblemClassify.aspx + CostType.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealth.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealth.aspx.cs index 7e190727..8b1a7acd 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealth.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealth.aspx.cs @@ -273,7 +273,8 @@ namespace FineUIPro.Web.ReportManage.HazardFactor /// protected void btnImport_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorOccHealthIn.aspx?ProjectId={0}", this.ProjectId, "导入 - "))); + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorOccHealthIn.aspx?ProjectId={0}", this.ProjectId, "导入 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorOccHealthIn.aspx?ProjectId={0}&UnitId={1}", this.CurrUser.LoginProjectId, this.CurrUser.UnitId, "导入 - "))); } #region 导出按钮 diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthEdit.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthEdit.aspx.cs index 2cbcc1a5..9d829371 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthEdit.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using FineUIPro.Web.DataShow; using Model; using System; using System.Linq; @@ -144,7 +145,18 @@ namespace FineUIPro.Web.ReportManage.HazardFactor var yearMonth2 = this.drpYearMonth.SelectedDate; model.Year = yearMonth.Split('-')[0]; model.Month = yearMonth.Split('-')[1]; - model.ProjectId = this.ProjectId; + if (!string.IsNullOrWhiteSpace(this.ProjectId)) + { + var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); + model.ProjectId = this.ProjectId; + model.UnitProjectName = project.ProjectName; + } + else + { + var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId); + model.UnitId = unit.UnitId; + model.UnitProjectName = unit.UnitName; + } model.WorkPlace = this.txtWorkPlace.Text.Trim(); model.JobStep = this.txtJobStep.Text.Trim(); model.Hazard = this.txtHazard.Text.Trim(); diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthIn.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthIn.aspx.cs index d8855e8e..0cec0cde 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthIn.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthIn.aspx.cs @@ -39,6 +39,20 @@ namespace FineUIPro.Web.ReportManage.HazardFactor } } /// + /// 单位id + /// + public string UnitId + { + get + { + return (string)ViewState["UnitId"]; + } + set + { + ViewState["UnitId"] = value; + } + } + /// /// 操作人 /// public string CompileMan @@ -75,6 +89,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor if (!IsPostBack) { this.ProjectId = Request.Params["ProjectId"]; + this.UnitId = Request.Params["UnitId"]; this.CompileMan = this.CurrUser.UserId; @@ -303,7 +318,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor else { Year = ct.Year.ToString(); - Month = ct.Month.ToString(); + Month = ct.Month > 9 ? ct.Month.ToString() : $"0{ct.Month}"; } } else @@ -425,6 +440,18 @@ namespace FineUIPro.Web.ReportManage.HazardFactor return (lstError, null); } + string UnitProjectName = string.Empty; + if (!string.IsNullOrWhiteSpace(this.ProjectId)) + { + var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); + UnitProjectName = project.ProjectName; + } + else if (!string.IsNullOrWhiteSpace(this.UnitId)) + { + var unit = BLL.UnitService.GetUnitByUnitId(this.UnitId); + UnitProjectName = unit.UnitName; + } + // 其余字段可根据实际业务映射到实体 var entity = new Model.HazardFactor_OccHealth { @@ -433,7 +460,9 @@ namespace FineUIPro.Web.ReportManage.HazardFactor CompileMan = this.CompileMan, CompileManName = this.CompileManName, State = int.Parse(BLL.Const.State_1),//默认已提交 - ProjectId =this.ProjectId, + ProjectId = this.ProjectId, + UnitId = this.UnitId, + UnitProjectName = UnitProjectName, Year = Year, Month = Month, WorkPlace = WorkPlace, diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx index 858945c7..cc473a66 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx @@ -64,7 +64,10 @@ - + <%----%> + @@ -90,7 +93,9 @@ - + <%-- + --%> + diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.cs index e058f859..b11f5f74 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.cs @@ -44,6 +44,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor ////权限按钮方法 this.GetButtonPower(); ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + //btnNew.OnClientClick = Window1.GetShowReference("HazardFactorSafetyEdit.aspx") + "return false;"; // 绑定表格 BindGrid(); } @@ -64,20 +65,26 @@ namespace FineUIPro.Web.ReportManage.HazardFactor sb.Append("WITH CTE AS ( "); if (dedupe == "0") {//按月 - sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tbb.ProjectName,tba.* "); + sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* "); } else {//按年 - sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tbb.ProjectName,tba.* "); + sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* "); } } else { - sb.Append("SELECT tbb.ProjectName,tba.* "); + sb.Append("SELECT tba.* "); } sb.Append("FROM HazardFactor_OccHealth AS tba WITH(NOLOCK) "); - sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId "); + //sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId "); sb.Append("WHERE 1=1 AND tba.State = 1 ");//取已提交数据 + + if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.UnitId != Const.UnitId_XJYJ) + {//分公司只能查看本单位的数据 + sb.Append("AND tba.UnitId = @UnitId "); + listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId)); + } if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null) { sb.Append("AND tba.ProjectId = @ProjectId "); @@ -260,6 +267,8 @@ namespace FineUIPro.Web.ReportManage.HazardFactor return; } this.btnMenuView.Hidden = false; + //this.btnNew.Hidden = false; + this.btnImport.Hidden = false; if (this.CurrUser.UserId == Const.hfnbdId || this.CurrUser.UserId == Const.sysglyId) { this.btnMenuDel.Hidden = false; @@ -272,6 +281,17 @@ namespace FineUIPro.Web.ReportManage.HazardFactor } #endregion + + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}&UnitId={1}", this.CurrUser.LoginProjectId, this.CurrUser.UnitId, "导入 - "))); + } + #region 导出按钮 /// 导出按钮 /// diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.designer.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.designer.cs index ff4ce9c6..96c115c3 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx.designer.cs @@ -131,6 +131,15 @@ namespace FineUIPro.Web.ReportManage.HazardFactor /// protected global::FineUIPro.ToolbarFill ToolbarFill1; + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + /// /// btnOut 控件。 /// diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx index a22a4948..d04eac46 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx @@ -19,6 +19,12 @@ + + + + + + diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx.cs index b3dbf608..a108f514 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using NPOI.SS.Formula.Atp; using System; namespace FineUIPro.Web.ReportManage.HazardFactor @@ -55,8 +56,9 @@ namespace FineUIPro.Web.ReportManage.HazardFactor { this.drpYearMonth.SelectedDate = Convert.ToDateTime($"{model.Year}-{model.Month}"); - this.txtCompileDate.Text = model.CompileDate.ToShortDateString(); + this.txtCompileDate.Text = model.CompileDate.ToShortDateString(); this.txtCompileManName.Text = model.CompileManName; + this.txtUnitProjectName.Text = model.UnitProjectName; this.txtWorkPlace.Text = model.WorkPlace; this.txtJobStep.Text = model.JobStep; diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx.designer.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx.designer.cs index a135bf3f..26ed9970 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthView.aspx.designer.cs @@ -59,6 +59,15 @@ namespace FineUIPro.Web.ReportManage.HazardFactor /// protected global::FineUIPro.DatePicker txtCompileDate; + /// + /// txtUnitProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtUnitProjectName; + /// /// txtCompileManName 控件。 /// diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafety.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafety.aspx.cs index 9186daa5..382e049b 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafety.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafety.aspx.cs @@ -273,7 +273,8 @@ namespace FineUIPro.Web.ReportManage.HazardFactor /// protected void btnImport_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}", this.ProjectId, "导入 - "))); + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}", this.ProjectId, "导入 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}&UnitId={1}", this.CurrUser.LoginProjectId, this.CurrUser.UnitId, "导入 - "))); } #region 导出按钮 diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyEdit.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyEdit.aspx.cs index 31da6fc8..4804f9dc 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyEdit.aspx.cs @@ -144,7 +144,18 @@ namespace FineUIPro.Web.ReportManage.HazardFactor var yearMonth2 = this.drpYearMonth.SelectedDate; model.Year = yearMonth.Split('-')[0]; model.Month = yearMonth.Split('-')[1]; - model.ProjectId = this.ProjectId; + if (!string.IsNullOrWhiteSpace(this.ProjectId)) + { + var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); + model.ProjectId = this.ProjectId; + model.UnitProjectName = project.ProjectName; + } + else + { + var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId); + model.UnitId = unit.UnitId; + model.UnitProjectName = unit.UnitName; + } model.WorkPlace = this.txtWorkPlace.Text.Trim(); model.JobStep = this.txtJobStep.Text.Trim(); model.Hazard = this.txtHazard.Text.Trim(); diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyIn.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyIn.aspx.cs index 21d9fadb..23a598dc 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyIn.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyIn.aspx.cs @@ -39,6 +39,20 @@ namespace FineUIPro.Web.ReportManage.HazardFactor } } /// + /// 单位id + /// + public string UnitId + { + get + { + return (string)ViewState["UnitId"]; + } + set + { + ViewState["UnitId"] = value; + } + } + /// /// 操作人 /// public string CompileMan @@ -75,6 +89,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor if (!IsPostBack) { this.ProjectId = Request.Params["ProjectId"]; + this.UnitId = Request.Params["UnitId"]; this.CompileMan = this.CurrUser.UserId; @@ -303,7 +318,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor else { Year = ct.Year.ToString(); - Month = ct.Month.ToString(); + Month = ct.Month > 9 ? ct.Month.ToString() : $"0{ct.Month}"; } } else @@ -425,15 +440,29 @@ namespace FineUIPro.Web.ReportManage.HazardFactor return (lstError, null); } + string UnitProjectName = string.Empty; + if (!string.IsNullOrWhiteSpace(this.ProjectId)) + { + var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); + UnitProjectName = project.ProjectName; + } + else if (!string.IsNullOrWhiteSpace(this.UnitId)) + { + var unit = BLL.UnitService.GetUnitByUnitId(this.UnitId); + UnitProjectName = unit.UnitName; + } + // 其余字段可根据实际业务映射到实体 var entity = new Model.HazardFactor_Safety { ID = SQLHelper.GetNewID(typeof(Model.HazardFactor_Safety)), - CompileDate=DateTime.Now, + CompileDate = DateTime.Now, CompileMan = this.CompileMan, CompileManName = this.CompileManName, State = int.Parse(BLL.Const.State_1),//默认已提交 - ProjectId =this.ProjectId, + ProjectId = this.ProjectId, + UnitId = this.UnitId, + UnitProjectName = UnitProjectName, Year = Year, Month = Month, WorkPlace = WorkPlace, diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx index 135f057e..b79c220f 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx @@ -64,7 +64,10 @@ - + <%----%> + @@ -90,7 +93,9 @@ - + <%-- + --%> + diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.cs index 8731f80d..324165e3 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.cs @@ -44,6 +44,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor ////权限按钮方法 this.GetButtonPower(); ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + //btnNew.OnClientClick = Window1.GetShowReference("HazardFactorSafetyEdit.aspx") + "return false;"; // 绑定表格 BindGrid(); } @@ -64,20 +65,26 @@ namespace FineUIPro.Web.ReportManage.HazardFactor sb.Append("WITH CTE AS ( "); if (dedupe == "0") {//按月 - sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tbb.ProjectName,tba.* "); + sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* "); } else {//按年 - sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tbb.ProjectName,tba.* "); + sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* "); } } else { - sb.Append("SELECT tbb.ProjectName,tba.* "); + sb.Append("SELECT tba.* "); } sb.Append("FROM HazardFactor_Safety AS tba WITH(NOLOCK) "); - sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId "); + //sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId "); sb.Append("WHERE 1=1 AND tba.State = 1 ");//取已提交数据 + + if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.UnitId != Const.UnitId_XJYJ) + {//分公司只能查看本单位的数据 + sb.Append("AND tba.UnitId = @UnitId "); + listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId)); + } if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null) { sb.Append("AND tba.ProjectId = @ProjectId "); @@ -260,6 +267,8 @@ namespace FineUIPro.Web.ReportManage.HazardFactor return; } this.btnMenuView.Hidden = false; + //this.btnNew.Hidden = false; + this.btnImport.Hidden = false; if (this.CurrUser.UserId == Const.hfnbdId || this.CurrUser.UserId == Const.sysglyId) { this.btnMenuDel.Hidden = false; @@ -272,6 +281,17 @@ namespace FineUIPro.Web.ReportManage.HazardFactor } #endregion + + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}&UnitId={1}", this.CurrUser.LoginProjectId, this.CurrUser.UnitId, "导入 - "))); + } + #region 导出按钮 /// 导出按钮 /// diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.designer.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.designer.cs index d9f1bc50..768996fc 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx.designer.cs @@ -131,6 +131,15 @@ namespace FineUIPro.Web.ReportManage.HazardFactor /// protected global::FineUIPro.ToolbarFill ToolbarFill1; + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + /// /// btnOut 控件。 /// diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx index 61a2b018..295b3915 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx @@ -19,6 +19,12 @@ + + + + + + diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx.cs index bd803a13..b94b5b92 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx.cs @@ -57,6 +57,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor this.drpYearMonth.SelectedDate = Convert.ToDateTime($"{model.Year}-{model.Month}"); this.txtCompileDate.Text = model.CompileDate.ToShortDateString(); this.txtCompileManName.Text = model.CompileManName; + this.txtUnitProjectName.Text = model.UnitProjectName; this.txtWorkPlace.Text = model.WorkPlace; this.txtJobStep.Text = model.JobStep; diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx.designer.cs b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx.designer.cs index 02809f8b..0fd50b76 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetyView.aspx.designer.cs @@ -59,6 +59,15 @@ namespace FineUIPro.Web.ReportManage.HazardFactor /// protected global::FineUIPro.DatePicker txtCompileDate; + /// + /// txtUnitProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtUnitProjectName; + /// /// txtCompileManName 控件。 /// diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 3ae09306..1a7d0f94 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -233,6 +233,12 @@ namespace Model partial void InsertBase_SafetyMeasures(Base_SafetyMeasures instance); partial void UpdateBase_SafetyMeasures(Base_SafetyMeasures instance); partial void DeleteBase_SafetyMeasures(Base_SafetyMeasures instance); + partial void InsertBase_SafetyProblemClassify(Base_SafetyProblemClassify instance); + partial void UpdateBase_SafetyProblemClassify(Base_SafetyProblemClassify instance); + partial void DeleteBase_SafetyProblemClassify(Base_SafetyProblemClassify instance); + partial void InsertBase_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem instance); + partial void UpdateBase_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem instance); + partial void DeleteBase_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem instance); partial void InsertBase_SecretLevel(Base_SecretLevel instance); partial void UpdateBase_SecretLevel(Base_SecretLevel instance); partial void DeleteBase_SecretLevel(Base_SecretLevel instance); @@ -3290,6 +3296,22 @@ namespace Model } } + public System.Data.Linq.Table Base_SafetyProblemClassify + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table Base_SafetyProblemClassifyItem + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Base_SecretLevel { get @@ -39817,6 +39839,391 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_SafetyProblemClassify")] + public partial class Base_SafetyProblemClassify : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ClassifyId; + + private string _ClassifyCode; + + private string _ClassifyName; + + private EntitySet _Base_SafetyProblemClassifyItem; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnClassifyIdChanging(string value); + partial void OnClassifyIdChanged(); + partial void OnClassifyCodeChanging(string value); + partial void OnClassifyCodeChanged(); + partial void OnClassifyNameChanging(string value); + partial void OnClassifyNameChanged(); + #endregion + + public Base_SafetyProblemClassify() + { + this._Base_SafetyProblemClassifyItem = new EntitySet(new Action(this.attach_Base_SafetyProblemClassifyItem), new Action(this.detach_Base_SafetyProblemClassifyItem)); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ClassifyId + { + get + { + return this._ClassifyId; + } + set + { + if ((this._ClassifyId != value)) + { + this.OnClassifyIdChanging(value); + this.SendPropertyChanging(); + this._ClassifyId = value; + this.SendPropertyChanged("ClassifyId"); + this.OnClassifyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string ClassifyCode + { + get + { + return this._ClassifyCode; + } + set + { + if ((this._ClassifyCode != value)) + { + this.OnClassifyCodeChanging(value); + this.SendPropertyChanging(); + this._ClassifyCode = value; + this.SendPropertyChanged("ClassifyCode"); + this.OnClassifyCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)] + public string ClassifyName + { + get + { + return this._ClassifyName; + } + set + { + if ((this._ClassifyName != value)) + { + this.OnClassifyNameChanging(value); + this.SendPropertyChanging(); + this._ClassifyName = value; + this.SendPropertyChanged("ClassifyName"); + this.OnClassifyNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_SafetyProblemClassifyItem_Classify", Storage="_Base_SafetyProblemClassifyItem", ThisKey="ClassifyId", OtherKey="ClassifyId", DeleteRule="NO ACTION")] + public EntitySet Base_SafetyProblemClassifyItem + { + get + { + return this._Base_SafetyProblemClassifyItem; + } + set + { + this._Base_SafetyProblemClassifyItem.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_Base_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem entity) + { + this.SendPropertyChanging(); + entity.Base_SafetyProblemClassify = this; + } + + private void detach_Base_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem entity) + { + this.SendPropertyChanging(); + entity.Base_SafetyProblemClassify = null; + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_SafetyProblemClassifyItem")] + public partial class Base_SafetyProblemClassifyItem : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ClassifyItemId; + + private string _ClassifyId; + + private string _ClassifyItemCode; + + private string _ClassifyItemName; + + private string _CompileMan; + + private string _CompileManName; + + private System.Nullable _CompileDate; + + private EntityRef _Base_SafetyProblemClassify; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnClassifyItemIdChanging(string value); + partial void OnClassifyItemIdChanged(); + partial void OnClassifyIdChanging(string value); + partial void OnClassifyIdChanged(); + partial void OnClassifyItemCodeChanging(string value); + partial void OnClassifyItemCodeChanged(); + partial void OnClassifyItemNameChanging(string value); + partial void OnClassifyItemNameChanged(); + partial void OnCompileManChanging(string value); + partial void OnCompileManChanged(); + partial void OnCompileManNameChanging(string value); + partial void OnCompileManNameChanged(); + partial void OnCompileDateChanging(System.Nullable value); + partial void OnCompileDateChanged(); + #endregion + + public Base_SafetyProblemClassifyItem() + { + this._Base_SafetyProblemClassify = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyItemId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ClassifyItemId + { + get + { + return this._ClassifyItemId; + } + set + { + if ((this._ClassifyItemId != value)) + { + this.OnClassifyItemIdChanging(value); + this.SendPropertyChanging(); + this._ClassifyItemId = value; + this.SendPropertyChanged("ClassifyItemId"); + this.OnClassifyItemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyId", DbType="NVarChar(50)")] + public string ClassifyId + { + get + { + return this._ClassifyId; + } + set + { + if ((this._ClassifyId != value)) + { + if (this._Base_SafetyProblemClassify.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnClassifyIdChanging(value); + this.SendPropertyChanging(); + this._ClassifyId = value; + this.SendPropertyChanged("ClassifyId"); + this.OnClassifyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyItemCode", DbType="NVarChar(50)")] + public string ClassifyItemCode + { + get + { + return this._ClassifyItemCode; + } + set + { + if ((this._ClassifyItemCode != value)) + { + this.OnClassifyItemCodeChanging(value); + this.SendPropertyChanging(); + this._ClassifyItemCode = value; + this.SendPropertyChanged("ClassifyItemCode"); + this.OnClassifyItemCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyItemName", DbType="NVarChar(100)")] + public string ClassifyItemName + { + get + { + return this._ClassifyItemName; + } + set + { + if ((this._ClassifyItemName != value)) + { + this.OnClassifyItemNameChanging(value); + this.SendPropertyChanging(); + this._ClassifyItemName = value; + this.SendPropertyChanged("ClassifyItemName"); + this.OnClassifyItemNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")] + public string CompileMan + { + get + { + return this._CompileMan; + } + set + { + if ((this._CompileMan != value)) + { + this.OnCompileManChanging(value); + this.SendPropertyChanging(); + this._CompileMan = value; + this.SendPropertyChanged("CompileMan"); + this.OnCompileManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileManName", DbType="NVarChar(50)")] + public string CompileManName + { + get + { + return this._CompileManName; + } + set + { + if ((this._CompileManName != value)) + { + this.OnCompileManNameChanging(value); + this.SendPropertyChanging(); + this._CompileManName = value; + this.SendPropertyChanged("CompileManName"); + this.OnCompileManNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")] + public System.Nullable CompileDate + { + get + { + return this._CompileDate; + } + set + { + if ((this._CompileDate != value)) + { + this.OnCompileDateChanging(value); + this.SendPropertyChanging(); + this._CompileDate = value; + this.SendPropertyChanged("CompileDate"); + this.OnCompileDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_SafetyProblemClassifyItem_Classify", Storage="_Base_SafetyProblemClassify", ThisKey="ClassifyId", OtherKey="ClassifyId", IsForeignKey=true)] + public Base_SafetyProblemClassify Base_SafetyProblemClassify + { + get + { + return this._Base_SafetyProblemClassify.Entity; + } + set + { + Base_SafetyProblemClassify previousValue = this._Base_SafetyProblemClassify.Entity; + if (((previousValue != value) + || (this._Base_SafetyProblemClassify.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_SafetyProblemClassify.Entity = null; + previousValue.Base_SafetyProblemClassifyItem.Remove(this); + } + this._Base_SafetyProblemClassify.Entity = value; + if ((value != null)) + { + value.Base_SafetyProblemClassifyItem.Add(this); + this._ClassifyId = value.ClassifyId; + } + else + { + this._ClassifyId = default(string); + } + this.SendPropertyChanged("Base_SafetyProblemClassify"); + } + } + } + + 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.Base_SecretLevel")] public partial class Base_SecretLevel : INotifyPropertyChanging, INotifyPropertyChanged { @@ -168600,6 +169007,10 @@ namespace Model private int _State; + private string _UnitId; + + private string _UnitProjectName; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -168656,6 +169067,10 @@ namespace Model partial void OnResponsibleDepartmentChanged(); partial void OnStateChanging(int value); partial void OnStateChanged(); + partial void OnUnitIdChanging(string value); + partial void OnUnitIdChanged(); + partial void OnUnitProjectNameChanging(string value); + partial void OnUnitProjectNameChanged(); #endregion public HazardFactor_OccHealth() @@ -168783,7 +169198,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] public string ProjectId { get @@ -168843,7 +169258,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hazard", DbType="NVarChar(500) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hazard", DbType="NVarChar(2000)")] public string Hazard { get @@ -169003,7 +169418,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NetRiskControlMeasures", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NetRiskControlMeasures", DbType="NVarChar(2000)")] public string NetRiskControlMeasures { get @@ -169123,7 +169538,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdditionalControlMeasures", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdditionalControlMeasures", DbType="NVarChar(2000)")] public string AdditionalControlMeasures { get @@ -169183,6 +169598,46 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")] + public string UnitId + { + get + { + return this._UnitId; + } + set + { + if ((this._UnitId != value)) + { + this.OnUnitIdChanging(value); + this.SendPropertyChanging(); + this._UnitId = value; + this.SendPropertyChanged("UnitId"); + this.OnUnitIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitProjectName", DbType="NVarChar(200)")] + public string UnitProjectName + { + get + { + return this._UnitProjectName; + } + set + { + if ((this._UnitProjectName != value)) + { + this.OnUnitProjectNameChanging(value); + this.SendPropertyChanging(); + this._UnitProjectName = value; + this.SendPropertyChanged("UnitProjectName"); + this.OnUnitProjectNameChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -169262,6 +169717,10 @@ namespace Model private int _State; + private string _UnitId; + + private string _UnitProjectName; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -169318,6 +169777,10 @@ namespace Model partial void OnResponsibleDepartmentChanged(); partial void OnStateChanging(int value); partial void OnStateChanged(); + partial void OnUnitIdChanging(string value); + partial void OnUnitIdChanged(); + partial void OnUnitProjectNameChanging(string value); + partial void OnUnitProjectNameChanged(); #endregion public HazardFactor_Safety() @@ -169445,7 +169908,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] public string ProjectId { get @@ -169505,7 +169968,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hazard", DbType="NVarChar(500) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hazard", DbType="NVarChar(2000)")] public string Hazard { get @@ -169665,7 +170128,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NetRiskControlMeasures", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NetRiskControlMeasures", DbType="NVarChar(2000)")] public string NetRiskControlMeasures { get @@ -169785,7 +170248,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdditionalControlMeasures", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdditionalControlMeasures", DbType="NVarChar(2000)")] public string AdditionalControlMeasures { get @@ -169845,6 +170308,46 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")] + public string UnitId + { + get + { + return this._UnitId; + } + set + { + if ((this._UnitId != value)) + { + this.OnUnitIdChanging(value); + this.SendPropertyChanging(); + this._UnitId = value; + this.SendPropertyChanged("UnitId"); + this.OnUnitIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitProjectName", DbType="NVarChar(200)")] + public string UnitProjectName + { + get + { + return this._UnitProjectName; + } + set + { + if ((this._UnitProjectName != value)) + { + this.OnUnitProjectNameChanging(value); + this.SendPropertyChanging(); + this._UnitProjectName = value; + this.SendPropertyChanged("UnitProjectName"); + this.OnUnitProjectNameChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged;