Пример #1
0
 public IList <IUserGroup> GetUserGroupsForUser(UserBase user)
 {
     using (Session session = new Session())
     {
         AuthorizationRepository repository = new AuthorizationRepository(session);
         return(repository.GetGroupsForUser(user));
     }
 }
 public IList<IUserGroup> GetUserGroupsForUser(UserBase user)
 {
     using (Session session = new Session())
     {
         AuthorizationRepository repository = new AuthorizationRepository(session);
         return repository.GetGroupsForUser(user);
     }
 }
Пример #3
0
    void LoadUserToGroup()
    {
        User user = Magic.Sys.User.Retrieve(_session, _userId);
        if (user != null)
        {
            this.lblUserName.Text = user.FullName;

            AuthorizationRepository repository = new AuthorizationRepository(_session);
            IList<IUserGroup> usr2grps = repository.GetGroupsForUser(user);
            this.rptUserToGroup.DataSource = usr2grps;
            this.rptUserToGroup.DataBind();

            if (usr2grps == null || usr2grps.Count <= 0)
                this.rptAllGroup.DataSource = repository.GetAllGroups();
            else
                this.rptAllGroup.DataSource = repository.GetAssigningGroupsForUser(user);
            this.rptAllGroup.DataBind();
        }
    }