Exemple #1
0
        public IViewComponentResult Invoke()
        {
            List <Category> category = new List <Category>();

            foreach (var item in categorylist.GetAllList().OrderBy(o => o.CategoryName).ToList())
            {
                category.Add(new Category
                {
                    CategoryId   = item.CategoryId,
                    CategoryName = item.CategoryName
                });
            }
            return(View(categorycache.jsonCache(category, "category", TimeSpan.FromDays(365))));
        }
        /*TODO Kategorileri Getirme*/
        public ActionResult Index()
        {
            List <Category> categories = new List <Category>();

            foreach (var item in categoryresulter.GetAllList().ToList())
            {
                categories.Add(new Category
                {
                    CategoryId   = item.CategoryId,
                    CategoryName = item.CategoryName
                });
            }

            return(View(jsoncache.jsonCache(categories, "category", TimeSpan.FromDays(365))));
        }
Exemple #3
0
        public IViewComponentResult Invoke()
        {
            #region cache yapılıyor
            List <Category> categories = new List <Category>();
            foreach (var item in categorylist.GetAllList().OrderBy(h => h.CategoryName).ToList())
            {
                categories.Add(new Category
                {
                    CategoryId   = item.CategoryId,
                    CategoryName = item.CategoryName
                });
            }

            return(View(category.jsonCache(categories, "category", TimeSpan.FromDays(365))));
        }
Exemple #4
0
        public IViewComponentResult Invoke()
        {
            List <UserImages> lastphotos = new List <UserImages>();

            foreach (var item in databaseimages.GetAllList().Where(w => w.ImageApprove == 1 && w.ImageEdıtor == 1).OrderByDescending(x => x.ImageId).Take(23).ToList())
            {
                lastphotos.Add(new UserImages
                {
                    ImageId              = item.ImageId,
                    ImageSrc             = item.ImageSrc,
                    ImageWithoutSeoTitle = item.ImageWithoutSeoTitle,
                    ImageTitle           = item.ImageTitle,
                    ImageApprove         = item.ImageApprove,
                });
            }
            return(View(cacheimage.jsonCache(lastphotos, "lastphotos", TimeSpan.FromDays(9))));
        }
Exemple #5
0
        public ActionResult Show(int ImageId, string ImageTitle)
        {
            List <UserImages> usr         = new List <UserImages>();
            List <Vote>       votes       = new List <Vote>();
            List <Category>   newcategory = new List <Category>();

            foreach (var item in userimages.GetAllList().Where(t => t.ImageId == ImageId && t.ImageTitle == ImageTitle).Select(a => new {
                ImageId = a.ImageId,
                ImageTitle = a.ImageTitle,
                ImageWithoutSeoTitle = a.ImageWithoutSeoTitle,
                ImageSrc = a.ImageSrc,
                UserName = a.UserName,
                UserEmail = a.UserEmail,
                ImageExifExposureMode = a.ImageExifExposureMode,
                ImageExifExposureTime = a.ImageExifExposureTime,
                ImageExifExposureProgram = a.ImageExifExposureProgram,
                ImageExifFNumber = a.ImageExifFNumber,
                ImageExifFocalLength = a.ImageExifFocalLength,
                ImageExifIso = a.ImageExifIso,
                ImageExifLensModel = a.ImageExifLensModel,
                ImageExifMake = a.ImageExifMake,
                ImageExifMeteringMode = a.ImageExifMeteringMode,
                ImageExifModel = a.ImageExifModel,
                ImageExifShutterSpeedValue = a.ImageExifShutterSpeedValue
            }))
            {
                foreach (var voteitem in databasevote.SpGetVotes(item.ImageId).ToList())
                {
                    votes.Add(new Vote
                    {
                        VoteId        = voteitem.VoteId,
                        VoteNumbers   = voteitem.VoteNumbers,
                        VoteContentId = voteitem.VoteContentId
                    });
                }
                usr.Add(new UserImages
                {
                    ImageId                    = item.ImageId,
                    ImageTitle                 = item.ImageTitle,
                    ImageWithoutSeoTitle       = item.ImageWithoutSeoTitle,
                    ImageSrc                   = item.ImageSrc,
                    UserName                   = item.UserName,
                    UserEmail                  = item.UserEmail,
                    ImageExifExposureMode      = item.ImageExifExposureMode,
                    ImageExifExposureTime      = item.ImageExifExposureTime,
                    ImageExifExposureProgram   = item.ImageExifExposureProgram,
                    ImageExifFNumber           = item.ImageExifFNumber,
                    ImageExifFocalLength       = item.ImageExifFocalLength,
                    ImageExifIso               = item.ImageExifIso,
                    ImageExifLensModel         = item.ImageExifLensModel,
                    ImageExifMake              = item.ImageExifMake,
                    ImageExifMeteringMode      = item.ImageExifMeteringMode,
                    ImageExifModel             = item.ImageExifModel,
                    ImageExifShutterSpeedValue = item.ImageExifShutterSpeedValue
                });
                ViewBag.User           = item.UserName;
                ViewBag.id             = item.ImageId;
                ViewData["imagetitle"] = item.ImageWithoutSeoTitle;
                ViewData["url"]        = item.ImageSrc;
                ViewData["urlıd"]      = item.ImageId;
                ViewData["urltitle"]   = item.ImageTitle;
            }
            foreach (var categoryloop in categoryrepository.GetAllList().ToList())
            {
                newcategory.Add(new Category
                {
                    CategoryId   = categoryloop.CategoryId,
                    CategoryName = categoryloop.CategoryName
                });
            }
            ViewBag.VoteList        = votes.AsEnumerable();
            ViewData["allcategory"] = categorycache.jsonCache(newcategory, "category", TimeSpan.FromDays(365));
            return(View(cacheimage.jsonCache(usr.AsEnumerable() as List <UserImages>, "mainimages", TimeSpan.FromDays(7))));
        }