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)); }
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")); }
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)); }
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)); }