提交代码

This commit is contained in:
2024-05-27 16:34:45 +08:00
parent 493f1a5ab5
commit d554e7a6c9
20 changed files with 185 additions and 89 deletions
@@ -183,9 +183,9 @@ namespace FineUIPro.Web.HSSE.Hazard
{
if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.NodeID.Contains("|"))
{
var ids= this.tvControlItem.SelectedNode.NodeID.Split('|');
var ids = this.tvControlItem.SelectedNode.NodeID.Split('|');
string strSql = @"select c.UnitWorkName, '' Id,*
,(CASE WHEN a.States = " + BLL.Const.State_3 + " THEN '审核/审批完成' when a.States = " + BLL.Const.State_0 + " OR a.States IS NULL THEN '待提交' WHEN a.States = " + BLL.Const.State_2 + " THEN '待总包安全经理审核' ELSE '待['+OperateUser.PersonName+']办理' END) AS FlowOperateName"
,b.CheckResult,(CASE WHEN a.States = " + BLL.Const.State_3 + " THEN '审核/审批完成' when a.States = " + BLL.Const.State_0 + " OR a.States IS NULL THEN '待提交' WHEN a.States = " + BLL.Const.State_2 + " THEN '待总包安全经理审核' ELSE '待['+OperateUser.PersonName+']办理' END) AS FlowOperateName"
+ @" from [dbo].[HSSE_ConstructionRisk] a left join [dbo].[HSSE_ConstructionRiskControl] b
on a.ConstructionRiskId =b.ConstructionRiskId left join WBS_UnitWork c on a.WorkAreaId = c.UnitWorkId
LEFT JOIN Sys_FlowOperate AS FlowOperate ON a.ConstructionRiskId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1
@@ -193,18 +193,23 @@ namespace FineUIPro.Web.HSSE.Hazard
where a.UnitId=@UnitId and a.DateWeek=@DateWeek order by a.[ConstructionContent],b.[ShowIndex]";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@UnitId", ids[0]));
listStr.Add(new SqlParameter("@DateWeek", ids[1]));
listStr.Add(new SqlParameter("@DateWeek", ids[1]));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
foreach(DataRow row in tb.Rows)
foreach (DataRow row in tb.Rows)
{
row["Id"] = row["ConstructionRiskId"] +"|"+ row["ControlId"];
row["Id"] = row["ConstructionRiskId"] + "|" + row["ControlId"];
}
Grid1.DataSource = tb;
Grid1.DataBind();
}
else
{
Grid1.DataSource = null;
Grid1.DataBind();
}
}
#region
/// <summary>
@@ -286,13 +291,31 @@ namespace FineUIPro.Web.HSSE.Hazard
protected void btnAudit_Click(object sender, EventArgs e)
{
var risks = Funs.DB.HSSE_ConstructionRisk.Where(x => x.States == "2");
foreach (var r in risks)
//if (Grid1.SelectedRowIndexArray.Length == 0)
//{
// Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
// return;
//}
//foreach (int rowIndex in Grid1.SelectedRowIndexArray)
//{
// string rowID = Grid1.DataKeys[rowIndex][0].ToString();
// var ids = rowID.Split('|');
// if (ids.Length >= 1)
// {
// var r = Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(x => x.ConstructionRiskId == ids[0]);
// if (r != null && r.States == "2")
// {
// r.States = "3";
// }
// }
//}
var r = Funs.DB.HSSE_ConstructionRisk.Where(x => x.ProjectId==this.CurrUser.LoginProjectId && x.States == "2");
foreach (var item in r)
{
r.States = "3";
item.States = "3";
}
Funs.DB.SubmitChanges();
BindGrid();
}
#region TreeView