123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using PublicLibrary.Model;
- namespace CoreEntity.Entity
- {
- [Serializable]
- public class Permission
- {
- private int _id;
- private string _permissionname;
- private string _permissionurl;
- private string _authtype;
- private string _icon;
- private int _parentid;
- private bool _isdelete;
- private int _creationperson;
- private DateTime _creationdate;
- private int _lastmodifiedperson;
- private DateTime _lastmodified;
- private List<Role> _rolelist;
- private string _roleids;
- private string _PermissionRule;
- private string _PermissionRuleType;
- public Permission()
- {
- }
- public int Id
- {
- get { return _id; }
- set { _id = value; }
- }
- public string PermissionName
- {
- get { return _permissionname; }
- set { _permissionname = value; }
- }
- public string PermissionUrl
- {
- get { return _permissionurl; }
- set { _permissionurl = value; }
- }
- public string Icon
- {
- get { return _icon; }
- set { _icon = value; }
- }
- public int ParentId
- {
- get { return _parentid; }
- set { _parentid = value; }
- }
- public bool IsDelete
- {
- get { return _isdelete; }
- set { _isdelete = value; }
- }
- public int CreationPerson
- {
- get { return _creationperson; }
- set { _creationperson = value; }
- }
- public DateTime CreationDate
- {
- get { return _creationdate; }
- set { _creationdate = value; }
- }
- public int LastModifiedPerson
- {
- get { return _lastmodifiedperson; }
- set { _lastmodifiedperson = value; }
- }
- public DateTime LastModified
- {
- get { return _lastmodified; }
- set { _lastmodified = value; }
- }
- public List<Role> RoleList
- {
- get { return _rolelist; }
- set { _rolelist = value; }
- }
- public string Roleids { get => _roleids; set => _roleids = value; }
- public string AuthType { get => _authtype; set => _authtype = value; }
- public static IList<Menu> Convert(IList<Permission> permss)
- {
- IList<Menu> options = new List<Menu>();
- foreach (Permission perm in permss)
- {
- var option = new Menu()
- {
- icon = perm.Icon,
- id = perm.Id.ToString(),
- name = perm.PermissionName,
- url = perm.PermissionUrl,
- parentId = perm.ParentId.ToString(),
- permissionName = perm.PermissionName.ToString()
- };
- options.Add(option);
- }
- return options;
- }
- private int _sort;
- public int Sort { get => _sort; set => _sort = value; }
- public string PermissionRule { get => _PermissionRule; set => _PermissionRule = value; }
- public string PermissionRuleType { get => _PermissionRuleType; set => _PermissionRuleType = value; }
- }
- }
|