コード例 #1
0
    private void NotAdminStuff()
    {
        //this guy is not an admin
        MemberSearch.Controls.Remove(SearchTable);
        FoundUsers.Controls.Remove(FoundUsersTable);
        FoundUsers.Controls.Remove(FoundUsersTableLabel);
        SecurityController s    = HttpContext.Current.User as SecurityController;
        ClubBAIST          cb   = new ClubBAIST();
        User         u          = cb.ReadUser(s.Identity.Name);
        List <Score> userScores = cb.ReadScores(u.Email);

        ListScores(userScores);
    }
コード例 #2
0
    private void AdminStuff()
    {
        //this guy is totally admin
        ClubBAIST cb = new ClubBAIST();

        if (Request.QueryString["u"] != null)
        {
            int          userID     = int.Parse(Request.QueryString["u"]);
            User         u          = cb.ReadUserByID(userID);
            List <Score> userScores = cb.ReadScores(u.Email);
            ListScores(userScores);
        }
        else
        {
            List <Score> allScores = cb.ReadAllScores();
            ListScores(allScores);
        }
    }