提交代码
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user