RoleServices.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6. using Bowin.Common.Linq.Entity;
  7. using EMISOnline.ViewModel.SystemView;
  8. using EMISOnline.DataLogic.SystemDAL;
  9. using EMISOnline.Entities;
  10. using EMISOnline.ViewModel;
  11. namespace EMISOnline.CommonLogic.SystemServices
  12. {
  13. public class RoleServices
  14. {
  15. public RoleDAL RoleDAL { get; set; }
  16. public Bowin.Common.Linq.Entity.IGridResultSet<RoleView> GetRoleViewList(int pageIndex, int pageSize)
  17. {
  18. Expression<Func<Sys_Role, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  19. return RoleDAL.GetRoleView(exp).OrderByDescending(x => x.IsSystemRole).ThenBy(x => x.RoleName)
  20. .ToGridResultSet<RoleView>(pageIndex, pageSize);
  21. }
  22. public IList<RoleView> GetRoleViewList()
  23. {
  24. Expression<Func<Sys_Role, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  25. return RoleDAL.GetRoleView(exp).OrderByDescending(x => x.IsSystemRole).ThenBy(x => x.RoleName)
  26. .ToList();
  27. }
  28. }
  29. }