diff --git a/DataBase/版本日志/SGGLDB_V2026-05-13-xiaj(安全不符合项清单).sql b/DataBase/版本日志/SGGLDB_V2026-05-13-xiaj(安全不符合项清单).sql new file mode 100644 index 00000000..616e93b6 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-05-13-xiaj(安全不符合项清单).sql @@ -0,0 +1,106 @@ + + +delete Sys_Menu +where MenuName='HSE' and MenuId='D1B06551-1BA3-4E18-952A-58E24A6328E0' +GO + +--ȫHSE嵥 +UPDATE Sys_Menu +SET Url='Check/HSE/CheckProblem.aspx' +WHERE MenuId='664ACF2F-6750-4389-AF11-F429010FC9A7' +GO + +--ȫHSE嵥˵Ȩ +IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '664ACF2F-6750-4389-AF11-F429010FC9A7') +BEGIN +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'AF673368-2D45-4415-AA7C-C67882635801', N'664ACF2F-6750-4389-AF11-F429010FC9A7', N'', 1); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'AF673368-2D45-4415-AA7C-C67882635802', N'664ACF2F-6750-4389-AF11-F429010FC9A7', N'޸', 2); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'AF673368-2D45-4415-AA7C-C67882635803', N'664ACF2F-6750-4389-AF11-F429010FC9A7', N'ɾ', 3); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) +VALUES (N'AF673368-2D45-4415-AA7C-C67882635804', N'664ACF2F-6750-4389-AF11-F429010FC9A7', N'', 4); +END +GO + +--drop table CheckProblem_Safety + +--ȫ嵥 +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'CheckProblem_Safety') AND type = N'U') +BEGIN +CREATE TABLE [dbo].[CheckProblem_Safety]( + [CheckId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NULL, + [UnitName] [nvarchar](200) NULL, + [ProjectId] [nvarchar](50) NULL, + [ProjectName] [nvarchar](200) NULL, + [State] [int] NOT NULL, + [Address] [nvarchar](200) NULL, + [Description] [nvarchar](max) NULL, + [UnitType] [nvarchar](20) NULL, + [AssemblyName] [nvarchar](100) NULL, + --[CheckUserId] [nvarchar](50) NULL, + [CheckTeamUser] [nvarchar](500) NULL, + [CheckDate] [datetime] NOT NULL, + [LimitDate] [datetime] NULL, + [CloseTime] [datetime] NULL, + [RectificationUserId] [nvarchar](50) NULL, + [RectificationUserName] [nvarchar](100) NULL, + [PMUserId] [nvarchar](50) NULL, + [PMUserName] [nvarchar](100) NULL, + [ClassifyId] [nvarchar](50) NULL, + [ClassifyItemId] [nvarchar](50) NULL, + [NatureId] [nvarchar](50) NULL, + [NatureItemId] [nvarchar](50) NULL, + [AttachUrl] [nvarchar](1000) NULL, + [RectificationUrl] [nvarchar](1000) NULL, + [Remark] [nvarchar](50) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileManName] [nvarchar](100) NULL, + [CompileDate] [datetime] NOT NULL, + CONSTRAINT [PK_CheckProblem_Safety] PRIMARY KEY CLUSTERED +( + [CheckId] 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] TEXTIMAGE_ON [PRIMARY] +ALTER TABLE [dbo].[CheckProblem_Safety] ADD CONSTRAINT [DF_CheckProblem_Safety_State] DEFAULT ((1)) FOR [State] +ALTER TABLE [dbo].[CheckProblem_Safety] ADD CONSTRAINT [DF_CheckProblem_Safety_CheckDate] DEFAULT (getdate()) FOR [CheckDate] +ALTER TABLE [dbo].[CheckProblem_Safety] ADD CONSTRAINT [DF_CheckProblem_Safety_CompileDate] DEFAULT (getdate()) FOR [CompileDate] + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'CheckId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܼ쵥λId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'UnitId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܼ쵥λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'UnitName' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܼĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'ProjectId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܼĿ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'ProjectName' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'״̬0ѱջ1У' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'State' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ŀڵַ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'Address' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'Description' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λͣа̡Ŀ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'UnitType' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ƣа̵дְƣ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'AssemblyName' +--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'CheckUserId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'顢' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'CheckTeamUser' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'CheckDate' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ֹ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'LimitDate' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ջʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'CloseTime' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'RectificationUserId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'RectificationUserName' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'PMUserId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ŀ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'PMUserName' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'ClassifyId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @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'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'NatureId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'NatureItemId' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ƬǰƬ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'AttachUrl' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĺƬ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'RectificationUrl' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'Remark' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'CompileMan' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'CompileManName' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety', @level2type=N'COLUMN',@level2name=N'CompileDate' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckProblem_Safety' + +END + +GO + + diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 02e610d7..2a2e64fa 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -301,6 +301,7 @@ + @@ -1206,7 +1207,9 @@ - + + + diff --git a/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs b/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs index c48482b5..115e1887 100644 --- a/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs +++ b/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs @@ -91,16 +91,16 @@ namespace BLL /// - /// 教材库下拉框 + /// 问题分类明细项下拉框 /// /// 下拉框名字 - /// 职务Id + /// 分类Id /// 是否显示请选择 - public static void InitClassifyItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease) + public static void InitClassifyItemDownList(FineUIPro.DropDownList dropName, string classifyId, bool isShowPlease) { dropName.DataValueField = "ClassifyItemId"; dropName.DataTextField = "ClassifyItemName"; - dropName.DataSource = GetClassifyItemList(workPostId); + dropName.DataSource = GetClassifyItemList(classifyId); dropName.DataBind(); if (isShowPlease) { diff --git a/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs b/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs index e5b767d6..3fe57ae7 100644 --- a/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs +++ b/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs @@ -85,12 +85,12 @@ namespace BLL } /// - /// 类型下拉框(末级) + /// 类型下拉框 /// /// /// /// - public static void InitClassifyIsEndDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + public static void InitClassifyDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) { dropName.DataValueField = "ClassifyId"; dropName.DataTextField = "ClassifyName"; diff --git a/SGGL/BLL/BaseInfo/SafetyProblemNatureItemService.cs b/SGGL/BLL/BaseInfo/SafetyProblemNatureItemService.cs index f2e42c37..608dd954 100644 --- a/SGGL/BLL/BaseInfo/SafetyProblemNatureItemService.cs +++ b/SGGL/BLL/BaseInfo/SafetyProblemNatureItemService.cs @@ -95,16 +95,16 @@ namespace BLL /// - /// 教材库下拉框 + /// 问题性质明细下拉框 /// /// 下拉框名字 - /// 职务Id + /// 性质Id /// 是否显示请选择 - public static void InitNatureItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease) + public static void InitNatureItemDownList(FineUIPro.DropDownList dropName, string natureId, bool isShowPlease) { dropName.DataValueField = "NatureItemId"; - dropName.DataTextField = "NatureItemName"; - dropName.DataSource = GetNatureItemList(workPostId); + dropName.DataTextField = "NatureItemContent"; + dropName.DataSource = GetNatureItemList(natureId); dropName.DataBind(); if (isShowPlease) { @@ -115,14 +115,14 @@ namespace BLL /// /// 获取下拉项 /// - /// + /// /// - public static List GetNatureItemList(string classifyId) + public static List GetNatureItemList(string natureId) { var lst = (from x in Funs.DB.Base_SafetyProblemNatureItem orderby x.NatureItemCode select x).ToList(); - if (!string.IsNullOrWhiteSpace(classifyId)) + if (!string.IsNullOrWhiteSpace(natureId)) { - lst = lst.Where(x => x.NatureId == classifyId).ToList(); + lst = lst.Where(x => x.NatureId == natureId).ToList(); } return lst; } diff --git a/SGGL/BLL/BaseInfo/SafetyProblemNatureService.cs b/SGGL/BLL/BaseInfo/SafetyProblemNatureService.cs index 716c0635..df18c421 100644 --- a/SGGL/BLL/BaseInfo/SafetyProblemNatureService.cs +++ b/SGGL/BLL/BaseInfo/SafetyProblemNatureService.cs @@ -90,7 +90,7 @@ namespace BLL /// /// /// - public static void InitNatureIsEndDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + public static void InitNatureDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) { dropName.DataValueField = "NatureId"; dropName.DataTextField = "NatureName"; diff --git a/SGGL/BLL/Check/HSE/CheckProblemSafetyService.cs b/SGGL/BLL/Check/HSE/CheckProblemSafetyService.cs new file mode 100644 index 00000000..78d1523d --- /dev/null +++ b/SGGL/BLL/Check/HSE/CheckProblemSafetyService.cs @@ -0,0 +1,213 @@ +using System; +using Model; +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 安全不符合项清单 + /// + public static class CheckProblemSafetyService + { + #region Fields + + public static Dictionary StateMap = new Dictionary + { + { "整改中" ,(int)StateInt.整改中}, + { "已闭环" ,(int)StateInt.已闭环}, + }; + + #endregion Fields + + #region Enums + + public enum StateInt : int + { + 整改中 = 1, + 已闭环 = 0 + } + + #endregion Enums + + #region Methods + + /// + /// 根据ID获取检查记录 + /// + /// 检查记录ID + /// 检查记录 + public static Model.CheckProblem_Safety GetCheckProblemById(string checkId) + { + return Funs.DB.CheckProblem_Safety.FirstOrDefault(e => e.CheckId == checkId); + } + + /// + /// 添加检查记录 + /// + /// 检查记录 + public static void AddCheckProblem(Model.CheckProblem_Safety model) + { + using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString)) + { + Model.CheckProblem_Safety newModel = new Model.CheckProblem_Safety + { + CheckId = model.CheckId, + UnitId = model.UnitId, + UnitName = model.UnitName, + ProjectId = model.ProjectId, + ProjectName = model.ProjectName, + State = model.State, + Address = model.Address, + Description = model.Description, + UnitType = model.UnitType, + AssemblyName = model.AssemblyName, + //CheckUserId = model.CheckUserId, + //CheckUserName = model.CheckUserName, + CheckTeamUser = model.CheckTeamUser, + CheckDate = model.CheckDate, + LimitDate = model.LimitDate, + CloseTime = model.CloseTime, + RectificationUserId = model.RectificationUserId, + RectificationUserName = model.RectificationUserName, + PMUserId = model.PMUserId, + PMUserName = model.PMUserName, + ClassifyId = model.ClassifyId, + ClassifyItemId = model.ClassifyItemId, + NatureId = model.NatureId, + NatureItemId = model.NatureItemId, + AttachUrl = model.AttachUrl, + RectificationUrl = model.RectificationUrl, + Remark = model.Remark, + CompileMan = model.CompileMan, + CompileManName = model.CompileManName, + CompileDate = DateTime.Now + }; + db.CheckProblem_Safety.InsertOnSubmit(newModel); + db.SubmitChanges(); + } + } + + /// + /// 更新检查记录 + /// + /// 检查记录 + public static void UpdateCheckProblem(Model.CheckProblem_Safety model) + { + using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString)) + { + Model.CheckProblem_Safety newModel = db.CheckProblem_Safety.FirstOrDefault(e => e.CheckId == model.CheckId); + if (newModel != null) + { + newModel.CheckDate = model.CheckDate; + newModel.UnitId = model.UnitId; + newModel.UnitName = model.UnitName; + newModel.ProjectId = model.ProjectId; + newModel.ProjectName = model.ProjectName; + newModel.State = model.State; + newModel.Address = model.Address; + newModel.Description = model.Description; + newModel.UnitType = model.UnitType; + newModel.AssemblyName = model.AssemblyName; + //newModel.CheckUserId = model.CheckUserId; + //newModel.CheckUserName = model.CheckUserName; + newModel.CheckTeamUser = model.CheckTeamUser; + newModel.CheckDate = model.CheckDate; + newModel.LimitDate = model.LimitDate; + newModel.CloseTime = model.CloseTime; + newModel.RectificationUserId = model.RectificationUserId; + newModel.RectificationUserName = model.RectificationUserName; + newModel.PMUserId = model.PMUserId; + newModel.PMUserName = model.PMUserName; + newModel.ClassifyId = model.ClassifyId; + newModel.ClassifyItemId = model.ClassifyItemId; + newModel.NatureId = model.NatureId; + newModel.NatureItemId = model.NatureItemId; + newModel.AttachUrl = model.AttachUrl; + newModel.RectificationUrl = model.RectificationUrl; + newModel.Remark = model.Remark; + db.SubmitChanges(); + } + } + } + + public static string ConvertState(int state) + { + string result = string.Empty; + result = StateMap.First(c => c.Value == state).Key; + return result; + } + + /// + /// 删除检查记录 + /// + /// 检查记录ID + public static void DeleteCheckProblemById(string checkId) + { + using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString)) + { + var model = db.CheckProblem_Safety.FirstOrDefault(e => e.CheckId == checkId); + if (model != null) + { + // 删除附件 + if (!string.IsNullOrEmpty(model.AttachUrl)) + { + BLL.UploadFileService.DeleteFile(Funs.RootPath, model.AttachUrl); + } + // 删除附件 + if (!string.IsNullOrEmpty(model.RectificationUrl)) + { + BLL.UploadFileService.DeleteFile(Funs.RootPath, model.RectificationUrl); + } + //// 删除编码记录 + //BLL.CodeRecordsService.DeleteCodeRecordsByDataId(checkId); + // 删除附件 + BLL.CommonService.DeleteAttachFileById(checkId); + + db.CheckProblem_Safety.DeleteOnSubmit(model); + db.SubmitChanges(); + } + } + } + + /// + /// 根据项目和时间段获取检查数量 + /// + /// 项目ID + /// 开始时间 + /// 结束时间 + /// 检查数量 + public static int GetCount(string projectId, DateTime startTime, DateTime endTime) + { + return (from x in Funs.DB.CheckProblem_Safety + where x.ProjectId == projectId && x.CheckDate >= startTime && x.CheckDate <= endTime + select x).Count(); + } + //public static int GetCount(string checkMainType) + //{ + // return (from x in Funs.DB.CheckProblem_Safety + // where x.CheckMainType == checkMainType + // select x.CheckProblemId).Count(); + //} + + + /// + /// 判断是否可以删除检查记录 + /// + /// 检查记录ID + /// true=可以删除,false=不能删除 + public static bool CanDeleteCheckProblem(string checkId) + { + var model = GetCheckProblemById(checkId); + if (model == null) + { + return false; + } + // 只有"整改中"状态可以删除,其他状态不能删除 + return model.State == (int)StateInt.整改中; + } + + + #endregion Methods + } +} diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 1697a864..ae9be174 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -1806,8 +1806,29 @@ namespace BLL public const string ProjectProjectMapMenuId = "F266456A-991F-45A3-BCD6-CF2515D71E39"; #endregion + #region 不符合项 + #region 不符合项导入模版 + + /// + /// 安全危害因素数据导入模板 + /// + public const string CheckProblemSafetyDataInTemplateUrl = "File\\Excel\\DataIn\\安全不符合项清单导入模板.xlsx"; + + #endregion + + #region 不符合项菜单 + + /// + /// HSE不符合清单 + /// + public const string SafetyCheckProblemMenuId = "664ACF2F-6750-4389-AF11-F429010FC9A7"; + + #endregion + + #region 不符合项基础字典 + /// /// 安全问题分类 /// @@ -1827,6 +1848,8 @@ namespace BLL #endregion + #endregion + #region 岗位培训 /// diff --git a/SGGL/BLL/LoginService.cs b/SGGL/BLL/LoginService.cs index 7fededfd..4a4c868c 100644 --- a/SGGL/BLL/LoginService.cs +++ b/SGGL/BLL/LoginService.cs @@ -10,8 +10,6 @@ namespace BLL public static class LoginService { - public static CNPCDB db = Funs.DB; - /// /// û¼ɹ /// diff --git a/SGGL/BLL/PZHGL/ProjectData/ProjectPageDataService.cs b/SGGL/BLL/PZHGL/ProjectData/ProjectPageDataService.cs index f47dfd62..8bef2369 100644 --- a/SGGL/BLL/PZHGL/ProjectData/ProjectPageDataService.cs +++ b/SGGL/BLL/PZHGL/ProjectData/ProjectPageDataService.cs @@ -1,14 +1,11 @@ namespace BLL { - using System.Collections.Generic; using System.Linq; using Model; using System; public static class ProjectPageDataService { - public static CNPCDB db = Funs.DB; - /// ///获取移动端首页 /// diff --git a/SGGL/BLL/ProjectData/ProjectService.cs b/SGGL/BLL/ProjectData/ProjectService.cs index d1bbc3cf..07beec47 100644 --- a/SGGL/BLL/ProjectData/ProjectService.cs +++ b/SGGL/BLL/ProjectData/ProjectService.cs @@ -202,6 +202,7 @@ select x).ToList(); return list; } + /// /// 项目属性下拉框 /// @@ -458,6 +459,31 @@ } #region 项目表下拉框 + + /// + /// 项目表下拉框 + /// + /// 下拉框名字 + /// 是否显示请选择 + public static void InitProjectDropDownList(FineUIPro.DropDownList dropName, string unitId, bool isShowPlease) + { + var IsThisUnit = CommonService.GetThisUnitId() == unitId ? true : false; + dropName.DataValueField = "ProjectId"; + dropName.DataTextField = "ProjectName"; + if (IsThisUnit) + { + dropName.DataSource = GetProjectWorkList(); + } + else + { + dropName.DataSource =GetProjectWorkList(unitId); + } + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } /// /// 项目表下拉框 /// diff --git a/SGGL/BLL/ProjectData/ProjectUserService.cs b/SGGL/BLL/ProjectData/ProjectUserService.cs index 2d9166d8..11bf3c67 100644 --- a/SGGL/BLL/ProjectData/ProjectUserService.cs +++ b/SGGL/BLL/ProjectData/ProjectUserService.cs @@ -6,8 +6,6 @@ public static class ProjectUserService { - public static CNPCDB db = Funs.DB; - /// ///获取项目用户信息 /// @@ -59,8 +57,8 @@ UnitId = projectUser.UnitId, RoleId = projectUser.RoleId, IsPost = projectUser.IsPost, - MainCNProfessionalId=projectUser.MainCNProfessionalId, - ViceCNProfessionalId=projectUser.ViceCNProfessionalId + MainCNProfessionalId = projectUser.MainCNProfessionalId, + ViceCNProfessionalId = projectUser.ViceCNProfessionalId }; //newProjectUser.RoleName = projectUser.RoleName; db.Project_ProjectUser.InsertOnSubmit(newProjectUser); @@ -154,7 +152,7 @@ public static List GetProjectUserByUnitidAndProjectId(string ProjectId, string UnitId, string RoleId) { - var ids = Funs.DB.Project_ProjectUser.Where(e => e.ProjectId == ProjectId &&( UnitId==""|| e.UnitId == UnitId)&&(RoleId==""||e.RoleId.Contains(RoleId)) ).Select(u => u.UserId).ToList(); + var ids = Funs.DB.Project_ProjectUser.Where(e => e.ProjectId == ProjectId && (UnitId == "" || e.UnitId == UnitId) && (RoleId == "" || e.RoleId.Contains(RoleId))).Select(u => u.UserId).ToList(); return Funs.DB.Sys_User.Where(u => ids.Contains(u.UserId)).ToList(); } @@ -170,5 +168,28 @@ where x.ProjectId == ProjectId && y.IdentityCard == IdentityCard select x).FirstOrDefault(); } + + /// + /// 根据项目Id获取项目所有在岗用户 + /// + /// + /// + /// + /// + public static List GetProjectUserByProjectId(string ProjectId, string UnitId, string RoleId) + { + var pUsers = Funs.DB.Project_ProjectUser.Where(e => e.ProjectId == ProjectId && e.IsPost == true).ToList(); + if (!string.IsNullOrWhiteSpace(UnitId)) + { + pUsers = pUsers.Where(x => x.UnitId == UnitId).ToList(); + } + if (!string.IsNullOrWhiteSpace(RoleId)) + { + pUsers = pUsers.Where(x => x.RoleId == RoleId).ToList(); + } + var ids = pUsers.Select(u => u.UserId).ToList(); + return Funs.DB.Sys_User.Where(u => ids.Contains(u.UserId)).ToList(); + } + } } \ No newline at end of file diff --git a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs index 28fe5cdf..61f786b9 100644 --- a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs +++ b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs @@ -124,13 +124,11 @@ namespace BLL #region 执行任务 public static void ExecuteTasks(string InterFaceTaskId) { - var model = GetInterFaceTaskById(InterFaceTaskId); var InterFaceSetlIds = model.InterFaceSetLists.Split(','); foreach (var item in InterFaceSetlIds) { ExecuteTasksByInterFaceSetlId(item); - } } /// @@ -149,7 +147,7 @@ namespace BLL if (InterfaceSetModel.IsSingleRequest == true) { var taskData = GetSingleRequestData(InterfaceSetModel.InterFaceUrl, InterfaceSetModel.RequestJsonBody, InterfaceSetModel.UrlReqMethod); - bool taskSuccess = taskData.code == 1; + bool taskSuccess = taskData != null && taskData.code == 1; InterFaceLogService.WriteInterFaceLog(InterFaceSetlId, InterfaceSetModel.RequestJsonBody, JsonConvert.SerializeObject(taskData), InterFaceLogService.Type1, taskSuccess); return; } diff --git a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs index 714bf12d..48b10be4 100644 --- a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs +++ b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs @@ -1,7 +1,6 @@ using FineUIPro; using Model; using Newtonsoft.Json; -using NPOI.POIFS.Crypt.Dsig; using System; using System.Collections; using System.Collections.Generic; @@ -11,8 +10,6 @@ namespace BLL { public static class CQMSDataService { - public static CNPCDB db = Funs.DB; - #region 获取列表 /// diff --git a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs index 6708a07c..3abc0b40 100644 --- a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs +++ b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs @@ -11,8 +11,6 @@ namespace BLL { public static class HJGLData_HJGLService { - public static CNPCDB db = Funs.DB; - #region 获取列表 /// diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs index a44de353..cc460382 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs @@ -4,16 +4,12 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Text; using Model; namespace BLL { public static class Project_HJGLData_DefectService { - public static CNPCDB db = Funs.DB; - - #region 获取列表 /// @@ -23,6 +19,7 @@ namespace BLL public static List GetProject_HJGLData_DefectByModle(Project_HJGLData_Defect table) { + var db = Funs.DB; var q = from x in db.Project_HJGLData_Defect where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && @@ -49,23 +46,24 @@ namespace BLL if (count == 0) return null; // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); return from x in q - select new - { - x.Id, - x.ProjectId, - x.UnitId, - x.CollCropCode, - x.UnitName, - x.ReportDate, - x.DefectName, - x.DefectNum - }; + select new + { + x.Id, + x.ProjectId, + x.UnitId, + x.CollCropCode, + x.UnitName, + x.ReportDate, + x.DefectName, + x.DefectNum + }; } #endregion public static Project_HJGLData_Defect GetProject_HJGLData_DefectById(string Id) { + var db = Funs.DB; return db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id); } @@ -75,17 +73,18 @@ namespace BLL /// /// /// - public static List GetProject_HJGLData_DefectByDate(DateTime? reportDate, - string projectid) + public static List GetProject_HJGLData_DefectByDate(DateTime? reportDate, string projectid) { + var db = Funs.DB; var q = from x in db.Project_HJGLData_Defect - where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid - select x; + where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid + select x; return q.ToList(); } public static void AddProject_HJGLData_Defect(Project_HJGLData_Defect newtable) { + var db = Funs.DB; var table = new Project_HJGLData_Defect { Id = newtable.Id, @@ -103,12 +102,14 @@ namespace BLL public static void AddBulkProject_HJGLData_Defect(List newtables) { + var db = Funs.DB; db.Project_HJGLData_Defect.InsertAllOnSubmit(newtables); db.SubmitChanges(); } public static void UpdateProject_HJGLData_Defect(Project_HJGLData_Defect newtable) { + var db = Funs.DB; var table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == newtable.Id); if (table != null) { @@ -126,6 +127,7 @@ namespace BLL public static void DeleteProject_HJGLData_DefectById(string Id) { + var db = Funs.DB; var table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id); if (table != null) { @@ -136,8 +138,8 @@ namespace BLL public static void DeleteProject_HJGLData_DefectByDate(DateTime? reportDate) { - var table = db.Project_HJGLData_Defect.Where(x => - x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); + var db = Funs.DB; + var table = db.Project_HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); if (table != null) { db.Project_HJGLData_Defect.DeleteAllOnSubmit(table); @@ -147,8 +149,8 @@ namespace BLL public static void DeleteProject_HJGLData_DefectByDate(DateTime? reportDate, string projectid) { - var table = db.Project_HJGLData_Defect.Where(x => - x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid); + var db = Funs.DB; + var table = db.Project_HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid); if (table != null) { db.Project_HJGLData_Defect.DeleteAllOnSubmit(table); @@ -162,11 +164,12 @@ namespace BLL /// public static bool IsReportByToday(string projectid, string type) { + var db = Funs.DB; var result = false; var q = (from x in Funs.DB.Project_HJGLData_Defect - where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && - x.ProjectId == projectid && x.DefectName == type - select x).ToList(); + where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && + x.ProjectId == projectid && x.DefectName == type + select x).ToList(); if (q != null && q.Count > 0) result = true; return result; } @@ -178,25 +181,27 @@ namespace BLL /// public static Project_HJGLData_Defect getTodayProject_HJGLData_Defect(string projectid, string type) { + var db = Funs.DB; var q = (from x in Funs.DB.Project_HJGLData_Defect - where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && - x.ProjectId == projectid && x.DefectName == type - select x).FirstOrDefault(); + where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date && + x.ProjectId == projectid && x.DefectName == type + select x).FirstOrDefault(); return q; } public static List getTodayProject_HJGLData_Defect() { + var db = Funs.DB; var q = (from x in Funs.DB.Project_HJGLData_Defect - where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date - group x by x.DefectName + where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date + group x by x.DefectName into g - select new HJGLDataDefectItems - { - Id = SQLHelper.GetNewID(), - DefectName = g.Key, - DefectNum = g.Sum(p => p.DefectNum) - }).ToList(); + select new HJGLDataDefectItems + { + Id = SQLHelper.GetNewID(), + DefectName = g.Key, + DefectNum = g.Sum(p => p.DefectNum) + }).ToList(); return q; } @@ -214,19 +219,19 @@ namespace BLL var baseUnit = UnitService.GetUnitByUnitId(thisUnitId); var data = (from x in db.CH_CheckItem join y in db.CH_Check on x.CHT_CheckID equals y.CHT_CheckID - where projectids.Contains(y.ProjectId) - group x by new { x.Defects_Definition, y.ProjectId } + where projectids.Contains(y.ProjectId) + group x by new { x.Defects_Definition, y.ProjectId } into g - select new - { - UnitId = thisUnitId, - CollCropCode = baseUnit.CollCropCode, - UnitName = baseUnit.UnitName, - ProjectId = g.Key.ProjectId, - ReportDate = DateTime.Now.Date, - DefectName = g.Key.Defects_Definition, - DefectNum = g.Count(x => x.Defects_Definition == g.Key.Defects_Definition) - }).ToList(); + select new + { + UnitId = thisUnitId, + CollCropCode = baseUnit.CollCropCode, + UnitName = baseUnit.UnitName, + ProjectId = g.Key.ProjectId, + ReportDate = DateTime.Now.Date, + DefectName = g.Key.Defects_Definition, + DefectNum = g.Count(x => x.Defects_Definition == g.Key.Defects_Definition) + }).ToList(); DeleteProject_HJGLData_DefectByDate(DateTime.Now.Date); //删除当前所有 var projectHjglDataDefect = new List(); foreach (var item in data @@ -255,14 +260,15 @@ namespace BLL /// public static void StatisticalData(string projectid) { + var db = Funs.DB; var thisUnitId = string.Empty; var thisUnit = CommonService.GetIsThisUnit(); if (thisUnit != null) thisUnitId = thisUnit.UnitId; var base_Unit = UnitService.GetUnitByUnitId(thisUnitId); var list = from x in db.CH_CheckItem - join y in db.CH_Check on x.CHT_CheckID equals y.CHT_CheckID - where y.ProjectId == projectid - select x; + join y in db.CH_Check on x.CHT_CheckID equals y.CHT_CheckID + where y.ProjectId == projectid + select x; var types = (from x in list select x.Defects_Definition).Distinct().ToList(); foreach (var t in types) if (!string.IsNullOrEmpty(t)) diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblem.aspx b/SGGL/FineUIPro.Web/Check/HSE/CheckProblem.aspx new file mode 100644 index 00000000..dce528ba --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblem.aspx @@ -0,0 +1,223 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckProblem.aspx.cs" Inherits="FineUIPro.Web.Check.HSE.CheckProblem" %> + + + + + + + + + 安全不符合项清单 + + + +
+ + + + + + + + + + <%-- + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblem.aspx.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblem.aspx.cs new file mode 100644 index 00000000..73f6b2f9 --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblem.aspx.cs @@ -0,0 +1,491 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +namespace FineUIPro.Web.Check.HSE +{ + public partial class CheckProblem : PageBase + { + /// + /// 项目id + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + //权限按钮方法 + GetButtonPower(); + InitDropDownList(); + + //Funs.FineUIPleaseSelect(this.dpState); + btnNew.OnClientClick = Window1.GetShowReference("CheckProblemEdit.aspx") + "return false;"; + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + + // 绑定表格 + BindGrid(); + } + } + + /// + /// 初始化下拉框 + /// + private void InitDropDownList() + { + ////受检单位 + //UnitService.InitBranchUnitDropDownList(this.drpUnit, true); + ////受检项目 + //ProjectService.InitProjectDropDownList(this.drpProject, true); + //问题分类 + SafetyProblemClassifyService.InitClassifyDropDownList(this.drpClassify, true); + //问题性质 + SafetyProblemNatureService.InitNatureDropDownList(this.drpNature, true); + } + + #endregion + + + #region 查询 + + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + + /// + /// 绑定数据 + /// + + public void BindGrid() + { + DataTable tb = ChecklistData(); + + // 2.获取当前分页数据 + //var table = this.GetPagedDataTable(Grid1, tb1); + + Grid1.RecordCount = tb.Rows.Count; + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var state = table.Rows[i]["State"].ToString().Trim(); + var limitDate = table.Rows[i]["LimitDate"].ToString(); + DateTime dtLimitDate = Convert.ToDateTime(limitDate); + if (Grid1.Rows[i].DataKeys[0] != null && !string.IsNullOrWhiteSpace(state) && state == "1") + { + if (dtLimitDate.AddDays(1) < DateTime.Now) //延期未整改 + { + Grid1.Rows[i].CellCssClasses[7] = "Red"; + } + else//期内未整改 + { + Grid1.Rows[i].CellCssClasses[7] = " Yellow "; + } + } + } + } + + /// + /// 数据加载 + /// + /// + protected DataTable ChecklistData() + { + StringBuilder sb = new StringBuilder(); + sb.Append("SELECT spc.ClassifyName,spcItem.ClassifyItemName,spn.NatureName,spnItem.NatureItemContent,tba.* "); + sb.Append("FROM CheckProblem_Safety AS tba WITH(NOLOCK) "); + sb.Append("LEFT JOIN Base_SafetyProblemClassify AS spc ON spc.ClassifyId=tba.ClassifyId "); + sb.Append("LEFT JOIN Base_SafetyProblemClassifyItem AS spcItem ON spcItem.ClassifyItemId=tba.ClassifyItemId "); + sb.Append("LEFT JOIN Base_SafetyProblemNature AS spn ON spn.NatureId=tba.NatureId "); + sb.Append("LEFT JOIN Base_SafetyProblemNatureItem AS spnItem ON spnItem.NatureItemId=tba.NatureItemId "); + sb.Append("WHERE 1=1 "); + + List listStr = new List(); + //listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + + if (!string.IsNullOrWhiteSpace(this.txtSearch.Text.Trim())) + { + sb.Append("AND (tba.UnitName LIKE @SearchTxt OR tba.ProjectName LIKE @SearchTxt OR tba.Description LIKE @SearchTxt OR tba.CheckTeamUser LIKE @SearchTxt) "); + listStr.Add(new SqlParameter("@SearchTxt", "%" + this.txtSearch.Text.Trim() + "%")); + } + if (!string.IsNullOrWhiteSpace(this.drpClassify.SelectedValue) && this.drpClassify.SelectedValue != Const._Null) + { + sb.Append("AND tba.ClassifyId=@ClassifyId "); + listStr.Add(new SqlParameter("@ClassifyId", this.drpClassify.SelectedValue)); + } + if (!string.IsNullOrWhiteSpace(this.drpNature.SelectedValue) && this.drpNature.SelectedValue != Const._Null) + { + sb.Append("AND tba.NatureId=@NatureId "); + listStr.Add(new SqlParameter("@NatureId", this.drpNature.SelectedValue)); + } + if (!string.IsNullOrWhiteSpace(this.rblState.SelectedValue)) + { + sb.Append("AND tba.State=@State "); + listStr.Add(new SqlParameter("@State", this.rblState.SelectedValue)); + } + if (!string.IsNullOrWhiteSpace(this.rblUnitType.SelectedValue)) + { + sb.Append("AND tba.UnitType=@UnitType "); + listStr.Add(new SqlParameter("@UnitType", this.rblUnitType.SelectedValue)); + } + string startDate = this.txtStartTime.Text.Trim(); + string endDate = this.txtEndTime.Text.Trim(); + if (!string.IsNullOrWhiteSpace(startDate)) + { + sb.Append("AND tba.CheckDate >= @StartDate "); + listStr.Add(new SqlParameter("@StartDate", startDate)); + } + if (!string.IsNullOrWhiteSpace(endDate)) + { + sb.Append("AND tba.CheckDate <= @EndDate "); + listStr.Add(new SqlParameter("@EndDate", $"{endDate} 23:59:59")); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter); + return tb; + } + + #endregion + + /***整改前、后照片*** + + protected string ConvertImageUrlByImage(object registrationId) + { + string url = string.Empty; + if (registrationId != null) + { + IList sourlist = AttachFileService.GetBeforeFileList(registrationId.ToString(), BLL.Const.SafetyCheckProblemMenuId); + + if (sourlist != null&& sourlist.Count>0) + { + string AttachUrl = ""; + foreach(var item in sourlist) + { if(!string.IsNullOrEmpty(item.AttachUrl)&& item.AttachUrl.ToLower().EndsWith(".jpg")|| item.AttachUrl.ToLower().EndsWith(".jpeg")|| item.AttachUrl.ToLower().EndsWith(".png")) + AttachUrl += item.AttachUrl.TrimEnd(',')+","; + } + url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["CEMS_IMG_URL"], AttachUrl.TrimEnd(',')); + } + } + return url; + } + protected string ConvertImgUrlByImage(object registrationId) + { + string url = string.Empty; + if (registrationId != null) + { + IList sourlist = AttachFileService.Getfilelist(registrationId.ToString()+"r", BLL.Const.SafetyCheckProblemMenuId); + + if (sourlist != null && sourlist.Count > 0) + { + string AttachUrl = ""; + foreach (var item in sourlist) + { + if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png")) + AttachUrl += item.AttachUrl.TrimEnd(',') + ","; + } + url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["CEMS_IMG_URL"], AttachUrl.TrimEnd(',')); + } + } + return url; + } + + ******/ + + /// + /// 检查问题状态 + /// + /// + /// + public string ConvertStates(Object obj) + { + string result = "整改中"; + string state = obj.ToString(); + if (state == "0") + { + result = "已闭环"; + } + else + { //闭环 + result = "整改中"; + } + return result; + } + + + #region 过滤表头、排序、分页、关闭窗口 + /// + /// 过滤表头 + /// + /// + /// + protected void Grid1_FilterChange(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + //Grid1.SortDirection = e.SortDirection; + //Grid1.SortField = e.SortField; + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 鼠标操作事件 + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + btnMenuModify_Click(null, null); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnMenuModify_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string checkId = Grid1.SelectedRowID; + var model = CheckProblemSafetyService.GetCheckProblemById(checkId); + if (model != null) + { + if (model.State == (int)CheckProblemSafetyService.StateInt.已闭环) //双击事件 已闭环 + { + Alert.ShowInTop("当前隐患已闭环,无法编辑,请右键查看!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckProblemEdit.aspx?CheckId={0}", checkId), "编辑安全不符合项")); + return; + } + } + + /// + /// 右键删除 + /// + /// + /// + protected void btnMenuDel_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string checkId = Grid1.SelectedRowID; + var model = CheckProblemSafetyService.GetCheckProblemById(checkId); + if (model != null) + { + if (model.State == (int)CheckProblemSafetyService.StateInt.已闭环)//双击事件 已闭环 + { + Alert.ShowInTop("当前隐患已闭环,无法删除!", MessageBoxIcon.Warning); + return; + } + else + { + BLL.CheckProblemSafetyService.DeleteCheckProblemById(checkId); + BLL.LogService.AddSys_Log(this.CurrUser, model.CheckId, model.CheckId, BLL.Const.SafetyCheckProblemMenuId, "删除HSE不符合记录"); + Grid1.DataBind(); + BindGrid(); + Alert.ShowInTop("删除数据成功!", MessageBoxIcon.Success); + } + } + } + + /// + /// 右击查看明细 + /// + /// + /// + protected void btnMenuView_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string checkId = Grid1.SelectedRowID; + var model = CheckProblemSafetyService.GetCheckProblemById(checkId); + if (model != null) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckProblemView.aspx?CheckId={0}", checkId), "查看安全不符合项")); + } + } + /// + /// 查询按钮 + /// + /// + /// + protected void btnQuery_Click(object sender, EventArgs e) + { + BindGrid(); + } + /// + /// 条件重置 + /// + /// + /// + protected void btnRset_Click(object sender, EventArgs e) + { + rblUnitType.SelectedIndex = 0; + drpClassify.SelectedIndex = 0; + drpNature.SelectedIndex = 0; + rblState.SelectedIndex = 0; + txtSearch.Text = ""; + txtStartTime.Text = ""; + txtEndTime.Text = ""; + BindGrid(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.SafetyCheckProblemMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + this.btnImport.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuModify.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + } + } + #endregion + + #region 导入 + + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckProblemIn.aspx"), "导入安全不符合项")); + } + + #endregion + + #region 导出 + + + /// + /// 导出 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("安全不符合项清单" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 100000; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblem.aspx.designer.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblem.aspx.designer.cs new file mode 100644 index 00000000..04c27815 --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblem.aspx.designer.cs @@ -0,0 +1,278 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.Check.HSE +{ + + + public partial class CheckProblem + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// txtSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSearch; + + /// + /// rblUnitType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rblUnitType; + + /// + /// drpClassify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpClassify; + + /// + /// drpNature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpNature; + + /// + /// btnRset 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRset; + + /// + /// btnQuery 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtStartTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStartTime; + + /// + /// Label5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label5; + + /// + /// txtEndTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndTime; + + /// + /// rblState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rblState; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// lbState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbState; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + + /// + /// btnMenuView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuView; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } +} diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx new file mode 100644 index 00000000..facda7a6 --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx @@ -0,0 +1,193 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckProblemEdit.aspx.cs" Inherits="FineUIPro.Web.Check.HSE.CheckProblemEdit" %> + + + + + + 安全不符合项清单 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + --%> + + + + + + + + + + + + + + + + + <%-- + --%> + <%-- + --%> + + + + + + + + + + + + + + + + + + <%----%> + + diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.cs new file mode 100644 index 00000000..254e8242 --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.cs @@ -0,0 +1,387 @@ +using BLL; +using Model; +using System; + +namespace FineUIPro.Web.Check.HSE +{ + public partial class CheckProblemEdit : PageBase + { + #region 公共字段 + /// + /// 主键 + /// + public string CheckId + { + get + { + return (string)ViewState["CheckId"]; + } + set + { + ViewState["CheckId"] = value; + } + } + + #endregion + + /// + /// 图片是否可以编辑 -1查看 0编辑 + /// + public int QuestionImg + { + get + { + return Convert.ToInt32(ViewState["QuestionImg"]); + } + set + { + ViewState["QuestionImg"] = value; + } + } + + /// + /// 页面初始化加载 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CheckId = Request.Params["CheckId"]; + this.InitDropDownList(); + + var model = CheckProblemSafetyService.GetCheckProblemById(this.CheckId); + if (model != null) + { + this.drpUnit.SelectedValue = model.UnitId; + BLL.ProjectService.InitProjectDropDownList(this.drpProject, model.UnitId, true); + if (!string.IsNullOrWhiteSpace(model.ProjectId)) + { + this.drpProject.SelectedValue = model.ProjectId; + } + else if (!string.IsNullOrWhiteSpace(model.ProjectName)) + { + this.drpProject.Text = model.ProjectName; + } + this.drpClassify.SelectedValue = model.ClassifyId; + BLL.SafetyProblemClassifyItemService.InitClassifyItemDownList(this.drpClassifyItem, model.ClassifyId, true); + if (!string.IsNullOrWhiteSpace(model.ClassifyItemId)) + { + this.drpClassifyItem.SelectedValue = model.ClassifyItemId; + } + this.drpNature.SelectedValue = model.NatureId; + BLL.SafetyProblemNatureItemService.InitNatureItemDownList(this.drpNatureItem, model.NatureId, true); + if (!string.IsNullOrWhiteSpace(model.NatureItemId)) + { + this.drpNatureItem.SelectedValue = model.NatureItemId; + } + this.txtAddress.Text = model.Address; + this.rblUnitType.SelectedValue = model.UnitType; + this.txtAssemblyName.Text = model.AssemblyName; + this.txtDescription.Text = model.Description; + this.txtRemark.Text = model.Remark; + this.txtCheckTeamUser.Text = model.CheckTeamUser; + //if (!string.IsNullOrWhiteSpace(model.CheckUserId)) + //{ + // this.drpCheckUser.SelectedValue = model.CheckUserId; + //} + if (!string.IsNullOrWhiteSpace(model.RectificationUserId)) + { + this.drpRectificationUser.SelectedValue = model.RectificationUserId; + } + if (!string.IsNullOrWhiteSpace(model.PMUserId)) + { + this.drpPMUser.SelectedValue = model.PMUserId; + } + this.txtCompileManName.Text = model.CompileManName; + if (model.CheckDate != null) + { + this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", model.CheckDate); + } + if (model.LimitDate != null) + { + this.txtLimitDate.Text = string.Format("{0:yyyy-MM-dd}", model.LimitDate); + } + if (model.CloseTime != null) + { + this.txtCloseTime.Text = string.Format("{0:yyyy-MM-dd}", model.CloseTime); + } + if (model.CompileDate != null) + { + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate); + } + } + else + { + this.txtCompileManName.Text = this.CurrUser.UserName; + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + } + } + } + + #region 下拉数据加载 + + /// + /// 初始化下拉框 + /// + private void InitDropDownList() + { + //受检单位 + UnitService.InitBranchUnitDropDownList(this.drpUnit, false); + //受检项目 + ProjectService.InitProjectDropDownList(this.drpProject, true); + //问题分类 + SafetyProblemClassifyService.InitClassifyDropDownList(this.drpClassify, false); + //问题性质 + SafetyProblemNatureService.InitNatureDropDownList(this.drpNature, false); + } + + /// + /// 受检单位下拉触发事件 + /// + /// + /// + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + //this.drpProject.Items.Clear(); + ////受检项目 + //BLL.ProjectService.InitProjectDropDownList(this.drpProject, this.drpUnit.SelectedValue, true); + + this.drpRectificationUser.Items.Clear(); + BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, this.drpUnit.SelectedValue, true); + this.drpPMUser.Items.Clear(); + BLL.UserService.InitUserUnitIdDropDownList(this.drpPMUser, this.drpUnit.SelectedValue, true); + } + + /// + /// 受检项目下拉触发事件 + /// + /// + /// + protected void drpProject_SelectedIndexChanged(object sender, EventArgs e) + { + string proId = this.drpProject.SelectedValue; + if (!string.IsNullOrWhiteSpace(proId) && proId != Const._Null) + { + var pro = BLL.ProjectService.GetProjectByProjectId(proId); + if (pro != null) + { + this.txtAddress.Text = pro.ProjectAddress; + this.drpPMUser.Items.Clear(); + BLL.UserService.InitUserDropDownList(this.drpPMUser, proId, true); + } + } + } + + /// + /// 问题分类下拉触发事件 + /// + /// + /// + protected void drpClassify_SelectedIndexChanged(object sender, EventArgs e) + { + if (!string.IsNullOrWhiteSpace(this.drpClassify.SelectedValue)) + { + this.drpClassifyItem.Items.Clear(); + BLL.SafetyProblemClassifyItemService.InitClassifyItemDownList(this.drpClassifyItem, this.drpClassify.SelectedValue, true); + } + } + /// + /// 问题性质下拉触发事件 + /// + /// + /// + protected void drpNature_SelectedIndexChanged(object sender, EventArgs e) + { + if (!string.IsNullOrWhiteSpace(this.drpNature.SelectedValue)) + { + this.drpNatureItem.Items.Clear(); + BLL.SafetyProblemNatureItemService.InitNatureItemDownList(this.drpNatureItem, this.drpNature.SelectedValue, true); + } + } + + #endregion + + + #region 附件上传 + /// + /// 上传附件 + /// + /// + /// + protected void btnAttach_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckProblemSafety&menuId={1}", this.CheckId, BLL.Const.SafetyCheckProblemMenuId))); + } + #endregion + + + + //protected void imgBtnFile_Click(object sender, EventArgs e) + //{ + // PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/CheckProblemSafety&menuId={2}", QuestionImg, this.hdCheckControlCode.Text, BLL.Const.SafetyCheckProblemMenuId))); + //} + + /// + /// 保存 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + //if (this.drpUnit.SelectedValue == BLL.Const._Null) + //{ + // Alert.ShowInTop("请选择受检单位!", MessageBoxIcon.Warning); + // return; + //} + //if (string.IsNullOrWhiteSpace(this.drpClassify.SelectedValue) || this.drpClassify.SelectedValue == BLL.Const._Null) + //{ + // Alert.ShowInTop("请选择问题分类!", MessageBoxIcon.Warning); + // return; + //} + //if (string.IsNullOrWhiteSpace(this.drpNature.SelectedValue) || this.drpNature.SelectedValue == BLL.Const._Null) + //{ + // Alert.ShowInTop("请选择问题性质!", MessageBoxIcon.Warning); + // return; + //} + //if (string.IsNullOrWhiteSpace(this.txtDescription.Text.Trim())) + //{ + // Alert.ShowInTop("请填写问题描述!", MessageBoxIcon.Warning); + // return; + //} + //if (string.IsNullOrWhiteSpace(this.txtCheckTeamUser.Text.Trim())) + //{ + // Alert.ShowInTop("请填写检查组/检查人!", MessageBoxIcon.Warning); + // return; + //} + //if (string.IsNullOrWhiteSpace(this.drpRectificationUser.SelectedValue) || this.drpRectificationUser.SelectedValue == BLL.Const._Null) + //{ + // Alert.ShowInTop("请选择整改人!", MessageBoxIcon.Warning); + // return; + //} + //if (string.IsNullOrWhiteSpace(this.drpPMUser.SelectedValue) || this.drpPMUser.SelectedValue == BLL.Const._Null) + //{ + // Alert.ShowInTop("请选择项目经理!", MessageBoxIcon.Warning); + // return; + //} + //if (string.IsNullOrWhiteSpace(this.txtCheckDate.Text.Trim())) + //{ + // Alert.ShowInTop("请选择检查日期!", MessageBoxIcon.Warning); + // return; + //} + //if (string.IsNullOrWhiteSpace(this.txtLimitDate.Text.Trim())) + //{ + // Alert.ShowInTop("请选择整改期限!", MessageBoxIcon.Warning); + // return; + //} + SaveData(); + + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + ///// + ///// 提交 + ///// + ///// + ///// + //protected void btnSubmit_Click(object sender, EventArgs e) + //{ + // if (BLL.CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyCheckProblemMenuId, BLL.Const.BtnSubmit)) + // { + + // if (string.IsNullOrEmpty(Request.Params["Main"])) + // { + // PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + // } + // else + // { + // PageContext.RegisterStartupScript(String.Format("window.close();")); + // } + // } + // else + // { + // Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + // } + //} + + /// + /// 保存数据 + /// + protected void SaveData() + { + CheckProblem_Safety model = new CheckProblem_Safety(); + model.UnitId = this.drpUnit.SelectedValue; + model.UnitName = this.drpUnit.SelectedText; + string proId = this.drpProject.SelectedValue; + if (!string.IsNullOrWhiteSpace(proId) && proId != Const._Null) + { + model.ProjectId = this.drpProject.SelectedValue; + model.ProjectName = this.drpProject.SelectedText; + } + //else + //{ + // model.ProjectName = this.drpUnit.SelectedText; + //} + model.Address = this.txtAddress.Text.Trim(); + model.Description = this.txtDescription.Text.Trim(); + model.UnitType = this.rblUnitType.SelectedValue; + model.AssemblyName = this.txtAssemblyName.Text.Trim(); + model.CheckTeamUser = this.txtCheckTeamUser.Text.Trim(); + model.CheckDate = Funs.GetNewDateTimeOrNow(this.txtCheckDate.Text.Trim()); + model.LimitDate = Funs.GetNewDateTime(this.txtLimitDate.Text.Trim()); + if (!string.IsNullOrWhiteSpace(this.txtCloseTime.Text.Trim())) + { + model.CloseTime = Funs.GetNewDateTime(this.txtCloseTime.Text.Trim()); + model.State = (int)CheckProblemSafetyService.StateInt.已闭环; + } + else + { + model.State = (int)CheckProblemSafetyService.StateInt.整改中; + } + model.RectificationUserId = this.drpRectificationUser.SelectedValue; + model.RectificationUserName = this.drpRectificationUser.SelectedText; + model.PMUserId = this.drpPMUser.SelectedValue; + model.PMUserName = this.drpPMUser.SelectedText; + model.ClassifyId = this.drpClassify.SelectedValue; + string classifyItemId = this.drpClassifyItem.SelectedValue; + if (!string.IsNullOrWhiteSpace(classifyItemId) && classifyItemId != Const._Null) + { + model.ClassifyItemId = classifyItemId; + } + model.NatureId = this.drpNature.SelectedValue; + string natureItemId = this.drpNatureItem.SelectedValue; + if (!string.IsNullOrWhiteSpace(natureItemId) && natureItemId != Const._Null) + { + model.NatureItemId = natureItemId; + } + model.Remark = this.txtRemark.Text.Trim(); + if (string.IsNullOrWhiteSpace(this.CheckId)) + { + //新增 + model.CheckId = SQLHelper.GetNewID(typeof(CheckProblem_Safety)); + this.CheckId = model.CheckId; + model.CompileMan = this.CurrUser.UserId; + model.CompileManName = this.CurrUser.UserName; + model.CompileDate = DateTime.Now; + BLL.CheckProblemSafetyService.AddCheckProblem(model); + + ////增加一条编码记录 + //BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.SafetyCheckProblemMenuId, model.ProjectId, null, model.CheckId, model.CheckDate); + } + else + { + //更新 + model.CheckId = this.CheckId; + BLL.CheckProblemSafetyService.UpdateCheckProblem(model); + } + } + + + protected void WindowAtt_Close(object sender, WindowCloseEventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.designer.cs new file mode 100644 index 00000000..8103f4e9 --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemEdit.aspx.designer.cs @@ -0,0 +1,314 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.Check.HSE +{ + + + public partial class CheckProblemEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnit; + + /// + /// drpProject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProject; + + /// + /// rblUnitType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rblUnitType; + + /// + /// txtAddress 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAddress; + + /// + /// txtAssemblyName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAssemblyName; + + /// + /// drpClassify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpClassify; + + /// + /// drpClassifyItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpClassifyItem; + + /// + /// drpNature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpNature; + + /// + /// drpNatureItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpNatureItem; + + /// + /// txtDescription 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription; + + /// + /// txtCheckTeamUser 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCheckTeamUser; + + /// + /// txtCheckDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCheckDate; + + /// + /// drpRectificationUser 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpRectificationUser; + + /// + /// txtLimitDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtLimitDate; + + /// + /// drpPMUser 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpPMUser; + + /// + /// txtCloseTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCloseTime; + + /// + /// txtCompileManName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileManName; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnAttach 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttach; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdId; + + /// + /// hdAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdAttachUrl; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// 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/Check/HSE/CheckProblemIn.aspx b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx new file mode 100644 index 00000000..84559e9c --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx @@ -0,0 +1,73 @@ +<%@ Page Language="C#" CodeBehind="CheckProblemIn.aspx.cs" Inherits="FineUIPro.Web.Check.HSE.CheckProblemIn" %> + + + + + + + + 导入 + + +
+ + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.cs new file mode 100644 index 00000000..c3d16867 --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.cs @@ -0,0 +1,716 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.IO; +using System.Linq; + +namespace FineUIPro.Web.Check.HSE +{ + public partial class CheckProblemIn : PageBase + { + #region 定义变量 + + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + + /// + /// 错误集合 + /// + public static List errorInfos = new List(); + /// + /// 问题分类 + /// + public static List classifys = new List(); + /// + /// 问题分类明细 + /// + public static List classifyItems = new List(); + /// + /// 问题性质 + /// + public static List natures = new List(); + /// + /// 问题性质明细 + /// + public static List natureItems = new List(); + + ///// + ///// 项目id + ///// + //public string ProjectId + //{ + // get + // { + // return (string)ViewState["ProjectId"]; + // } + // set + // { + // ViewState["ProjectId"] = value; + // } + //} + ///// + ///// 单位id + ///// + //public string UnitId + //{ + // get + // { + // return (string)ViewState["UnitId"]; + // } + // set + // { + // ViewState["UnitId"] = value; + // } + //} + + /// + /// 操作人 + /// + public string CompileMan + { + get + { + return (string)ViewState["CompileMan"]; + } + set + { + ViewState["CompileMan"] = value; + } + } + public string CompileManName + { + get + { + return (string)ViewState["CompileManName"]; + } + set + { + ViewState["CompileManName"] = value; + } + } + + /// + /// 导入表格列数 + /// + public static int Cols = 17; + + /// + /// 单位类型 + /// + public static List validUnitTypeStrings = new List { "承包商", "项目部" }; + /// + /// 在岗用户 + /// + public static List users = new List(); + + #endregion + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //users = BLL.ProjectUserService.GetProjectUserByProjectId(this.ProjectId,null,null); + //获取所有在岗用户 + users = BLL.UserService.GetProjectUserListByProjectId(null); + + classifys = SafetyProblemClassifyService.GetClassify(); + classifyItems = SafetyProblemClassifyItemService.GetClassifyItemList(""); + natures = SafetyProblemNatureService.GetNature(); + natureItems = SafetyProblemNatureItemService.GetNatureItemList(""); + + this.CompileMan = this.CurrUser.UserId; + this.CompileManName = this.CurrUser.UserName; + this.hdFileName.Text = string.Empty; + if (errorInfos != null) + { + errorInfos.Clear(); + } + + //if (this.CurrUser.UserId == Const.AdminId) + //{ + // this.btnFastImport.Hidden = false; + //} + } + } + + #region 下载模板 + + /// + /// 下载模板按钮 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + //这里要注意了,如果传过来的没有记录 + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, + MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), + PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + Const.CheckProblemSafetyDataInTemplateUrl; + string filePath = Const.CheckProblemSafetyDataInTemplateUrl; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + } + + #endregion + + #region 审核 + /// + /// 审核 + /// + /// + /// + protected void btnAudit_Click(object sender, EventArgs e) + { + try + { + if (this.fuAttachUrl.HasFile == false) + { + ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls" && IsXls != ".xlsx") + { + ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning); + return; + } + if (errorInfos != null) + { + errorInfos.Clear(); + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls; + string filePath = initFullPath + this.hdFileName.Text; + this.fuAttachUrl.PostedFile.SaveAs(filePath); + AuditExcelAndShowResult(filePath); + } + catch (Exception ex) + { + ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + + /// + /// 审核Excel并展示校验结果 + /// + private void AuditExcelAndShowResult(string fileName) + { + try + { + string msg = string.Empty; + var dt = BLL.Common.NPOIHelper.ExcelToDataSet(fileName, out msg, true); + if (dt != null) + { + //string rootPath = Server.MapPath("~/"); + //var localPath = ConfigurationManager.AppSettings["localRoot"]; + //imgDic = NPOIHelper.ExtractDispimgImagesFromXml(rootPath + initPath + this.hdFileName.Text, localPath + "FileUpload/CheckSpecial"); + ValidateExcelData(dt.Tables[0], false); + hdCheckResult.Text = "1"; + } + } + catch (Exception exc) + { + BLL.ErrLogInfo.WriteLog("", exc); + Response.Write(exc); + } + } + + /// + /// 校验Excel数据(仅校验) + /// + /// + /// true:导入;false:审核 + /// + private bool ValidateExcelData(DataTable pds, bool import) + { + int ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify($"导入Excel格式错误!Excel只有{ic}列", MessageBoxIcon.Warning); + return false; + } + int ir = pds.Rows.Count; + if (pds == null || ir <= 0) + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + return false; + } + var errors = new List(); + for (int i = 0; i < ir; i++) + { + var (error, _) = ValidateRowAndBuildEntity(pds.Rows[i], (i + 2).ToString(), import); + if (error.Any()) { errors.AddRange(error); } + } + errorInfos.Clear(); + errorInfos.AddRange(errors); + this.gvErrorInfo.DataSource = errorInfos; + this.gvErrorInfo.DataBind(); + if (errors.Count > 0) + { + ShowNotify("存在校验错误,请查看错误列表并修正后再次导入。", MessageBoxIcon.Warning); + return false; + } + ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success); + return true; + } + + + /// + /// 校验单行并生成实体(字段顺序与新模板一致) + /// + private (List lstError, Model.CheckProblem_Safety entity) ValidateRowAndBuildEntity(DataRow row, string displayRow, bool import) + { + List lstError = new List(); + // 新模板字段顺序 + string rData0 = row[0]?.ToString().Trim(); // 受检单位 + string rData1 = row[1]?.ToString().Trim(); // 受检项目 + string rData2 = row[2]?.ToString().Trim(); // 项目所在地(省市) + string rData3 = row[3]?.ToString().Trim(); // 不符合项描述 + string rData4 = row[4]?.ToString().Trim(); // 单位类型 + string rData5 = row[5]?.ToString().Trim(); // 机组名称 + string rData6 = row[6]?.ToString().Trim(); // 提出人 + string rData7 = row[7]?.ToString().Trim(); // 提出日期 + string rData8 = row[8]?.ToString().Trim(); // 截止日期 + string rData9 = row[9]?.ToString().Trim(); // 整改人 + string rData10 = row[10]?.ToString().Trim(); // 闭合日期 + string rData11 = row[11]?.ToString().Trim(); // 项目经理 + string rData12 = row[12]?.ToString().Trim(); // 问题分类 + string rData13 = row[13]?.ToString().Trim(); // 分类明细 + string rData14 = row[14]?.ToString().Trim(); // 问题性质 + string rData15 = row[15]?.ToString().Trim(); // 性质明细 + string rData16 = row[16]?.ToString().Trim(); // 备注 + + + string UnitId = string.Empty; + string UnitName = string.Empty; + string ProjectId = null; + string ProjectName = null; + int State = 1; + string Address = string.Empty; + string Description = string.Empty; + string UnitType = string.Empty; + string AssemblyName = string.Empty; + //string CheckUserId = string.Empty; + //string CheckUserName = string.Empty; + string CheckTeamUser = string.Empty; + DateTime CheckDate = DateTime.Now; + DateTime LimitDate = DateTime.Now; + DateTime? CloseTime = null; + string RectificationUserId = string.Empty; + string RectificationUserName = string.Empty; + string PMUserId = string.Empty; + string PMUserName = string.Empty; + string ClassifyId = string.Empty; + string ClassifyItemId = string.Empty; + string NatureId = string.Empty; + string NatureItemId = string.Empty; + string Remark = string.Empty; + + // 校验并转换 + if (!string.IsNullOrWhiteSpace(rData0)) + { + var unit = BLL.UnitService.getUnitByUnitName(rData0); + if (unit != null) + { + UnitId = unit.UnitId; + UnitName = unit.UnitName; + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "受检单位", Reason = $"未找到单位:{rData0};请确认单位名称是否有误!" }); + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "受检单位", Reason = "受检单位必填" }); + } + if (!string.IsNullOrWhiteSpace(rData1)) + { + var project = BLL.ProjectService.GetProjectByProjectName(rData1); + if (project != null) + { + ProjectId = project.ProjectId; + ProjectName = project.ProjectName; + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "受检项目", Reason = $"未找到项目:{rData1};请确认项目名称是否有误!" }); + } + } + //else + //{ + // lstError.Add(new ErrorInfo { Row = displayRow, Column = "受检项目", Reason = "受检项目必填" }); + //} + + if (!string.IsNullOrEmpty(rData2)) + { + Address = rData2; + } + if (!string.IsNullOrEmpty(rData3)) + { + Description = rData3; + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "不符合描述", Reason = "不符合描述必填!" }); + } + if (!string.IsNullOrEmpty(rData4)) + { + if (!validUnitTypeStrings.Any(x => x == rData4)) + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "单位类型", Reason = "只能是[承包商/项目部]!" }); + } + else + { + UnitType = rData4; + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "单位类型", Reason = "单位类型必选!" }); + } + if (!string.IsNullOrEmpty(rData5)) + { + AssemblyName = rData5; + } + //else + //{ + // lstError.Add(new ErrorInfo { Row = displayRow, Column = "机组名称", Reason = "机组名称必填!" }); + //} + + if (!string.IsNullOrEmpty(rData6)) + { + CheckTeamUser = rData6; + //var user = users.Where(x => x.UserName == rData6).FirstOrDefault(); + //if (user != null) + //{ + // CheckUserId = user.UserId; + // CheckUserName = rData6; + //} + //else + //{ + // lstError.Add(new ErrorInfo { Row = displayRow, Column = "提出人", Reason = $"系统不存在人员[{rData6}]!" }); + //} + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "提出人", Reason = "提出人必填!" }); + } + if (!string.IsNullOrEmpty(rData7)) + { + if (!DateTime.TryParse(rData7, out DateTime ct)) + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "提出日期", Reason = "提出日期格式错误[正确格式:yyyy-MM-dd,2026-06-01]" }); + } + else + { + CheckDate = ct; + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "提出日期", Reason = "不能为空" }); + } + if (!string.IsNullOrEmpty(rData8)) + { + if (!DateTime.TryParse(rData8, out DateTime ct)) + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "截止日期", Reason = "截止日期格式错误[正确格式:yyyy-MM-dd,2026-06-01]" }); + } + else + { + LimitDate = ct; + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "截止日期", Reason = "不能为空" }); + } + if (!string.IsNullOrEmpty(rData9)) + { + var user = users.Where(x => x.UserName == rData9).FirstOrDefault(); + if (user != null) + { + RectificationUserId = user.UserId; + RectificationUserName = rData9; + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "整改人", Reason = $"系统不存在人员[{rData9}]!" }); + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "整改人", Reason = "整改人必填!" }); + } + if (!string.IsNullOrEmpty(rData10)) + { + if (!DateTime.TryParse(rData10, out DateTime ct)) + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "闭合日期", Reason = "闭合日期格式错误[正确格式:yyyy-MM-dd,2026-06-01]" }); + } + else + { + CloseTime = ct; + State = (int)CheckProblemSafetyService.StateInt.已闭环; + } + } + //else + //{ + // lstError.Add(new ErrorInfo { Row = displayRow, Column = "闭合日期", Reason = "不能为空" }); + //} + if (!string.IsNullOrEmpty(rData11)) + { + var user = users.Where(x => x.UserName == rData11).FirstOrDefault(); + if (user != null) + { + PMUserId = user.UserId; + PMUserName = rData11; + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "项目经理", Reason = $"系统不存在人员[{rData11}]!" }); + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "项目经理", Reason = "项目经理必填!" }); + } + if (!string.IsNullOrEmpty(rData12)) + {//问题分类 + var classify = classifys.Where(x => x.ClassifyName == rData12).FirstOrDefault(); + if (classify != null) + { + ClassifyId = classify.ClassifyId; + if (!string.IsNullOrEmpty(rData13)) + {//问题分类明细 + var classifyItem = classifyItems.Where(x => x.ClassifyItemName == rData13).FirstOrDefault(); + if (classifyItem != null) + { + ClassifyItemId = classifyItem.ClassifyItemId; + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "问题分类明细", Reason = $"系统不存在问题分类明细[{rData13}],请检查名称是否正确!" }); + } + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "问题分类", Reason = $"系统不存在问题分类[{rData12}],请检查名称是否正确!" }); + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "问题分类", Reason = "问题分类必填!" }); + } + if (!string.IsNullOrEmpty(rData14)) + {//问题性质 + var nature = natures.Where(x => x.NatureName == rData14).FirstOrDefault(); + if (nature != null) + { + NatureId = nature.NatureId; + if (!string.IsNullOrEmpty(rData15)) + {//问题性质明细 + var natureItem = natureItems.Where(x => x.NatureItemContent == rData15).FirstOrDefault(); + if (natureItem != null) + { + NatureItemId = natureItem.NatureItemId; + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "问题性质明细", Reason = $"系统不存在问题性质明细[{rData15}],请检查名称是否正确!" }); + } + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "问题性质", Reason = $"系统不存在问题性质[{rData14}],请检查名称是否正确!" }); + } + } + else + { + lstError.Add(new ErrorInfo { Row = displayRow, Column = "问题性质", Reason = "问题性质必填!" }); + } + if (!string.IsNullOrEmpty(rData16)) + { + Remark = rData16; + } + // 其余字段可根据实际业务映射到实体 + var entity = new Model.CheckProblem_Safety + { + CheckId = SQLHelper.GetNewID(typeof(Model.CheckProblem_Safety)), + CompileDate = DateTime.Now, + CompileMan = this.CompileMan, + CompileManName = this.CompileManName, + UnitId = UnitId, + UnitName = UnitName, + ProjectId = ProjectId, + ProjectName = ProjectName, + State = State,//状态(0:已闭环,1:整改中) + Address = Address, + Description = Description, + UnitType = UnitType, + AssemblyName = AssemblyName, + CheckTeamUser = CheckTeamUser, + CheckDate = CheckDate, + LimitDate = LimitDate, + CloseTime = CloseTime, + RectificationUserId = RectificationUserId, + RectificationUserName = RectificationUserName, + PMUserId = PMUserId, + PMUserName = PMUserName, + ClassifyId = ClassifyId, + ClassifyItemId = ClassifyItemId, + NatureId = NatureId, + NatureItemId = NatureItemId, + Remark = Remark + }; + return (lstError, entity); + } + + #endregion + + #region 导入 + + /// + /// 导入 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + if (hdCheckResult.Text == "1") + { + if (errorInfos.Count <= 0) + { + string rootPath = Server.MapPath("~/"); + var localPath = ConfigurationManager.AppSettings["localRoot"]; + //imgDic = NPOIHelper.ExtractDispimgImagesFromXml(rootPath + initPath + this.hdFileName.Text, localPath + "FileUpload/CheckSpecial"); + ImportExcelToDatabase(rootPath + initPath + this.hdFileName.Text, true); + + hdCheckResult.Text = string.Empty; + ShowNotify("导入成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning); + } + } + /// + /// 导入Excel到数据库 + /// + private void ImportExcelToDatabase(string fileName, bool import) + { + try + { + string msg = string.Empty; + var dt = BLL.Common.NPOIHelper.ExcelToDataSet(fileName, out msg, true); + BLL.ErrLogInfo.WriteLog(msg); + SaveExcelDataToDatabase(fileName, dt.Tables[0], import); + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("", ex); + } + } + + /// + /// 校验并保存数据到数据库 + /// + private bool SaveExcelDataToDatabase(string fileName, DataTable pds, bool import) + { + int ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify($"导入Excel格式错误!Excel只有{ic}列", MessageBoxIcon.Warning); + return false; + } + int ir = pds.Rows.Count; + if (pds == null || ir <= 0) + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + return false; + } + var errors = new List(); + var toInsert = new List(); + + for (int i = 0; i < ir; i++) + { + var (error, entity) = ValidateRowAndBuildEntity(pds.Rows[i], (i + 2).ToString(), import); + if (error.Any()) + errors.AddRange(error); + else + toInsert.Add(entity); + } + if (errors.Count > 0) + { + errorInfos.Clear(); + errorInfos.AddRange(errors); + this.gvErrorInfo.DataSource = errorInfos; + this.gvErrorInfo.DataBind(); + ShowNotify("存在校验错误,请先审核并修正后再导入。", MessageBoxIcon.Warning); + return false; + } + try + { + if (toInsert.Any()) + { + Funs.DB.CheckProblem_Safety.InsertAllOnSubmit(toInsert); + Funs.DB.SubmitChanges(); + } + ShowNotify($"成功导入 {toInsert.Count} 条记录。", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + return true; + } + catch (Exception ex) + { + ErrLogInfo.WriteLog("导入 安全不符合项(CheckProblem_Safety) 失败", ex); + ShowNotify("导入失败:" + ex.Message, MessageBoxIcon.Error); + return false; + } + } + + #endregion // 导入 + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.designer.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.designer.cs new file mode 100644 index 00000000..872722ff --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemIn.aspx.designer.cs @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.Check.HSE +{ + + + public partial class CheckProblemIn + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdFileName; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + + /// + /// hdCheckResult 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdCheckResult; + + /// + /// fuAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fuAttachUrl; + + /// + /// gvErrorInfo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvErrorInfo; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + } +} diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemView.aspx b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemView.aspx new file mode 100644 index 00000000..123b6d59 --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemView.aspx @@ -0,0 +1,170 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckProblemView.aspx.cs" Inherits="FineUIPro.Web.Check.HSE.CheckProblemView" %> + + + + + + 安全不符合项清单 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemView.aspx.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemView.aspx.cs new file mode 100644 index 00000000..2135f532 --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemView.aspx.cs @@ -0,0 +1,134 @@ +using BLL; +using Model; +using System; + +namespace FineUIPro.Web.Check.HSE +{ + public partial class CheckProblemView : PageBase + { + #region 公共字段 + /// + /// 主键 + /// + public string CheckId + { + get + { + return (string)ViewState["CheckId"]; + } + set + { + ViewState["CheckId"] = value; + } + } + + #endregion + + /// + /// 图片是否可以编辑 -1查看 0编辑 + /// + public int QuestionImg + { + get + { + return Convert.ToInt32(ViewState["QuestionImg"]); + } + set + { + ViewState["QuestionImg"] = value; + } + } + + /// + /// 页面初始化加载 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CheckId = Request.Params["CheckId"]; + + var model = CheckProblemSafetyService.GetCheckProblemById(this.CheckId); + if (model != null) + { + this.txtUnitName.Text = model.UnitName; + this.txtProjectName.Text = model.ProjectName; + var classify = SafetyProblemClassifyService.GetClassifyById(model.ClassifyId); + if (classify != null) + { + this.txtClassifyName.Text = classify.ClassifyName; + } + var classifyItem = SafetyProblemClassifyItemService.GetClassifyItemById(model.ClassifyItemId); + if (classifyItem != null) + { + this.txtClassifyItemName.Text = classifyItem.ClassifyItemName; + } + var nature = SafetyProblemNatureService.GetNatureById(model.NatureId); + if (nature != null) + { + this.txtNatureName.Text = nature.NatureName; + } + var natureItem = SafetyProblemNatureItemService.GetNatureItemById(model.NatureItemId); + if (natureItem != null) + { + this.txtNatureItemContent.Text = natureItem.NatureItemContent; + } + this.txtAddress.Text = model.Address; + this.rblUnitType.SelectedValue = model.UnitType; + this.txtAssemblyName.Text = model.AssemblyName; + this.txtDescription.Text = model.Description; + this.txtRemark.Text = model.Remark; + this.txtCheckTeamUser.Text = model.CheckTeamUser; + this.txtRectificationUserName.Text = model.RectificationUserName; + this.txtPMUserName.Text = model.PMUserName; + this.txtCompileManName.Text = model.CompileManName; + if (model.CheckDate != null) + { + this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", model.CheckDate); + } + if (model.LimitDate != null) + { + this.txtLimitDate.Text = string.Format("{0:yyyy-MM-dd}", model.LimitDate); + } + if (model.CloseTime != null) + { + this.txtCloseTime.Text = string.Format("{0:yyyy-MM-dd}", model.CloseTime); + } + if (model.CompileDate != null) + { + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate); + } + } + } + } + + + #region 附件上传 + /// + /// 上传附件 + /// + /// + /// + protected void btnAttach_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CheckProblemSafety&menuId={1}", this.CheckId, BLL.Const.SafetyCheckProblemMenuId))); + } + #endregion + + + + //protected void imgBtnFile_Click(object sender, EventArgs e) + //{ + // PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={1}&path=FileUpload/CheckProblemSafety&menuId={2}", QuestionImg, this.hdCheckControlCode.Text, BLL.Const.SafetyCheckProblemMenuId))); + //} + + + + protected void WindowAtt_Close(object sender, WindowCloseEventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Check/HSE/CheckProblemView.aspx.designer.cs b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemView.aspx.designer.cs new file mode 100644 index 00000000..b2bf3adf --- /dev/null +++ b/SGGL/FineUIPro.Web/Check/HSE/CheckProblemView.aspx.designer.cs @@ -0,0 +1,278 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.Check.HSE +{ + + + public partial class CheckProblemView + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtUnitName; + + /// + /// rblUnitType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rblUnitType; + + /// + /// txtProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectName; + + /// + /// txtAddress 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAddress; + + /// + /// txtAssemblyName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAssemblyName; + + /// + /// txtClassifyName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyName; + + /// + /// txtNatureName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureName; + + /// + /// txtClassifyItemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtClassifyItemName; + + /// + /// txtNatureItemContent 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtNatureItemContent; + + /// + /// txtDescription 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtDescription; + + /// + /// txtCheckTeamUser 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCheckTeamUser; + + /// + /// txtCheckDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCheckDate; + + /// + /// txtRectificationUserName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRectificationUserName; + + /// + /// txtLimitDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtLimitDate; + + /// + /// txtPMUserName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPMUserName; + + /// + /// txtCloseTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCloseTime; + + /// + /// txtCompileManName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileManName; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnAttach 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttach; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdId; + + /// + /// hdAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdAttachUrl; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/安全不符合项清单导入模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/安全不符合项清单导入模板.xlsx new file mode 100644 index 00000000..c0101389 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/安全不符合项清单导入模板.xlsx differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 3288e4ac..39cfe764 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -299,6 +299,10 @@ + + + + @@ -8158,6 +8162,34 @@ WorkStage.aspx + + CheckProblemView.aspx + ASPXCodeBehind + + + CheckProblemView.aspx + + + CheckProblemEdit.aspx + ASPXCodeBehind + + + CheckProblemEdit.aspx + + + CheckProblem.aspx + ASPXCodeBehind + + + CheckProblem.aspx + + + CheckProblemIn.aspx + ASPXCodeBehind + + + CheckProblemIn.aspx + mainMenu_FiveStarts.aspx ASPXCodeBehind @@ -20201,6 +20233,7 @@ + diff --git a/SGGL/FineUIPro.Web/common/PageBase.cs b/SGGL/FineUIPro.Web/common/PageBase.cs index 10a536f2..79847ebf 100644 --- a/SGGL/FineUIPro.Web/common/PageBase.cs +++ b/SGGL/FineUIPro.Web/common/PageBase.cs @@ -974,22 +974,14 @@ namespace FineUIPro.Web { html = (row.FindControl("lblNumber") as AspNet.Label).Text; } - if (column.ColumnID == "tfTeamType" && (row.FindControl("lbTeamType") as AspNet.Label) != null) + if (column.ColumnID == "tfState") { - html = (row.FindControl("lbTeamType") as AspNet.Label).Text; - } - if (column.ColumnID == "tfI" && (row.FindControl("tfI") as AspNet.Label) != null) - { - html = (row.FindControl("lbI") as AspNet.Label).Text; + html = (row.FindControl("lbState") as AspNet.Label).Text; } if (column.ColumnID == "tfCompileMan" && (row.FindControl("lblCompileMan") as AspNet.Label) != null) { html = (row.FindControl("lblCompileMan") as AspNet.Label).Text; } - if (column.ColumnID == "tfSpecialEquipmentId") - { - html = (row.FindControl("lblSpecialEquipmentId") as AspNet.Label).Text; - } // 处理CheckBox if (html.Contains("f-grid-static-checkbox")) { diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 2392503c..5498255e 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -536,6 +536,9 @@ namespace Model partial void InsertCheck_ViolationPerson(Check_ViolationPerson instance); partial void UpdateCheck_ViolationPerson(Check_ViolationPerson instance); partial void DeleteCheck_ViolationPerson(Check_ViolationPerson instance); + partial void InsertCheckProblem_Safety(CheckProblem_Safety instance); + partial void UpdateCheckProblem_Safety(CheckProblem_Safety instance); + partial void DeleteCheckProblem_Safety(CheckProblem_Safety instance); partial void InsertCL_MatchingM(CL_MatchingM instance); partial void UpdateCL_MatchingM(CL_MatchingM instance); partial void DeleteCL_MatchingM(CL_MatchingM instance); @@ -4122,6 +4125,14 @@ namespace Model } } + public System.Data.Linq.Table CheckProblem_Safety + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table CL_MatchingM { get @@ -88019,6 +88030,716 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CheckProblem_Safety")] + public partial class CheckProblem_Safety : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _CheckId; + + private string _UnitId; + + private string _UnitName; + + private string _ProjectId; + + private string _ProjectName; + + private int _State; + + private string _Address; + + private string _Description; + + private string _UnitType; + + private string _AssemblyName; + + private string _CheckTeamUser; + + private System.DateTime _CheckDate; + + private System.Nullable _LimitDate; + + private System.Nullable _CloseTime; + + private string _RectificationUserId; + + private string _RectificationUserName; + + private string _PMUserId; + + private string _PMUserName; + + private string _ClassifyId; + + private string _ClassifyItemId; + + private string _NatureId; + + private string _NatureItemId; + + private string _AttachUrl; + + private string _RectificationUrl; + + private string _Remark; + + private string _CompileMan; + + private string _CompileManName; + + private System.DateTime _CompileDate; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnCheckIdChanging(string value); + partial void OnCheckIdChanged(); + partial void OnUnitIdChanging(string value); + partial void OnUnitIdChanged(); + partial void OnUnitNameChanging(string value); + partial void OnUnitNameChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnProjectNameChanging(string value); + partial void OnProjectNameChanged(); + partial void OnStateChanging(int value); + partial void OnStateChanged(); + partial void OnAddressChanging(string value); + partial void OnAddressChanged(); + partial void OnDescriptionChanging(string value); + partial void OnDescriptionChanged(); + partial void OnUnitTypeChanging(string value); + partial void OnUnitTypeChanged(); + partial void OnAssemblyNameChanging(string value); + partial void OnAssemblyNameChanged(); + partial void OnCheckTeamUserChanging(string value); + partial void OnCheckTeamUserChanged(); + partial void OnCheckDateChanging(System.DateTime value); + partial void OnCheckDateChanged(); + partial void OnLimitDateChanging(System.Nullable value); + partial void OnLimitDateChanged(); + partial void OnCloseTimeChanging(System.Nullable value); + partial void OnCloseTimeChanged(); + partial void OnRectificationUserIdChanging(string value); + partial void OnRectificationUserIdChanged(); + partial void OnRectificationUserNameChanging(string value); + partial void OnRectificationUserNameChanged(); + partial void OnPMUserIdChanging(string value); + partial void OnPMUserIdChanged(); + partial void OnPMUserNameChanging(string value); + partial void OnPMUserNameChanged(); + partial void OnClassifyIdChanging(string value); + partial void OnClassifyIdChanged(); + partial void OnClassifyItemIdChanging(string value); + partial void OnClassifyItemIdChanged(); + partial void OnNatureIdChanging(string value); + partial void OnNatureIdChanged(); + partial void OnNatureItemIdChanging(string value); + partial void OnNatureItemIdChanged(); + partial void OnAttachUrlChanging(string value); + partial void OnAttachUrlChanged(); + partial void OnRectificationUrlChanging(string value); + partial void OnRectificationUrlChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnCompileManChanging(string value); + partial void OnCompileManChanged(); + partial void OnCompileManNameChanging(string value); + partial void OnCompileManNameChanged(); + partial void OnCompileDateChanging(System.DateTime value); + partial void OnCompileDateChanged(); + #endregion + + public CheckProblem_Safety() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string CheckId + { + get + { + return this._CheckId; + } + set + { + if ((this._CheckId != value)) + { + this.OnCheckIdChanging(value); + this.SendPropertyChanging(); + this._CheckId = value; + this.SendPropertyChanged("CheckId"); + this.OnCheckIdChanged(); + } + } + } + + [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="_UnitName", DbType="NVarChar(50)")] + public string UnitName + { + get + { + return this._UnitName; + } + set + { + if ((this._UnitName != value)) + { + this.OnUnitNameChanging(value); + this.SendPropertyChanging(); + this._UnitName = value; + this.SendPropertyChanged("UnitName"); + this.OnUnitNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this.OnProjectIdChanging(value); + this.SendPropertyChanging(); + this._ProjectId = value; + this.SendPropertyChanged("ProjectId"); + this.OnProjectIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectName", DbType="NVarChar(50)")] + public string ProjectName + { + get + { + return this._ProjectName; + } + set + { + if ((this._ProjectName != value)) + { + this.OnProjectNameChanging(value); + this.SendPropertyChanging(); + this._ProjectName = value; + this.SendPropertyChanged("ProjectName"); + this.OnProjectNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_State", DbType="Int NOT NULL")] + public int State + { + get + { + return this._State; + } + set + { + if ((this._State != value)) + { + this.OnStateChanging(value); + this.SendPropertyChanging(); + this._State = value; + this.SendPropertyChanged("State"); + this.OnStateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(200)")] + public string Address + { + get + { + return this._Address; + } + set + { + if ((this._Address != value)) + { + this.OnAddressChanging(value); + this.SendPropertyChanging(); + this._Address = value; + this.SendPropertyChanged("Address"); + this.OnAddressChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + public string Description + { + get + { + return this._Description; + } + set + { + if ((this._Description != value)) + { + this.OnDescriptionChanging(value); + this.SendPropertyChanging(); + this._Description = value; + this.SendPropertyChanged("Description"); + this.OnDescriptionChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitType", DbType="NVarChar(20)")] + public string UnitType + { + get + { + return this._UnitType; + } + set + { + if ((this._UnitType != value)) + { + this.OnUnitTypeChanging(value); + this.SendPropertyChanging(); + this._UnitType = value; + this.SendPropertyChanged("UnitType"); + this.OnUnitTypeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AssemblyName", DbType="NVarChar(100)")] + public string AssemblyName + { + get + { + return this._AssemblyName; + } + set + { + if ((this._AssemblyName != value)) + { + this.OnAssemblyNameChanging(value); + this.SendPropertyChanging(); + this._AssemblyName = value; + this.SendPropertyChanged("AssemblyName"); + this.OnAssemblyNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckTeamUser", DbType="NVarChar(500)")] + public string CheckTeamUser + { + get + { + return this._CheckTeamUser; + } + set + { + if ((this._CheckTeamUser != value)) + { + this.OnCheckTeamUserChanging(value); + this.SendPropertyChanging(); + this._CheckTeamUser = value; + this.SendPropertyChanged("CheckTeamUser"); + this.OnCheckTeamUserChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckDate", DbType="DateTime NOT NULL")] + public System.DateTime CheckDate + { + get + { + return this._CheckDate; + } + set + { + if ((this._CheckDate != value)) + { + this.OnCheckDateChanging(value); + this.SendPropertyChanging(); + this._CheckDate = value; + this.SendPropertyChanged("CheckDate"); + this.OnCheckDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LimitDate", DbType="DateTime")] + public System.Nullable LimitDate + { + get + { + return this._LimitDate; + } + set + { + if ((this._LimitDate != value)) + { + this.OnLimitDateChanging(value); + this.SendPropertyChanging(); + this._LimitDate = value; + this.SendPropertyChanged("LimitDate"); + this.OnLimitDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CloseTime", DbType="DateTime")] + public System.Nullable CloseTime + { + get + { + return this._CloseTime; + } + set + { + if ((this._CloseTime != value)) + { + this.OnCloseTimeChanging(value); + this.SendPropertyChanging(); + this._CloseTime = value; + this.SendPropertyChanged("CloseTime"); + this.OnCloseTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectificationUserId", DbType="NVarChar(50)")] + public string RectificationUserId + { + get + { + return this._RectificationUserId; + } + set + { + if ((this._RectificationUserId != value)) + { + this.OnRectificationUserIdChanging(value); + this.SendPropertyChanging(); + this._RectificationUserId = value; + this.SendPropertyChanged("RectificationUserId"); + this.OnRectificationUserIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectificationUserName", DbType="NVarChar(100)")] + public string RectificationUserName + { + get + { + return this._RectificationUserName; + } + set + { + if ((this._RectificationUserName != value)) + { + this.OnRectificationUserNameChanging(value); + this.SendPropertyChanging(); + this._RectificationUserName = value; + this.SendPropertyChanged("RectificationUserName"); + this.OnRectificationUserNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PMUserId", DbType="NVarChar(50)")] + public string PMUserId + { + get + { + return this._PMUserId; + } + set + { + if ((this._PMUserId != value)) + { + this.OnPMUserIdChanging(value); + this.SendPropertyChanging(); + this._PMUserId = value; + this.SendPropertyChanged("PMUserId"); + this.OnPMUserIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PMUserName", DbType="NVarChar(100)")] + public string PMUserName + { + get + { + return this._PMUserName; + } + set + { + if ((this._PMUserName != value)) + { + this.OnPMUserNameChanging(value); + this.SendPropertyChanging(); + this._PMUserName = value; + this.SendPropertyChanged("PMUserName"); + this.OnPMUserNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyId", DbType="NVarChar(50)")] + 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="_ClassifyItemId", DbType="NVarChar(50)")] + 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="_NatureId", DbType="NVarChar(50)")] + public string NatureId + { + get + { + return this._NatureId; + } + set + { + if ((this._NatureId != value)) + { + this.OnNatureIdChanging(value); + this.SendPropertyChanging(); + this._NatureId = value; + this.SendPropertyChanged("NatureId"); + this.OnNatureIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemId", DbType="NVarChar(50)")] + public string NatureItemId + { + get + { + return this._NatureItemId; + } + set + { + if ((this._NatureItemId != value)) + { + this.OnNatureItemIdChanging(value); + this.SendPropertyChanging(); + this._NatureItemId = value; + this.SendPropertyChanged("NatureItemId"); + this.OnNatureItemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttachUrl", DbType="NVarChar(1000)")] + public string AttachUrl + { + get + { + return this._AttachUrl; + } + set + { + if ((this._AttachUrl != value)) + { + this.OnAttachUrlChanging(value); + this.SendPropertyChanging(); + this._AttachUrl = value; + this.SendPropertyChanged("AttachUrl"); + this.OnAttachUrlChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectificationUrl", DbType="NVarChar(1000)")] + public string RectificationUrl + { + get + { + return this._RectificationUrl; + } + set + { + if ((this._RectificationUrl != value)) + { + this.OnRectificationUrlChanging(value); + this.SendPropertyChanging(); + this._RectificationUrl = value; + this.SendPropertyChanged("RectificationUrl"); + this.OnRectificationUrlChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(50)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [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(100)")] + 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 NOT NULL")] + public System.DateTime CompileDate + { + get + { + return this._CompileDate; + } + set + { + if ((this._CompileDate != value)) + { + this.OnCompileDateChanging(value); + this.SendPropertyChanging(); + this._CompileDate = value; + this.SendPropertyChanged("CompileDate"); + this.OnCompileDateChanged(); + } + } + } + + 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.CL_MatchingM")] public partial class CL_MatchingM : INotifyPropertyChanging, INotifyPropertyChanged {