//
        // GET: /Home/
        public ActionResult Index(int e = 0)
        {
            HomeViewModel model = new HomeViewModel();
            ICollection<Collection> collections = CollectionRepository.Find(c => c.Status == CollectionStatus.COMPLETE && c.Type == CollectionType.SITE, c => c.CoverPhoto, c => c.Site).ToList<Collection>();

            model.Sites = collections.Select(c => GetDetailsForCollection(c)).ToArray();
            model.SiteThumbnails = new List<ThumbnailModel>();
            foreach (var s in model.Sites)
            {
                model.SiteThumbnails.Add(new ThumbnailModel()
                {
                    ID = s.SiteID,
                    Name = s.SiteName,
                    First = s.First,
                    Last = s.Last,
                    PhotoCount = s.PhotoCount,
                    CoverPhotoID = s.CoverPhotoID,
                    Link = "/photo/sitedashboard?siteId=" + s.SiteID.ToString()
                });
            }

            model.Tags = PhotoService.GetTagNames();

            model.SiteIndex = new Random().Next(model.Sites.Count());

            if (e == 2)
            {
                ViewBag.Message = "Please enter at lease one search parameter.";
            }

            return View(model);
        }
 public ActionResult SiteList()
 {
     HomeViewModel model = new HomeViewModel();
     model.Collections = CollectionRepository.Find(c => c.Status == CollectionStatus.COMPLETE && c.Type == CollectionType.SITE, c => c.CoverPhoto, c => c.Site).ToList<Collection>();
     model.Sites = model.Collections.Select(c => GetDetailsForCollection(c)).ToArray();
     model.SiteThumbnails = new List<ThumbnailModel>();
     foreach (var s in model.Sites)
     {
         model.SiteThumbnails.Add(new ThumbnailModel()
         {
             ID = s.SiteID,
             Name = s.SiteName,
             First = s.First,
             Last = s.Last,
             PhotoCount = s.PhotoCount,
             CoverPhotoID = s.CoverPhotoID,
             Link = "/photo/sitedashboard?siteId=" + s.SiteID.ToString()
         });
     }
     return View(model);
 }