Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Get admin username from the sessioan variable and place it in the label.
        lblusername.Text = "Welcome Admin:&nbsp;" + UserIdentity.AdminUsername + "<br><span class='content2'>Login session will expire in " + Session.Timeout + " mins.</span>";

        ProviderSiteStatistics SiteStats = new ProviderSiteStatistics();
        SiteStats.fillup();

        lbltotalrecipe.Text = "Recipes: " + string.Format("{0:#,###}", SiteStats.TotalLyric);
        lbltotalarticle.Text = "Articles: " + SiteStats.TotalArticle;
        lbltotalrecipecomments.Text = "Lyric Comments: " + SiteStats.TotalRecipeComments;
        lbltotalarticlecomments.Text = "Article Comments: " + SiteStats.TotalArticleComments;
        lbltotalsavedrecipeincookbook.Text = "Recipes in CookBook: " + SiteStats.TotalSavedRecipesInCookBook;
        lbltotaluserswhousecookbook.Text = "Users in CookBook: " + SiteStats.TotalUsersWhoUseCookBook;
        lbltotaluserswhousefriendslist.Text = "Users in FriendsList: " + SiteStats.TotalUsersWhoUseFriendsList;
        lbltotalprivatemessage.Text = "Private Messages: " + SiteStats.TotalPrivateMessage;
        lbltotalRegisteredUsers.Text = "Total Members: " + SiteStats.TotalMembers;
        lbltotaluserjoinedtoday.Text = "Joined Today: " + SiteStats.TotalUsersJoinedToday;
        lbltotaluserjoininaweek.Text = "Joined Last 7 Days: " + SiteStats.TotalUsersJoinedInAWeek;
        lbltotaluserjoinedinamonth.Text = "Joined Last 31 Days: " + SiteStats.TotalUsersJoinedInAMonth;

        SiteStats = null;
    }
    private void MemberStatistics(ProviderSiteStatistics MemberStats)
    {
        lbltotaluserjoinedtoday.Text = "Joined Today: " + MemberStats.TotalUsersJoinedToday;
        lbltotaluserjoininaweek.Text = "Joined Last 7 Days: " + MemberStats.TotalUsersJoinedInAWeek;
        lbltotaluserjoinedinamonth.Text = "Joined Last 31 Days: " + MemberStats.TotalUsersJoinedInAMonth;
        lbltotalunactivatedaccount.Text = "UnActivated Account: " + MemberStats.TotalUnActivatedAccount.ToString();
        lbltotalsuspendedaccount.Text = "Suspended Account: " + MemberStats.TotalSuspendedAccount.ToString();

        if (MemberStats.TotalUsersJoinedToday != 0)
        {
            lbltotaluserjoinedtoday.Text = "Joined Today: <a href='membershipmanagers.aspx?numdays=1'>" + MemberStats.TotalUsersJoinedToday + "</a>";
            lbltotaluserjoinedtoday.Attributes.Add("onmouseover", "Tip('View users who joined today.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
            lbltotaluserjoinedtoday.Attributes.Add("onmouseout", "UnTip()");
        }

        if (MemberStats.TotalUsersJoinedInAWeek != 0)
        {
            lbltotaluserjoininaweek.Text = "Joined Last 7 Days: <a href='membershipmanagers.aspx?numdays=7'>" + MemberStats.TotalUsersJoinedInAWeek + "</a>";
            lbltotaluserjoininaweek.Attributes.Add("onmouseover", "Tip('View users who joined in the last 7 days.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
            lbltotaluserjoininaweek.Attributes.Add("onmouseout", "UnTip()");
        }

        if (MemberStats.TotalUsersJoinedInAMonth != 0)
        {
            lbltotaluserjoinedinamonth.Text = "Joined Last 31 Days: <a href='membershipmanagers.aspx?numdays=31'>" + MemberStats.TotalUsersJoinedInAMonth + "</a>";
            lbltotaluserjoinedinamonth.Attributes.Add("onmouseover", "Tip('View users who joined in the last 31 days.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
            lbltotaluserjoinedinamonth.Attributes.Add("onmouseout", "UnTip()");
        }

        if (MemberStats.TotalUnActivatedAccount != 0)
        {
            lbltotalunactivatedaccount.Text = "UnActivated Account: <a class='thickbox' href='popupgetuserswhohasnotactivatedaccount.aspx?keepThis=true&TB_iframe=true&height=360&width=400'>" + MemberStats.TotalUnActivatedAccount + "</a>";
            lbltotalunactivatedaccount.Attributes.Add("onmouseover", "Tip('View all users who has not activated their account after registration.<br>You can resend an account activation email.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
            lbltotalunactivatedaccount.Attributes.Add("onmouseout", "UnTip()");
        }

        if (MemberStats.TotalSuspendedAccount != 0)
        {
            lbltotalsuspendedaccount.Text = "Suspended Account: <a href='membershipmanagers.aspx?ob=6&sb=2&page=1&ps=20&search=none&numdays=0'>" + MemberStats.TotalSuspendedAccount + "</a>";
            lbltotalsuspendedaccount.Attributes.Add("onmouseover", "Tip('View all suspended users.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
            lbltotalsuspendedaccount.Attributes.Add("onmouseout", "UnTip()");
        }
    }
 private void GetMemberStatistic()
 {
     ProviderSiteStatistics MemberStats = new ProviderSiteStatistics();
     MemberStats.fillup();
     MemberStatistics(MemberStats);
     MemberStats = null;
 }
Пример #4
0
    private void GetStatisticsCounters()
    {
        ProviderSiteStatistics Statistics = new ProviderSiteStatistics();
        Statistics.fillup();

        lbltotalrecipe.Text = "Hợp âm: " + string.Format("{0:#,###}", Statistics.TotalLyric);
        lbltotalarticle.Text = "Bài viết: " + Statistics.TotalArticle;
        lbltotalrecipecomments.Text = "Lời bình hợp âm: " + Statistics.TotalRecipeComments;
        lbltotalarticlecomments.Text = "Lời bình bài viết : " + Statistics.TotalArticleComments;
        lbltotalsavedrecipeincookbook.Text = "Mục yêu thích: " + Statistics.TotalSavedRecipesInCookBook;
        lbltotaluserswhousecookbook.Text = "Thành viên trong mục yêu thích: " + Statistics.TotalUsersWhoUseCookBook;
        lbltotaluserswhousefriendslist.Text = "Bạn bè: " + Statistics.TotalUsersWhoUseFriendsList;
        lbltotalprivatemessage.Text = "Tin nhắn: " + Statistics.TotalPrivateMessage;
        lbltotalRegisteredUsers.Text = "Số thành viên: <a href='members.aspx'>" + Statistics.TotalMembers + "</a>";
        lbltotalRegisteredUsers.Attributes.Add("onmouseover",
                                               "Tip('Nhấn vào đây xem thành viên của website.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
        lbltotalRegisteredUsers.Attributes.Add("onmouseout", "UnTip()");
        lbltotaluserjoinedtoday.Text = "Thành viên ngày hôm nay: " + Statistics.TotalUsersJoinedToday;
        lbltotaluserjoininaweek.Text = "Thành viên 7 ngày gần đây: " + Statistics.TotalUsersJoinedInAWeek;
        lbltotaluserjoinedinamonth.Text = "Thành viên 30 ngày gần đây: " + Statistics.TotalUsersJoinedInAMonth;

        Statistics = null;
    }