From 9191546586a49d057e999f29c9974d4fc8d307e3 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Thu, 16 May 2024 09:15:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2024-05-15.sql | 47 ++ SGGL/BLL/API/APIPersonService.cs | 26 +- SGGL/BLL/BLL.csproj | 1 + SGGL/BLL/Common/Const.cs | 8 + SGGL/BLL/Common/Funs.cs | 8 +- .../Hazard/ConstructionRiskListService.cs | 167 ++++++ .../Excel/DataIn/施工作业风险导入模板.xls | Bin 0 -> 19968 bytes SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 40 ++ .../HSSE/Check/RectifyNoticesAdd.aspx.cs | 35 +- .../HSSE/Hazard/ConstructionRisk.aspx | 136 +++++ .../HSSE/Hazard/ConstructionRisk.aspx.cs | 328 +++++++++++ .../Hazard/ConstructionRisk.aspx.designer.cs | 179 ++++++ .../Hazard/ConstructionRiskControlCheck.aspx | 73 +++ .../ConstructionRiskControlCheck.aspx.cs | 115 ++++ ...structionRiskControlCheck.aspx.designer.cs | 98 ++++ .../Hazard/ConstructionRiskControlEdit.aspx | 59 ++ .../ConstructionRiskControlEdit.aspx.cs | 128 ++++ ...nstructionRiskControlEdit.aspx.designer.cs | 89 +++ .../HSSE/Hazard/ConstructionRiskDataIn.aspx | 54 ++ .../Hazard/ConstructionRiskDataIn.aspx.cs | 440 ++++++++++++++ .../ConstructionRiskDataIn.aspx.designer.cs | 125 ++++ .../HSSE/Hazard/ConstructionRiskEdit.aspx | 178 ++++++ .../HSSE/Hazard/ConstructionRiskEdit.aspx.cs | 324 ++++++++++ .../ConstructionRiskEdit.aspx.designer.cs | 269 +++++++++ .../HiddenRectificationAdd.aspx.cs | 28 +- SGGL/Model/APIItem/HSSE/PersonItem.cs | 8 + SGGL/Model/Model.cs | 554 ++++++++++++++++++ 27 files changed, 3505 insertions(+), 12 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2024-05-15.sql create mode 100644 SGGL/BLL/HSSE/Hazard/ConstructionRiskListService.cs create mode 100644 SGGL/FineUIPro.Web/File/Excel/DataIn/施工作业风险导入模板.xls create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2024-05-15.sql b/DataBase/版本日志/SGGLDB_V2024-05-15.sql new file mode 100644 index 00000000..e5a0eecb --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2024-05-15.sql @@ -0,0 +1,47 @@ + + INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed]) VALUES (N'F531D523-35BC-4D13-88D3-CB2554C4185C', N'ʩҵ', NULL, N'HSSE/Hazard/ConstructionRisk.aspx', '80', N'467A0CB9-737D-4451-965E-869EBC3A4BD6', N'Menu_HSSE', '0', '1', '1'); + INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'C7B0FB4D-BA13-4AB6-B3AB-BA4B47D16616', N'F531D523-35BC-4D13-88D3-CB2554C4185C', N'ɾ', '3'); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'3BAF7D0C-5BEB-44F8-9534-416162865C37', N'F531D523-35BC-4D13-88D3-CB2554C4185C', N'', '2'); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'3E684D9D-43CE-4637-B668-F4A6742EBC15', N'F531D523-35BC-4D13-88D3-CB2554C4185C', N'', '4'); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'BC2EF312-846E-4AE4-8980-9B42C90487C0', N'F531D523-35BC-4D13-88D3-CB2554C4185C', N'', '1'); +INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex]) VALUES (N'641CDB58-A8BB-4EA1-8786-FA23F5B7123D', N'F531D523-35BC-4D13-88D3-CB2554C4185C', N'', '5'); + + + + +CREATE TABLE [dbo].[HSSE_ConstructionRisk]( + [ConstructionRiskId] [nvarchar](50) NOT NULL, + [WorkAreaId] [nvarchar](50) NULL, + [UnitId] [nvarchar](50) NULL, + [ConstructionContent] [nvarchar](1000) NULL, + [RefLicense] [nvarchar](100) NULL, + [LicenseDes] [nvarchar](100) NULL, + [RiskLevel] [nvarchar](50) NULL, + [States] [nvarchar](2) NULL, + [DateA] [date] NULL, + [DateZ] [date] NULL, + [DateWeek] [nvarchar](50) NULL, + [ProjectId] [nvarchar](50) NULL, + CONSTRAINT [PK_HSSE_ConstructionRisk] PRIMARY KEY CLUSTERED +( + [ConstructionRiskId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO +CREATE TABLE [dbo].[HSSE_ConstructionRiskControl]( + [ControlId] [nvarchar](50) NOT NULL, + [Measures] [nvarchar](50) NULL, + [CheckResult] [nvarchar](50) NULL, + [CheckMan] [nvarchar](50) NULL, + [Rectification] [nvarchar](50) NULL, + [ConstructionRiskId] [nvarchar](50) NULL, + [ShowIndex] [int] NULL, + CONSTRAINT [PK_HSSE_ConstructionRiskControl] PRIMARY KEY CLUSTERED +( + [ControlId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs index 2f4a5ae7..67109ef6 100644 --- a/SGGL/BLL/API/APIPersonService.cs +++ b/SGGL/BLL/API/APIPersonService.cs @@ -61,7 +61,7 @@ namespace BLL using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { Model.PersonItem person = new Model.PersonItem(); - var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId || (x.ProjectId == projectId && x.ProjectId.Length > 1 && x.IdentityCard == idcard)); + var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId || (x.ProjectId == projectId && x.ProjectId.Length > 1 && x.IdentityCard == idcard)); if (getProjectPerson != null) { person.SitePersonId = getProjectPerson.SitePersonId; @@ -133,7 +133,8 @@ namespace BLL person.AttachUrl2 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#2", null); person.AttachUrl3 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#3", null); person.AttachUrl4 = getAttachUrl4(getProjectPerson.PersonId); - person.AttachUrl5 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#5", null); + person.AttachUrl5 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#5", null); + person.AttachUrl6 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#6", null); } var getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == idcard && idcard.Length > 1); if (getPerson != null) @@ -443,11 +444,11 @@ namespace BLL /// 培训岗位ID /// 培训类型ID /// - public static List getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId,string name) + public static List getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId, string name) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - + var getPersons = from x in db.View_SitePerson_Person where x.ProjectId == projectId && x.States == Const.ProjectPersonStates_1 select new Model.PersonItem @@ -583,7 +584,7 @@ namespace BLL UserId = newPerson.PersonId, MenuId = Const.PersonListMenuId, OperationName = "APP修改人员", - OperationLog = "修改人员"+newPerson.PersonName, + OperationLog = "修改人员" + newPerson.PersonName, DataId = newPerson.PersonId, ProjectId = person.ProjectId, }; @@ -598,7 +599,7 @@ namespace BLL if (!string.IsNullOrEmpty(newPerson.PersonId)) { - SaveMeetUrl(newPerson.PersonId, Const.PersonListMenuId, person.AttachUrl1, person.AttachUrl2, person.AttachUrl3, person.AttachUrl4, person.AttachUrl5); + SaveMeetUrl(newPerson.PersonId, Const.PersonListMenuId, person.AttachUrl1, person.AttachUrl2, person.AttachUrl3, person.AttachUrl4, person.AttachUrl5, person.AttachUrl6); } if (person.States == Const.ProjectPersonStates_0 && !string.IsNullOrEmpty(newProjectPerson.AuditorId)) @@ -619,7 +620,7 @@ namespace BLL /// /// 人员附件保存方法 /// - public static void SaveMeetUrl(string personId, string menuId, string url1, string url2, string url3, string url4, string url5) + public static void SaveMeetUrl(string personId, string menuId, string url1, string url2, string url3, string url4, string url5, string url6) { Model.ToDoItem toDoItem = new Model.ToDoItem { @@ -659,6 +660,13 @@ namespace BLL { APIUpLoadFileService.SaveAttachUrl(toDoItem); } + + toDoItem.DataId = personId + "#6"; + toDoItem.UrlStr = url6; + if (!string.IsNullOrEmpty(url6)) + { + APIUpLoadFileService.SaveAttachUrl(toDoItem); + } } #endregion @@ -755,7 +763,7 @@ namespace BLL var getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == person.IdentityCard || x.PersonId == person.PersonId); if (getPerson == null) { - var getSitePerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId ==person.PersonId); + var getSitePerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == person.PersonId); if (getSitePerson != null) { getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == getSitePerson.IdentityCard || x.PersonId == getSitePerson.PersonId); @@ -778,7 +786,7 @@ namespace BLL getPerson.IDCardUrl = person.AttachUrl1; } db.SubmitChanges(); - SaveMeetUrl(getPerson.PersonId, Const.PersonListMenuId, person.AttachUrl1, person.AttachUrl2, person.AttachUrl3, person.AttachUrl4, person.AttachUrl5); + SaveMeetUrl(getPerson.PersonId, Const.PersonListMenuId, person.AttachUrl1, person.AttachUrl2, person.AttachUrl3, person.AttachUrl4, person.AttachUrl5, person.AttachUrl6); } } } diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index aefffb1c..4b9b2631 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -463,6 +463,7 @@ + diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index dc2d0a0c..05bfc034 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -2194,6 +2194,10 @@ namespace BLL /// public const string ProjectCheckHolidayMenuId = "0D23A707-ADA0-4C2B-9665-611134243529"; /// + /// 施工作业风险 + /// + public const string ConstructionRiskMenuId = "F531D523-35BC-4D13-88D3-CB2554C4185C"; + /// /// 危险因素统计分析 /// public const string CheckAnalysisMenuId = "14C42C8E-8D3D-4D30-AA56-4F96828610AD"; @@ -3483,6 +3487,10 @@ namespace BLL /// 焊口二次设计信息模板文件原始虚拟路径 /// public const string JotTwoDesignTemplateUrl = "File\\Excel\\DataOut\\焊口二次设计信息.xlsx"; + /// + /// 施工作业风险导入模板 + /// + public const string ConstructionRiskTemplateUrl = "File\\Excel\\DataIn\\施工作业风险导入模板.xls"; #endregion #region 初始化上传路径 diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs index bc002863..ab290041 100644 --- a/SGGL/BLL/Common/Funs.cs +++ b/SGGL/BLL/Common/Funs.cs @@ -1498,8 +1498,14 @@ namespace BLL return splitLists; } + public static int GetWeekOfYear(DateTime dtWeek) + { + System.Globalization.GregorianCalendar gc = new System.Globalization.GregorianCalendar(); + int weekOfYear = gc.GetWeekOfYear(dtWeek, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday); + return weekOfYear; + } + - } } diff --git a/SGGL/BLL/HSSE/Hazard/ConstructionRiskListService.cs b/SGGL/BLL/HSSE/Hazard/ConstructionRiskListService.cs new file mode 100644 index 00000000..1bb9da85 --- /dev/null +++ b/SGGL/BLL/HSSE/Hazard/ConstructionRiskListService.cs @@ -0,0 +1,167 @@ +using Org.BouncyCastle.Bcpg.Sig; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + public static class ConstructionRiskListService + { + public static Model.SGGLDB db = Funs.DB; + + /// + /// 要求主键获取危险清单信息 + /// + /// 主键 + /// + public static Model.HSSE_ConstructionRisk GetConstructionRisk(string constructionRiskId) + { + return Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(e => e.ConstructionRiskId == constructionRiskId); + } + + + + + + /// + /// + /// + /// + public static void AddConstructionRisk(Model.HSSE_ConstructionRisk constructionRisk) + { + Model.SGGLDB db = Funs.DB; + Model.HSSE_ConstructionRisk newconstructionRisk = new Model.HSSE_ConstructionRisk + { + ProjectId = constructionRisk.ProjectId, + + ConstructionRiskId = constructionRisk.ConstructionRiskId, + DateA = constructionRisk.DateA, + DateZ = constructionRisk.DateZ, + DateWeek = constructionRisk.DateWeek, + ConstructionContent = constructionRisk.ConstructionContent, + States = constructionRisk.States, + RefLicense = constructionRisk.RefLicense, + LicenseDes = constructionRisk.LicenseDes, + WorkAreaId = constructionRisk.WorkAreaId, + UnitId = constructionRisk.UnitId, + RiskLevel = constructionRisk.RiskLevel + }; + Funs.DB.HSSE_ConstructionRisk.InsertOnSubmit(newconstructionRisk); + Funs.DB.SubmitChanges(); + + } + + public static void AddConstructionRiskControl(Model.HSSE_ConstructionRiskControl constructionRiskControl) + { + Model.SGGLDB db = Funs.DB; + Model.HSSE_ConstructionRiskControl newconstructionRisk = new Model.HSSE_ConstructionRiskControl + { + + ControlId = constructionRiskControl.ControlId, + Measures = constructionRiskControl.Measures, + CheckMan = constructionRiskControl.CheckMan, + CheckResult = constructionRiskControl.CheckResult, + Rectification = constructionRiskControl.Rectification, + ShowIndex = constructionRiskControl.ShowIndex, + ConstructionRiskId = constructionRiskControl.ConstructionRiskId + }; + Funs.DB.HSSE_ConstructionRiskControl.InsertOnSubmit(newconstructionRisk); + Funs.DB.SubmitChanges(); + } + public static void UpdateConstructionRiskControl(Model.HSSE_ConstructionRiskControl constructionRiskControl) + { + Model.SGGLDB db = Funs.DB; + Model.HSSE_ConstructionRiskControl newconstructionRisk = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId == constructionRiskControl.ControlId); + + if (newconstructionRisk != null) + { + newconstructionRisk.ControlId = constructionRiskControl.ControlId; + newconstructionRisk.Measures = constructionRiskControl.Measures; + newconstructionRisk.CheckMan = constructionRiskControl.CheckMan; + newconstructionRisk.CheckResult = constructionRiskControl.CheckResult; + newconstructionRisk.Rectification = constructionRiskControl.Rectification; + newconstructionRisk.ShowIndex = constructionRiskControl.ShowIndex; + newconstructionRisk.ConstructionRiskId = constructionRiskControl.ConstructionRiskId; + } + + Funs.DB.SubmitChanges(); + } + public static void AddConstructionRiskControl(List constructionRisk,string constructionRiskId) + { + Model.SGGLDB db = Funs.DB; + int i = 1; + + var cons = Funs.DB.HSSE_ConstructionRiskControl.Where(x => x.ConstructionRiskId == constructionRiskId); + if (cons.Count() > 0) + { + Funs.DB.HSSE_ConstructionRiskControl.DeleteAllOnSubmit(cons); + } + foreach (var item in constructionRisk) + { + Model.HSSE_ConstructionRiskControl newconstructionRisk = new Model.HSSE_ConstructionRiskControl + { + ControlId = item.ControlId, + ConstructionRiskId = constructionRiskId, + Measures = item.Measures, + CheckResult = item.CheckResult, + CheckMan = item.CheckMan, + Rectification = item.Rectification, + ShowIndex = i++, + }; + Funs.DB.HSSE_ConstructionRiskControl.InsertOnSubmit(newconstructionRisk); + } + Funs.DB.SubmitChanges(); + + } + /// + /// + /// + /// + public static void UpdateConstructionRisk(Model.HSSE_ConstructionRisk hazardList) + { + Model.SGGLDB db = Funs.DB; + Model.HSSE_ConstructionRisk newHazardList = db.HSSE_ConstructionRisk.FirstOrDefault(e => e.ConstructionRiskId == hazardList.ConstructionRiskId); + if (newHazardList != null) + { + newHazardList.ProjectId = hazardList.ProjectId; + newHazardList.DateA = hazardList.DateA; + newHazardList.DateZ = hazardList.DateZ; + newHazardList.DateWeek = hazardList.DateWeek; + newHazardList.ConstructionContent = hazardList.ConstructionContent; + newHazardList.States = hazardList.States; + newHazardList.RefLicense = hazardList.RefLicense; + newHazardList.LicenseDes = hazardList.LicenseDes; + newHazardList.WorkAreaId = hazardList.WorkAreaId; + newHazardList.UnitId = hazardList.UnitId; + newHazardList.RiskLevel = hazardList.RiskLevel; + db.SubmitChanges(); + } + else + { + AddConstructionRisk(hazardList); + } + } + + /// + /// + /// + /// + public static void DeleteConstructionRisk(string constructionRiskId) + { + Model.SGGLDB db = Funs.DB; + Model.HSSE_ConstructionRisk hazardList = db.HSSE_ConstructionRisk.FirstOrDefault(e => e.ConstructionRiskId == constructionRiskId); + if (hazardList != null) + { + + var constructionRiskControls = db.HSSE_ConstructionRiskControl.Where(e => e.ConstructionRiskId == constructionRiskId); + if (constructionRiskControls.Count() > 0) + { + db.HSSE_ConstructionRiskControl.DeleteAllOnSubmit(constructionRiskControls); + } + db.HSSE_ConstructionRisk.DeleteOnSubmit(hazardList); + db.SubmitChanges(); + } + } + + } +} diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/施工作业风险导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/施工作业风险导入模板.xls new file mode 100644 index 0000000000000000000000000000000000000000..ce18a034b2b5a823259a429134682e40027dee85 GIT binary patch literal 19968 zcmeHP2UHZv)~*=_7z88;D4=8|N)*LJ6vLXpxIR%)7(fNHhyh_01QkWW$YKr{cFnrF zCX5)sRTQ(kU|N+`(OqRt%)7UnW_o(MNA#WlKWE>0HK)3}Zr%IUty{OMyQ;e9@-If^ z>vmgI5KizX8l*<9L$p|Q5nN-Wf*~QcaDnL>xm->Y34zQ1g@2F*K7pj*Z`s~L_LW55F0`?fCw%?j363AYy{B+qA5f(h>amOfoKlV0-`0vrVyJ! zw1Q|2(FP*=4n}*pZq7>ogG~63R<#cq3%^Ow7NKMeoF|Z}&j zh18LBrcd;7T>i>q)0W&8*>jS{zF@f@N48;CZ-||ts9c?BsLtiqPB*1StW&3W>3Ne&TkTQvk zgzGUVAP}5t>yLf6zU5<|zFUi@BZXe9rAZF!muR0z6%j4y{1rq@c1cdak&yckBgi<= zQ{+WFi5F=L(dPd?1XDT;7oiS?VBn5$C4$ie)6nK{Y(yP*QXEI9V@GNvBE&i2HxEDH zz`N78;y{XT0d=&ajt$``B0o_ww<(Gjj9q9EDOrS#N#=l6=MV1No1x27{&RX0K$fQ* zLDebzZqtv?WbpNx_|9RwiWE*wj>NHRQl~d26guIdC zGb$m0Hi0&9AF)BY2+|b&FU-N9o{j@HAHNVC5&8K4o9QBIE>LS{F>Ox*PEOh3Z)N)v z=z08f9Ra$t0NsU`j@bTl*6CWLCNqlsi zIZ^a$1iUa1CPlP;a5lw9#~Buj4wEUGzm5)m%dQvB#wh+JMn=nZmxKNul>RtFW9Y}N zk6ROo4n@Zv!O&@bnvOF$njRBF^S7b+adt=1uaQV77bbJGJ~-p6r4J9Z@vN&C&H^d= zzFIvcE))*V43+6EDLT#;mFcb&9cPfrbWe&71##%sYU!#tO$6{;3Elb$$PYR(bBZY6@H z5#CJfTY{O`!2~n0mkDNKSF6k9)&Tn(T?1;$0kcCOP@z^yt^jsKg+MAvsO2DNn zMF}Y>Dcll*I5xp`E)96lru_zIP9X^c{A8lx1OrcSB%$toR$YbiS= zrP#G)lw#8urPwq^DK?E!YSX4oDwbj|TGd*L+Z}LinD%6BZ+WUn1%#(&{W*^50HP9b zP1TNx8e^yA>mob@KUX_kwblS(+8fWlyriNXEacVE1gh9V2}E9`3X)H>J_q8c3{sh2 zC&0L6zU;G_IMsm&*#sEsflrD0uIAjLht62z4S;_br+Qdbwa5U7qD z3#4x4nv!D%^?HD`WP!+HYL~y2KZmg7~mNynXmU7|rl3V3SrX5PA!Z5n`&tr12~O z;tN?!b!0KxEC~jr9yV#s0x9nCl^|_cAl^QFAS~sCs^iB3p|=znA*MP^8qWeYX$x5j zo3J0$8IXF|q#X;SxW`w5v}b{M`|yDPLtPN4P6uFMszYzFG7?O6m^7XRKyU+#0g=Vv zsss}lkb2m}A7mJi;vQcK62JoS_Td9zG{bXkb+}KOxLl!l(o|7BR}5o!Dv{?%El3W_ z?6CPJ7Zbmsr{^Lzav7#-$nk8HDxuECshZTeQK}YoHc8c{&ZenS>TH&(17{srCxu<1 zC-D~+s}vz_07YO9U4%ZYk4lIrX8t$*GGuPCIZ`WSjl{Zg31M<+5glshN~9gPVucF2 zh5?{s4$W!+Q&!k)docIHV#i1t--d(lE7v57d`2ltR0?ryU~O4NDGftVipga}nkq!R zc|?rrL~w{j>*~Y)eO)O&JR-(*A~>MZB325KRy-n&>O^q(L=hc$I{?}uH(M62VlA-= zSPOF)RvVi2JrAoX#rnRE)fQRT&0juU71az_F^5JqAa>XWg>jE!`}YkA?+}+G<+ed% zXahw)BW90cHA^-{35hiUF-1O82M1KFOMLrC6~#2nK{3psS+(IE2@w$`56Y1?0aGH8 z4kD3-Ttt!wVJcUwO3Klhmf-#3?HHEzbDG{|B zrjeB)8#p+B#e`Y3o3&6@L()txC0s5V!WK3c8WNE=>{B%-Hn8Jkqr#XYMK?rtI*24z z@`kY8BrJh^xnf(`lmh5hY8X|atpQq{1Ox4g(5=4++6JK2Nzl-yun?|dQ#1hArnV|J zW%{Enm{F}w5sqt9JGC}dK)b8ADIc`GTAM1MJ=EKj586SkO&MrYXeSk$;y}f%2u zG6R+^44-Okif~+;woq$R1+=$%oANIr^Qyj^;Hg#69 zDKnzm!j8XMn<5<7rY>r2s(@~--llxeu4-+nfNrDSrhL$DYHi9un-V`&oBHzDw55to zaehD#dTrI)6ydlwbysUs1#~<0Hsyo%P-{~KbbIwS<%9NAYf}c=lyp$FX=@&vda2kH zr%SX=JF2%S!f|ctt=6UrXn*xK<%9N7Yf}YufO?zqLAO$CQyMx-YDS`1_hU24On6u( zeWtgJm4mdf?iv!@1SKS+*Zn{|GXba5lj39vG7n)M+zzFA6r3hNlTv7-r!F%~hSWTW zxH`_}q^^4oA2U2wHo-k9Azr_@XM!vKa)h6n&Q|O327k3+Wm zCQX)qs@}1-qxl1gw#}M(9j{5FocA7G)yykxxP$v1y@INQ;-py)M_!-5l)1s@^7ofl zO)x1-H11UD*)?1|>gDRcPJT+i)KK%xR+CYYU8nXQdD^w`%D#>M^AE*^Tjkr`mIhU4 zu6pxI!(7WmN5|S?_{NlqOEpWI?OU!JekkaAPUW*#p$vHp@CXuF;#<&2{OhO^IPo zZV;Cn<5x{9xW3i&eJi4$QNDTinJb3|@7$Ny_PTgwm+Tjp#vHmkxoTNW_tCAVTr8Qr z<&SdTb5C~uP*GVHbNK#!-*e^LNB`YD+;!A|rk^aLtM>cODEQaN{_PtMoju~4(x(>f z=3Us|%ePD8MP3^+h9({D`^;+J#J`O-VL#L;w&1SqSDM*>|CcNsy)t$rqYwl(@Ze6qdWkAil zf?qxcI<4On>TxXTb>&`1k7FMn{xsHldbxH}{rIFc4&O@JR1F$8zj^uh4YNkKwW_+2 z`=lt-&)7-po>f^h^Y(?76FVgzY>_y7N=AshO0=`&Mf(G9NBHNS_WART-}uy`tSc=Z z{7NDQP8?+P;+N97DHHtnj{nK9-J6no!CP~0UvithquUIZ!Cr~Q9o9K5jhofiP2X)%e`SyRkMKZ_h1xwQBA8Ex%N@ z_Mf~s%rJ9W*2}18X|F8ux-I#;-`nuu=c(4V<{z^DD0z4J?Bukx9=$zfL9uD+Rp;+M zEZ@2Gugc5*A4djk{_}L`gl?PtS9Qtsvb+^@bwE~5amMq-tq$zA&U6kl(RA$bzPzaT zN5eM_rv^SfJLxyuo87A4b{=Qht{|Z_$L86^tmzY`>ic9IKiamL{SSxrCQU9F=IC(m z_K_03m$wt`JCvUu+#$oYWLl#aDL2>OiCeZha?89o&7Td)n0aH}sh^I8jNSGq<(P-Z zV6RCd_nWu6lW_E1uaDDTdac{%_`8X<&e2b1yWVI0?71cFub@VawRgMC>C*q~+IuH@ z`ng26u)ER9DCn%DslllQ+pcN1>po^-(c`2++Xilk^ZL#|=VaQnpXd5-b?>*Vc<#gv zL!;K`h`Q^}j@NTdd=HRO>T57I^tYwWt7Hj_FaE4a_FA}PQ?U%KeR(TU9CxH$J(wPslF_A8;j7~oqE**)BL?<& zo%+UOZqsosUK*QMk63bI>8WK4)8owSLx!vv5h82c;%TdIug}^(bl|?7qgRjbu-Q<0 zux*;_NsULDd4?|xx>QYYPU#SyFkt%rs-J$yk9ae%*s>!1$mGZUJETs$x$WiV`@i12 zfAW>gecPKp`@4odoe({AsH5rIvQ_hlUqP@eRy-?wN$Pi%=Ndnbzc~B*<@w*vp8Kx` z2^Q@thlY=yqi=bm=y~u3%Y)T9ov+B2##}Yh%qfbGp3{BWy$hpvtQg$>aq+GvZmwHf zK3!pYv0{YRy_1O-w}oa7fAiCi-uaT-g-KbR{i=g}$34(+d)3|AuI$Gn{s%`Nxw37k zd!jgT$w2Xe{9>=3gN{fy%5G1%=9^GqGwy``&e69IJTLmjVU+HE*YO`J6GS(|Hg3Cl z$mHngKQC!M956^Xtpy{5zXU{oax!Wj5_71m+>E40mkv%EH)q52JNt(n3A?hPLy4E=rmhD(ml_*n-s*j%&yL{eE9VVMzX`q5YJ@{d z!Q%15Zdk8aZC>8G$JIAxeQvag+>yQIynOE|&*Ig+Po(U0dlV`e(`HGJkq<|#+v4${ z@6knDWZSM;UEY82-F5nw$^YD7%(-RqnMD7}qBT2#&k{_68({2PEX~h-KBzTU&ju$w zP134oO_7crd-Z3-#Vzh-UjFf#M%qJP{nh~v;eR~W-{B^8&lrAe<;cU!SDkMZ<^8Ky z+%^koyQfRX=bcD6_{YM)K4!h<-fADcD{|Jtv2C84#xCye)U$;{A18OO6%!gdev_Mj zd0xMFsXP2OWDj^~w_$V8xx<&cR!>e|`|5kqj57{LM;J~oBj(G(^5lCz`B}`3^{_S@ zQWG9D@m9K~)B3Z;<@Voi>mj)?_~)Nb|EBy{Ve^AS>EBS-rm!E{2+o5;#*UdJ8#8HG zzp3M76Nlh4#gB_G_B!Qh7+T%+puU5g?kpP(uoXM8!~Z-Nt?6NMmStb zx^Q{&yVREP+5@tuxAo8K)HG*6bj*k=M-kH>X>{=Qd3|mOHI+>C(8k ziOW3u&(v~D-szq9#G>C=!*`mUuXws;pWa#NBJWt4^~2b~vAbU-w!dKWy6x+S?;Rie zEXwk!F_@~;UT4L-v6a2Ux{JgnuoufbIC4z|8L%{F1IGv*Uc=D<{Qjue7Q(lEykJL! z@kr%Dx!n|)YYXjPCqsE*{R=|~+O^fm;6pSWP(cTX?CzjW61y55P|^<`?b(w2)#P?P zl&5VQ$1Bg<5ox6q4aR+BR)A_k4`(YyT~iOxTnz4PL4kqGnJO5pxkFfYO{$S~;1!kt z=w0cQBV@rxGFhD2&H`yPS-_&q)I6rrIa3( z^2X&CkXs-PQYiAZA@tN}vh=U=B(h5ifvAD_2~WV zNqs4whYB8=t*$Dv7*v_A3Vppm`V}I*RZ77&RZ|MP)#!F&tj|<%hzcZbht?C4b_52J zzksi(=2wUWs#HUw)Sl{GmN7+reZozpEM?zOw!;G0MdNy?NJ+N^(hwC6rH-KLJ<3He z73in}gMCO%TPnjWlqQjdtd5@p!shVn2e0{zAo1|^PG9(LZz^>a2H*6_$V7;fh!1=S z5=5flC!@Z!^de#KbzdTU-#1A>!dpcmTiTgqv&zO7ny~aQFMAPeAT44c0St`Ybl~P8 zor&B$d?O3<@XXD_zKwZ!=H{WvF%Qq&JZx3W!!tJz>x+5Vqq)`)Q(r2Ze}!GSrCUA9xYVz7|rpH!j;2&E|!PS^xQn7+C03sbMx>GT$ICa1Gssx~q)z9bI(7ya3b z6E4?HFNoR}byOw?7ttX}@G1x@iA_O&0Bfl90jw@OLNWm>)g0O`9NxFk$L&&(6vGF4 z2Gq3?<@koMO8If?tJ0n$!UBd-bQg;5N*!lWlvLnhLUVkXfix6-2RSFG{#o7R}Kk5;tmaiP&&VW!JAR_s&Ws}bU&}5~f z;_ zZ6Qlu8#|r8B3}x6q#Dp^B1UJX-II1BsTkc9uREcql0cCG`9!rVTqB`2C4v;TB%LRQ z6tdGP4M^b-MW-Z?!q%ZvnvlXyO{cUVg|?+r+K|FdO{b)gLet&=4!kA6N3mjKa)4@z zKuAR+3Br7MmYmOOgJ{sC8F-V1DOHdNzSe^)&6TL2POP*siDfZ^`{Dbt8l7n0r4j$5 zBN_!tq6~o5#>%43STQUZ|C<53364zY9+<{Pz>xz@kE0XL9dH_odH)OlEDPZ9C(($49Hg-JJ>viGGwMV2+WMSUf&c?6;J8wr zzUKA2-f@Q87fXq&GnAIvVD8g$N-v3=Y^H-$KMOCmte}Hv=L**tPLqwbSL4=SR2nQTv zyF$dVw;x0tZzCWwfzJkrfdOSOFlPkEGB98}Am1d2nxqrVK%%JsAfe|aU-o|_e$e*p z5f30g8?a5cFp7Sb`|}K6TK?w|zl`G_UVbX}GxVi2h}d7Q)uxdKU5s=iA@C$m=V5>A z4!xu|^py$VInm%bQQ%3za2^RgEgCpwkb{BGKOKM`3O_H1LGV^kEAYQy@JMg){8sRH zK|zq?2YDgXbuiF + + + + + @@ -10156,6 +10161,41 @@ UnexpectedEnvironmentalView.aspx + + ConstructionRisk.aspx + ASPXCodeBehind + + + ConstructionRisk.aspx + + + ConstructionRiskControlCheck.aspx + ASPXCodeBehind + + + ConstructionRiskControlCheck.aspx + + + ConstructionRiskControlEdit.aspx + ASPXCodeBehind + + + ConstructionRiskControlEdit.aspx + + + ConstructionRiskDataIn.aspx + ASPXCodeBehind + + + ConstructionRiskDataIn.aspx + + + ConstructionRiskEdit.aspx + ASPXCodeBehind + + + ConstructionRiskEdit.aspx + EnvironmentalRiskItemEdit.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs index 84d58ea7..a2e9ea9b 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs @@ -27,7 +27,17 @@ namespace FineUIPro.Web.HSSE.Check } } #endregion - + public string ControlId + { + get + { + return (string)ViewState["ControlId"]; + } + set + { + ViewState["ControlId"] = value; + } + } /// /// 加载页面 /// @@ -85,6 +95,29 @@ namespace FineUIPro.Web.HSSE.Check BindGrid(); BindGrid1(); + ControlId = Request.Params["ControlId"]; + if (!string.IsNullOrEmpty(ControlId)) + { + var control = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId==ControlId); + if (control != null) + { + var risk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x => x.ConstructionRiskId == control.ConstructionRiskId); + drpWorkAreaId.SelectedValue = risk.WorkAreaId; + drpUnitId.SelectedValue= risk.UnitId; + List view = getViewTestPlanTrainingList(); + var item = new Check_RectifyNoticesItem + { + RectifyNoticesItemId = SQLHelper.GetNewID(), + RectifyNoticesId = this.RectifyNoticesId, + WrongContent = risk.LicenseDes + }; + view.Add(item); + //将gd数据保存在list中 + Grid1.DataSource = view; + Grid1.DataBind(); + } + } + } } diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx new file mode 100644 index 00000000..9caa4eb3 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx @@ -0,0 +1,136 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRisk.aspx.cs" Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRisk" %> + + + + + + + 施工作业风险 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + <%-- + --%> + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.cs new file mode 100644 index 00000000..bf9405d1 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.cs @@ -0,0 +1,328 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRisk : PageBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower();//权限设置 + + this.InitTreeMenu();//加载树 + } + } + + #region 加载树施工单位 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + + List units = null; + + var user = Person_PersonsService.GetPerson_PersonsById(this.CurrUser.PersonId); + if (!string.IsNullOrEmpty(user.UnitId)) + { + var projectUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, user.UnitId); + if (projectUnit != null) + { + if (projectUnit.UnitType == BLL.Const.ProjectUnitType_1 || projectUnit.UnitType == BLL.Const.ProjectUnitType_3 || projectUnit.UnitType == BLL.Const.ProjectUnitType_4) + { + var ids = Funs.DB.HSSE_ConstructionRisk.Select(x=>x.UnitId).Distinct().ToList(); + units = (from x in Funs.DB.Base_Unit + where ids.Contains(x.UnitId) + select x).OrderBy(x => x.UnitCode).ToList(); + } + else + { + units = (from x in Funs.DB.Base_Unit + where x.UnitId == this.CurrUser.UnitId select x).ToList(); + } + } + } + else if (user.UnitId == Const.UnitId_SEDIN || user.PersonId == Const.hfnbdId) + { + var ids = Funs.DB.HSSE_ConstructionRisk.Select(x => x.UnitId).Distinct().ToList(); + units = (from x in Funs.DB.Base_Unit + where ids.Contains(x.UnitId) + select x).OrderBy(x => x.UnitCode).ToList(); + } + + + if (units != null && units.Count > 0) + { + foreach (var unit in units) + { + + TreeNode rootNode = new TreeNode(); + rootNode.Text = unit.UnitName; + rootNode.NodeID = unit.UnitId; + rootNode.ToolTip = "单位"; + rootNode.Expanded = false; + this.tvControlItem.Nodes.Add(rootNode); + this.BindNodes(rootNode); + + } + } + + } + #endregion + + #region 关闭弹出窗口及刷新页面 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + this.InitTreeMenu(); + this.BindGrid(); + } + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + + + if (hdState.Text == "A") + { + var ids = Grid1.SelectedRowID.Split('|'); + if (ids.Length > 1) + { + hdState.Text = ""; + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../Check/RectifyNoticesAdd.aspx?ControlId={0}", ids[1], "编辑 - "))); + } + + } + else if (hdState.Text == "B") + { + var ids = Grid1.SelectedRowID.Split('|'); + if (ids.Length > 1) + { + hdState.Text = ""; + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HiddenInspection/HiddenRectificationAdd.aspx?ControlId={0}", ids[1], "编辑 - "))); + } + } + this.InitTreeMenu(); + this.BindGrid(); + } + #endregion + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + #endregion + + + #region 删除 + /// + /// 删除 + /// + /// + /// + + + /// + /// 右键删除明细 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var ids =rowID.Split('|'); + if (ids.Length >= 1) + { + var list = Funs.DB.HSSE_ConstructionRiskControl.Where(x => x.ConstructionRiskId == ids[0]).ToList(); + Funs.DB.HSSE_ConstructionRiskControl.DeleteAllOnSubmit(list); + var constructionRisk = Funs.DB.HSSE_ConstructionRisk.Where(x => x.ConstructionRiskId == ids[0]).FirstOrDefault(); + Funs.DB.HSSE_ConstructionRisk.DeleteOnSubmit(constructionRisk); + Funs.DB.SubmitChanges(); + } + } + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.InitTreeMenu(); + this.BindGrid(); + } + #endregion + + + + + + /// + /// 数据绑定 + /// + private void BindGrid() + { + if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.NodeID.Contains("|")) + { + var ids= this.tvControlItem.SelectedNode.NodeID.Split('|'); + string strSql = @"select c.UnitWorkName, '' Id,* + ,(CASE WHEN a.States = " + BLL.Const.State_3 + " THEN '审核/审批完成' when a.States = " + BLL.Const.State_0 + " OR a.States IS NULL THEN '待提交' WHEN a.States = " + BLL.Const.State_2 + " THEN '待总包安全经理审核' ELSE '待['+OperateUser.PersonName+']办理' END) AS FlowOperateName" + + @" from [dbo].[HSSE_ConstructionRisk] a left join [dbo].[HSSE_ConstructionRiskControl] b + on a.ConstructionRiskId =b.ConstructionRiskId left join WBS_UnitWork c on a.WorkAreaId = c.UnitWorkId + LEFT JOIN Sys_FlowOperate AS FlowOperate ON a.ConstructionRiskId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1 + LEFT JOIN Person_Persons AS OperateUser ON FlowOperate.OperaterId=OperateUser.PersonId + where a.UnitId=@UnitId and a.DateWeek=@DateWeek order by a.[ConstructionContent],b.[ShowIndex]"; + List listStr = new List(); + listStr.Add(new SqlParameter("@UnitId", ids[0])); + listStr.Add(new SqlParameter("@DateWeek", ids[1])); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + foreach(DataRow row in tb.Rows) + { + row["Id"] = row["ConstructionRiskId"] +"|"+ row["ControlId"]; + } + + Grid1.DataSource = tb; + Grid1.DataBind(); + } + } + #region 绑定树节点 + /// + /// 绑定树节点 + /// + /// + private void BindNodes(TreeNode node) + { + + var DateWeek = (from x in Funs.DB.HSSE_ConstructionRisk + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitId == node.NodeID + select x.DateWeek).OrderByDescending(x=>x).ToList(); + foreach (var d in DateWeek) + { + TreeNode newNode = new TreeNode(); + newNode.Text = d; //string.Format("{0:yyyy-MM-dd}", d.AssessmentDate); + newNode.NodeID = node.NodeID + "|" + d; + newNode.EnableClickEvent = true; + newNode.ToolTip = "标签"; + node.Nodes.Add(newNode); + + } + } + + #endregion + + #region 获取按钮权限 + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + + + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.ConstructionRiskMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnIn)) + { + this.btnImport.Hidden = false; + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnAuditing)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskDataIn.aspx", "导入 - "))); + } + #endregion + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskEdit.aspx", "添加 - "))); + } + #endregion + + protected void btnAudit_Click(object sender, EventArgs e) + { + + var risks = Funs.DB.HSSE_ConstructionRisk.Where(x => x.States == "2"); + foreach (var r in risks) + { + r.States = "3"; + } + Funs.DB.SubmitChanges(); + } + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand111(object sender, TreeCommandEventArgs e) + { + BindGrid(); + } + #endregion + protected void btnMenuCheck_Click(object sender, EventArgs e) + { + var ids = Grid1.SelectedRowID.Split('|'); + if (ids.Length > 1) + { + hdState.Text = ""; + PageContext.RegisterStartupScript(Window2.GetSaveStateReference(hdState.ClientID) + + Window2.GetShowReference(String.Format("ConstructionRiskControlCheck.aspx?ControlId={0}", ids[1], "编辑 - "))); + } + } + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + var ids = Grid1.SelectedRowID.Split('|'); + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskEdit.aspx?ConstructionRiskId={0}", ids[0], "编辑 - "))); + + } + } +} + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.designer.cs new file mode 100644 index 00000000..60b7c989 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRisk + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// hdState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdState; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + + /// + /// btnMenuCheck 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuCheck; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx new file mode 100644 index 00000000..1c43e5f0 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx @@ -0,0 +1,73 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRiskControlCheck.aspx.cs" + Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRiskControlCheck" ValidateRequest="false" %> + +<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" + TagPrefix="uc1" %> + + + + 施工作业风险 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.cs new file mode 100644 index 00000000..02bdea89 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.cs @@ -0,0 +1,115 @@ +using BLL; +using Org.BouncyCastle.Crypto; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRiskControlCheck : PageBase + { + #region 定义变量 + + /// + /// 项目主键 + /// + + public string ControlId + { + get + { + return (string)ViewState["ControlId"]; + } + set + { + ViewState["ControlId"] = value; + } + } + public string ConstructionRiskId + { + get + { + return (string)ViewState["ConstructionRiskId"]; + } + set + { + ViewState["ConstructionRiskId"] = value; + } + } + + + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + string ControlId = Request["ControlId"]; + if (!string.IsNullOrEmpty(ControlId)) + { + + this.ControlId = ControlId; + } + var constructionRiskControl = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x=>x.ControlId == this.ControlId); + if (constructionRiskControl != null) + { + this.ConstructionRiskId = constructionRiskControl.ConstructionRiskId; + if (!string.IsNullOrEmpty(constructionRiskControl.CheckResult)) + { + rbCheckResult.SelectedValue = constructionRiskControl.CheckResult; + } + if (!string.IsNullOrEmpty(constructionRiskControl.Rectification)) + { + rbRectification.SelectedValue = constructionRiskControl.Rectification; + } + } + } + } + #endregion + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + this.SaveData(BLL.Const.BtnSave); + } + #endregion + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + + Model.HSSE_ConstructionRiskControl newconstructionRisk = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId == this.ControlId); + + if (newconstructionRisk != null) + { + newconstructionRisk.CheckResult = rbCheckResult.SelectedValue; + newconstructionRisk.Rectification = rbRectification.SelectedValue; + } + Funs.DB.SubmitChanges(); + + PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(rbRectification.SelectedValue) + ActiveWindow.GetHidePostBackReference()); + + + } + + protected void rdCheckResult_SelectedIndexChanged(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.designer.cs new file mode 100644 index 00000000..b96e463d --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.designer.cs @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRiskControlCheck + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// rbCheckResult 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbCheckResult; + + /// + /// rbRectification 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbRectification; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx new file mode 100644 index 00000000..823d8987 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx @@ -0,0 +1,59 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRiskControlEdit.aspx.cs" + Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRiskControlEdit" ValidateRequest="false" %> + +<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" + TagPrefix="uc1" %> + + + + 施工作业风险 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.cs new file mode 100644 index 00000000..f6323317 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.cs @@ -0,0 +1,128 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRiskControlEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ConstructionRiskId + { + get + { + return (string)ViewState["ConstructionRiskId"]; + } + set + { + ViewState["ConstructionRiskId"] = value; + } + } + /// + /// 项目主键 + /// + + public string ControlId + { + get + { + return (string)ViewState["ControlId"]; + } + set + { + ViewState["ControlId"] = value; + } + } + + + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + this.ConstructionRiskId = Request.Params["ConstructionRiskId"]; + this.ControlId = Request.Params["ControlId"]; + + + var constructionRiskControl = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x=>x.ControlId == this.ControlId); + if (constructionRiskControl != null) + { + + if (!string.IsNullOrEmpty(constructionRiskControl.Measures)) + { + txtMeasures.Text = constructionRiskControl.Measures; + } + + } + } + } + #endregion + + + + + + + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + #endregion + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + Model.HSSE_ConstructionRiskControl newConstructionRiskControl = new Model.HSSE_ConstructionRiskControl + { + ConstructionRiskId = this.ConstructionRiskId, + + }; + + newConstructionRiskControl.Measures = this.txtMeasures.Text ; + + if (!string.IsNullOrEmpty(this.ControlId)) + { + newConstructionRiskControl.ControlId = this.ControlId; + BLL.ConstructionRiskListService.UpdateConstructionRiskControl(newConstructionRiskControl); + BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRiskControl.ConstructionRiskId, newConstructionRiskControl.ConstructionRiskId, BLL.Const.ProjectEnvironmentalRiskListMenuId, BLL.Const.BtnModify); + } + else + { + newConstructionRiskControl.ControlId = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList)); + this.ControlId = newConstructionRiskControl.ControlId; + BLL.ConstructionRiskListService.AddConstructionRiskControl(newConstructionRiskControl); + BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRiskControl.ConstructionRiskId, newConstructionRiskControl.ConstructionRiskId, BLL.Const.ProjectEnvironmentalRiskListMenuId, BLL.Const.BtnAdd); + } + + } + + protected void rdCheckResult_SelectedIndexChanged(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.designer.cs new file mode 100644 index 00000000..d5a9ebe4 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRiskControlEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtMeasures 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtMeasures; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx new file mode 100644 index 00000000..4cf9a3a4 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx @@ -0,0 +1,54 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRiskDataIn.aspx.cs" Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRiskDataIn" %> + + + + + + + 危险源台账导入 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.cs new file mode 100644 index 00000000..50f2dc95 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.cs @@ -0,0 +1,440 @@ +using BLL; +using FineUIPro.Web.SysManage; +using Model; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.OleDb; +using System.IO; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRiskDataIn : PageBase + { + #region 定义变量 + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + /// + /// 导入模版文件原始的虚拟路径 + /// + private string initTemplatePath = Const.ConstructionRiskTemplateUrl; + + /// + /// 错误集合 + /// + public static List errorInfos = new List(); + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (errorInfos != null) + { + errorInfos.Clear(); + } + } + } + #endregion + + #region 模板下载 + /// + /// 模板下载 + /// + /// + /// + protected void imgbtnUpload_Click(object sender, EventArgs e) + { + string uploadfilepath = Server.MapPath("~/") + initTemplatePath; + string fileName = Path.GetFileName(initTemplatePath); + FileInfo info = new FileInfo(uploadfilepath); + if (info.Exists) + { + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.Flush(); + Response.Close(); + } + else + { + ShowNotify("文件不存在!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 审核 + /// + /// 审核 + /// + /// + /// + protected void btnAudit_Click(object sender, EventArgs e) + { + try + { + if (this.FileExcel.HasFile == false) + { + Alert.ShowInTop("请您选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(FileExcel.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls") + { + Alert.ShowInTop("只可以选择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; + FileExcel.PostedFile.SaveAs(filePath); + ImportXlsToData(filePath); + + } + catch (Exception ex) + { + Alert.ShowInTop(ex.Message); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.SelectCommand.CommandTimeout = 1200; + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL(ds.Tables[0], 14); + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + #endregion + + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集列数 + /// + private bool AddDatasetToSQL(DataTable pds, int Cols) + { + string result = string.Empty; + int ic, ir; + ic = pds.Columns.Count; + + + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + var units = from x in Funs.DB.Base_Unit select x; + var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == CurrUser.LoginProjectId select x; + for (int i = 0; i < ir; i++) + { + string row0 = pds.Rows[i][0].ToString().Trim(); + string row1 = pds.Rows[i][1].ToString().Trim(); + string row2 = pds.Rows[i][2].ToString().Trim(); + string row3 = pds.Rows[i][3].ToString().Trim(); + string row4 = pds.Rows[i][4].ToString().Trim(); + string row5 = pds.Rows[i][5].ToString().Trim(); + string row6 = pds.Rows[i][6].ToString().Trim(); + string row7 = pds.Rows[i][7].ToString().Trim(); + string row8 = pds.Rows[i][8].ToString().Trim(); + if (string.IsNullOrEmpty(row0)) + { + result += (i + 2).ToString() + "," + "本周开始时间" + "," + "此项为必填项!" + "|"; + } + if (string.IsNullOrEmpty(row1)) + { + result += (i + 2).ToString() + "," + "本周结束时间" + "," + "此项为必填项!" + "|"; + } + if (string.IsNullOrEmpty(row2)) + { + result += (i + 2).ToString() + "," + "单位工程" + "," + "此项为必填项!" + "|"; + } + else + { + var unitWork = unitWorks.Where(x => x.UnitWorkName == row2.Trim()).FirstOrDefault(); + if (unitWork == null) + { + result += (i + 2).ToString() + "," + "单位工程" + "," + "此项目不存在!" + "|"; + + } + } + if (string.IsNullOrEmpty(row3)) + { + result += (i + 2).ToString() + "," + "单位工程" + "," + "此项为必填项!" + "|"; + } + else + { + var unit = units.Where(x => x.UnitName == row3.Trim()).FirstOrDefault(); + if (unit == null) + { + result += (i + 2).ToString() + "," + "单位" + "," + "此项目不存在!" + "|"; + + } + } + if (string.IsNullOrEmpty(row4)) + { + result += (i + 2).ToString() + "," + "施工内容" + "," + "此项为必填项!" + "|"; + } + if (string.IsNullOrEmpty(row5)) + { + result += (i + 2).ToString() + "," + "施工内容" + "," + "此项为必填项!" + "|"; + } + } + + if (!string.IsNullOrEmpty(result)) + { + result = result.Substring(0, result.LastIndexOf("|")); + } + errorInfos.Clear(); + if (!string.IsNullOrEmpty(result)) + { + string results = result; + List errorInfoList = results.Split('|').ToList(); + foreach (var item in errorInfoList) + { + string[] errors = item.Split(','); + Model.ErrorInfo errorInfo = new Model.ErrorInfo(); + errorInfo.Row = errors[0]; + errorInfo.Column = errors[1]; + errorInfo.Reason = errors[2]; + errorInfos.Add(errorInfo); + } + if (errorInfos.Count > 0) + { + Grid1.DataSource = errorInfos; + Grid1.DataBind(); + } + } + else + { + ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success); + } + } + else + { + throw new Exception("导入数据为空!"); + } + return true; + } + + #region 导入 + /// + /// 导入 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (errorInfos.Count <= 0) + { + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + string filePath = initFullPath + this.hdfileName.Text; + ImportXlsToData2(filePath); + } + else + { + Alert.ShowInTop("请先将错误数据修正,再重新导入保存!", MessageBoxIcon.Warning); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData2(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.SelectCommand.CommandTimeout = 1200; + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL2(ds.Tables[0]); + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集列数 + /// + private bool AddDatasetToSQL2(DataTable pds) + { + string result = string.Empty; + string dReportID = string.Empty; + string dateStr = string.Empty; + int ir; + + string des = ""; + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + Model.HSSE_ConstructionRisk newConstructionRisk = null; + var units = from x in Funs.DB.Base_Unit select x; + var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == CurrUser.LoginProjectId select x; + int index = 1; + for (int i = 0; i < ir; i++) + { + string row0 = pds.Rows[i][0].ToString().Trim(); + string row1 = pds.Rows[i][1].ToString().Trim(); + string row2 = pds.Rows[i][2].ToString().Trim(); + string row3 = pds.Rows[i][3].ToString().Trim(); + string row4 = pds.Rows[i][4].ToString().Trim(); + string row5 = pds.Rows[i][5].ToString().Trim(); + string row6 = pds.Rows[i][6].ToString().Trim(); + string row7 = pds.Rows[i][7].ToString().Trim(); + string row8 = pds.Rows[i][8].ToString().Trim(); + var unit = units.Where(x => x.UnitName == row3).FirstOrDefault(); + var unitWork = unitWorks.Where(x => x.UnitWorkName == row2).FirstOrDefault(); + + if (des != row4) + { + index = 1; + newConstructionRisk = new Model.HSSE_ConstructionRisk(); + newConstructionRisk.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.HSSE_ConstructionRisk)); + + newConstructionRisk.ProjectId = this.CurrUser.LoginProjectId; + newConstructionRisk.UnitId = unit.UnitId; + newConstructionRisk.WorkAreaId = unitWork.UnitWorkId; + try + { + newConstructionRisk.DateA = Funs.GetNewDateTime(row0); + + newConstructionRisk.DateWeek = newConstructionRisk.DateA.Value.ToString("yyyy年") + Funs.GetWeekOfYear(newConstructionRisk.DateA.Value)+"周"; + } + catch (Exception e) { } + try + { + newConstructionRisk.DateZ = Funs.GetNewDateTime(row1); + } + catch (Exception e) { } + newConstructionRisk.ConstructionContent = row4; + newConstructionRisk.RefLicense = row5; + newConstructionRisk.LicenseDes = row6; + newConstructionRisk.RiskLevel = row7; + Funs.DB.HSSE_ConstructionRisk.InsertOnSubmit(newConstructionRisk); + des = row4; + } + + Model.HSSE_ConstructionRiskControl constructionRiskControl = new Model.HSSE_ConstructionRiskControl(); + constructionRiskControl.ControlId = SQLHelper.GetNewID(typeof(Model.HSSE_ConstructionRiskControl)); + constructionRiskControl.ConstructionRiskId = newConstructionRisk.ConstructionRiskId; + constructionRiskControl.Measures = row8; + constructionRiskControl.ShowIndex = index; + Funs.DB.HSSE_ConstructionRiskControl.InsertOnSubmit(constructionRiskControl); + + + } + Funs.DB.SubmitChanges(); + ShowNotify("导入成功!", MessageBoxIcon.Success); + + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + throw new Exception("导入数据为空!"); + } + return true; + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.designer.cs new file mode 100644 index 00000000..b60eac35 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.designer.cs @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRiskDataIn + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdId; + + /// + /// hdfileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdfileName; + + /// + /// FileExcel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload FileExcel; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// imgbtnUpload 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnUpload; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx new file mode 100644 index 00000000..2d2eafb9 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx @@ -0,0 +1,178 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRiskEdit.aspx.cs" + Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRiskEdit" ValidateRequest="false" %> + +<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" + TagPrefix="uc1" %> + + + + 施工作业风险 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.cs new file mode 100644 index 00000000..c7c5564e --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.cs @@ -0,0 +1,324 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRiskEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ConstructionRiskId + { + get + { + return (string)ViewState["ConstructionRiskId"]; + } + set + { + ViewState["ConstructionRiskId"] = value; + } + } + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + /// + /// 定义集合 + /// + private static List constructionRiskControls = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ProjectId = this.CurrUser.LoginProjectId; + this.InitDropDownList(); + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + constructionRiskControls.Clear(); + + this.ConstructionRiskId = Request.Params["ConstructionRiskId"]; + var constructionRisk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x=>x.ConstructionRiskId==this.ConstructionRiskId); + if (constructionRisk != null) + { + this.ProjectId = constructionRisk.ProjectId; + this.InitDropDownList(); + this.dpDateA.Text = string.Format("{0:yyyy-MM-dd}", constructionRisk.DateA); + this.dpDateZ.Text = string.Format("{0:yyyy-MM-dd}", constructionRisk.DateZ); + + if (!string.IsNullOrEmpty(constructionRisk.WorkAreaId)) + { + drpWorkArea.SelectedValue = constructionRisk.WorkAreaId; + } + if (!string.IsNullOrEmpty(constructionRisk.UnitId)) + { + drpUnit.SelectedValue = constructionRisk.UnitId; + } + if (!string.IsNullOrEmpty(constructionRisk.RiskLevel)) + { + drpRiskLevel.SelectedValue = constructionRisk.RiskLevel; + } + if (!string.IsNullOrEmpty(constructionRisk.RefLicense)) + { + drpRefLicense.SelectedValueArray = constructionRisk.RefLicense.Split(','); + } + if (!string.IsNullOrEmpty(constructionRisk.ConstructionContent)) + { + this.txtConstructionContent.Text = HttpUtility.HtmlDecode(constructionRisk.ConstructionContent); + } + if (!string.IsNullOrEmpty(constructionRisk.LicenseDes)) + { + this.txtLicenseDes.Text = HttpUtility.HtmlDecode(constructionRisk.LicenseDes); + } + if (!string.IsNullOrEmpty(constructionRisk.RiskLevel)) + { + this.drpRiskLevel.SelectedValueArray = constructionRisk.RiskLevel.Split(','); + } + constructionRiskControls = (from x in Funs.DB.HSSE_ConstructionRiskControl where x.ConstructionRiskId == this.ConstructionRiskId orderby x.ShowIndex select x).ToList(); + } + + Grid1.DataSource = constructionRiskControls; + Grid1.DataBind(); + + ///初始化审核菜单 + this.ctlAuditFlow.MenuId = BLL.Const.ConstructionRiskMenuId; + this.ctlAuditFlow.DataId = this.ConstructionRiskId; + this.ctlAuditFlow.ProjectId = this.ProjectId; + this.ctlAuditFlow.UnitId = this.CurrUser.UnitId; + } + } + #endregion + + /// + /// 初始化下拉框 + /// + private void InitDropDownList() + { + ///区域下拉框 + BLL.UnitWorkService.InitUnitWorkDownList(this.drpWorkArea, this.ProjectId, true); + + drpRefLicense.DataValueField = "LicenseTypeName"; + drpRefLicense.DataTextField = "LicenseTypeName"; + drpRefLicense.DataSource = (from x in Funs.DB.Base_LicenseType orderby x.LicenseTypeCode select x).ToList(); + drpRefLicense.DataBind(); + + + UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.ProjectId, Const.ProjectUnitType_2, false); + + + } + + + + #region 提交按钮 + /// + /// 提交按钮 + /// + /// + /// + protected void btnSubmit_Click(object sender, EventArgs e) + { + if (this.ctlAuditFlow.NextStep == BLL.Const.State_1 && this.ctlAuditFlow.NextPerson == BLL.Const._Null) + { + ShowNotify("请选择下一步办理人!", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSubmit); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + #endregion + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + #endregion + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + Model.HSSE_ConstructionRisk newConstructionRisk = new Model.HSSE_ConstructionRisk + { + ProjectId = this.ProjectId, + + }; + if (this.dpDateA.SelectedDate.HasValue) + { + newConstructionRisk.DateWeek = this.dpDateA.SelectedDate.Value.Year + "年" + Funs.GetWeekOfYear(this.dpDateA.SelectedDate.Value) + "周"; + } + if (this.drpWorkArea.SelectedValue != BLL.Const._Null) + { + newConstructionRisk.WorkAreaId = this.drpWorkArea.SelectedValue; + } + if (this.drpRiskLevel.SelectedValue != BLL.Const._Null) + { + newConstructionRisk.RiskLevel = drpRiskLevel.SelectedValue; + } + if ( drpRefLicense.SelectedValueArray!=null && drpRefLicense.SelectedValueArray.Count()>0) + { + newConstructionRisk.RefLicense = string.Join(",",drpRefLicense.SelectedValueArray); + } + if (this.drpUnit.SelectedValue != BLL.Const._Null) + { + newConstructionRisk.UnitId = drpUnit.SelectedValue; + } + newConstructionRisk.DateA = Funs.GetNewDateTime(this.dpDateA.Text.Trim()); + newConstructionRisk.DateZ = Funs.GetNewDateTime(this.dpDateZ.Text.Trim()); + newConstructionRisk.LicenseDes = HttpUtility.HtmlEncode(this.txtLicenseDes.Text); + newConstructionRisk.ConstructionContent = HttpUtility.HtmlEncode(this.txtConstructionContent.Text); + ////单据状态 + newConstructionRisk.States = BLL.Const.State_0; + if (type == BLL.Const.BtnSubmit) + { + newConstructionRisk.States = this.ctlAuditFlow.NextStep; + } + if (!string.IsNullOrEmpty(this.ConstructionRiskId)) + { + newConstructionRisk.ConstructionRiskId = this.ConstructionRiskId; + BLL.ConstructionRiskListService.UpdateConstructionRisk(newConstructionRisk); + BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRisk.ConstructionRiskId, newConstructionRisk.ConstructionRiskId, BLL.Const.ProjectEnvironmentalRiskListMenuId, BLL.Const.BtnModify); + } + else + { + newConstructionRisk.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList)); + this.ConstructionRiskId = newConstructionRisk.ConstructionRiskId; + BLL.ConstructionRiskListService.AddConstructionRisk(newConstructionRisk); + BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRisk.ConstructionRiskId, newConstructionRisk.ConstructionRiskId, BLL.Const.ProjectEnvironmentalRiskListMenuId, BLL.Const.BtnAdd); + } + foreach(var item in constructionRiskControls) + { + item.ConstructionRiskId= newConstructionRisk.ConstructionRiskId; + + } + BLL.ConstructionRiskListService.AddConstructionRiskControl(constructionRiskControls, this.ConstructionRiskId); + ////保存流程审核数据 + this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectEnvironmentalRiskListMenuId, this.ConstructionRiskId, (type == BLL.Const.BtnSubmit ? true : false), this.txtConstructionContent.Text.Trim(), "../Hazard/EnvironmentalRiskListView.aspx?EnvironmentalRiskListId={0}"); + } + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, EventArgs e) + { + constructionRiskControls = (from x in Funs.DB.HSSE_ConstructionRiskControl where x.ConstructionRiskId == this.ConstructionRiskId orderby x.ShowIndex select x).ToList(); + Grid1.DataSource = constructionRiskControls; + Grid1.DataBind(); + } + #endregion + + #region Grid双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + btnMenuEdit_Click(null, null); + } + #endregion + + #region 编辑 + /// + /// 编辑按钮 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string rowID = Grid1.SelectedRowID; + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskControlEdit.aspx?ConstructionRiskId={0}&ControlId={1}", ConstructionRiskId, rowID, "编辑 - "))); + + } + #endregion + + #region 删除 + /// + /// 批量删除 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var constructionRiskControl = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId == rowID); + Funs.DB.HSSE_ConstructionRiskControl.DeleteOnSubmit(constructionRiskControl); + Funs.DB.SubmitChanges(); + } + constructionRiskControls = (from x in Funs.DB.HSSE_ConstructionRiskControl where x.ConstructionRiskId == this.ConstructionRiskId orderby x.ShowIndex select x).ToList(); + Grid1.DataSource = constructionRiskControls; + Grid1.DataBind(); + ShowNotify("删除数据成功!(表格数据已重新绑定)"); + } + } + #endregion + + + + #region 区域选择框事件 + /// + /// 区域选择框事件 + /// + /// + /// + protected void dpDateA_SelectedIndexChanged (object sender, EventArgs e) + { + + } + #endregion + + protected void btnAdd_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.ConstructionRiskId)) + { + this.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList)); + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskControlEdit.aspx?ConstructionRiskId=" + this.ConstructionRiskId, "添加 - "))); + } + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.designer.cs new file mode 100644 index 00000000..c429cf60 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.designer.cs @@ -0,0 +1,269 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRiskEdit + { + + /// + /// 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; + + /// + /// dpDateA 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker dpDateA; + + /// + /// dpDateZ 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker dpDateZ; + + /// + /// txtConstructionContent 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtConstructionContent; + + /// + /// drpWorkArea 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWorkArea; + + /// + /// drpRefLicense 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpRefLicense; + + /// + /// drpRiskLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpRiskLevel; + + /// + /// txtLicenseDes 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtLicenseDes; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAdd; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtContents 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HtmlEditor txtContents; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ctlAuditFlow 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.FlowOperateControl ctlAuditFlow; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnSubmit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSubmit; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx.cs b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx.cs index 5ce6eab9..a929b2c0 100644 --- a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx.cs @@ -21,7 +21,18 @@ namespace FineUIPro.Web.HSSE.HiddenInspection ViewState["HazardRegisterId"] = value; } } - + private string ControlId + { + get + { + return (string)ViewState["ControlId"]; + } + set + { + ViewState["ControlId"] = value; + } + } + /// /// 图片路径 /// @@ -144,6 +155,21 @@ namespace FineUIPro.Web.HSSE.HiddenInspection this.txtWorkPackageId.Text = registration.WorkPackageName; } } + + + this.ControlId = Request.Params["ControlId"]; + if (!string.IsNullOrEmpty(ControlId)) + { + var control = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId == ControlId); + if (control != null) + { + var risk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x => x.ConstructionRiskId == control.ConstructionRiskId); + txtRegisterDef.Text = risk.LicenseDes; + drpUnit.SelectedValue = risk.UnitId; + drpWorkArea.SelectedValue = risk.WorkAreaId; + } + } + } } #endregion diff --git a/SGGL/Model/APIItem/HSSE/PersonItem.cs b/SGGL/Model/APIItem/HSSE/PersonItem.cs index c529dd29..94ae9006 100644 --- a/SGGL/Model/APIItem/HSSE/PersonItem.cs +++ b/SGGL/Model/APIItem/HSSE/PersonItem.cs @@ -198,6 +198,14 @@ namespace Model set; } /// + /// 合同/协议 + /// + public string AttachUrl6 + { + get; + set; + } + /// /// 岗位类型 /// public string PostType diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 645a9a07..5f619b70 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -680,6 +680,12 @@ namespace Model partial void InsertHJGLData_HJGL(HJGLData_HJGL instance); partial void UpdateHJGLData_HJGL(HJGLData_HJGL instance); partial void DeleteHJGLData_HJGL(HJGLData_HJGL instance); + partial void InsertHSSE_ConstructionRisk(HSSE_ConstructionRisk instance); + partial void UpdateHSSE_ConstructionRisk(HSSE_ConstructionRisk instance); + partial void DeleteHSSE_ConstructionRisk(HSSE_ConstructionRisk instance); + partial void InsertHSSE_ConstructionRiskControl(HSSE_ConstructionRiskControl instance); + partial void UpdateHSSE_ConstructionRiskControl(HSSE_ConstructionRiskControl instance); + partial void DeleteHSSE_ConstructionRiskControl(HSSE_ConstructionRiskControl instance); partial void InsertHSSE_Hazard_HazardRegister(HSSE_Hazard_HazardRegister instance); partial void UpdateHSSE_Hazard_HazardRegister(HSSE_Hazard_HazardRegister instance); partial void DeleteHSSE_Hazard_HazardRegister(HSSE_Hazard_HazardRegister instance); @@ -3557,6 +3563,22 @@ namespace Model } } + public System.Data.Linq.Table HSSE_ConstructionRisk + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table HSSE_ConstructionRiskControl + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table HSSE_Hazard_HazardRegister { get @@ -100919,6 +100941,538 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HSSE_ConstructionRisk")] + public partial class HSSE_ConstructionRisk : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ConstructionRiskId; + + private string _WorkAreaId; + + private string _UnitId; + + private string _ConstructionContent; + + private string _RefLicense; + + private string _LicenseDes; + + private string _RiskLevel; + + private string _States; + + private System.Nullable _DateA; + + private System.Nullable _DateZ; + + private string _DateWeek; + + private string _ProjectId; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnConstructionRiskIdChanging(string value); + partial void OnConstructionRiskIdChanged(); + partial void OnWorkAreaIdChanging(string value); + partial void OnWorkAreaIdChanged(); + partial void OnUnitIdChanging(string value); + partial void OnUnitIdChanged(); + partial void OnConstructionContentChanging(string value); + partial void OnConstructionContentChanged(); + partial void OnRefLicenseChanging(string value); + partial void OnRefLicenseChanged(); + partial void OnLicenseDesChanging(string value); + partial void OnLicenseDesChanged(); + partial void OnRiskLevelChanging(string value); + partial void OnRiskLevelChanged(); + partial void OnStatesChanging(string value); + partial void OnStatesChanged(); + partial void OnDateAChanging(System.Nullable value); + partial void OnDateAChanged(); + partial void OnDateZChanging(System.Nullable value); + partial void OnDateZChanged(); + partial void OnDateWeekChanging(string value); + partial void OnDateWeekChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + #endregion + + public HSSE_ConstructionRisk() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionRiskId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ConstructionRiskId + { + get + { + return this._ConstructionRiskId; + } + set + { + if ((this._ConstructionRiskId != value)) + { + this.OnConstructionRiskIdChanging(value); + this.SendPropertyChanging(); + this._ConstructionRiskId = value; + this.SendPropertyChanged("ConstructionRiskId"); + this.OnConstructionRiskIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaId", DbType="NVarChar(50)")] + public string WorkAreaId + { + get + { + return this._WorkAreaId; + } + set + { + if ((this._WorkAreaId != value)) + { + this.OnWorkAreaIdChanging(value); + this.SendPropertyChanging(); + this._WorkAreaId = value; + this.SendPropertyChanged("WorkAreaId"); + this.OnWorkAreaIdChanged(); + } + } + } + + [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="_ConstructionContent", DbType="NVarChar(1000)")] + public string ConstructionContent + { + get + { + return this._ConstructionContent; + } + set + { + if ((this._ConstructionContent != value)) + { + this.OnConstructionContentChanging(value); + this.SendPropertyChanging(); + this._ConstructionContent = value; + this.SendPropertyChanged("ConstructionContent"); + this.OnConstructionContentChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RefLicense", DbType="NVarChar(100)")] + public string RefLicense + { + get + { + return this._RefLicense; + } + set + { + if ((this._RefLicense != value)) + { + this.OnRefLicenseChanging(value); + this.SendPropertyChanging(); + this._RefLicense = value; + this.SendPropertyChanged("RefLicense"); + this.OnRefLicenseChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LicenseDes", DbType="NVarChar(100)")] + public string LicenseDes + { + get + { + return this._LicenseDes; + } + set + { + if ((this._LicenseDes != value)) + { + this.OnLicenseDesChanging(value); + this.SendPropertyChanging(); + this._LicenseDes = value; + this.SendPropertyChanged("LicenseDes"); + this.OnLicenseDesChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RiskLevel", DbType="NVarChar(50)")] + public string RiskLevel + { + get + { + return this._RiskLevel; + } + set + { + if ((this._RiskLevel != value)) + { + this.OnRiskLevelChanging(value); + this.SendPropertyChanging(); + this._RiskLevel = value; + this.SendPropertyChanged("RiskLevel"); + this.OnRiskLevelChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_States", DbType="NVarChar(2)")] + public string States + { + get + { + return this._States; + } + set + { + if ((this._States != value)) + { + this.OnStatesChanging(value); + this.SendPropertyChanging(); + this._States = value; + this.SendPropertyChanged("States"); + this.OnStatesChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateA", DbType="Date")] + public System.Nullable DateA + { + get + { + return this._DateA; + } + set + { + if ((this._DateA != value)) + { + this.OnDateAChanging(value); + this.SendPropertyChanging(); + this._DateA = value; + this.SendPropertyChanged("DateA"); + this.OnDateAChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateZ", DbType="Date")] + public System.Nullable DateZ + { + get + { + return this._DateZ; + } + set + { + if ((this._DateZ != value)) + { + this.OnDateZChanging(value); + this.SendPropertyChanging(); + this._DateZ = value; + this.SendPropertyChanged("DateZ"); + this.OnDateZChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateWeek", DbType="NVarChar(50)")] + public string DateWeek + { + get + { + return this._DateWeek; + } + set + { + if ((this._DateWeek != value)) + { + this.OnDateWeekChanging(value); + this.SendPropertyChanging(); + this._DateWeek = value; + this.SendPropertyChanged("DateWeek"); + this.OnDateWeekChanged(); + } + } + } + + [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(); + } + } + } + + 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.HSSE_ConstructionRiskControl")] + public partial class HSSE_ConstructionRiskControl : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ControlId; + + private string _Measures; + + private string _CheckResult; + + private string _CheckMan; + + private string _Rectification; + + private string _ConstructionRiskId; + + private System.Nullable _ShowIndex; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnControlIdChanging(string value); + partial void OnControlIdChanged(); + partial void OnMeasuresChanging(string value); + partial void OnMeasuresChanged(); + partial void OnCheckResultChanging(string value); + partial void OnCheckResultChanged(); + partial void OnCheckManChanging(string value); + partial void OnCheckManChanged(); + partial void OnRectificationChanging(string value); + partial void OnRectificationChanged(); + partial void OnConstructionRiskIdChanging(string value); + partial void OnConstructionRiskIdChanged(); + partial void OnShowIndexChanging(System.Nullable value); + partial void OnShowIndexChanged(); + #endregion + + public HSSE_ConstructionRiskControl() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ControlId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ControlId + { + get + { + return this._ControlId; + } + set + { + if ((this._ControlId != value)) + { + this.OnControlIdChanging(value); + this.SendPropertyChanging(); + this._ControlId = value; + this.SendPropertyChanged("ControlId"); + this.OnControlIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Measures", DbType="NVarChar(50)")] + public string Measures + { + get + { + return this._Measures; + } + set + { + if ((this._Measures != value)) + { + this.OnMeasuresChanging(value); + this.SendPropertyChanging(); + this._Measures = value; + this.SendPropertyChanged("Measures"); + this.OnMeasuresChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckResult", DbType="NVarChar(50)")] + public string CheckResult + { + get + { + return this._CheckResult; + } + set + { + if ((this._CheckResult != value)) + { + this.OnCheckResultChanging(value); + this.SendPropertyChanging(); + this._CheckResult = value; + this.SendPropertyChanged("CheckResult"); + this.OnCheckResultChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckMan", DbType="NVarChar(50)")] + public string CheckMan + { + get + { + return this._CheckMan; + } + set + { + if ((this._CheckMan != value)) + { + this.OnCheckManChanging(value); + this.SendPropertyChanging(); + this._CheckMan = value; + this.SendPropertyChanged("CheckMan"); + this.OnCheckManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rectification", DbType="NVarChar(50)")] + public string Rectification + { + get + { + return this._Rectification; + } + set + { + if ((this._Rectification != value)) + { + this.OnRectificationChanging(value); + this.SendPropertyChanging(); + this._Rectification = value; + this.SendPropertyChanged("Rectification"); + this.OnRectificationChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionRiskId", DbType="NVarChar(50)")] + public string ConstructionRiskId + { + get + { + return this._ConstructionRiskId; + } + set + { + if ((this._ConstructionRiskId != value)) + { + this.OnConstructionRiskIdChanging(value); + this.SendPropertyChanging(); + this._ConstructionRiskId = value; + this.SendPropertyChanged("ConstructionRiskId"); + this.OnConstructionRiskIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ShowIndex", DbType="Int")] + public System.Nullable ShowIndex + { + get + { + return this._ShowIndex; + } + set + { + if ((this._ShowIndex != value)) + { + this.OnShowIndexChanging(value); + this.SendPropertyChanging(); + this._ShowIndex = value; + this.SendPropertyChanged("ShowIndex"); + this.OnShowIndexChanged(); + } + } + } + + 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.HSSE_Hazard_HazardRegister")] public partial class HSSE_Hazard_HazardRegister : INotifyPropertyChanging, INotifyPropertyChanged {
}Kk5;tmaiP&&VW!JAR_s&Ws}bU&}5~f z;_ zZ6Qlu8#|r8B3}x6q#Dp^B1UJX-II1BsTkc9uREcql0cCG`9!rVTqB`2C4v;TB%LRQ z6tdGP4M^b-MW-Z?!q%ZvnvlXyO{cUVg|?+r+K|FdO{b)gLet&=4!kA6N3mjKa)4@z zKuAR+3Br7MmYmOOgJ{sC8F-V1DOHdNzSe^)&6TL2POP*siDfZ^`{Dbt8l7n0r4j$5 zBN_!tq6~o5#>%43STQUZ|C<53364zY9+<{Pz>xz@kE0XL9dH_odH)OlEDPZ9C(($49Hg-JJ>viGGwMV2+WMSUf&c?6;J8wr zzUKA2-f@Q87fXq&GnAIvVD8g$N-v3=Y^H-$KMOCmte}Hv=L**tPLqwbSL4=SR2nQTv zyF$dVw;x0tZzCWwfzJkrfdOSOFlPkEGB98}Am1d2nxqrVK%%JsAfe|aU-o|_e$e*p z5f30g8?a5cFp7Sb`|}K6TK?w|zl`G_UVbX}GxVi2h}d7Q)uxdKU5s=iA@C$m=V5>A z4!xu|^py$VInm%bQQ%3za2^RgEgCpwkb{BGKOKM`3O_H1LGV^kEAYQy@JMg){8sRH zK|zq?2YDgXbuiF + + + + + @@ -10156,6 +10161,41 @@ UnexpectedEnvironmentalView.aspx + + ConstructionRisk.aspx + ASPXCodeBehind + + + ConstructionRisk.aspx + + + ConstructionRiskControlCheck.aspx + ASPXCodeBehind + + + ConstructionRiskControlCheck.aspx + + + ConstructionRiskControlEdit.aspx + ASPXCodeBehind + + + ConstructionRiskControlEdit.aspx + + + ConstructionRiskDataIn.aspx + ASPXCodeBehind + + + ConstructionRiskDataIn.aspx + + + ConstructionRiskEdit.aspx + ASPXCodeBehind + + + ConstructionRiskEdit.aspx + EnvironmentalRiskItemEdit.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs index 84d58ea7..a2e9ea9b 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs @@ -27,7 +27,17 @@ namespace FineUIPro.Web.HSSE.Check } } #endregion - + public string ControlId + { + get + { + return (string)ViewState["ControlId"]; + } + set + { + ViewState["ControlId"] = value; + } + } /// /// 加载页面 /// @@ -85,6 +95,29 @@ namespace FineUIPro.Web.HSSE.Check BindGrid(); BindGrid1(); + ControlId = Request.Params["ControlId"]; + if (!string.IsNullOrEmpty(ControlId)) + { + var control = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId==ControlId); + if (control != null) + { + var risk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x => x.ConstructionRiskId == control.ConstructionRiskId); + drpWorkAreaId.SelectedValue = risk.WorkAreaId; + drpUnitId.SelectedValue= risk.UnitId; + List view = getViewTestPlanTrainingList(); + var item = new Check_RectifyNoticesItem + { + RectifyNoticesItemId = SQLHelper.GetNewID(), + RectifyNoticesId = this.RectifyNoticesId, + WrongContent = risk.LicenseDes + }; + view.Add(item); + //将gd数据保存在list中 + Grid1.DataSource = view; + Grid1.DataBind(); + } + } + } } diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx new file mode 100644 index 00000000..9caa4eb3 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx @@ -0,0 +1,136 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRisk.aspx.cs" Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRisk" %> + + + + + + + 施工作业风险 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + <%-- + --%> + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.cs new file mode 100644 index 00000000..bf9405d1 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.cs @@ -0,0 +1,328 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRisk : PageBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower();//权限设置 + + this.InitTreeMenu();//加载树 + } + } + + #region 加载树施工单位 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + + List units = null; + + var user = Person_PersonsService.GetPerson_PersonsById(this.CurrUser.PersonId); + if (!string.IsNullOrEmpty(user.UnitId)) + { + var projectUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, user.UnitId); + if (projectUnit != null) + { + if (projectUnit.UnitType == BLL.Const.ProjectUnitType_1 || projectUnit.UnitType == BLL.Const.ProjectUnitType_3 || projectUnit.UnitType == BLL.Const.ProjectUnitType_4) + { + var ids = Funs.DB.HSSE_ConstructionRisk.Select(x=>x.UnitId).Distinct().ToList(); + units = (from x in Funs.DB.Base_Unit + where ids.Contains(x.UnitId) + select x).OrderBy(x => x.UnitCode).ToList(); + } + else + { + units = (from x in Funs.DB.Base_Unit + where x.UnitId == this.CurrUser.UnitId select x).ToList(); + } + } + } + else if (user.UnitId == Const.UnitId_SEDIN || user.PersonId == Const.hfnbdId) + { + var ids = Funs.DB.HSSE_ConstructionRisk.Select(x => x.UnitId).Distinct().ToList(); + units = (from x in Funs.DB.Base_Unit + where ids.Contains(x.UnitId) + select x).OrderBy(x => x.UnitCode).ToList(); + } + + + if (units != null && units.Count > 0) + { + foreach (var unit in units) + { + + TreeNode rootNode = new TreeNode(); + rootNode.Text = unit.UnitName; + rootNode.NodeID = unit.UnitId; + rootNode.ToolTip = "单位"; + rootNode.Expanded = false; + this.tvControlItem.Nodes.Add(rootNode); + this.BindNodes(rootNode); + + } + } + + } + #endregion + + #region 关闭弹出窗口及刷新页面 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + this.InitTreeMenu(); + this.BindGrid(); + } + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + + + if (hdState.Text == "A") + { + var ids = Grid1.SelectedRowID.Split('|'); + if (ids.Length > 1) + { + hdState.Text = ""; + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../Check/RectifyNoticesAdd.aspx?ControlId={0}", ids[1], "编辑 - "))); + } + + } + else if (hdState.Text == "B") + { + var ids = Grid1.SelectedRowID.Split('|'); + if (ids.Length > 1) + { + hdState.Text = ""; + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HiddenInspection/HiddenRectificationAdd.aspx?ControlId={0}", ids[1], "编辑 - "))); + } + } + this.InitTreeMenu(); + this.BindGrid(); + } + #endregion + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + #endregion + + + #region 删除 + /// + /// 删除 + /// + /// + /// + + + /// + /// 右键删除明细 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var ids =rowID.Split('|'); + if (ids.Length >= 1) + { + var list = Funs.DB.HSSE_ConstructionRiskControl.Where(x => x.ConstructionRiskId == ids[0]).ToList(); + Funs.DB.HSSE_ConstructionRiskControl.DeleteAllOnSubmit(list); + var constructionRisk = Funs.DB.HSSE_ConstructionRisk.Where(x => x.ConstructionRiskId == ids[0]).FirstOrDefault(); + Funs.DB.HSSE_ConstructionRisk.DeleteOnSubmit(constructionRisk); + Funs.DB.SubmitChanges(); + } + } + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.InitTreeMenu(); + this.BindGrid(); + } + #endregion + + + + + + /// + /// 数据绑定 + /// + private void BindGrid() + { + if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.NodeID.Contains("|")) + { + var ids= this.tvControlItem.SelectedNode.NodeID.Split('|'); + string strSql = @"select c.UnitWorkName, '' Id,* + ,(CASE WHEN a.States = " + BLL.Const.State_3 + " THEN '审核/审批完成' when a.States = " + BLL.Const.State_0 + " OR a.States IS NULL THEN '待提交' WHEN a.States = " + BLL.Const.State_2 + " THEN '待总包安全经理审核' ELSE '待['+OperateUser.PersonName+']办理' END) AS FlowOperateName" + + @" from [dbo].[HSSE_ConstructionRisk] a left join [dbo].[HSSE_ConstructionRiskControl] b + on a.ConstructionRiskId =b.ConstructionRiskId left join WBS_UnitWork c on a.WorkAreaId = c.UnitWorkId + LEFT JOIN Sys_FlowOperate AS FlowOperate ON a.ConstructionRiskId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1 + LEFT JOIN Person_Persons AS OperateUser ON FlowOperate.OperaterId=OperateUser.PersonId + where a.UnitId=@UnitId and a.DateWeek=@DateWeek order by a.[ConstructionContent],b.[ShowIndex]"; + List listStr = new List(); + listStr.Add(new SqlParameter("@UnitId", ids[0])); + listStr.Add(new SqlParameter("@DateWeek", ids[1])); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + foreach(DataRow row in tb.Rows) + { + row["Id"] = row["ConstructionRiskId"] +"|"+ row["ControlId"]; + } + + Grid1.DataSource = tb; + Grid1.DataBind(); + } + } + #region 绑定树节点 + /// + /// 绑定树节点 + /// + /// + private void BindNodes(TreeNode node) + { + + var DateWeek = (from x in Funs.DB.HSSE_ConstructionRisk + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitId == node.NodeID + select x.DateWeek).OrderByDescending(x=>x).ToList(); + foreach (var d in DateWeek) + { + TreeNode newNode = new TreeNode(); + newNode.Text = d; //string.Format("{0:yyyy-MM-dd}", d.AssessmentDate); + newNode.NodeID = node.NodeID + "|" + d; + newNode.EnableClickEvent = true; + newNode.ToolTip = "标签"; + node.Nodes.Add(newNode); + + } + } + + #endregion + + #region 获取按钮权限 + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + + + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.ConstructionRiskMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnIn)) + { + this.btnImport.Hidden = false; + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnAuditing)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskDataIn.aspx", "导入 - "))); + } + #endregion + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskEdit.aspx", "添加 - "))); + } + #endregion + + protected void btnAudit_Click(object sender, EventArgs e) + { + + var risks = Funs.DB.HSSE_ConstructionRisk.Where(x => x.States == "2"); + foreach (var r in risks) + { + r.States = "3"; + } + Funs.DB.SubmitChanges(); + } + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand111(object sender, TreeCommandEventArgs e) + { + BindGrid(); + } + #endregion + protected void btnMenuCheck_Click(object sender, EventArgs e) + { + var ids = Grid1.SelectedRowID.Split('|'); + if (ids.Length > 1) + { + hdState.Text = ""; + PageContext.RegisterStartupScript(Window2.GetSaveStateReference(hdState.ClientID) + + Window2.GetShowReference(String.Format("ConstructionRiskControlCheck.aspx?ControlId={0}", ids[1], "编辑 - "))); + } + } + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + var ids = Grid1.SelectedRowID.Split('|'); + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskEdit.aspx?ConstructionRiskId={0}", ids[0], "编辑 - "))); + + } + } +} + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.designer.cs new file mode 100644 index 00000000..60b7c989 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRisk.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRisk + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// hdState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdState; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + + /// + /// btnMenuCheck 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuCheck; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx new file mode 100644 index 00000000..1c43e5f0 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx @@ -0,0 +1,73 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRiskControlCheck.aspx.cs" + Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRiskControlCheck" ValidateRequest="false" %> + +<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" + TagPrefix="uc1" %> + + + + 施工作业风险 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.cs new file mode 100644 index 00000000..02bdea89 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.cs @@ -0,0 +1,115 @@ +using BLL; +using Org.BouncyCastle.Crypto; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRiskControlCheck : PageBase + { + #region 定义变量 + + /// + /// 项目主键 + /// + + public string ControlId + { + get + { + return (string)ViewState["ControlId"]; + } + set + { + ViewState["ControlId"] = value; + } + } + public string ConstructionRiskId + { + get + { + return (string)ViewState["ConstructionRiskId"]; + } + set + { + ViewState["ConstructionRiskId"] = value; + } + } + + + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + string ControlId = Request["ControlId"]; + if (!string.IsNullOrEmpty(ControlId)) + { + + this.ControlId = ControlId; + } + var constructionRiskControl = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x=>x.ControlId == this.ControlId); + if (constructionRiskControl != null) + { + this.ConstructionRiskId = constructionRiskControl.ConstructionRiskId; + if (!string.IsNullOrEmpty(constructionRiskControl.CheckResult)) + { + rbCheckResult.SelectedValue = constructionRiskControl.CheckResult; + } + if (!string.IsNullOrEmpty(constructionRiskControl.Rectification)) + { + rbRectification.SelectedValue = constructionRiskControl.Rectification; + } + } + } + } + #endregion + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + this.SaveData(BLL.Const.BtnSave); + } + #endregion + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + + Model.HSSE_ConstructionRiskControl newconstructionRisk = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId == this.ControlId); + + if (newconstructionRisk != null) + { + newconstructionRisk.CheckResult = rbCheckResult.SelectedValue; + newconstructionRisk.Rectification = rbRectification.SelectedValue; + } + Funs.DB.SubmitChanges(); + + PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(rbRectification.SelectedValue) + ActiveWindow.GetHidePostBackReference()); + + + } + + protected void rdCheckResult_SelectedIndexChanged(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.designer.cs new file mode 100644 index 00000000..b96e463d --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.designer.cs @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRiskControlCheck + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// rbCheckResult 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbCheckResult; + + /// + /// rbRectification 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbRectification; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx new file mode 100644 index 00000000..823d8987 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx @@ -0,0 +1,59 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRiskControlEdit.aspx.cs" + Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRiskControlEdit" ValidateRequest="false" %> + +<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" + TagPrefix="uc1" %> + + + + 施工作业风险 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.cs new file mode 100644 index 00000000..f6323317 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.cs @@ -0,0 +1,128 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRiskControlEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ConstructionRiskId + { + get + { + return (string)ViewState["ConstructionRiskId"]; + } + set + { + ViewState["ConstructionRiskId"] = value; + } + } + /// + /// 项目主键 + /// + + public string ControlId + { + get + { + return (string)ViewState["ControlId"]; + } + set + { + ViewState["ControlId"] = value; + } + } + + + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + this.ConstructionRiskId = Request.Params["ConstructionRiskId"]; + this.ControlId = Request.Params["ControlId"]; + + + var constructionRiskControl = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x=>x.ControlId == this.ControlId); + if (constructionRiskControl != null) + { + + if (!string.IsNullOrEmpty(constructionRiskControl.Measures)) + { + txtMeasures.Text = constructionRiskControl.Measures; + } + + } + } + } + #endregion + + + + + + + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + #endregion + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + Model.HSSE_ConstructionRiskControl newConstructionRiskControl = new Model.HSSE_ConstructionRiskControl + { + ConstructionRiskId = this.ConstructionRiskId, + + }; + + newConstructionRiskControl.Measures = this.txtMeasures.Text ; + + if (!string.IsNullOrEmpty(this.ControlId)) + { + newConstructionRiskControl.ControlId = this.ControlId; + BLL.ConstructionRiskListService.UpdateConstructionRiskControl(newConstructionRiskControl); + BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRiskControl.ConstructionRiskId, newConstructionRiskControl.ConstructionRiskId, BLL.Const.ProjectEnvironmentalRiskListMenuId, BLL.Const.BtnModify); + } + else + { + newConstructionRiskControl.ControlId = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList)); + this.ControlId = newConstructionRiskControl.ControlId; + BLL.ConstructionRiskListService.AddConstructionRiskControl(newConstructionRiskControl); + BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRiskControl.ConstructionRiskId, newConstructionRiskControl.ConstructionRiskId, BLL.Const.ProjectEnvironmentalRiskListMenuId, BLL.Const.BtnAdd); + } + + } + + protected void rdCheckResult_SelectedIndexChanged(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.designer.cs new file mode 100644 index 00000000..d5a9ebe4 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlEdit.aspx.designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRiskControlEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtMeasures 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtMeasures; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx new file mode 100644 index 00000000..4cf9a3a4 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx @@ -0,0 +1,54 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRiskDataIn.aspx.cs" Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRiskDataIn" %> + + + + + + + 危险源台账导入 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.cs new file mode 100644 index 00000000..50f2dc95 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.cs @@ -0,0 +1,440 @@ +using BLL; +using FineUIPro.Web.SysManage; +using Model; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.OleDb; +using System.IO; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRiskDataIn : PageBase + { + #region 定义变量 + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + /// + /// 导入模版文件原始的虚拟路径 + /// + private string initTemplatePath = Const.ConstructionRiskTemplateUrl; + + /// + /// 错误集合 + /// + public static List errorInfos = new List(); + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (errorInfos != null) + { + errorInfos.Clear(); + } + } + } + #endregion + + #region 模板下载 + /// + /// 模板下载 + /// + /// + /// + protected void imgbtnUpload_Click(object sender, EventArgs e) + { + string uploadfilepath = Server.MapPath("~/") + initTemplatePath; + string fileName = Path.GetFileName(initTemplatePath); + FileInfo info = new FileInfo(uploadfilepath); + if (info.Exists) + { + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.Flush(); + Response.Close(); + } + else + { + ShowNotify("文件不存在!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 审核 + /// + /// 审核 + /// + /// + /// + protected void btnAudit_Click(object sender, EventArgs e) + { + try + { + if (this.FileExcel.HasFile == false) + { + Alert.ShowInTop("请您选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(FileExcel.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls") + { + Alert.ShowInTop("只可以选择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; + FileExcel.PostedFile.SaveAs(filePath); + ImportXlsToData(filePath); + + } + catch (Exception ex) + { + Alert.ShowInTop(ex.Message); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.SelectCommand.CommandTimeout = 1200; + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL(ds.Tables[0], 14); + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + #endregion + + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集列数 + /// + private bool AddDatasetToSQL(DataTable pds, int Cols) + { + string result = string.Empty; + int ic, ir; + ic = pds.Columns.Count; + + + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + var units = from x in Funs.DB.Base_Unit select x; + var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == CurrUser.LoginProjectId select x; + for (int i = 0; i < ir; i++) + { + string row0 = pds.Rows[i][0].ToString().Trim(); + string row1 = pds.Rows[i][1].ToString().Trim(); + string row2 = pds.Rows[i][2].ToString().Trim(); + string row3 = pds.Rows[i][3].ToString().Trim(); + string row4 = pds.Rows[i][4].ToString().Trim(); + string row5 = pds.Rows[i][5].ToString().Trim(); + string row6 = pds.Rows[i][6].ToString().Trim(); + string row7 = pds.Rows[i][7].ToString().Trim(); + string row8 = pds.Rows[i][8].ToString().Trim(); + if (string.IsNullOrEmpty(row0)) + { + result += (i + 2).ToString() + "," + "本周开始时间" + "," + "此项为必填项!" + "|"; + } + if (string.IsNullOrEmpty(row1)) + { + result += (i + 2).ToString() + "," + "本周结束时间" + "," + "此项为必填项!" + "|"; + } + if (string.IsNullOrEmpty(row2)) + { + result += (i + 2).ToString() + "," + "单位工程" + "," + "此项为必填项!" + "|"; + } + else + { + var unitWork = unitWorks.Where(x => x.UnitWorkName == row2.Trim()).FirstOrDefault(); + if (unitWork == null) + { + result += (i + 2).ToString() + "," + "单位工程" + "," + "此项目不存在!" + "|"; + + } + } + if (string.IsNullOrEmpty(row3)) + { + result += (i + 2).ToString() + "," + "单位工程" + "," + "此项为必填项!" + "|"; + } + else + { + var unit = units.Where(x => x.UnitName == row3.Trim()).FirstOrDefault(); + if (unit == null) + { + result += (i + 2).ToString() + "," + "单位" + "," + "此项目不存在!" + "|"; + + } + } + if (string.IsNullOrEmpty(row4)) + { + result += (i + 2).ToString() + "," + "施工内容" + "," + "此项为必填项!" + "|"; + } + if (string.IsNullOrEmpty(row5)) + { + result += (i + 2).ToString() + "," + "施工内容" + "," + "此项为必填项!" + "|"; + } + } + + if (!string.IsNullOrEmpty(result)) + { + result = result.Substring(0, result.LastIndexOf("|")); + } + errorInfos.Clear(); + if (!string.IsNullOrEmpty(result)) + { + string results = result; + List errorInfoList = results.Split('|').ToList(); + foreach (var item in errorInfoList) + { + string[] errors = item.Split(','); + Model.ErrorInfo errorInfo = new Model.ErrorInfo(); + errorInfo.Row = errors[0]; + errorInfo.Column = errors[1]; + errorInfo.Reason = errors[2]; + errorInfos.Add(errorInfo); + } + if (errorInfos.Count > 0) + { + Grid1.DataSource = errorInfos; + Grid1.DataBind(); + } + } + else + { + ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success); + } + } + else + { + throw new Exception("导入数据为空!"); + } + return true; + } + + #region 导入 + /// + /// 导入 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (errorInfos.Count <= 0) + { + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + string filePath = initFullPath + this.hdfileName.Text; + ImportXlsToData2(filePath); + } + else + { + Alert.ShowInTop("请先将错误数据修正,再重新导入保存!", MessageBoxIcon.Warning); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData2(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.SelectCommand.CommandTimeout = 1200; + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL2(ds.Tables[0]); + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集列数 + /// + private bool AddDatasetToSQL2(DataTable pds) + { + string result = string.Empty; + string dReportID = string.Empty; + string dateStr = string.Empty; + int ir; + + string des = ""; + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + Model.HSSE_ConstructionRisk newConstructionRisk = null; + var units = from x in Funs.DB.Base_Unit select x; + var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == CurrUser.LoginProjectId select x; + int index = 1; + for (int i = 0; i < ir; i++) + { + string row0 = pds.Rows[i][0].ToString().Trim(); + string row1 = pds.Rows[i][1].ToString().Trim(); + string row2 = pds.Rows[i][2].ToString().Trim(); + string row3 = pds.Rows[i][3].ToString().Trim(); + string row4 = pds.Rows[i][4].ToString().Trim(); + string row5 = pds.Rows[i][5].ToString().Trim(); + string row6 = pds.Rows[i][6].ToString().Trim(); + string row7 = pds.Rows[i][7].ToString().Trim(); + string row8 = pds.Rows[i][8].ToString().Trim(); + var unit = units.Where(x => x.UnitName == row3).FirstOrDefault(); + var unitWork = unitWorks.Where(x => x.UnitWorkName == row2).FirstOrDefault(); + + if (des != row4) + { + index = 1; + newConstructionRisk = new Model.HSSE_ConstructionRisk(); + newConstructionRisk.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.HSSE_ConstructionRisk)); + + newConstructionRisk.ProjectId = this.CurrUser.LoginProjectId; + newConstructionRisk.UnitId = unit.UnitId; + newConstructionRisk.WorkAreaId = unitWork.UnitWorkId; + try + { + newConstructionRisk.DateA = Funs.GetNewDateTime(row0); + + newConstructionRisk.DateWeek = newConstructionRisk.DateA.Value.ToString("yyyy年") + Funs.GetWeekOfYear(newConstructionRisk.DateA.Value)+"周"; + } + catch (Exception e) { } + try + { + newConstructionRisk.DateZ = Funs.GetNewDateTime(row1); + } + catch (Exception e) { } + newConstructionRisk.ConstructionContent = row4; + newConstructionRisk.RefLicense = row5; + newConstructionRisk.LicenseDes = row6; + newConstructionRisk.RiskLevel = row7; + Funs.DB.HSSE_ConstructionRisk.InsertOnSubmit(newConstructionRisk); + des = row4; + } + + Model.HSSE_ConstructionRiskControl constructionRiskControl = new Model.HSSE_ConstructionRiskControl(); + constructionRiskControl.ControlId = SQLHelper.GetNewID(typeof(Model.HSSE_ConstructionRiskControl)); + constructionRiskControl.ConstructionRiskId = newConstructionRisk.ConstructionRiskId; + constructionRiskControl.Measures = row8; + constructionRiskControl.ShowIndex = index; + Funs.DB.HSSE_ConstructionRiskControl.InsertOnSubmit(constructionRiskControl); + + + } + Funs.DB.SubmitChanges(); + ShowNotify("导入成功!", MessageBoxIcon.Success); + + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + throw new Exception("导入数据为空!"); + } + return true; + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.designer.cs new file mode 100644 index 00000000..b60eac35 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskDataIn.aspx.designer.cs @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRiskDataIn + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdId; + + /// + /// hdfileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdfileName; + + /// + /// FileExcel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload FileExcel; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// imgbtnUpload 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnUpload; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx new file mode 100644 index 00000000..2d2eafb9 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx @@ -0,0 +1,178 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRiskEdit.aspx.cs" + Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRiskEdit" ValidateRequest="false" %> + +<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" + TagPrefix="uc1" %> + + + + 施工作业风险 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.cs new file mode 100644 index 00000000..c7c5564e --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.cs @@ -0,0 +1,324 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace FineUIPro.Web.HSSE.Hazard +{ + public partial class ConstructionRiskEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ConstructionRiskId + { + get + { + return (string)ViewState["ConstructionRiskId"]; + } + set + { + ViewState["ConstructionRiskId"] = value; + } + } + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + /// + /// 定义集合 + /// + private static List constructionRiskControls = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ProjectId = this.CurrUser.LoginProjectId; + this.InitDropDownList(); + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + constructionRiskControls.Clear(); + + this.ConstructionRiskId = Request.Params["ConstructionRiskId"]; + var constructionRisk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x=>x.ConstructionRiskId==this.ConstructionRiskId); + if (constructionRisk != null) + { + this.ProjectId = constructionRisk.ProjectId; + this.InitDropDownList(); + this.dpDateA.Text = string.Format("{0:yyyy-MM-dd}", constructionRisk.DateA); + this.dpDateZ.Text = string.Format("{0:yyyy-MM-dd}", constructionRisk.DateZ); + + if (!string.IsNullOrEmpty(constructionRisk.WorkAreaId)) + { + drpWorkArea.SelectedValue = constructionRisk.WorkAreaId; + } + if (!string.IsNullOrEmpty(constructionRisk.UnitId)) + { + drpUnit.SelectedValue = constructionRisk.UnitId; + } + if (!string.IsNullOrEmpty(constructionRisk.RiskLevel)) + { + drpRiskLevel.SelectedValue = constructionRisk.RiskLevel; + } + if (!string.IsNullOrEmpty(constructionRisk.RefLicense)) + { + drpRefLicense.SelectedValueArray = constructionRisk.RefLicense.Split(','); + } + if (!string.IsNullOrEmpty(constructionRisk.ConstructionContent)) + { + this.txtConstructionContent.Text = HttpUtility.HtmlDecode(constructionRisk.ConstructionContent); + } + if (!string.IsNullOrEmpty(constructionRisk.LicenseDes)) + { + this.txtLicenseDes.Text = HttpUtility.HtmlDecode(constructionRisk.LicenseDes); + } + if (!string.IsNullOrEmpty(constructionRisk.RiskLevel)) + { + this.drpRiskLevel.SelectedValueArray = constructionRisk.RiskLevel.Split(','); + } + constructionRiskControls = (from x in Funs.DB.HSSE_ConstructionRiskControl where x.ConstructionRiskId == this.ConstructionRiskId orderby x.ShowIndex select x).ToList(); + } + + Grid1.DataSource = constructionRiskControls; + Grid1.DataBind(); + + ///初始化审核菜单 + this.ctlAuditFlow.MenuId = BLL.Const.ConstructionRiskMenuId; + this.ctlAuditFlow.DataId = this.ConstructionRiskId; + this.ctlAuditFlow.ProjectId = this.ProjectId; + this.ctlAuditFlow.UnitId = this.CurrUser.UnitId; + } + } + #endregion + + /// + /// 初始化下拉框 + /// + private void InitDropDownList() + { + ///区域下拉框 + BLL.UnitWorkService.InitUnitWorkDownList(this.drpWorkArea, this.ProjectId, true); + + drpRefLicense.DataValueField = "LicenseTypeName"; + drpRefLicense.DataTextField = "LicenseTypeName"; + drpRefLicense.DataSource = (from x in Funs.DB.Base_LicenseType orderby x.LicenseTypeCode select x).ToList(); + drpRefLicense.DataBind(); + + + UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.ProjectId, Const.ProjectUnitType_2, false); + + + } + + + + #region 提交按钮 + /// + /// 提交按钮 + /// + /// + /// + protected void btnSubmit_Click(object sender, EventArgs e) + { + if (this.ctlAuditFlow.NextStep == BLL.Const.State_1 && this.ctlAuditFlow.NextPerson == BLL.Const._Null) + { + ShowNotify("请选择下一步办理人!", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSubmit); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + #endregion + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + #endregion + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + Model.HSSE_ConstructionRisk newConstructionRisk = new Model.HSSE_ConstructionRisk + { + ProjectId = this.ProjectId, + + }; + if (this.dpDateA.SelectedDate.HasValue) + { + newConstructionRisk.DateWeek = this.dpDateA.SelectedDate.Value.Year + "年" + Funs.GetWeekOfYear(this.dpDateA.SelectedDate.Value) + "周"; + } + if (this.drpWorkArea.SelectedValue != BLL.Const._Null) + { + newConstructionRisk.WorkAreaId = this.drpWorkArea.SelectedValue; + } + if (this.drpRiskLevel.SelectedValue != BLL.Const._Null) + { + newConstructionRisk.RiskLevel = drpRiskLevel.SelectedValue; + } + if ( drpRefLicense.SelectedValueArray!=null && drpRefLicense.SelectedValueArray.Count()>0) + { + newConstructionRisk.RefLicense = string.Join(",",drpRefLicense.SelectedValueArray); + } + if (this.drpUnit.SelectedValue != BLL.Const._Null) + { + newConstructionRisk.UnitId = drpUnit.SelectedValue; + } + newConstructionRisk.DateA = Funs.GetNewDateTime(this.dpDateA.Text.Trim()); + newConstructionRisk.DateZ = Funs.GetNewDateTime(this.dpDateZ.Text.Trim()); + newConstructionRisk.LicenseDes = HttpUtility.HtmlEncode(this.txtLicenseDes.Text); + newConstructionRisk.ConstructionContent = HttpUtility.HtmlEncode(this.txtConstructionContent.Text); + ////单据状态 + newConstructionRisk.States = BLL.Const.State_0; + if (type == BLL.Const.BtnSubmit) + { + newConstructionRisk.States = this.ctlAuditFlow.NextStep; + } + if (!string.IsNullOrEmpty(this.ConstructionRiskId)) + { + newConstructionRisk.ConstructionRiskId = this.ConstructionRiskId; + BLL.ConstructionRiskListService.UpdateConstructionRisk(newConstructionRisk); + BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRisk.ConstructionRiskId, newConstructionRisk.ConstructionRiskId, BLL.Const.ProjectEnvironmentalRiskListMenuId, BLL.Const.BtnModify); + } + else + { + newConstructionRisk.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList)); + this.ConstructionRiskId = newConstructionRisk.ConstructionRiskId; + BLL.ConstructionRiskListService.AddConstructionRisk(newConstructionRisk); + BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRisk.ConstructionRiskId, newConstructionRisk.ConstructionRiskId, BLL.Const.ProjectEnvironmentalRiskListMenuId, BLL.Const.BtnAdd); + } + foreach(var item in constructionRiskControls) + { + item.ConstructionRiskId= newConstructionRisk.ConstructionRiskId; + + } + BLL.ConstructionRiskListService.AddConstructionRiskControl(constructionRiskControls, this.ConstructionRiskId); + ////保存流程审核数据 + this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectEnvironmentalRiskListMenuId, this.ConstructionRiskId, (type == BLL.Const.BtnSubmit ? true : false), this.txtConstructionContent.Text.Trim(), "../Hazard/EnvironmentalRiskListView.aspx?EnvironmentalRiskListId={0}"); + } + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, EventArgs e) + { + constructionRiskControls = (from x in Funs.DB.HSSE_ConstructionRiskControl where x.ConstructionRiskId == this.ConstructionRiskId orderby x.ShowIndex select x).ToList(); + Grid1.DataSource = constructionRiskControls; + Grid1.DataBind(); + } + #endregion + + #region Grid双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + btnMenuEdit_Click(null, null); + } + #endregion + + #region 编辑 + /// + /// 编辑按钮 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string rowID = Grid1.SelectedRowID; + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskControlEdit.aspx?ConstructionRiskId={0}&ControlId={1}", ConstructionRiskId, rowID, "编辑 - "))); + + } + #endregion + + #region 删除 + /// + /// 批量删除 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var constructionRiskControl = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId == rowID); + Funs.DB.HSSE_ConstructionRiskControl.DeleteOnSubmit(constructionRiskControl); + Funs.DB.SubmitChanges(); + } + constructionRiskControls = (from x in Funs.DB.HSSE_ConstructionRiskControl where x.ConstructionRiskId == this.ConstructionRiskId orderby x.ShowIndex select x).ToList(); + Grid1.DataSource = constructionRiskControls; + Grid1.DataBind(); + ShowNotify("删除数据成功!(表格数据已重新绑定)"); + } + } + #endregion + + + + #region 区域选择框事件 + /// + /// 区域选择框事件 + /// + /// + /// + protected void dpDateA_SelectedIndexChanged (object sender, EventArgs e) + { + + } + #endregion + + protected void btnAdd_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.ConstructionRiskId)) + { + this.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList)); + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskControlEdit.aspx?ConstructionRiskId=" + this.ConstructionRiskId, "添加 - "))); + } + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.designer.cs new file mode 100644 index 00000000..c429cf60 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskEdit.aspx.designer.cs @@ -0,0 +1,269 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// 自动生成> +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Hazard +{ + + + public partial class ConstructionRiskEdit + { + + /// + /// 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; + + /// + /// dpDateA 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker dpDateA; + + /// + /// dpDateZ 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker dpDateZ; + + /// + /// txtConstructionContent 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtConstructionContent; + + /// + /// drpWorkArea 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWorkArea; + + /// + /// drpRefLicense 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpRefLicense; + + /// + /// drpRiskLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpRiskLevel; + + /// + /// txtLicenseDes 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtLicenseDes; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAdd; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtContents 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HtmlEditor txtContents; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ctlAuditFlow 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.FlowOperateControl ctlAuditFlow; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnSubmit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSubmit; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx.cs b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx.cs index 5ce6eab9..a929b2c0 100644 --- a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx.cs @@ -21,7 +21,18 @@ namespace FineUIPro.Web.HSSE.HiddenInspection ViewState["HazardRegisterId"] = value; } } - + private string ControlId + { + get + { + return (string)ViewState["ControlId"]; + } + set + { + ViewState["ControlId"] = value; + } + } + /// /// 图片路径 /// @@ -144,6 +155,21 @@ namespace FineUIPro.Web.HSSE.HiddenInspection this.txtWorkPackageId.Text = registration.WorkPackageName; } } + + + this.ControlId = Request.Params["ControlId"]; + if (!string.IsNullOrEmpty(ControlId)) + { + var control = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId == ControlId); + if (control != null) + { + var risk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x => x.ConstructionRiskId == control.ConstructionRiskId); + txtRegisterDef.Text = risk.LicenseDes; + drpUnit.SelectedValue = risk.UnitId; + drpWorkArea.SelectedValue = risk.WorkAreaId; + } + } + } } #endregion diff --git a/SGGL/Model/APIItem/HSSE/PersonItem.cs b/SGGL/Model/APIItem/HSSE/PersonItem.cs index c529dd29..94ae9006 100644 --- a/SGGL/Model/APIItem/HSSE/PersonItem.cs +++ b/SGGL/Model/APIItem/HSSE/PersonItem.cs @@ -198,6 +198,14 @@ namespace Model set; } /// + /// 合同/协议 + /// + public string AttachUrl6 + { + get; + set; + } + /// /// 岗位类型 /// public string PostType diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 645a9a07..5f619b70 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -680,6 +680,12 @@ namespace Model partial void InsertHJGLData_HJGL(HJGLData_HJGL instance); partial void UpdateHJGLData_HJGL(HJGLData_HJGL instance); partial void DeleteHJGLData_HJGL(HJGLData_HJGL instance); + partial void InsertHSSE_ConstructionRisk(HSSE_ConstructionRisk instance); + partial void UpdateHSSE_ConstructionRisk(HSSE_ConstructionRisk instance); + partial void DeleteHSSE_ConstructionRisk(HSSE_ConstructionRisk instance); + partial void InsertHSSE_ConstructionRiskControl(HSSE_ConstructionRiskControl instance); + partial void UpdateHSSE_ConstructionRiskControl(HSSE_ConstructionRiskControl instance); + partial void DeleteHSSE_ConstructionRiskControl(HSSE_ConstructionRiskControl instance); partial void InsertHSSE_Hazard_HazardRegister(HSSE_Hazard_HazardRegister instance); partial void UpdateHSSE_Hazard_HazardRegister(HSSE_Hazard_HazardRegister instance); partial void DeleteHSSE_Hazard_HazardRegister(HSSE_Hazard_HazardRegister instance); @@ -3557,6 +3563,22 @@ namespace Model } } + public System.Data.Linq.Table HSSE_ConstructionRisk + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table HSSE_ConstructionRiskControl + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table HSSE_Hazard_HazardRegister { get @@ -100919,6 +100941,538 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HSSE_ConstructionRisk")] + public partial class HSSE_ConstructionRisk : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ConstructionRiskId; + + private string _WorkAreaId; + + private string _UnitId; + + private string _ConstructionContent; + + private string _RefLicense; + + private string _LicenseDes; + + private string _RiskLevel; + + private string _States; + + private System.Nullable _DateA; + + private System.Nullable _DateZ; + + private string _DateWeek; + + private string _ProjectId; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnConstructionRiskIdChanging(string value); + partial void OnConstructionRiskIdChanged(); + partial void OnWorkAreaIdChanging(string value); + partial void OnWorkAreaIdChanged(); + partial void OnUnitIdChanging(string value); + partial void OnUnitIdChanged(); + partial void OnConstructionContentChanging(string value); + partial void OnConstructionContentChanged(); + partial void OnRefLicenseChanging(string value); + partial void OnRefLicenseChanged(); + partial void OnLicenseDesChanging(string value); + partial void OnLicenseDesChanged(); + partial void OnRiskLevelChanging(string value); + partial void OnRiskLevelChanged(); + partial void OnStatesChanging(string value); + partial void OnStatesChanged(); + partial void OnDateAChanging(System.Nullable value); + partial void OnDateAChanged(); + partial void OnDateZChanging(System.Nullable value); + partial void OnDateZChanged(); + partial void OnDateWeekChanging(string value); + partial void OnDateWeekChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + #endregion + + public HSSE_ConstructionRisk() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionRiskId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ConstructionRiskId + { + get + { + return this._ConstructionRiskId; + } + set + { + if ((this._ConstructionRiskId != value)) + { + this.OnConstructionRiskIdChanging(value); + this.SendPropertyChanging(); + this._ConstructionRiskId = value; + this.SendPropertyChanged("ConstructionRiskId"); + this.OnConstructionRiskIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaId", DbType="NVarChar(50)")] + public string WorkAreaId + { + get + { + return this._WorkAreaId; + } + set + { + if ((this._WorkAreaId != value)) + { + this.OnWorkAreaIdChanging(value); + this.SendPropertyChanging(); + this._WorkAreaId = value; + this.SendPropertyChanged("WorkAreaId"); + this.OnWorkAreaIdChanged(); + } + } + } + + [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="_ConstructionContent", DbType="NVarChar(1000)")] + public string ConstructionContent + { + get + { + return this._ConstructionContent; + } + set + { + if ((this._ConstructionContent != value)) + { + this.OnConstructionContentChanging(value); + this.SendPropertyChanging(); + this._ConstructionContent = value; + this.SendPropertyChanged("ConstructionContent"); + this.OnConstructionContentChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RefLicense", DbType="NVarChar(100)")] + public string RefLicense + { + get + { + return this._RefLicense; + } + set + { + if ((this._RefLicense != value)) + { + this.OnRefLicenseChanging(value); + this.SendPropertyChanging(); + this._RefLicense = value; + this.SendPropertyChanged("RefLicense"); + this.OnRefLicenseChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LicenseDes", DbType="NVarChar(100)")] + public string LicenseDes + { + get + { + return this._LicenseDes; + } + set + { + if ((this._LicenseDes != value)) + { + this.OnLicenseDesChanging(value); + this.SendPropertyChanging(); + this._LicenseDes = value; + this.SendPropertyChanged("LicenseDes"); + this.OnLicenseDesChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RiskLevel", DbType="NVarChar(50)")] + public string RiskLevel + { + get + { + return this._RiskLevel; + } + set + { + if ((this._RiskLevel != value)) + { + this.OnRiskLevelChanging(value); + this.SendPropertyChanging(); + this._RiskLevel = value; + this.SendPropertyChanged("RiskLevel"); + this.OnRiskLevelChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_States", DbType="NVarChar(2)")] + public string States + { + get + { + return this._States; + } + set + { + if ((this._States != value)) + { + this.OnStatesChanging(value); + this.SendPropertyChanging(); + this._States = value; + this.SendPropertyChanged("States"); + this.OnStatesChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateA", DbType="Date")] + public System.Nullable DateA + { + get + { + return this._DateA; + } + set + { + if ((this._DateA != value)) + { + this.OnDateAChanging(value); + this.SendPropertyChanging(); + this._DateA = value; + this.SendPropertyChanged("DateA"); + this.OnDateAChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateZ", DbType="Date")] + public System.Nullable DateZ + { + get + { + return this._DateZ; + } + set + { + if ((this._DateZ != value)) + { + this.OnDateZChanging(value); + this.SendPropertyChanging(); + this._DateZ = value; + this.SendPropertyChanged("DateZ"); + this.OnDateZChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateWeek", DbType="NVarChar(50)")] + public string DateWeek + { + get + { + return this._DateWeek; + } + set + { + if ((this._DateWeek != value)) + { + this.OnDateWeekChanging(value); + this.SendPropertyChanging(); + this._DateWeek = value; + this.SendPropertyChanged("DateWeek"); + this.OnDateWeekChanged(); + } + } + } + + [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(); + } + } + } + + 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.HSSE_ConstructionRiskControl")] + public partial class HSSE_ConstructionRiskControl : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ControlId; + + private string _Measures; + + private string _CheckResult; + + private string _CheckMan; + + private string _Rectification; + + private string _ConstructionRiskId; + + private System.Nullable _ShowIndex; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnControlIdChanging(string value); + partial void OnControlIdChanged(); + partial void OnMeasuresChanging(string value); + partial void OnMeasuresChanged(); + partial void OnCheckResultChanging(string value); + partial void OnCheckResultChanged(); + partial void OnCheckManChanging(string value); + partial void OnCheckManChanged(); + partial void OnRectificationChanging(string value); + partial void OnRectificationChanged(); + partial void OnConstructionRiskIdChanging(string value); + partial void OnConstructionRiskIdChanged(); + partial void OnShowIndexChanging(System.Nullable value); + partial void OnShowIndexChanged(); + #endregion + + public HSSE_ConstructionRiskControl() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ControlId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ControlId + { + get + { + return this._ControlId; + } + set + { + if ((this._ControlId != value)) + { + this.OnControlIdChanging(value); + this.SendPropertyChanging(); + this._ControlId = value; + this.SendPropertyChanged("ControlId"); + this.OnControlIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Measures", DbType="NVarChar(50)")] + public string Measures + { + get + { + return this._Measures; + } + set + { + if ((this._Measures != value)) + { + this.OnMeasuresChanging(value); + this.SendPropertyChanging(); + this._Measures = value; + this.SendPropertyChanged("Measures"); + this.OnMeasuresChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckResult", DbType="NVarChar(50)")] + public string CheckResult + { + get + { + return this._CheckResult; + } + set + { + if ((this._CheckResult != value)) + { + this.OnCheckResultChanging(value); + this.SendPropertyChanging(); + this._CheckResult = value; + this.SendPropertyChanged("CheckResult"); + this.OnCheckResultChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckMan", DbType="NVarChar(50)")] + public string CheckMan + { + get + { + return this._CheckMan; + } + set + { + if ((this._CheckMan != value)) + { + this.OnCheckManChanging(value); + this.SendPropertyChanging(); + this._CheckMan = value; + this.SendPropertyChanged("CheckMan"); + this.OnCheckManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rectification", DbType="NVarChar(50)")] + public string Rectification + { + get + { + return this._Rectification; + } + set + { + if ((this._Rectification != value)) + { + this.OnRectificationChanging(value); + this.SendPropertyChanging(); + this._Rectification = value; + this.SendPropertyChanged("Rectification"); + this.OnRectificationChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionRiskId", DbType="NVarChar(50)")] + public string ConstructionRiskId + { + get + { + return this._ConstructionRiskId; + } + set + { + if ((this._ConstructionRiskId != value)) + { + this.OnConstructionRiskIdChanging(value); + this.SendPropertyChanging(); + this._ConstructionRiskId = value; + this.SendPropertyChanged("ConstructionRiskId"); + this.OnConstructionRiskIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ShowIndex", DbType="Int")] + public System.Nullable ShowIndex + { + get + { + return this._ShowIndex; + } + set + { + if ((this._ShowIndex != value)) + { + this.OnShowIndexChanging(value); + this.SendPropertyChanging(); + this._ShowIndex = value; + this.SendPropertyChanged("ShowIndex"); + this.OnShowIndexChanged(); + } + } + } + + 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.HSSE_Hazard_HazardRegister")] public partial class HSSE_Hazard_HazardRegister : INotifyPropertyChanging, INotifyPropertyChanged {