public ActionResult Index(string theme) { if (!string.IsNullOrWhiteSpace(theme)) { string dir = Server.MapPath("content/themes/" + theme); //make sure theme dir exists if (Directory.Exists(dir)) { Session["theme"] = theme; } } string re = Request.RawUrl; GalleryRepository rep = this.GetGalleryRepository(); ViewBag.Folders = rep.Folders; var photoRepository = new PhotoRepository(); PhotosModel photosModel = new PhotosModel() { PicCount = photoRepository.GetImagesCount() // Categorieses = photoRepository.GetCategories() }; ViewBag.Categories = photoRepository.GetCategories(); ViewBag.HtmlContent = rep.RootFolder.GetHtmlContentIfAny(); //initial html content from root folder return(View("Index")); }
public ActionResult Add() { PhotoRepository rep = this.GetPhotoRepository(); PhotosModel photosModel = new PhotosModel() { PicCount = rep.GetImagesCount(), Categorieses = rep.GetCategories(), CatCount = rep.GetCategories().Count, }; return(View("Add", photosModel)); }
// // GET: /Photos/ public ViewResult Index() { var photoRepository = new PhotoRepository(); PhotosModel photosModel = new PhotosModel() { PicCount = photoRepository.GetImagesCount(), Categorieses = photoRepository.GetCategories() }; return(View("IndexPhoto", photosModel)); }