数据穿透

This commit is contained in:
geh
2026-03-06 14:24:20 +08:00
parent 474e208256
commit a05f640047
115 changed files with 14173 additions and 203 deletions
@@ -95,14 +95,14 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
HSSE_Hazard_HazardRegisterService.InitStatesDropDownList(this.drpStates, true);
/* ListItem[] ProblemTypes = new ListItem[2];
ListItem[] ProblemTypes = new ListItem[2];
ProblemTypes[0] = new ListItem("日常巡检", "1");
ProblemTypes[1] = new ListItem("专项巡检", "2");
this.drpProblemTypes.DataValueField = "Value";
this.drpProblemTypes.DataTextField = "Text";
this.drpProblemTypes.DataSource = ProblemTypes;
this.drpProblemTypes.DataBind();
Funs.FineUIPleaseSelect(this.drpProblemTypes);*/
Funs.FineUIPleaseSelect(this.drpProblemTypes);
// 绑定表格
BindGrid();
}
@@ -132,7 +132,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
if (!string.IsNullOrEmpty(this.ProjectId) || !string.IsNullOrEmpty(this.UnintId))
{
string strSql = "SELECT * FROM View_Hazard_HazardRegister WHERE ProblemTypes ='1' ";
string strSql = "SELECT * FROM View_Hazard_HazardRegister WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(ProjectId))
{
@@ -156,8 +156,8 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
}
if (!string.IsNullOrEmpty(this.dpRiskLevel.SelectedValue.Trim()))
{
strSql += " AND Risk_Level = @Risk_Level";
listStr.Add(new SqlParameter("@Risk_Level", this.dpRiskLevel.SelectedText));
strSql += " AND Risk_Level LIKE @Risk_Level";
listStr.Add(new SqlParameter("@Risk_Level", "%" + this.dpRiskLevel.SelectedText + "%"));
}
//if (this.ckType.SelectedValue != "0")
//{
@@ -202,6 +202,26 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
strSql += " AND States LIKE @States";
listStr.Add(new SqlParameter("@States", "%" + this.drpStates.SelectedValue + "%"));
}
if (this.drpProblemTypes.SelectedValue != BLL.Const._Null)
{
strSql += " AND ProblemTypes = @ProblemTypes";
listStr.Add(new SqlParameter("@ProblemTypes", this.drpProblemTypes.SelectedValue));
}
if (this.drpDataSource.SelectedValue != BLL.Const._Null)
{
if (this.drpDataSource.SelectedValue == "0")
{
strSql += " AND DataSource != @DataSource";
listStr.Add(new SqlParameter("@DataSource", "1"));
}
else
{
strSql += " AND DataSource = @DataSource";
listStr.Add(new SqlParameter("@DataSource", this.drpDataSource.SelectedValue));
}
}
if (!CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId))
{
strSql += " AND (ResponsibleUnit =@ResponsibleUnit OR SendUnitId=@SendUnitId)";
@@ -381,14 +401,20 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
{
if (registration.States == "1") //待整改
{
if (registration.ResponsibleMan == this.CurrUser.UserId) //当前人是责任人,可以进行整改操作
if (registration.DataSource == "1")
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationRectify.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
}
else
}else
{
Alert.ShowInTop("您不是记录责任人,无法整改!", MessageBoxIcon.Warning);
return;
if (registration.ResponsibleMan == this.CurrUser.UserId) //当前人是责任人,可以进行整改操作
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationRectify.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
}
else
{
Alert.ShowInTop("您不是记录责任人,无法整改!", MessageBoxIcon.Warning);
return;
}
}
}
else
@@ -904,5 +930,33 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
}
}
#endregion
protected string ConvertDataSource(object dataSource)
{
string data = "本单位";
if (dataSource != null)
{
if (dataSource.ToString() == "1")
{
data = "总包";
}
}
return data;
}
#region
/// <summary>
/// 拉取总包检查
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnPull_Click(object sender, EventArgs e)
{
APIHazardRegisterSyncService.getHazardRegisterLists(this.ProjectId);
this.BindGrid();
}
#endregion
}
}