Exemplo n.º 1
0
 public ActionResult Activity()
 {
     var summaryManager = new DataSummaryManager();
     var summary = summaryManager.GetActivitySummary(new APIRequestParams());
     ViewBag.ShowPOILink = true;
     return View(summary);
 }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            var dataSummary = new DataSummaryManager();
            StatsModel model = new StatsModel();

            var dateTo = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1).AddDays(-1);
            var dateFrom = dateTo.AddYears(-1);

            model.TopContributors = dataSummary.GetTopNContributors(15, null);
            model.UserRegistrations = dataSummary.GetUserRegistrationStats(dateFrom, dateTo);
            model.UserEdits = dataSummary.GetUserEditSummary(dateFrom, dateTo);
            model.UserComments = dataSummary.GetUserCommentStats(dateFrom, dateTo);

            return View(model);
        }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            if (dataSummaryManager == null) dataSummaryManager = new DataSummaryManager();

            APIRequestParams filterSettings = new APIRequestParams();
            filterSettings.ParseParameters(filterSettings,context);

            string action = "totals_per_country";

            if (!String.IsNullOrEmpty(context.Request["action"]))
            {
                action = context.Request["action"].ToString();
            }

            if (action == "totals_per_country")
            {
                context.Response.ContentType = "application/javascript";
                context.Response.Write(dataSummaryManager.GetTotalsPerCountrySummary(true,"ocm_getdatasummary", filterSettings ));
                context.Response.Flush();
            }

            if (action == "full_summary")
            {
                // Output JSON summary of:
                // - Current totals per country
                // - Total added (per country? based on date range, location/distance filter?)
                // - Total modified
                // - User Comments Count

                // - per month values, current month first? default last 12 months
            }

            if (action == "activity_summary")
            {
                // Based on date range, location and distance:
                // - list of recent comments, checkins, id & title etc of items added & modified
                var o = new JSONOutputProvider();

                context.Response.ContentType = o.ContentType;
                var summary = dataSummaryManager.GetActivitySummary(filterSettings);
                o.PerformSerialisationV2(context.Response.OutputStream, summary, filterSettings.Callback);

                context.Response.Flush();
            }
        }
Exemplo n.º 4
0
        public ActionResult Index(string countryname)
        {
            if (!String.IsNullOrEmpty(countryname))
            {

                var country = new ReferenceDataManager().GetCountryByName(countryname);
                return this.Summary(countryname);
            }

            //list of all countries
            var allCountries = new ReferenceDataManager().GetCountries(false);
            var countryStats = new DataSummaryManager().GetAllCountryStats();

            var continents = new Dictionary<string, string>();
            continents.Add("AS", "Asia");
            continents.Add("EU", "Europe");
            continents.Add("NA", "North America");
            continents.Add("OC", "Oceania");
            continents.Add("SA", "South America");

            ViewBag.Continents = continents;
            ViewBag.CountryStats = countryStats;
            return View(allCountries);
        }