コード例 #1
0
    private void LoadData()
    {
        ProviderFriendsListMain MyFriends = new ProviderFriendsListMain(UserIdentity.UserID);

        MyFriendsList.DataSource = MyFriends.GetFriendsList();
        MyFriendsList.DataBind();

        int NumRecordsAllowed = SiteConfiguration.GetConfiguration.NumberOfFriendsInFriendsList;

        int Remaining = NumRecordsAllowed - MyFriends.TotalCount;

        lblcounter.Text = "<img src='images/friendlisticon.gif' align='absmiddle'>&nbsp;&nbsp;Bạn có (" + MyFriends.TotalCount + ") thành viên trong danh sách. Bạn chỉ có quyền nhớ " + NumRecordsAllowed + " Thành viên trong danh sách bạn bè. Bạn còn nhớ thêm được " + Remaining + " thành viên nữa.";

        MyFriends = null;
    }
コード例 #2
0
ファイル: pmsend.aspx.cs プロジェクト: mangmaytinh/vguitar
    protected void Page_Load(object sender, EventArgs e)
    {
        EnsureParameterIsCorrect();

        if (Authentication.IsUserAuthenticated)
        {
            Blogic.UpdateUserLastLogin(UserIdentity.UserID);

            HideContentIfNotLogin.Visible = true;

            GetMethodMode();

            ProviderFriendsListMain MyFriends = new ProviderFriendsListMain(UserIdentity.UserID);

            MyFriendsList.DataSource = MyFriends.GetFriendsList();
            MyFriendsList.DataBind();

            if (MyFriends.TotalCount == 0)
                lblcountfriends.Visible = true;

            MyFriends = null;
        }
        else
        {
            HideContentIfNotLogin.Visible = false;
            lblyouarenotlogin.Visible = true;
            lblyouarenotlogin.Text = "<div style='margin-top: 12px; margin-bottom: 7px;'><img src='images/lock.gif' align='absmiddle'> You are not authorize to view this page. Please login to to send a private message to other members.</div>";
        }
    }