提交代码
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
/// <param name="workPostIds">培训岗位ID</param>
|
||||
/// <param name="trainTypeId">培训类型ID</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId,string name)
|
||||
public static List<Model.PersonItem> 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
|
||||
/// <summary>
|
||||
/// 人员附件保存方法
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,6 +463,7 @@
|
||||
<Compile Include="HSSE\Environmental\EnvironmentalEmergencyPlanService.cs" />
|
||||
<Compile Include="HSSE\Environmental\EnvironmentalMonitoringService.cs" />
|
||||
<Compile Include="HSSE\Environmental\UnexpectedEnvironmentalService.cs" />
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskListService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_EnvironmentalRiskItemService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_EnvironmentalRiskListService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_HazardListService.cs" />
|
||||
|
||||
@@ -2194,6 +2194,10 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string ProjectCheckHolidayMenuId = "0D23A707-ADA0-4C2B-9665-611134243529";
|
||||
/// <summary>
|
||||
/// 施工作业风险
|
||||
/// </summary>
|
||||
public const string ConstructionRiskMenuId = "F531D523-35BC-4D13-88D3-CB2554C4185C";
|
||||
/// <summary>
|
||||
/// 危险因素统计分析
|
||||
/// </summary>
|
||||
public const string CheckAnalysisMenuId = "14C42C8E-8D3D-4D30-AA56-4F96828610AD";
|
||||
@@ -3483,6 +3487,10 @@ namespace BLL
|
||||
/// 焊口二次设计信息模板文件原始虚拟路径
|
||||
/// </summary>
|
||||
public const string JotTwoDesignTemplateUrl = "File\\Excel\\DataOut\\焊口二次设计信息.xlsx";
|
||||
/// <summary>
|
||||
/// 施工作业风险导入模板
|
||||
/// </summary>
|
||||
public const string ConstructionRiskTemplateUrl = "File\\Excel\\DataIn\\施工作业风险导入模板.xls";
|
||||
#endregion
|
||||
|
||||
#region 初始化上传路径
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 要求主键获取危险清单信息
|
||||
/// </summary>
|
||||
/// <param name="hazardListCode">主键</param>
|
||||
/// <returns></returns>
|
||||
public static Model.HSSE_ConstructionRisk GetConstructionRisk(string constructionRiskId)
|
||||
{
|
||||
return Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(e => e.ConstructionRiskId == constructionRiskId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="hazardList"></param>
|
||||
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<Model.HSSE_ConstructionRiskControl > 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();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="hazardList"></param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="constructionRiskId"> </param>
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -887,6 +887,11 @@
|
||||
<Content Include="HSSE\Environmental\UnexpectedEnvironmental.aspx" />
|
||||
<Content Include="HSSE\Environmental\UnexpectedEnvironmentalEdit.aspx" />
|
||||
<Content Include="HSSE\Environmental\UnexpectedEnvironmentalView.aspx" />
|
||||
<Content Include="HSSE\Hazard\ConstructionRisk.aspx" />
|
||||
<Content Include="HSSE\Hazard\ConstructionRiskControlCheck.aspx" />
|
||||
<Content Include="HSSE\Hazard\ConstructionRiskControlEdit.aspx" />
|
||||
<Content Include="HSSE\Hazard\ConstructionRiskDataIn.aspx" />
|
||||
<Content Include="HSSE\Hazard\ConstructionRiskEdit.aspx" />
|
||||
<Content Include="HSSE\Hazard\EnvironmentalRiskItemEdit.aspx" />
|
||||
<Content Include="HSSE\Hazard\EnvironmentalRiskList.aspx" />
|
||||
<Content Include="HSSE\Hazard\EnvironmentalRiskListEdit.aspx" />
|
||||
@@ -10156,6 +10161,41 @@
|
||||
<Compile Include="HSSE\Environmental\UnexpectedEnvironmentalView.aspx.designer.cs">
|
||||
<DependentUpon>UnexpectedEnvironmentalView.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRisk.aspx.cs">
|
||||
<DependentUpon>ConstructionRisk.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRisk.aspx.designer.cs">
|
||||
<DependentUpon>ConstructionRisk.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskControlCheck.aspx.cs">
|
||||
<DependentUpon>ConstructionRiskControlCheck.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskControlCheck.aspx.designer.cs">
|
||||
<DependentUpon>ConstructionRiskControlCheck.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskControlEdit.aspx.cs">
|
||||
<DependentUpon>ConstructionRiskControlEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskControlEdit.aspx.designer.cs">
|
||||
<DependentUpon>ConstructionRiskControlEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskDataIn.aspx.cs">
|
||||
<DependentUpon>ConstructionRiskDataIn.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskDataIn.aspx.designer.cs">
|
||||
<DependentUpon>ConstructionRiskDataIn.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskEdit.aspx.cs">
|
||||
<DependentUpon>ConstructionRiskEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskEdit.aspx.designer.cs">
|
||||
<DependentUpon>ConstructionRiskEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\Hazard\EnvironmentalRiskItemEdit.aspx.cs">
|
||||
<DependentUpon>EnvironmentalRiskItemEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -27,7 +27,17 @@ namespace FineUIPro.Web.HSSE.Check
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public string ControlId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ControlId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ControlId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
@@ -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<Model.Check_RectifyNoticesItem> 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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRisk.aspx.cs" Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRisk" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>施工作业风险</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="280px" Title="施工作业风险" ShowBorder="true" Layout="VBox"
|
||||
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft">
|
||||
<Items>
|
||||
<f:HiddenField runat="server" ID="hdState">
|
||||
</f:HiddenField>
|
||||
<f:Tree ID="tvControlItem" EnableCollapse="true" ShowHeader="false" Title="WBS"
|
||||
OnNodeCommand="tvControlItem_NodeCommand111" AutoLeafIdentification="true"
|
||||
runat="server" ShowBorder="false" EnableTextSelection="True">
|
||||
|
||||
</f:Tree>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="施工作业风险"
|
||||
TitleToolTip="施工作业风险" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="危险源台账" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="Id"
|
||||
EnableColumnLines="true" DataIDField="Id" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick"
|
||||
OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" runat="server" Position="Top">
|
||||
<Items>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnNew" Icon="SystemSave" runat="server" ToolTip="添加" Text="添加" ValidateForms="SimpleForm1"
|
||||
OnClick="btnNew_Click">
|
||||
</f:Button>
|
||||
|
||||
<f:Button ID="btnAudit" Text="安全经理审核" ToolTip="安全经理审核" Icon="ApplicationEdit" runat="server" OnClick="btnAudit_Click" ConfirmText="是否确认审核?" >
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" Text="导入" ToolTip="导入" Icon="ApplicationGet" runat="server" OnClick="btnImport_Click">
|
||||
</f:Button>
|
||||
<%-- <f:Button ID="btnQR" Text="生成二维码" ToolTip="生成二维码" Icon="TableRefresh" runat="server" OnClick="btnQR_Click">
|
||||
</f:Button>--%>
|
||||
<%--<f:Button runat="server" ID="btnSeeQR" OnClick="btnSeeQR_Click" Icon="Shading"
|
||||
ToolTip="小程序二维码" Text="小程序二维码" Hidden="true">
|
||||
</f:Button>--%>
|
||||
<%-- <f:Button runat="server" ID="btnSeeQR1" OnClick="btnImport_Click" Icon="TableRefresh"
|
||||
ToolTip="二维码" Text="二维码">
|
||||
</f:Button>--%>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
|
||||
|
||||
<f:RenderField Width="100px" ColumnID="UnitWorkName" DataField="UnitWorkName"
|
||||
SortField="UnitWorkName" FieldType="String" HeaderText="单位工程" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="300px" ColumnID="ConstructionContent" DataField="ConstructionContent"
|
||||
SortField="ConstructionContent" FieldType="String" HeaderText="施工内容" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="RefLicense" DataField="RefLicense"
|
||||
SortField="RefLicense" FieldType="String" HeaderText="涉及的高风险作业" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="LicenseDes" DataField="LicenseDes"
|
||||
SortField="LicenseDes" FieldType="String" HeaderText="作业风险描述" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="RiskLevel" DataField="RiskLevel"
|
||||
SortField="RiskLevel" FieldType="String" HeaderText="风险等级" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="Measures" DataField="Measures" ExpandUnusedSpace="true"
|
||||
SortField="Measures" FieldType="String" HeaderText="管控措施" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="FlowOperateName" DataField="FlowOperateName"
|
||||
SortField="FlowOperateName" FieldType="String" HeaderText="状态" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||
</Listeners>
|
||||
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="施工作业风险" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Top" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="1000px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="施工作业风险" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Top" EnableResize="true" runat="server" OnClose="Window2_Close" IsModal="true"
|
||||
Width="600px" Height="300px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server" Text="删除" Icon="Delete">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuCheck" EnablePostBack="true" runat="server"
|
||||
Text="巡检" Icon="ScriptLightning" OnClick="btnMenuCheck_Click">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['UnitWorkName', 'ConstructionContent', 'RefLicense', 'LicenseDes','RiskLevel']);
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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 加载树施工单位
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
this.tvControlItem.Nodes.Clear();
|
||||
|
||||
List<Base_Unit> 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 关闭弹出窗口及刷新页面
|
||||
/// <summary>
|
||||
/// 关闭弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 页索引改变事件
|
||||
/// <summary>
|
||||
/// 页索引改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 右键删除明细
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
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<SqlParameter> listStr = new List<SqlParameter>();
|
||||
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 绑定树节点
|
||||
/// <summary>
|
||||
/// 绑定树节点
|
||||
/// </summary>
|
||||
/// <param name="node"></param>
|
||||
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 导入
|
||||
/// <summary>
|
||||
/// 导入按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskDataIn.aspx", "导入 - ")));
|
||||
}
|
||||
#endregion
|
||||
#region 导入
|
||||
/// <summary>
|
||||
/// 导入按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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
|
||||
/// <summary>
|
||||
/// 点击TreeView
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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], "编辑 - ")));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
|
||||
|
||||
public partial class ConstructionRisk
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// hdState 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdState;
|
||||
|
||||
/// <summary>
|
||||
/// tvControlItem 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree tvControlItem;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuCheck 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuCheck;
|
||||
}
|
||||
}
|
||||
@@ -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" %>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>施工作业风险</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.lab
|
||||
{
|
||||
font-size: small;
|
||||
color: Red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
Layout="VBox" BodyPadding="10px" runat="server" RedStarPosition="BeforeText"
|
||||
LabelAlign="Right">
|
||||
<Rows>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:RadioButtonList ID="rbCheckResult" Label="检查结果" runat="server" ColumnNumber="1" ShowRedStar="true" Required="true">
|
||||
<f:RadioItem Text="符合" Value="符合" />
|
||||
<f:RadioItem Text="不符合" Value="不符合" />
|
||||
</f:RadioButtonList>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
|
||||
<f:RadioButtonList ID="rbRectification" Label="整改情况" runat="server" ColumnNumber="1">
|
||||
<f:RadioItem Text="A" Value="A" />
|
||||
<f:RadioItem Text="B" Value="B" />
|
||||
<f:RadioItem Text="C" Value="C" />
|
||||
</f:RadioButtonList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Label runat="server" ID="lbTemp">
|
||||
</f:Label>
|
||||
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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 定义变量
|
||||
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
|
||||
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 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 保存按钮
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SaveData(BLL.Const.BtnSave);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
|
||||
|
||||
public partial class ConstructionRiskControlCheck
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// rbCheckResult 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rbCheckResult;
|
||||
|
||||
/// <summary>
|
||||
/// rbRectification 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rbRectification;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// lbTemp 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbTemp;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
}
|
||||
}
|
||||
@@ -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" %>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>施工作业风险</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.lab
|
||||
{
|
||||
font-size: small;
|
||||
color: Red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
Layout="VBox" BodyPadding="10px" runat="server" RedStarPosition="BeforeText"
|
||||
LabelAlign="Right">
|
||||
<Rows>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtMeasures" runat="server" AutoGrowHeight="true" ShowRedStar="true" Required="true" LabelWidth="140px" AutoGrowHeightMin="50" Label="管控措施"></f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Label runat="server" ID="lbTemp">
|
||||
</f:Label>
|
||||
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string ConstructionRiskId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ConstructionRiskId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ConstructionRiskId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
|
||||
public string ControlId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ControlId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ControlId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 保存按钮
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SaveData(BLL.Const.BtnSave);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
|
||||
|
||||
public partial class ConstructionRiskControlEdit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtMeasures 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtMeasures;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// lbTemp 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbTemp;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionRiskDataIn.aspx.cs" Inherits="FineUIPro.Web.HSSE.Hazard.ConstructionRiskDataIn" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>危险源台账导入</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="2px" BodyPadding="2px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:HiddenField ID="hdId" runat="server"></f:HiddenField>
|
||||
<f:HiddenField ID="hdfileName" runat="server"></f:HiddenField>
|
||||
<f:FileUpload ID="FileExcel" runat="server" Label="数据文件" EmptyText="请上传EXCEl格式文件" Width="350px" LabelWidth="90px" LabelAlign="Right"></f:FileUpload>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnAudit" runat="server" Text="审核" ToolTip="审核" Icon="PageEdit" OnClick="btnAudit_Click"></f:Button>
|
||||
<f:Button ID="btnSave" runat="server" Text="导入" ToolTip="导入" Icon="SystemSave" OnClick="btnSave_Click"></f:Button>
|
||||
<f:Button ID="imgbtnUpload" runat="server" Icon="DiskDownload" Text="模板下载" EnableAjaxLoading="false" OnClick="imgbtnUpload_Click"></f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="危险源台账导入" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="" AllowCellEditing="true"
|
||||
EnableColumnLines="true" DataIDField="" EnableTextSelection="True">
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField Width="120px" HeaderText="错误行号" ColumnID="Row" DataField="Row" SortField="Row"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" HeaderText="错误列" ColumnID="Column" DataField="Column" SortField="Column"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" HeaderText="错误类型" ColumnID="Reason" DataField="Reason" SortField="Reason"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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 定义变量
|
||||
/// <summary>
|
||||
/// 上传预设的虚拟路径
|
||||
/// </summary>
|
||||
private string initPath = Const.ExcelUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 导入模版文件原始的虚拟路径
|
||||
/// </summary>
|
||||
private string initTemplatePath = Const.ConstructionRiskTemplateUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 错误集合
|
||||
/// </summary>
|
||||
public static List<Model.ErrorInfo> errorInfos = new List<Model.ErrorInfo>();
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
if (errorInfos != null)
|
||||
{
|
||||
errorInfos.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 模板下载
|
||||
/// <summary>
|
||||
/// 模板下载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 审核
|
||||
/// <summary>
|
||||
/// 审核
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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提取数据
|
||||
/// <summary>
|
||||
/// 从Excel提取数据--》Dataset
|
||||
/// </summary>
|
||||
/// <param name="filename">Excel文件路径名</param>
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// 将Dataset的数据导入数据库
|
||||
/// </summary>
|
||||
/// <param name="pds">数据集</param>
|
||||
/// <param name="Cols">数据集列数</param>
|
||||
/// <returns></returns>
|
||||
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<string> 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 导入
|
||||
/// <summary>
|
||||
/// 导入
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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提取数据
|
||||
/// <summary>
|
||||
/// 从Excel提取数据--》Dataset
|
||||
/// </summary>
|
||||
/// <param name="filename">Excel文件路径名</param>
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// 将Dataset的数据导入数据库
|
||||
/// </summary>
|
||||
/// <param name="pds">数据集</param>
|
||||
/// <param name="Cols">数据集列数</param>
|
||||
/// <returns></returns>
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
|
||||
|
||||
public partial class ConstructionRiskDataIn
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// hdId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdId;
|
||||
|
||||
/// <summary>
|
||||
/// hdfileName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdfileName;
|
||||
|
||||
/// <summary>
|
||||
/// FileExcel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload FileExcel;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// imgbtnUpload 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button imgbtnUpload;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
}
|
||||
}
|
||||
@@ -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" %>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>施工作业风险</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.lab
|
||||
{
|
||||
font-size: small;
|
||||
color: Red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
Layout="VBox" BodyPadding="10px" runat="server" RedStarPosition="BeforeText"
|
||||
LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpUnit" runat="server" EnableEdit="true" Label="施工单位" LabelWidth="140px"
|
||||
AutoPostBack="true">
|
||||
</f:DropDownList>
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="本周开始日期" ID="dpDateA" LabelWidth="140px" AutoPostBack="true"
|
||||
ShowRedStar="true" Required="true" EnableDateSelectEvent ="true" OnDateSelect ="dpDateA_SelectedIndexChanged">
|
||||
</f:DatePicker>
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="本周结束日期" ID="dpDateZ" LabelWidth="140px"
|
||||
ShowRedStar="true" Required="true" >
|
||||
</f:DatePicker>
|
||||
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtConstructionContent" runat="server" AutoGrowHeight="true" ShowRedStar="true" Required="true" LabelWidth="140px" AutoGrowHeightMin="50" Label="施工内容"></f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpWorkArea" runat="server" EnableEdit="true" Label="单位工程" LabelWidth="140px"
|
||||
AutoPostBack="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpRefLicense" runat="server" EnableEdit="true" Label="涉及的高风险作业" LabelWidth="140px" EnableMultiSelect="true"
|
||||
AutoPostBack="true" >
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpRiskLevel" runat="server" EnableEdit="true" Label="风险等级" LabelWidth="140px"
|
||||
AutoPostBack="true" >
|
||||
<f:ListItem Value="" Text="- 请选择 -" />
|
||||
<f:ListItem Value="一级风险" Text="一级风险" />
|
||||
<f:ListItem Value="二级风险" Text="二级风险" />
|
||||
<f:ListItem Value="三级风险" Text="三级风险" />
|
||||
<f:ListItem Value="四级风险" Text="四级风险" />
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtLicenseDes" runat="server" AutoGrowHeight="true" ShowRedStar="true" Required="true" AutoGrowHeightMin="50" Label="作业风险描述" LabelWidth="140px"></f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server"
|
||||
DataIDField="ControlId" DataKeyNames="ControlId" ForceFit="true"
|
||||
EnableMultiSelect="true" ShowGridHeader="true" EnableColumnLines="true" AllowSorting="true"
|
||||
SortField="ShowIndex" SortDirection="ASC" EnableRowDoubleClickEvent="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:Button ID="btnAdd" Icon="ShapeSquareSelect" Text="添加管控措施" runat="server" ToolTip="添加管控措施" ValidateForms="SimpleForm1" OnClick="btnAdd_Click" >
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField HeaderText="序号" Width="45px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField Width="100px" ColumnID="Measures" DataField="Measures" FieldType="String" ExpandUnusedSpace="true"
|
||||
HeaderText="管控措施" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="40px" ColumnID="CheckResult" DataField="CheckResult" FieldType="String"
|
||||
HeaderText="检查结果" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="40px" ColumnID="Rectification" DataField="Rectification"
|
||||
FieldType="String" HeaderText="环境因素" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Form ID="Form2" ShowBorder="false" AutoScroll="true" ShowHeader="true" Title="辨识内容"
|
||||
EnableCollapse="true" Collapsed="true" BodyPadding="10px" runat="server" RedStarPosition="BeforeText"
|
||||
LabelAlign="Right">
|
||||
<Items>
|
||||
<f:HtmlEditor runat="server" Label="辨识内容" ID="txtContents" ShowLabel="false" Editor="UMEditor"
|
||||
BasePath="~/res/umeditor/" ToolbarSet="Full" Height="160px" LabelAlign="Right">
|
||||
</f:HtmlEditor>
|
||||
</Items>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true"
|
||||
BodyPadding="0px">
|
||||
<uc1:FlowOperateControl ID="ctlAuditFlow" runat="server" />
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Label runat="server" ID="lbTemp">
|
||||
</f:Label>
|
||||
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSubmit" Icon="SystemSaveNew" runat="server" Text="提交" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSubmit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="Window1" Title="编辑危险源明细" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="900px" Height="500px">
|
||||
</f:Window>
|
||||
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
Icon="Pencil" runat="server" Text="编辑" >
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Icon="Delete" ConfirmText="确定删除当前数据?" ConfirmTarget="Parent" runat="server" Text="删除">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string ConstructionRiskId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ConstructionRiskId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ConstructionRiskId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 定义集合
|
||||
/// </summary>
|
||||
private static List<Model.HSSE_ConstructionRiskControl> constructionRiskControls = new List<Model.HSSE_ConstructionRiskControl>();
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// 初始化下拉框
|
||||
/// </summary>
|
||||
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 提交按钮
|
||||
/// <summary>
|
||||
/// 提交按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 保存按钮
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SaveData(BLL.Const.BtnSave);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
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 关闭弹出窗
|
||||
/// <summary>
|
||||
/// 关闭弹出窗
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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双击事件
|
||||
/// <summary>
|
||||
/// Grid行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
btnMenuEdit_Click(null, null);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
/// <summary>
|
||||
/// 编辑按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 删除
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 区域选择框事件
|
||||
/// <summary>
|
||||
/// 区域选择框事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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, "添加 - ")));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
|
||||
|
||||
public partial class ConstructionRiskEdit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// drpUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnit;
|
||||
|
||||
/// <summary>
|
||||
/// dpDateA 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker dpDateA;
|
||||
|
||||
/// <summary>
|
||||
/// dpDateZ 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker dpDateZ;
|
||||
|
||||
/// <summary>
|
||||
/// txtConstructionContent 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtConstructionContent;
|
||||
|
||||
/// <summary>
|
||||
/// drpWorkArea 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpWorkArea;
|
||||
|
||||
/// <summary>
|
||||
/// drpRefLicense 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpRefLicense;
|
||||
|
||||
/// <summary>
|
||||
/// drpRiskLevel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpRiskLevel;
|
||||
|
||||
/// <summary>
|
||||
/// txtLicenseDes 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtLicenseDes;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnAdd 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAdd;
|
||||
|
||||
/// <summary>
|
||||
/// Form2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form2;
|
||||
|
||||
/// <summary>
|
||||
/// txtContents 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HtmlEditor txtContents;
|
||||
|
||||
/// <summary>
|
||||
/// ContentPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ContentPanel ContentPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// ctlAuditFlow 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Web.Controls.FlowOperateControl ctlAuditFlow;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// lbTemp 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbTemp;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSubmit;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,18 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
ViewState["HazardRegisterId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string ControlId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ControlId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ControlId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 图片路径
|
||||
/// </summary>
|
||||
@@ -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
|
||||
|
||||
@@ -198,6 +198,14 @@ namespace Model
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 合同/协议
|
||||
/// </summary>
|
||||
public string AttachUrl6
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 岗位类型
|
||||
/// </summary>
|
||||
public string PostType
|
||||
|
||||
@@ -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> HSSE_ConstructionRisk
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<HSSE_ConstructionRisk>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<HSSE_ConstructionRiskControl> HSSE_ConstructionRiskControl
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<HSSE_ConstructionRiskControl>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<HSSE_Hazard_HazardRegister> 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<System.DateTime> _DateA;
|
||||
|
||||
private System.Nullable<System.DateTime> _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<System.DateTime> value);
|
||||
partial void OnDateAChanged();
|
||||
partial void OnDateZChanging(System.Nullable<System.DateTime> 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<System.DateTime> 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<System.DateTime> 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<int> _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<int> 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<int> 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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user