Пример #1
0
 public ActionResult Upload(int galleryId)
 {
     var photo = new Photo
     {
         GalleryId = galleryId
     };
     return View(photo);
 }
Пример #2
0
        public ActionResult Edit(Photo model, int id)
        {
            if (!ModelState.IsValid) return View(model);

            _photoService.UpdatePhoto(id, model);

            return RedirectToAction("Details", "Galleries", new { Id =  model.GalleryId });
        }
Пример #3
0
        public ActionResult Upload(Photo model, HttpPostedFileBase image)
        {
            if (!ModelState.IsValid) return View(model);

            var path = SavePhotoService.UploadPhoto(image);
            _photoService.AddPhotoToGallery(path, model);

            return RedirectToAction("Details", "Galleries", new { Id = model.GalleryId });
        }