Example #1
0
        public ActionResult Index()
        {
            ViewBag.Title = "Home Page";
            HomepageData model = new HomepageData();

            foreach (var ws in websiteRepository.GetWebsites())
            {
                model.Stats.Add(new WebsiteStats()
                {
                    ActivityCount = visitRepository.GetActivityCount(ws.ID),
                    Site          = ws,
                    VisitCount    = visitRepository.GetVisitCount(ws.ID)
                });
            }
            model.WebsiteCount  = websiteRepository.GetWebsites().Count();
            model.WebpageCount  = webpageRepository.GetWebpageCount();
            model.VisitCount    = visitRepository.GetVisitCount();
            model.ActivityCount = visitRepository.GetActivityCount();
            return(View(model));
        }
Example #2
0
        public ActionResult Index()
        {
            //var homeViewModel = new HomeViewModel() {
            //    Websites = new List<Models.Website>() {
            //     new Website() {
            //         Name = "Test",
            //         PrimaryUrl = "http://localhost"
            //     }
            //    }
            //};

            var homeViewModel = new HomeViewModel()
            {
                Websites = websiteRepository.GetWebsites().ToList()
            };

            return(View(homeViewModel));
        }