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 00000000..ce18a034
Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/施工作业风险导入模板.xls differ
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 519e83e8..73b0aca7 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -887,6 +887,11 @@
+
+
+
+
+
@@ -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
{