提交代码

This commit is contained in:
2024-09-24 11:28:27 +08:00
parent 24de50cd30
commit 0865c7e41e
54 changed files with 5535 additions and 784 deletions
@@ -15,15 +15,15 @@ namespace FineUIPro.Web.HSSE.Hazard
/// 项目主键
/// </summary>
public string ControlId
public string ConstructionRiskCheckId
{
get
{
return (string)ViewState["ControlId"];
return (string)ViewState["ConstructionRiskCheckId"];
}
set
{
ViewState["ControlId"] = value;
ViewState["ConstructionRiskCheckId"] = value;
}
}
public string ConstructionRiskId
@@ -51,32 +51,40 @@ namespace FineUIPro.Web.HSSE.Hazard
{
if (!IsPostBack)
{
string ControlId = Request["ControlId"];
if (!string.IsNullOrEmpty(ControlId))
string ConstructionRiskCheckId = Request["ConstructionRiskCheckId"];
if (!string.IsNullOrEmpty(ConstructionRiskCheckId))
{
this.ControlId = ControlId;
this.ConstructionRiskCheckId = ConstructionRiskCheckId;
}
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;
}
}
if (this.rbCheckResult.SelectedValue == "符合")
this.ConstructionRiskId = Request["ConstructionRiskId"];
var constructionRiskCheck = Funs.DB.HSSE_ConstructionRiskCheck.FirstOrDefault(x=>x.ConstructionRiskCheckId == this.ConstructionRiskCheckId);
if (constructionRiskCheck != null)
{
this.rbRectification.Hidden = true;
this.ConstructionRiskId = constructionRiskCheck.ConstructionRiskId;
if (constructionRiskCheck.CheckDate != null)
{
this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", constructionRiskCheck.CheckDate);
}
if (!string.IsNullOrEmpty(constructionRiskCheck.CheckResult))
{
rbCheckResult.SelectedValue = constructionRiskCheck.CheckResult;
}
if (this.rbCheckResult.SelectedValue == "符合")
{
this.rbRectification.Hidden = true;
}
else
{
this.rbRectification.Hidden = false;
}
if (!string.IsNullOrEmpty(constructionRiskCheck.Rectification))
{
rbRectification.SelectedValue = constructionRiskCheck.Rectification;
}
}
else
{
this.rbRectification.Hidden = false;
this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
}
}
@@ -100,24 +108,30 @@ namespace FineUIPro.Web.HSSE.Hazard
/// <param name="type"></param>
private void SaveData(string type)
{
Model.HSSE_ConstructionRiskControl newconstructionRisk = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId == this.ControlId);
Model.HSSE_ConstructionRiskCheck check = new Model.HSSE_ConstructionRiskCheck();
check.ConstructionRiskId = this.ConstructionRiskId;
check.CheckDate = Funs.GetNewDateTimeOrNow(this.txtCheckDate.Text.Trim());
check.CheckResult = rbCheckResult.SelectedValue;
check.CheckMan = this.CurrUser.PersonId;
string str = string.Empty;
if (newconstructionRisk != null)
if (this.rbCheckResult.SelectedValue == "不符合")
{
newconstructionRisk.CheckMan = this.CurrUser.PersonId;
newconstructionRisk.CheckResult = rbCheckResult.SelectedValue;
if (this.rbCheckResult.SelectedValue == "不符合")
{
newconstructionRisk.Rectification = rbRectification.SelectedValue;
str= rbRectification.SelectedValue;
}
check.Rectification = rbRectification.SelectedValue;
str = rbRectification.SelectedValue;
}
if (!string.IsNullOrEmpty(this.ConstructionRiskCheckId))
{
check.ConstructionRiskCheckId = this.ConstructionRiskCheckId;
BLL.ConstructionRiskCheckService.UpdateConstructionRiskCheck(check);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
check.ConstructionRiskCheckId = SQLHelper.GetNewID();
BLL.ConstructionRiskCheckService.AddConstructionRiskCheck(check);
str += "|" + check.ConstructionRiskCheckId;
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(str) + ActiveWindow.GetHidePostBackReference());
}
Funs.DB.SubmitChanges();
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(str) + ActiveWindow.GetHidePostBackReference());
}
protected void rdCheckResult_SelectedIndexChanged(object sender, EventArgs e)