Esempio n. 1
0
 public void EditPhoto(Photo photo)
 {
     var original = this.FindPhoto(photo.Id);
     original.Title = photo.Title;
     original.Description = photo.Description;
     original.Rating = photo.Rating;
     original.PhotoUrl = photo.PhotoUrl;
     _repo.SaveChanges();
 }
Esempio n. 2
0
 public ActionResult CreatePhoto(Photo photo, int id)
 {
     if (ModelState.IsValid)
     {
         photo.AlbumId = id;
         _photoService.CreatePhoto(photo);
         return RedirectToAction("Index");
     }
     return View();
 }
Esempio n. 3
0
 public void CreatePhoto(Photo photo)
 {
     _repo.Add<Photo>(photo);
     _repo.SaveChanges();
 }
Esempio n. 4
0
 public ActionResult EditPhoto(Photo photo)
 {
     if (ModelState.IsValid)
     {
         _photoService.EditPhoto(photo);
         return RedirectToAction("Index");
     }
     return View();
 }