Пример #1
0
        public ActionResult Polaroid(string icode)
        {
            var site = sitesService.GetSiteByCode(icode);

            FlickrContext context = new FlickrContext();

            context.Photos.OnError += new Query <Photo> .ErrorHandler(Photos_OnError);

            var bigs = (from ph in context.Photos
                        where ph.User == site.flickr_username &&
                        ph.PhotoSize == PhotoSize.Default
                        select ph).ToList();

            var thumbs = (from ph in context.Photos
                          where ph.User == site.flickr_username &&
                          ph.PhotoSize == PhotoSize.Thumbnail
                          select ph).ToList();

            var query = from b in bigs
                        join t in thumbs on b.Id equals t.Id
                        select new Image()
            {
                Src = t.Url, Alt = b.Url, Id = t.Id, Title = t.Title
            };


            ViewBag.Title = site.title;
            return(View(query.ToList()));
        }
Пример #2
0
        public ActionResult Index(string icode)
        {
            if (!String.IsNullOrEmpty(icode))
            {
                var site = sitesService.GetSiteByCode(icode);
                if (site != null)
                {
                    StateManager.AddSite(site);

                    return(ViewSite(site.SitesTypes.default_page));
                }
            }
            else
            {
                return(RedirectToAction("CreateSite"));
            }

            return(View());
        }