Files
SGGL_SHJ/SGGL/FineUIPro.Web/HSSE/Hazard/ConstructionRiskControlCheck.aspx.cs
T
2024-05-27 16:34:45 +08:00

116 lines
3.4 KiB
C#

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.CheckMan = this.CurrUser.PersonId;
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)
{
}
}
}