Exemplo n.º 1
0
        private void BindData()
        {
            int i;
            int courseID = GetCourseID();
            Courses courseda = new Courses(Globals.CurrentIdentity);
            User.UserList users =  courseda.GetStaff(courseID, null);
            CourseRole.CourseRoleList roles = courseda.GetRoles(courseID, null);

            Principal.PrincipalList prins = new Principal.PrincipalList();
            prins.AddRange(roles); prins.AddRange(users);

            dgRoles.DataSource = prins;
            dgRoles.DataBind();

            for (i = 0; i < roles.Count; i++) {
                if (roles[i].Staff) {
                    dgRoles.SelectedIndex = i;
                    BindPermissions();
                    break;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get a PrincipalList with the user and all their groups
        /// </summary>
        public Principal.PrincipalList GetPrincipals(string username, int asstID)
        {
            Principal.PrincipalList plist = new Principal.PrincipalList();
            User user = new User();

            //Add the user principal
            m_dp.GetUserInfo(username, user, null);
            plist.Add(user);

            //Add the groups
            Group.GroupList glist = m_dp.GetUserGroups(username, asstID);
            plist.AddRange(glist);

            return plist;
        }