Esempio n. 1
0
        public async Task <ActionResult> VisitorSummary()
        {
            using (VisitorEntryDataProvider visitorDP = new VisitorEntryDataProvider()) {
                if (visitorDP.Usable)
                {
                    await Manager.AddOnManager.AddAddOnNamedAsync(AreaRegistration.CurrentPackage.AreaName, Module.ModuleName); // add module specific items

                    VisitorEntryDataProvider.Info info = await visitorDP.GetStatsAsync();

                    DisplayModel model = new DisplayModel {
                    };
                    model.TodaysAnonymous     = info.TodaysAnonymous;
                    model.TodaysUsers         = info.TodaysUsers;
                    model.YesterdaysAnonymous = info.YesterdaysAnonymous;
                    model.YesterdaysUsers     = info.YesterdaysUsers;
                    return(View(model));
                }
                return(new EmptyResult());
            }
        }
Esempio n. 2
0
        public async Task <ActionResult> TinyVisitors()
        {
            using (VisitorEntryDataProvider visitorDP = new VisitorEntryDataProvider()) {
                if (visitorDP.Usable)
                {
                    string addonUrl = VersionManager.GetAddOnPackageUrl(AreaRegistration.CurrentPackage.AreaName);
                    VisitorEntryDataProvider.Info info = await visitorDP.GetStatsAsync();

                    DisplayModel model = new DisplayModel {
                    };
                    model.TodaysAnonymous     = info.TodaysAnonymous;
                    model.TodaysUsers         = info.TodaysUsers;
                    model.YesterdaysAnonymous = info.YesterdaysAnonymous;
                    model.YesterdaysUsers     = info.YesterdaysUsers;
                    model.Tooltip             = this.__ResStr("tooltip", "Today: {0} Users, {1} Anonymous - Yesterday: {2}/{3}", model.TodaysUsers, model.TodaysAnonymous, model.YesterdaysUsers, model.YesterdaysAnonymous);
                    model.ImageUrl            = addonUrl + "Icons/People.png";
                    model.VisitorsUrl         = Module.VisitorsUrl;
                    return(View(model));
                }
                return(new EmptyResult());
            }
        }