コード例 #1
0
        public ActionResult Edit(int id)
        {
            IGalleryDAC dac     = new GalleryDAC();
            var         gallery = dac.GetGallery(id);
            var         model   = new GalleryEdit {
                Description = gallery.Description, GalleryID = gallery.GalleryID, Name = gallery.Name, SortOrder = gallery.SortOrder, MainImage = gallery.DisplayImage
            };

            return(View(model));
        }
コード例 #2
0
        public ActionResult Edit(GalleryEdit gallery)
        {
            if (!ModelState.IsValid)
            {
                return(View(gallery));
            }
            IGalleryDAC dac = new GalleryDAC();

            dac.Update(gallery.GalleryID, gallery.Name, gallery.Description, gallery.SortOrder, gallery.MainImage);
            return(RedirectToAction("Index"));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        public ActionResult Edit(int idgallery)
        {
            var gallery = unitOfWork.RepositoryGallery.Get(idgallery);

            var galleryEdit = new GalleryEdit()
            {
                Gallery = gallery
            };

            var images = unitOfWork.RepositoryImage.GetParentImagesByGallery(idgallery);

            galleryEdit.Images = images;

            return(View(galleryEdit));
        }