Permission.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using PublicLibrary.Model;
  5. namespace CoreEntity.Entity
  6. {
  7. [Serializable]
  8. public class Permission
  9. {
  10. private int _id;
  11. private string _permissionname;
  12. private string _permissionurl;
  13. private string _authtype;
  14. private string _icon;
  15. private int _parentid;
  16. private bool _isdelete;
  17. private int _creationperson;
  18. private DateTime _creationdate;
  19. private int _lastmodifiedperson;
  20. private DateTime _lastmodified;
  21. private List<Role> _rolelist;
  22. private string _roleids;
  23. private string _PermissionRule;
  24. private string _PermissionRuleType;
  25. public Permission()
  26. {
  27. }
  28. public int Id
  29. {
  30. get { return _id; }
  31. set { _id = value; }
  32. }
  33. public string PermissionName
  34. {
  35. get { return _permissionname; }
  36. set { _permissionname = value; }
  37. }
  38. public string PermissionUrl
  39. {
  40. get { return _permissionurl; }
  41. set { _permissionurl = value; }
  42. }
  43. public string Icon
  44. {
  45. get { return _icon; }
  46. set { _icon = value; }
  47. }
  48. public int ParentId
  49. {
  50. get { return _parentid; }
  51. set { _parentid = value; }
  52. }
  53. public bool IsDelete
  54. {
  55. get { return _isdelete; }
  56. set { _isdelete = value; }
  57. }
  58. public int CreationPerson
  59. {
  60. get { return _creationperson; }
  61. set { _creationperson = value; }
  62. }
  63. public DateTime CreationDate
  64. {
  65. get { return _creationdate; }
  66. set { _creationdate = value; }
  67. }
  68. public int LastModifiedPerson
  69. {
  70. get { return _lastmodifiedperson; }
  71. set { _lastmodifiedperson = value; }
  72. }
  73. public DateTime LastModified
  74. {
  75. get { return _lastmodified; }
  76. set { _lastmodified = value; }
  77. }
  78. public List<Role> RoleList
  79. {
  80. get { return _rolelist; }
  81. set { _rolelist = value; }
  82. }
  83. public string Roleids { get => _roleids; set => _roleids = value; }
  84. public string AuthType { get => _authtype; set => _authtype = value; }
  85. public static IList<Menu> Convert(IList<Permission> permss)
  86. {
  87. IList<Menu> options = new List<Menu>();
  88. foreach (Permission perm in permss)
  89. {
  90. var option = new Menu()
  91. {
  92. icon = perm.Icon,
  93. id = perm.Id.ToString(),
  94. name = perm.PermissionName,
  95. url = perm.PermissionUrl,
  96. parentId = perm.ParentId.ToString(),
  97. permissionName = perm.PermissionName.ToString()
  98. };
  99. options.Add(option);
  100. }
  101. return options;
  102. }
  103. private int _sort;
  104. public int Sort { get => _sort; set => _sort = value; }
  105. public string PermissionRule { get => _PermissionRule; set => _PermissionRule = value; }
  106. public string PermissionRuleType { get => _PermissionRuleType; set => _PermissionRuleType = value; }
  107. }
  108. }