20241012 Contractor Quality Punishment设置查看全部权限

This commit is contained in:
2024-10-12 16:22:19 +08:00
parent 7d5c5d55c5
commit b7b87e2240
5 changed files with 27 additions and 7 deletions
+22 -3
View File
@@ -1,7 +1,9 @@
using System;
using NPOI.SS.Formula.Atp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Security;
namespace BLL
{
@@ -45,7 +47,7 @@ namespace BLL
{
var bt = from x in Funs.DB.Sys_ButtonPower
join y in Funs.DB.Sys_Menu on x.MenuId equals y.MenuId
where x.RoleId == roleId
where x.RoleId == roleId
select x;
if (bt.Count() > 0)
@@ -104,8 +106,25 @@ namespace BLL
//}
//else
//{
return false;
return false;
//}
}
/// <summary>
/// 根据用户id获取有ViewAll按钮权限用户
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public static Model.Sys_User GetButtonPowerByUserId(string userId)
{
var q = (from x in Funs.DB.Sys_User
join y in Funs.DB.Sys_Role on x.RoleId equals y.RoleId
join z in Funs.DB.Sys_ButtonPower on y.RoleId equals z.RoleId
join w in Funs.DB.Sys_ButtonToMenu on z.ButtonToMenuId equals w.ButtonToMenuId
where w.ButtonEnName == "ViewAll"
&& x.UserId == userId
select x).FirstOrDefault();
return q;
}
}
}