Ejemplo n.º 1
0
 /// <summary>
 /// 用户的默认构造函数
 /// </summary>
 public User()
 {
     id = Guid.NewGuid();
     this.departments = new List <Department>();
     this.projects    = new List <Project>();
     roles            = new RoleCollection();
     userGroups       = new List <UserGroup>();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 以名称创建部门对象
 /// </summary>
 /// <param name="name"></param>
 public Department(string name)
 {
     id = Guid.NewGuid();
     if (name != null && name.Trim() != "")
     {
         this.name = name;
     }
     roles = new RoleCollection();
 }
Ejemplo n.º 3
0
 /// <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();
 }
Ejemplo n.º 4
0
 /// <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;
 }
Ejemplo n.º 5
0
 /// <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;
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 默认构造函数
 /// </summary>
 public Department()
 {
     id    = Guid.NewGuid();
     roles = new RoleCollection();
 }
Ejemplo n.º 7
0
 /// <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));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public Project()
 {
     id    = Guid.NewGuid();
     roles = new RoleCollection();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 默认构造函数
 /// </summary>
 public Position()
 {
     id    = Guid.NewGuid();
     roles = new RoleCollection();
 }
Ejemplo n.º 10
0
 /// <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));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public UserGroup()
 {
     id    = Guid.NewGuid();
     roles = new RoleCollection();
 }