This commit is contained in:
2026-06-04 14:34:48 +08:00
parent 451101c60a
commit 648c93e289
16 changed files with 97 additions and 30 deletions
@@ -41,12 +41,18 @@
<Items>
<%--<f:TextBox ID="txtConsequence" runat="server" Label="主要后果" EmptyText="请输入主要后果(20字以内)" MaxLength="20" ShowRedStar="true" Required="true">
</f:TextBox>--%>
<f:RadioButtonList ID="rblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True">
<%--<f:RadioButtonList ID="rblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True">
<f:RadioItem Value="人员伤亡" Text="人员伤亡" />
<f:RadioItem Value="财产损失" Text="财产损失" />
<f:RadioItem Value="环境破坏" Text="环境破坏" />
<f:RadioItem Value="公司声誉" Text="公司声誉" />
</f:RadioButtonList>
</f:RadioButtonList>--%>
<f:CheckBoxList ID="cblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True">
<f:CheckItem Text="人员伤亡" Value="人员伤亡" />
<f:CheckItem Text="财产损失" Value="财产损失" />
<f:CheckItem Text="环境破坏" Value="环境破坏" />
<f:CheckItem Text="公司声誉" Value="公司声誉" />
</f:CheckBoxList>
</Items>
</f:FormRow>
<f:FormRow>
@@ -3,6 +3,7 @@ using FineUIPro.Web.DataShow;
using Model;
using System;
using System.Linq;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ReportManage.HazardFactor
{
@@ -78,8 +79,12 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
this.txtJobStep.Text = model.JobStep;
this.txtHazard.Text = model.Hazard;
//this.txtConsequence.Text = model.Consequence;
this.rblConsequence.SelectedValue = model.Consequence;
this.txtAccidentType.Text = model.AccidentType;
//this.rblConsequence.SelectedValue = model.Consequence;
if (!string.IsNullOrWhiteSpace(model.Consequence))
{
this.cblConsequence.SelectedValueArray = model.Consequence.Split('、');
}
this.txtAccidentType.Text = model.AccidentType;
this.rblIllegality.SelectedValue = model.Illegality ? "1" : "0";
this.txtBaseRiskSeverity.Text = model.BaseRiskSeverity.ToString();
this.txtBaseRiskProbability.Text = model.BaseRiskProbability.ToString();
@@ -163,7 +168,12 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
model.JobStep = this.txtJobStep.Text.Trim();
model.Hazard = this.txtHazard.Text.Trim();
//model.Consequence = this.txtConsequence.Text.Trim();
model.Consequence = this.rblConsequence.SelectedValue;
//model.Consequence = this.rblConsequence.SelectedValue;
if (this.cblConsequence.SelectedValueArray.Length > 0)
{
string selConsequences = String.Join("、", cblConsequence.SelectedValueArray);
model.Consequence = selConsequences;
}
model.AccidentType = this.txtAccidentType.Text.Trim();
model.Illegality = this.rblIllegality.SelectedValue == "1";
model.BaseRiskSeverity = int.Parse(this.txtBaseRiskSeverity.Text.Trim());
@@ -96,13 +96,13 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
protected global::FineUIPro.TextArea txtHazard;
/// <summary>
/// rblConsequence 控件。
/// cblConsequence 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rblConsequence;
protected global::FineUIPro.CheckBoxList cblConsequence;
/// <summary>
/// txtAccidentType 控件。
@@ -355,11 +355,19 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
if (!string.IsNullOrEmpty(rData4))
{
//Consequence = rData4;
if (!validConsequenceStrings.Any(x => x == rData4))
rData4 = rData4.Replace(",", "、").Replace("", "、").Replace("", "、");
int err = 0;
var Consequences = rData4.Split('、');
foreach (var obj in Consequences)
{
lstError.Add(new ErrorInfo { Row = displayRow, Column = "主要后果", Reason = "只能是[人员伤亡/财产损失/环境破坏/公司声誉]!" });
string item = obj.ToString().Trim();
if (!validConsequenceStrings.Any(x => x == item))
{
err++;
lstError.Add(new ErrorInfo { Row = displayRow, Column = "主要后果", Reason = $"[{item}]错误,只能是[人员伤亡/财产损失/环境破坏/公司声誉]!" });
}
}
else
if (err == 0)
{
Consequence = rData4;
}
@@ -475,7 +483,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
var entity = new Model.HazardFactor_OccHealth
{
ID = SQLHelper.GetNewID(typeof(Model.HazardFactor_OccHealth)),
CompileDate=DateTime.Now,
CompileDate = DateTime.Now,
CompileMan = this.CompileMan,
CompileManName = this.CompileManName,
State = int.Parse(BLL.Const.State_1),//默认已提交
@@ -47,12 +47,18 @@
<Items>
<%--<f:TextBox ID="txtConsequence" runat="server" Label="主要后果" Readonly="true" MaxLength="20" ShowRedStar="true" Required="true">
</f:TextBox>--%>
<f:RadioButtonList ID="rblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True" Readonly="true">
<%--<f:RadioButtonList ID="rblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True" Readonly="true">
<f:RadioItem Value="人员伤亡" Text="人员伤亡" />
<f:RadioItem Value="财产损失" Text="财产损失" />
<f:RadioItem Value="环境破坏" Text="环境破坏" />
<f:RadioItem Value="公司声誉" Text="公司声誉" />
</f:RadioButtonList>
</f:RadioButtonList>--%>
<f:CheckBoxList ID="cblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True" Readonly="true">
<f:CheckItem Text="人员伤亡" Value="人员伤亡" />
<f:CheckItem Text="财产损失" Value="财产损失" />
<f:CheckItem Text="环境破坏" Value="环境破坏" />
<f:CheckItem Text="公司声誉" Value="公司声誉" />
</f:CheckBoxList>
</Items>
</f:FormRow>
<f:FormRow>
@@ -64,7 +64,11 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
this.txtJobStep.Text = model.JobStep;
this.txtHazard.Text = model.Hazard;
//this.txtConsequence.Text = model.Consequence;
this.rblConsequence.SelectedValue = model.Consequence;
//this.rblConsequence.SelectedValue = model.Consequence;
if (!string.IsNullOrWhiteSpace(model.Consequence))
{
this.cblConsequence.SelectedValueArray = model.Consequence.Split('、');
}
this.txtAccidentType.Text = model.AccidentType;
this.rblIllegality.SelectedValue = model.Illegality ? "1" : "0";
this.txtBaseRiskSeverity.Text = model.BaseRiskSeverity.ToString();
@@ -105,13 +105,13 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
protected global::FineUIPro.TextArea txtHazard;
/// <summary>
/// rblConsequence 控件。
/// cblConsequence 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rblConsequence;
protected global::FineUIPro.CheckBoxList cblConsequence;
/// <summary>
/// txtAccidentType 控件。
@@ -41,12 +41,18 @@
<Items>
<%--<f:TextBox ID="txtConsequence" runat="server" Label="主要后果" EmptyText="请输入主要后果(20字以内)" MaxLength="20" ShowRedStar="true" Required="true">
</f:TextBox>--%>
<f:RadioButtonList ID="rblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True">
<%--<f:RadioButtonList ID="rblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True">
<f:RadioItem Value="人员伤亡" Text="人员伤亡" />
<f:RadioItem Value="财产损失" Text="财产损失" />
<f:RadioItem Value="环境破坏" Text="环境破坏" />
<f:RadioItem Value="公司声誉" Text="公司声誉" />
</f:RadioButtonList>
</f:RadioButtonList>--%>
<f:CheckBoxList ID="cblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True" >
<f:CheckItem Text="人员伤亡" Value="人员伤亡" />
<f:CheckItem Text="财产损失" Value="财产损失" />
<f:CheckItem Text="环境破坏" Value="环境破坏" />
<f:CheckItem Text="公司声誉" Value="公司声誉" />
</f:CheckBoxList>
</Items>
</f:FormRow>
<f:FormRow>
@@ -77,7 +77,11 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
this.txtJobStep.Text = model.JobStep;
this.txtHazard.Text = model.Hazard;
//this.txtConsequence.Text = model.Consequence;
this.rblConsequence.SelectedValue = model.Consequence;
//this.rblConsequence.SelectedValue = model.Consequence;
if (!string.IsNullOrWhiteSpace(model.Consequence))
{
this.cblConsequence.SelectedValueArray = model.Consequence.Split('、');
}
this.txtAccidentType.Text = model.AccidentType;
this.rblIllegality.SelectedValue = model.Illegality ? "1" : "0";
this.txtBaseRiskSeverity.Text = model.BaseRiskSeverity.ToString();
@@ -162,7 +166,12 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
model.JobStep = this.txtJobStep.Text.Trim();
model.Hazard = this.txtHazard.Text.Trim();
//model.Consequence = this.txtConsequence.Text.Trim();
model.Consequence = this.rblConsequence.SelectedValue;
//model.Consequence = this.rblConsequence.SelectedValue;
if (this.cblConsequence.SelectedValueArray.Length > 0)
{
string selConsequences = String.Join("、", cblConsequence.SelectedValueArray);
model.Consequence = selConsequences;
}
model.AccidentType = this.txtAccidentType.Text.Trim();
model.Illegality = this.rblIllegality.SelectedValue == "1";
model.BaseRiskSeverity = int.Parse(this.txtBaseRiskSeverity.Text.Trim());
@@ -96,13 +96,13 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
protected global::FineUIPro.TextArea txtHazard;
/// <summary>
/// rblConsequence 控件。
/// cblConsequence 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rblConsequence;
protected global::FineUIPro.CheckBoxList cblConsequence;
/// <summary>
/// txtAccidentType 控件。
@@ -355,11 +355,19 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
if (!string.IsNullOrEmpty(rData4))
{
//Consequence = rData4;
if (!validConsequenceStrings.Any(x => x == rData4))
rData4 = rData4.Replace(",", "、").Replace("", "、").Replace("", "、");
int err = 0;
var Consequences = rData4.Split('、');
foreach (var obj in Consequences)
{
lstError.Add(new ErrorInfo { Row = displayRow, Column = "主要后果", Reason = "只能是[人员伤亡/财产损失/环境破坏/公司声誉]!" });
string item = obj.ToString().Trim();
if (!validConsequenceStrings.Any(x => x == item))
{
err++;
lstError.Add(new ErrorInfo { Row = displayRow, Column = "主要后果", Reason = $"[{item}]错误,只能是[人员伤亡/财产损失/环境破坏/公司声誉]!" });
}
}
else
if (err == 0)
{
Consequence = rData4;
}
@@ -47,12 +47,18 @@
<Items>
<%--<f:TextBox ID="txtConsequence" runat="server" Label="主要后果" Readonly="true" MaxLength="20" ShowRedStar="true" Required="true">
</f:TextBox>--%>
<f:RadioButtonList ID="rblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True" Readonly="true">
<%--<f:RadioButtonList ID="rblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True" Readonly="true">
<f:RadioItem Value="人员伤亡" Text="人员伤亡" />
<f:RadioItem Value="财产损失" Text="财产损失" />
<f:RadioItem Value="环境破坏" Text="环境破坏" />
<f:RadioItem Value="公司声誉" Text="公司声誉" />
</f:RadioButtonList>
</f:RadioButtonList>--%>
<f:CheckBoxList ID="cblConsequence" runat="server" Label="主要后果" LabelAlign="Right" Required="True" ShowRedStar="True" Readonly="true">
<f:CheckItem Text="人员伤亡" Value="人员伤亡" />
<f:CheckItem Text="财产损失" Value="财产损失" />
<f:CheckItem Text="环境破坏" Value="环境破坏" />
<f:CheckItem Text="公司声誉" Value="公司声誉" />
</f:CheckBoxList>
</Items>
</f:FormRow>
<f:FormRow>
@@ -63,7 +63,11 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
this.txtJobStep.Text = model.JobStep;
this.txtHazard.Text = model.Hazard;
//this.txtConsequence.Text = model.Consequence;
this.rblConsequence.SelectedValue = model.Consequence;
//this.rblConsequence.SelectedValue = model.Consequence;
if (!string.IsNullOrWhiteSpace(model.Consequence))
{
this.cblConsequence.SelectedValueArray = model.Consequence.Split('、');
}
this.txtAccidentType.Text = model.AccidentType;
this.rblIllegality.SelectedValue = model.Illegality ? "1" : "0";
this.txtBaseRiskSeverity.Text = model.BaseRiskSeverity.ToString();
@@ -105,13 +105,13 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
protected global::FineUIPro.TextArea txtHazard;
/// <summary>
/// rblConsequence 控件。
/// cblConsequence 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rblConsequence;
protected global::FineUIPro.CheckBoxList cblConsequence;
/// <summary>
/// txtAccidentType 控件。