コード例 #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;
                }
            }
        }
コード例 #2
0
ファイル: submit.ascx.cs プロジェクト: lokygb/FrontDesk
        private void BindPListData()
        {
            int asstID = GetAsstID();

            Principal.PrincipalList plist = (new Users(Globals.CurrentIdentity)).GetPrincipals(
                Globals.CurrentUserName, asstID);

            lstPrincipal.DataSource = plist;
            lstPrincipal.DataBind();
            lstPrincipal.SelectedIndex = 0;
        }
コード例 #3
0
ファイル: users.cs プロジェクト: lokygb/FrontDesk
        /// <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);
        }