示例#1
0
 public ActionResult Details(int id)
 {
     Gallery gallery = galleries.Find(id);
     ImagesBrowser imagesLocation = new ImagesBrowser(gallery.Path);
     Models.Gallery.Images images = new Models.Gallery.Images { Title = gallery.Title, GalleryImages = imagesLocation.GetImages() };
     return View(images);
 }
        public ActionResult ImageDetails(int id, string filename)
        {
            Gallery gallery = galleriesRepository.Galleries.Find(id);

            ImagesBrowser imagesBrowser = new ImagesBrowser(gallery.Path);
            string pathToImage = imagesBrowser.GetImagePath(filename);

            GalleryImageDetails galleryImageDetails = new GalleryImageDetails
                                                          {
                                                              Id = gallery.Id,
                                                              PathToImage = pathToImage,
                                                              FileName = filename
                                                          };
            return View(galleryImageDetails);
        }
        public ActionResult Edit(int id)
        {
            Gallery gallery = galleriesRepository.Galleries.Find(id);
            ImagesBrowser imagesLocation = new ImagesBrowser(gallery.Path);

            GalleryEdit galleryEdit = new GalleryEdit { FileNames = imagesLocation.GetImagesFileNames() };
            galleryEdit.InjectFrom(gallery);

            return View(galleryEdit);
        }