安全检查,补充公司级树

This commit is contained in:
2025-04-10 17:34:21 +08:00
parent 6e6f78e900
commit d9a4bb09ac
98 changed files with 6493 additions and 3750 deletions
@@ -11,6 +11,22 @@ namespace FineUIPro.Web.HSSE.InformationProject
{
public partial class Notice : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@@ -21,8 +37,21 @@ namespace FineUIPro.Web.HSSE.InformationProject
{
if (!IsPostBack)
{
////权限按钮方法
this.GetButtonPower();
//Funs.DropDownPageSize(this.ddlPageSize);
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.btnNew.OnClientClick = Window2.GetShowReference("NoticeEdit.aspx") + "return false;";
this.SddlPageSize.SelectedValue = SGrid.PageSize.ToString();
this.AddlPageSize.SelectedValue = AGrid.PageSize.ToString();
@@ -34,12 +63,33 @@ namespace FineUIPro.Web.HSSE.InformationProject
}
#endregion
/// <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.SBindGrid();
this.ABindGrid();
}
#region SBindGrid
/// <summary>
/// 绑定数据
/// </summary>
private void SBindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT Notice.NoticeId AS SNoticeId,(CASE WHEN Notice.NoticeCode IS NULL THEN CodeRecords.Code ELSE Notice.NoticeCode END) AS NoticeCode,Notice.NoticeTitle,Notice.MainContent,Notice.CompileDate,Notice.CompileMan,Users.UserName AS CompileManName,Notice.CompileDate,Notice.States
,Notice.IsRelease,(CASE WHEN IsRelease=1 THEN '已发布' ELSE '未发布' END) AS IsReleaseName,Notice.ReleaseDate,AccessProjectText
,Notice.ProjectId,(CASE WHEN Notice.ProjectId IS NULL THEN '公司本部' ELSE Project.ProjectName END ) AS ProjectName
@@ -130,6 +180,10 @@ namespace FineUIPro.Web.HSSE.InformationProject
/// </summary>
private void ABindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT Notice.NoticeId,(CASE WHEN Notice.NoticeCode IS NULL THEN CodeRecords.Code ELSE Notice.NoticeCode END) AS NoticeCode,Notice.NoticeTitle,Notice.ReleaseDate,AccessProjectText,AccessProjectId"
+ @" ,Notice.ProjectId,(CASE WHEN Notice.ProjectId IS NULL THEN '公司本部' ELSE Project.ProjectName END ) AS ProjectName"
+ @" ,(CASE WHEN LEN(Notice.AccessProjectText) > 40 THEN SUBSTRING(Notice.AccessProjectText,0,40)+'...' ELSE AccessProjectText END) AS SortAccessProjectText"
@@ -139,14 +193,19 @@ namespace FineUIPro.Web.HSSE.InformationProject
+ @" WHERE IsRelease = 1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND Notice.AccessProjectId LIKE @ProjectId";
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
{
listStr.Add(new SqlParameter("@ProjectId", "%" + Request.Params["projectId"] + "%"));
}
else if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
//if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
//{
// listStr.Add(new SqlParameter("@ProjectId", "%" + Request.Params["projectId"] + "%"));
//}
//else if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
//{
// listStr.Add(new SqlParameter("@ProjectId", "%" + this.CurrUser.LoginProjectId + "%"));
//}
if (!string.IsNullOrEmpty(this.ProjectId))
{
listStr.Add(new SqlParameter("@ProjectId", "%" + this.CurrUser.LoginProjectId + "%"));
listStr.Add(new SqlParameter("@ProjectId", "%" + this.ProjectId + "%"));
}
else
{
@@ -388,11 +447,11 @@ namespace FineUIPro.Web.HSSE.InformationProject
return;
}
string menuId = BLL.Const.ServerNoticeMenuId;
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
if (!string.IsNullOrEmpty(this.ProjectId))
{
menuId = BLL.Const.ProjectNoticeMenuId;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, menuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, menuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))