PermissionManage.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Central.Control.Domain;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data.Common;
  5. using System.Data.SqlClient;
  6. using System.Linq;
  7. using System.Text;
  8. namespace MES.Production.Service.ServiceImp
  9. {
  10. /// <summary>
  11. /// Service 授权模块关系处理类
  12. /// add 作者: 季健国 QQ:181589805 by 2016-05-22
  13. /// </summary>
  14. public class PermissionManage : RepositoryBase<SYS_PERMISSION>, IService.IPermissionManage
  15. {
  16. /// <summary>
  17. /// 根据系统ID获取所有模块的权限ID集合
  18. /// </summary>
  19. public List<int> GetPermissionIdBySysId(string sysId)
  20. {
  21. try
  22. {
  23. string sql = "select p.id from sys_permission p where exists(select 1 from sys_module t where t.fk_belongsystem=@sysid and t.id=p.moduleid)";
  24. DbParameter para = new SqlParameter("@sysid", sysId);
  25. return this.SelectBySql<int>(sql, para);
  26. }
  27. catch (Exception e)
  28. {
  29. throw e;
  30. }
  31. }
  32. }
  33. }