Пример #1
0
        private void AddNormalUser(UserAdministrator admin, IAssociation roleName)
        {
            if (roleName == null)
            {
                throw new Exception("Asocjacja nie moze byc null.");
            }

            AddPart(roleName, new NormalUser(admin));
        }
Пример #2
0
        public User(Association <User, NormalUser> roleNameNormalUser, Association <User, UserAdministrator> roleNameAdministrator) : base()
        {
            UserAdministrator admin = GetAdministrator(roleNameAdministrator);

            if (admin != null)
            {
                RemoveAdministrator(admin, roleNameAdministrator);
            }

            AddNormalUser(admin, roleNameNormalUser);
        }