安全检查补充公司级树
This commit is contained in:
@@ -13,22 +13,73 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
public partial class ConstructionRisk : PageBase
|
||||
{
|
||||
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
GetButtonPower();//权限设置
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
this.InitTreeMenu();//加载树
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
|
||||
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
btnNew.Hidden = true;
|
||||
}
|
||||
this.GetButtonPower();
|
||||
this.InitTreeMenu();
|
||||
this.BindGrid();
|
||||
}
|
||||
#region 加载树施工单位
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.tvControlItem.Nodes.Clear();
|
||||
|
||||
List<Base_Unit> units = null;
|
||||
@@ -36,12 +87,12 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
var user = UserService.GetUserByUserId(this.CurrUser.UserId);
|
||||
if (!string.IsNullOrEmpty(user.UnitId))
|
||||
{
|
||||
var projectUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, user.UnitId);
|
||||
var projectUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.ProjectId, user.UnitId);
|
||||
if (projectUnit != null)
|
||||
{
|
||||
if (projectUnit.UnitType == BLL.Const.ProjectUnitType_1 || projectUnit.UnitType == BLL.Const.ProjectUnitType_3 || projectUnit.UnitType == BLL.Const.ProjectUnitType_4)
|
||||
{
|
||||
var ids = Funs.DB.HSSE_ConstructionRisk.Where(x => x.ProjectId == this.CurrUser.LoginProjectId).Select(x => x.UnitId).Distinct().ToList();
|
||||
var ids = Funs.DB.HSSE_ConstructionRisk.Where(x => x.ProjectId == this.ProjectId).Select(x => x.UnitId).Distinct().ToList();
|
||||
units = (from x in Funs.DB.Base_Unit
|
||||
where ids.Contains(x.UnitId)
|
||||
select x).OrderBy(x => x.UnitCode).ToList();
|
||||
@@ -56,7 +107,7 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
}
|
||||
else if (user.UnitId == CommonService.GetThisUnitId() || user.UserId == Const.hfnbdId)
|
||||
{
|
||||
var ids = Funs.DB.HSSE_ConstructionRisk.Where(x => x.ProjectId == this.CurrUser.LoginProjectId).Select(x => x.UnitId).Distinct().ToList();
|
||||
var ids = Funs.DB.HSSE_ConstructionRisk.Where(x => x.ProjectId == this.ProjectId).Select(x => x.UnitId).Distinct().ToList();
|
||||
units = (from x in Funs.DB.Base_Unit
|
||||
where ids.Contains(x.UnitId)
|
||||
select x).OrderBy(x => x.UnitCode).ToList();
|
||||
@@ -122,6 +173,7 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 页索引改变事件
|
||||
/// <summary>
|
||||
/// 页索引改变事件
|
||||
@@ -135,7 +187,6 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 删除
|
||||
@@ -177,10 +228,6 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
@@ -223,7 +270,7 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
{
|
||||
|
||||
var DateWeek = (from x in Funs.DB.HSSE_ConstructionRisk
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
where x.ProjectId == this.ProjectId
|
||||
&& x.UnitId == node.NodeID
|
||||
select x.DateWeek).Distinct().ToList().OrderByDescending(x => x);
|
||||
foreach (var d in DateWeek)
|
||||
@@ -249,7 +296,7 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
}
|
||||
|
||||
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ConstructionRiskMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ConstructionRiskMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
@@ -317,7 +364,7 @@ namespace FineUIPro.Web.HSSE.Hazard
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
var r = Funs.DB.HSSE_ConstructionRisk.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == "2");
|
||||
var r = Funs.DB.HSSE_ConstructionRisk.Where(x => x.ProjectId == this.ProjectId && x.States == "2");
|
||||
foreach (var item in r)
|
||||
{
|
||||
item.States = "3";
|
||||
|
||||
Reference in New Issue
Block a user