提交代码
This commit is contained in:
@@ -37,6 +37,21 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 办理类型
|
||||
/// </summary>
|
||||
public string State
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["State"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["State"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 定义集合
|
||||
/// </summary>
|
||||
@@ -54,19 +69,24 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
this.drpHandleType.DataTextField = "Text";
|
||||
this.drpHandleType.DataValueField = "Value";
|
||||
this.HideOptions.Hidden = true;
|
||||
this.rblIsAgree.Hidden = true;
|
||||
this.drpHandleMan.DataTextField = "PersonName";
|
||||
this.drpHandleMan.DataValueField = "PersonId";
|
||||
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);
|
||||
var constructionRisk = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x => x.ConstructionRiskId == this.ConstructionRiskId);
|
||||
if (constructionRisk != null)
|
||||
{
|
||||
this.hdConstructionRiskId.Text = this.ConstructionRiskId;
|
||||
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;
|
||||
@@ -75,38 +95,82 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
drpUnit.SelectedValue = constructionRisk.UnitId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(constructionRisk.RiskLevel))
|
||||
{
|
||||
drpRiskLevel.SelectedValue = constructionRisk.RiskLevel;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(constructionRisk.RefLicense))
|
||||
{
|
||||
drpRefLicense.SelectedValueArray = constructionRisk.RefLicense.Split(',');
|
||||
this.drpRiskLevel.DataSource = BLL.ConstructionRiskListService.RiskLevelList2();
|
||||
this.drpRiskLevel.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpRiskLevel);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(constructionRisk.RiskLevel))
|
||||
{
|
||||
drpRiskLevel.SelectedValue = constructionRisk.RiskLevel;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(constructionRisk.ConstructionContent))
|
||||
{
|
||||
this.txtConstructionContent.Text = HttpUtility.HtmlDecode(constructionRisk.ConstructionContent);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(constructionRisk.LicenseDes))
|
||||
{
|
||||
this.txtLicenseDes.Text = HttpUtility.HtmlDecode(constructionRisk.LicenseDes);
|
||||
}
|
||||
this.hdConstructionContentId.Text = constructionRisk.ConstructionContentId;
|
||||
if (!string.IsNullOrEmpty(constructionRisk.RiskLevel))
|
||||
{
|
||||
this.drpRiskLevel.SelectedValueArray = constructionRisk.RiskLevel.Split(',');
|
||||
}
|
||||
if (!string.IsNullOrEmpty(constructionRisk.LicenseDes))
|
||||
{
|
||||
this.drpLicenseDes.SelectedValueArray = constructionRisk.LicenseDes.Split(',');
|
||||
}
|
||||
this.hdCoordinate.Text = constructionRisk.Coordinate;
|
||||
constructionRiskControls = (from x in Funs.DB.HSSE_ConstructionRiskControl where x.ConstructionRiskId == this.ConstructionRiskId orderby x.ShowIndex select x).ToList();
|
||||
gvApprove.DataSource = BLL.ConstructionRiskApproveService.getListData(this.ConstructionRiskId);
|
||||
gvApprove.DataBind();
|
||||
if (!string.IsNullOrEmpty(constructionRisk.States))
|
||||
{
|
||||
State = constructionRisk.States;
|
||||
}
|
||||
else
|
||||
{
|
||||
State = BLL.Const.ConstructionRisk_Compile;
|
||||
this.HideOptions.Hidden = true;
|
||||
this.rblIsAgree.Hidden = true;
|
||||
}
|
||||
if (State != BLL.Const.ConstructionRisk_Complete.ToString())
|
||||
{
|
||||
drpHandleType.DataSource = BLL.ConstructionRiskListService.GetDHandleTypeByState(State);
|
||||
drpHandleType.DataBind();
|
||||
}
|
||||
|
||||
if (State == BLL.Const.ConstructionRisk_Compile || State == BLL.Const.ConstructionRisk_ReCompile)
|
||||
{
|
||||
this.HideOptions.Visible = false;
|
||||
this.rblIsAgree.Visible = false;
|
||||
this.drpHandleMan.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.HideOptions.Hidden = false;
|
||||
this.rblIsAgree.Hidden = false;
|
||||
}
|
||||
if (State == Const.ConstructionRisk_Audit2)
|
||||
{
|
||||
this.drpHandleMan.Enabled = false;
|
||||
}
|
||||
if (State == BLL.Const.ConstructionRisk_Complete || !string.IsNullOrEmpty(Request.Params["see"]))
|
||||
{
|
||||
this.btnSave.Visible = false;
|
||||
this.btnSubmit.Visible = false;
|
||||
this.next.Hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
drpHandleType.DataSource = BLL.ConstructionRiskListService.GetDHandleTypeByState(BLL.Const.ConstructionRisk_Compile);
|
||||
drpHandleType.DataBind();
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
}
|
||||
drpHandleType_SelectedIndexChanged(null, null);
|
||||
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
|
||||
@@ -117,17 +181,20 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
private void InitDropDownList()
|
||||
{
|
||||
///区域下拉框
|
||||
BLL.UnitWorkService.InitUnitWorkDownList(this.drpWorkArea, this.ProjectId, true);
|
||||
BLL.MainItemService.InitMainItemDownList(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();
|
||||
|
||||
|
||||
Funs.FineUIPleaseSelect(this.drpRefLicense);
|
||||
this.drpRiskLevel.DataTextField = "Text";
|
||||
this.drpRiskLevel.DataValueField = "Value";
|
||||
this.drpRiskLevel.DataSource = BLL.ConstructionRiskListService.RiskLevelList();
|
||||
this.drpRiskLevel.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpRiskLevel);
|
||||
Funs.FineUIPleaseSelect(this.drpLicenseDes);
|
||||
UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.ProjectId, Const.ProjectUnitType_2, false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -140,9 +207,24 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
/// <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)
|
||||
if (this.drpWorkArea.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择下一步办理人!", MessageBoxIcon.Warning);
|
||||
ShowNotify("请选择主项!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpRiskLevel.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择风险等级!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.txtConstructionContent.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请选择施工内容!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpLicenseDes.SelectedValueArray.Length == 1 && this.drpLicenseDes.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择作业风险描述!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
this.SaveData(BLL.Const.BtnSubmit);
|
||||
@@ -158,6 +240,26 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpWorkArea.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择主项!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpRiskLevel.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择风险等级!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.txtConstructionContent.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请选择施工内容!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpLicenseDes.SelectedValueArray.Length == 1 && this.drpLicenseDes.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择作业风险描述!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
this.SaveData(BLL.Const.BtnSave);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
@@ -172,7 +274,7 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
Model.HSSE_ConstructionRisk newConstructionRisk = new Model.HSSE_ConstructionRisk
|
||||
{
|
||||
ProjectId = this.ProjectId,
|
||||
|
||||
|
||||
};
|
||||
if (this.dpDateA.SelectedDate.HasValue)
|
||||
{
|
||||
@@ -186,9 +288,25 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
newConstructionRisk.RiskLevel = drpRiskLevel.SelectedValue;
|
||||
}
|
||||
if ( drpRefLicense.SelectedValueArray!=null && drpRefLicense.SelectedValueArray.Count()>0)
|
||||
if (this.drpRefLicense.SelectedValueArray.Length == 1 && this.drpRefLicense.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
newConstructionRisk.RefLicense = string.Join(",",drpRefLicense.SelectedValueArray);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
string refLicense = string.Empty;
|
||||
foreach (var item in this.drpRefLicense.SelectedItemArray)
|
||||
{
|
||||
if (item.Value != BLL.Const._Null)
|
||||
{
|
||||
refLicense += item.Value + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(refLicense))
|
||||
{
|
||||
refLicense = refLicense.Substring(0, refLicense.Length - 1);
|
||||
}
|
||||
newConstructionRisk.RefLicense = refLicense;
|
||||
}
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
@@ -196,36 +314,125 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
}
|
||||
newConstructionRisk.DateA = Funs.GetNewDateTime(this.dpDateA.Text.Trim());
|
||||
newConstructionRisk.DateZ = Funs.GetNewDateTime(this.dpDateZ.Text.Trim());
|
||||
newConstructionRisk.LicenseDes = HttpUtility.HtmlEncode(this.txtLicenseDes.Text);
|
||||
if (this.drpLicenseDes.SelectedValueArray.Length == 1 && this.drpLicenseDes.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
string licenseDes = string.Empty;
|
||||
foreach (var item in this.drpLicenseDes.SelectedItemArray)
|
||||
{
|
||||
if (item.Value != BLL.Const._Null)
|
||||
{
|
||||
licenseDes += item.Value + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(licenseDes))
|
||||
{
|
||||
licenseDes = licenseDes.Substring(0, licenseDes.Length - 1);
|
||||
}
|
||||
newConstructionRisk.LicenseDes = licenseDes;
|
||||
}
|
||||
newConstructionRisk.ConstructionContent = HttpUtility.HtmlEncode(this.txtConstructionContent.Text);
|
||||
newConstructionRisk.ConstructionContentId = this.hdConstructionContentId.Text;
|
||||
newConstructionRisk.Coordinate = this.hdCoordinate.Text;
|
||||
////单据状态
|
||||
newConstructionRisk.States = BLL.Const.State_0;
|
||||
//if (type == BLL.Const.BtnSubmit)
|
||||
//{
|
||||
// newConstructionRisk.States = this.ctlAuditFlow.NextStep;
|
||||
//}
|
||||
if (type == BLL.Const.BtnSubmit)
|
||||
{
|
||||
newConstructionRisk.States = this.ctlAuditFlow.NextStep;
|
||||
newConstructionRisk.States = this.drpHandleType.SelectedValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.HSSE_ConstructionRisk ConstructionRisk1 = BLL.ConstructionRiskListService.GetConstructionRisk(ConstructionRiskId);
|
||||
if (ConstructionRisk1 != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ConstructionRisk1.States))
|
||||
{
|
||||
newConstructionRisk.States = BLL.Const.ConstructionRisk_Compile;
|
||||
}
|
||||
else
|
||||
{
|
||||
newConstructionRisk.States = ConstructionRisk1.States;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newConstructionRisk.States = BLL.Const.ConstructionRisk_Compile;
|
||||
}
|
||||
}
|
||||
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);
|
||||
BLL.ConstructionRiskListService.UpdateConstructionRisk(newConstructionRisk);
|
||||
if (type == BLL.Const.BtnSubmit)
|
||||
{
|
||||
Model.HSSE_ConstructionRiskApprove approve1 = BLL.ConstructionRiskApproveService.GetConstructionRiskApproveByConstructionRiskId(ConstructionRiskId);
|
||||
approve1.ApproveDate = DateTime.Now;
|
||||
approve1.ApproveIdea = this.txtOpinions.Text.Trim();
|
||||
approve1.IsAgree = Convert.ToBoolean(this.rblIsAgree.SelectedValue);
|
||||
BLL.ConstructionRiskApproveService.UpdateConstructionRiskApprove(approve1);
|
||||
if (this.drpHandleMan.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
Model.HSSE_ConstructionRiskApprove approve = new Model.HSSE_ConstructionRiskApprove();
|
||||
approve.ConstructionRiskId = newConstructionRisk.ConstructionRiskId;
|
||||
approve.ApproveMan = this.drpHandleMan.SelectedValue;
|
||||
approve.ApproveType = this.drpHandleType.SelectedValue;
|
||||
BLL.ConstructionRiskApproveService.AddConstructionRiskApprove(approve);
|
||||
}
|
||||
}
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRisk.ConstructionRiskId, newConstructionRisk.ConstructionRiskId, BLL.Const.ConstructionRiskMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
else
|
||||
{
|
||||
newConstructionRisk.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList));
|
||||
if (string.IsNullOrEmpty(this.hdConstructionRiskId.Text))
|
||||
{
|
||||
newConstructionRisk.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList));
|
||||
}
|
||||
else
|
||||
{
|
||||
newConstructionRisk.ConstructionRiskId = this.hdConstructionRiskId.Text;
|
||||
}
|
||||
this.ConstructionRiskId = newConstructionRisk.ConstructionRiskId;
|
||||
BLL.ConstructionRiskListService.AddConstructionRisk(newConstructionRisk);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRisk.ConstructionRiskId, newConstructionRisk.ConstructionRiskId, BLL.Const.ProjectEnvironmentalRiskListMenuId, BLL.Const.BtnAdd);
|
||||
BLL.ConstructionRiskListService.AddConstructionRisk(newConstructionRisk);
|
||||
if (type == BLL.Const.BtnSubmit)
|
||||
{
|
||||
Model.HSSE_ConstructionRiskApprove approve1 = new Model.HSSE_ConstructionRiskApprove();
|
||||
approve1.ConstructionRiskId = newConstructionRisk.ConstructionRiskId;
|
||||
approve1.ApproveMan = this.CurrUser.PersonId;
|
||||
approve1.ApproveType = BLL.Const.MainPlan_Compile;
|
||||
approve1.ApproveDate = DateTime.Now;
|
||||
BLL.ConstructionRiskApproveService.AddConstructionRiskApprove(approve1);
|
||||
Model.HSSE_ConstructionRiskApprove approve = new Model.HSSE_ConstructionRiskApprove();
|
||||
approve.ConstructionRiskId = newConstructionRisk.ConstructionRiskId;
|
||||
if (this.drpHandleMan.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
approve.ApproveMan = this.drpHandleMan.SelectedValue;
|
||||
}
|
||||
approve.ApproveType = this.drpHandleType.SelectedValue;
|
||||
BLL.ConstructionRiskApproveService.AddConstructionRiskApprove(approve);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.HSSE_ConstructionRiskApprove approve1 = new Model.HSSE_ConstructionRiskApprove();
|
||||
approve1.ConstructionRiskId = newConstructionRisk.ConstructionRiskId;
|
||||
approve1.ApproveMan = this.CurrUser.PersonId;
|
||||
approve1.ApproveType = BLL.Const.ConstructionRisk_Compile;
|
||||
BLL.ConstructionRiskApproveService.AddConstructionRiskApprove(approve1);
|
||||
}
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newConstructionRisk.ConstructionRiskId, newConstructionRisk.ConstructionRiskId, BLL.Const.ConstructionRiskMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
foreach(var item in constructionRiskControls)
|
||||
foreach (var item in constructionRiskControls)
|
||||
{
|
||||
item.ConstructionRiskId= newConstructionRisk.ConstructionRiskId;
|
||||
|
||||
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 关闭弹出窗
|
||||
@@ -236,7 +443,7 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
/// <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();
|
||||
constructionRiskControls = (from x in Funs.DB.HSSE_ConstructionRiskControl where x.ConstructionRiskId == this.hdConstructionRiskId.Text orderby x.ShowIndex select x).ToList();
|
||||
Grid1.DataSource = constructionRiskControls;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
@@ -248,7 +455,7 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -308,7 +515,7 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 区域选择框事件
|
||||
/// <summary>
|
||||
@@ -316,9 +523,9 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void dpDateA_SelectedIndexChanged (object sender, EventArgs e)
|
||||
protected void dpDateA_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -326,9 +533,9 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ConstructionRiskId))
|
||||
{
|
||||
this.ConstructionRiskId = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList));
|
||||
this.hdConstructionRiskId.Text = SQLHelper.GetNewID(typeof(Model.Hazard_EnvironmentalRiskList));
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskControlEdit.aspx?ConstructionRiskId=" + this.ConstructionRiskId, "添加 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionRiskControlEdit.aspx?ConstructionRiskId=" + this.hdConstructionRiskId.Text, "添加 - ")));
|
||||
}
|
||||
|
||||
protected void btnMap_Click(object sender, EventArgs e)
|
||||
@@ -338,5 +545,109 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
//PageContext.RegisterStartupScript(Window2.GetShowReference());
|
||||
}
|
||||
|
||||
protected void drpRefLicense_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpRefLicense.SelectedValueArray.Length == 1 && this.drpRefLicense.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
this.drpRiskLevel.DataSource = BLL.ConstructionRiskListService.RiskLevelList();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpRiskLevel.DataSource = BLL.ConstructionRiskListService.RiskLevelList2();
|
||||
}
|
||||
this.drpRiskLevel.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpRiskLevel);
|
||||
this.drpRiskLevel.SelectedValue = BLL.Const._Null;
|
||||
}
|
||||
|
||||
#region 选择施工内容
|
||||
/// <summary>
|
||||
/// 选择施工内容
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
string window = String.Format("ShowWBS.aspx", "查找 - ");
|
||||
PageContext.RegisterStartupScript(Window3.GetSaveStateReference(hdConstructionContentId.ClientID) + Window3.GetShowReference(window));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出窗口
|
||||
/// <summary>
|
||||
/// 关闭弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window3_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(hdConstructionContentId.Text))
|
||||
{
|
||||
var c = BLL.ControlItemAndCycleService.GetControlItemAndCycleById(hdConstructionContentId.Text);
|
||||
if (c != null)
|
||||
{
|
||||
this.txtConstructionContent.Text = c.ControlItemContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void rblIsAgree_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.drpHandleMan.Enabled = true;
|
||||
string State = BLL.ConstructionRiskListService.GetConstructionRisk(this.ConstructionRiskId).States;
|
||||
if (this.rblIsAgree.SelectedValue.Equals("true"))
|
||||
{
|
||||
if (State == Const.ConstructionRisk_Audit1)
|
||||
{
|
||||
this.drpHandleMan.Items.Clear();
|
||||
SitePerson_PersonService.InitProjectUserListByProjectUnitTypeDropDownList(drpHandleMan, this.CurrUser.LoginProjectId, Const.ProjectUnitType_1, false);
|
||||
}
|
||||
if (State == Const.ConstructionRisk_Audit2)
|
||||
{
|
||||
this.drpHandleMan.Items.Clear();
|
||||
Funs.FineUIPleaseSelect(this.drpHandleMan);
|
||||
this.drpHandleMan.Enabled = false;
|
||||
}
|
||||
this.drpHandleType.SelectedIndex = 0;
|
||||
this.drpHandleMan.SelectedIndex = 0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpHandleMan.Items.Clear();
|
||||
this.drpHandleType.SelectedIndex = 1;
|
||||
ListItem item = new ListItem();
|
||||
var user = BLL.Person_PersonsService.GetPerson_PersonsById(BLL.ConstructionRiskApproveService.GetComplie(this.ConstructionRiskId).ApproveMan);
|
||||
item.Value = user.PersonId;
|
||||
item.Text = user.PersonName;
|
||||
this.drpHandleMan.Items.Add(item);
|
||||
this.drpHandleMan.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
protected void drpHandleType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.drpHandleMan.Items.Clear();
|
||||
Funs.FineUIPleaseSelect(this.drpHandleMan);
|
||||
if (this.drpHandleType.SelectedValue == BLL.Const.ConstructionRisk_Audit3)
|
||||
{
|
||||
this.drpHandleMan.Enabled = false;
|
||||
}
|
||||
else if (this.drpHandleType.SelectedValue == BLL.Const.ConstructionRisk_ReCompile)
|
||||
{
|
||||
this.drpHandleMan.Enabled = true;
|
||||
string userId = (from x in Funs.DB.HSSE_ConstructionRiskApprove where x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Compile select x.ApproveMan).First();
|
||||
ListItem lis = new ListItem(BLL.Person_PersonsService.GetPersonsNameById(userId), userId);
|
||||
this.drpHandleMan.Items.Add(lis);
|
||||
this.drpHandleMan.SelectedIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpHandleMan.Enabled = true;
|
||||
SitePerson_PersonService.InitProjectUserListByProjectUnitTypeDropDownList(drpHandleMan, this.CurrUser.LoginProjectId, Const.ProjectUnitType_1, false);
|
||||
this.drpHandleMan.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user