/// <summary> /// 用户的默认构造函数 /// </summary> public User() { id = Guid.NewGuid(); this.departments = new List <Department>(); this.projects = new List <Project>(); roles = new RoleCollection(); userGroups = new List <UserGroup>(); }
/// <summary> /// 以名称创建部门对象 /// </summary> /// <param name="name"></param> public Department(string name) { id = Guid.NewGuid(); if (name != null && name.Trim() != "") { this.name = name; } roles = new RoleCollection(); }
/// <summary> /// 以指定的名称和上级职位创建新职位 /// </summary> /// <param name="name"></param> /// <param name="parent"></param> public Position(string name, Position parent) { id = Guid.NewGuid(); if (name != null && name.Trim() != "") { this.name = name; } this.parent = parent; roles = new RoleCollection(); }
/// <summary> /// 由用户名和密码构造用户对象 /// </summary> /// <param name="userName"></param> /// <param name="password"></param> public User(string userName, string password) { id = Guid.NewGuid(); this.departments = new List <Department>(); this.projects = new List <Project>(); roles = new RoleCollection(); userGroups = new List <UserGroup>(); if (userName != null && userName.Trim() != "") { this.userName = userName; } this.password = password; }
/// <summary> /// 以名称和角色集合创建部门对象 /// </summary> /// <param name="name"></param> /// <param name="roles"></param> public Department(string name, RoleCollection roles) { id = Guid.NewGuid(); if (name != null && name.Trim() != "") { this.name = name; } if (roles == null) { this.roles = new RoleCollection(); } else { this.roles = roles; } }
/// <summary> /// 默认构造函数 /// </summary> public Department() { id = Guid.NewGuid(); roles = new RoleCollection(); }
/// <summary> /// 以指定的名称创建子部门 /// </summary> /// <param name="name"></param> /// <param name="roles"></param> /// <returns></returns> public Department CreateSubDepartment(string name, RoleCollection roles) { return(new Department(name, roles, this)); }
/// <summary> /// 构造函数 /// </summary> public Project() { id = Guid.NewGuid(); roles = new RoleCollection(); }
/// <summary> /// 默认构造函数 /// </summary> public Position() { id = Guid.NewGuid(); roles = new RoleCollection(); }
/// <summary> /// 以指定的名称和角色集合创建子职位 /// </summary> /// <param name="name"></param> /// <param name="roles"></param> /// <returns></returns> public Position CreateSubPosition(string name, RoleCollection roles) { return(new Position(name, roles, this)); }
/// <summary> /// 构造函数 /// </summary> public UserGroup() { id = Guid.NewGuid(); roles = new RoleCollection(); }