Exemplo n.º 1
0
        protected void stats_ServerClick(object sender, EventArgs e)
        {
            //UserManageView.InnerHtml = "<span class='card-title'>Feature coming soon...</span>";
            //UserManageView.InnerHtml = "<img src=\"MakeUserRegChart.cshtml\" />";

            //UserManageView.InnerHtml = "<asp:Chart ID=\"chtNBAChampionships\" runat=\"server\">";
            //UserManageView.InnerHtml += "<Series>";
            //UserManageView.InnerHtml += "<asp:Series Name=\"Championships\" YValueType=\"Int32\" ChartType=\"Column\" ChartArea=\"MainChartArea\">";
            //UserManageView.InnerHtml += "<Points>";
            //UserManageView.InnerHtml += "<asp:DataPoint AxisLabel=\"Celtics\" YValues=\"17\"/>";
            //UserManageView.InnerHtml += "<asp:DataPoint AxisLabel=\"Lakers\" YValues=\"15\" />";
            //UserManageView.InnerHtml += "<asp:DataPoint AxisLabel=\"Bulls\" YValues=\"6\" />";
            //UserManageView.InnerHtml += "<asp:DataPoint AxisLabel=\"Spurs\" YValues=\"4\" />";
            //UserManageView.InnerHtml += "<asp:DataPoint AxisLabel=\"76ers\" YValues=\"3\" />";
            //UserManageView.InnerHtml += "<asp:DataPoint AxisLabel=\"Pistons\" YValues=\"3\" />";
            //UserManageView.InnerHtml += "<asp:DataPoint AxisLabel=\"Warriors\" YValues=\"3\" />";
            //UserManageView.InnerHtml += "</Points>";
            //UserManageView.InnerHtml += "</asp:Series>";
            //UserManageView.InnerHtml += "</Series>";
            //UserManageView.InnerHtml += "<ChartAreas>";
            //UserManageView.InnerHtml += "<asp:ChartArea Name=\"MainChartArea\">";
            //UserManageView.InnerHtml += "</asp:ChartArea>";
            //UserManageView.InnerHtml += "</ChartAreas>";
            //UserManageView.InnerHtml += "</asp:Chart>";

            UserService.UserCRUDClient userCRUDService = new UserService.UserCRUDClient();
            userCRUDService.Open();
            DateTime todayIs            = DateTime.Today;
            int      newUsersThisYear   = userCRUDService.numNewUsersYearManagement(todayIs);
            int      newUsersThisMonth  = userCRUDService.numNewUsersMonthManagement(todayIs);
            int      newUsersThisWeek   = userCRUDService.numNewUsersWeekManagement(todayIs);
            int      newUsersToday      = userCRUDService.numNewUsersDayManagement(todayIs);
            int      reportedusersTotal = userCRUDService.numReportedUsersManagement();
            int      flaggedUsersTotal  = userCRUDService.numFlaggedUsersManagement();
            int      premUsersTotal     = userCRUDService.numPremUsersManagement();

            userCRUDService.Close();

            string statsView = "<span class='card-title'>Stats</span>";

            statsView += "<div class='row'>";
            statsView += "<p>New Users This <b>Year:</b> " + newUsersThisYear.ToString() + "</p>";
            statsView += "<p>New Users This <b>Month:</b> " + newUsersThisMonth.ToString() + "</p>";
            statsView += "<p>New Users This <b>Week:</b> " + newUsersThisWeek.ToString() + "</p>";
            statsView += "<p>New Users <b>Today:</b> " + newUsersToday.ToString() + "</p>";
            statsView += "<br/>";
            statsView += "<p>Number of <b>Premium Users:</b> " + premUsersTotal.ToString() + "</p>";
            statsView += "<p>Number of <b>Reported Users:</b> " + reportedusersTotal.ToString() + "</p>";
            statsView += "<p>Number of <b>Flagged Users:</b> " + flaggedUsersTotal.ToString() + "</p>";
            statsView += "</div>";

            UserManageView.InnerHtml = statsView;
        }