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 _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 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 Convert(IList permss) { IList options = new List(); 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; } } }