补充公司级别树

This commit is contained in:
2025-04-09 19:14:54 +08:00
parent 8514fb0156
commit 023e3d33cf
86 changed files with 5694 additions and 3375 deletions
@@ -13,6 +13,20 @@ namespace FineUIPro.Web.HSSE.ActionPlan
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 管理规定发布主键
/// </summary>
public string ManagerRuleId
@@ -69,7 +83,20 @@ namespace FineUIPro.Web.HSSE.ActionPlan
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
this.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.CurrUser.LoginProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
this.GetButtonPower();
}
this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference());
this.ManagerRuleListCode = Request.Params["managerRuleListCode"];
@@ -77,12 +104,32 @@ namespace FineUIPro.Web.HSSE.ActionPlan
BindGrid();
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.BindGrid();
this.GetButtonPower();
//if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
//{
// btnNew.Hidden = true;
//}
}
/// <summary>
/// 加载数据
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = "SELECT ManagerRule.ManagerRuleId,CodeRecords.Code AS ManageRuleCode,ManagerRule.ProjectId,"
+ @"ManagerRule.OldManageRuleCode,ManagerRule.ManageRuleName,ManagerRule.ManageRuleTypeId,"
+ @"ManagerRule.VersionNo,"
@@ -113,7 +160,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
}
else
{
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
}
if (!string.IsNullOrEmpty(this.txtManageRuleCode.Text.Trim()))
{
@@ -133,11 +180,11 @@ namespace FineUIPro.Web.HSSE.ActionPlan
if (this.cbIssue.SelectedValueArray.Length == 1)
{
///是否发布
///是否发布
string selectValue = String.Join(", ", this.cbIssue.SelectedValueArray);
if (selectValue == "1")
{
strSql += " AND ManagerRule.IsIssue = 1 ";
strSql += " AND ManagerRule.IsIssue = 1 ";
}
else
{
@@ -148,7 +195,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
@@ -198,7 +245,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
{
this.DeleteData();
}
@@ -230,7 +277,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
BLL.LogService.AddSys_Log(this.CurrUser, manageRule.ManageRuleCode, manageRule.ManagerRuleId, BLL.Const.ActionPlan_ManagerRuleMenuId, Const.BtnDelete);
BLL.ActionPlan_ManagerRuleService.DeleteManageRuleById(rowID);
}
BindGrid();
ShowNotify("删除成功!", MessageBoxIcon.Success);
//}
@@ -306,14 +353,14 @@ namespace FineUIPro.Web.HSSE.ActionPlan
if (managerRule != null)
{
if (this.btnMenuEdit.Hidden || managerRule.State == BLL.Const.State_2) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
{
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("ManagerRuleView.aspx?ManagerRuleId={0}", managerRuleId, "查看 - ")));
}
else
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("ManagerRuleEdit.aspx?ManagerRuleId={0}", managerRuleId, "编辑 - ")));
}
}
}
}
#endregion
@@ -420,7 +467,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
/// <param name="e"></param>
protected void btnMenuIssuance_Click(object sender, EventArgs e)
{
string strShowNotify = string.Empty;
string strShowNotify = string.Empty;
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
@@ -451,7 +498,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
else
{
strShowNotify += "管理规定:" + managerRule.ManageRuleName + "";
}
}
}
@@ -513,7 +560,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ActionPlan_ManagerRuleMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ActionPlan_ManagerRuleMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
@@ -539,7 +586,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
}
}
#endregion
#region
/// <summary>
/// 查询
@@ -549,7 +596,7 @@ namespace FineUIPro.Web.HSSE.ActionPlan
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
if(this.PageSize.HasValue)
if (this.PageSize.HasValue)
{
this.ddlPageSize.SelectedValue = this.PageSize.ToString();
}