public ActionResult EditConfirmed(Videofilm videofilm) { if (!videofilm.CustomerId.HasValue) { videofilm.Customer = null; videofilm.CustomerId = null; } else if (repositoryCustomer.Get(videofilm.CustomerId.GetValueOrDefault()) == null) { return(View("Error")); } if (videofilm == null) { return(HttpNotFound()); } else { repository.Edit(videofilm); repository.SaveChanges(); return(RedirectToAction("Index")); } }
public ActionResult Create(Videofilm videoFilm) { if (!ModelState.IsValid) { return(View("VideoFilms")); } repository.Add(videoFilm); repository.SaveChanges(); return(RedirectToAction("index")); }
public ActionResult Delete(int id) { Videofilm videofilm = repository.Get(id); if (videofilm == null) { return(HttpNotFound()); } else { return(View(videofilm)); } }
public ActionResult Create(Videofilm videofilm) { try { db.Videofilmer.Add(videofilm); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult DeleteConfirmed(int id) { Videofilm videofilm = repository.Get(id); if (videofilm == null) { return(HttpNotFound()); } else { repository.Remove(videofilm); repository.SaveChanges(); return(RedirectToAction("index")); } }
public ActionResult Find(Videofilm videoFilm) { return(View(repository.Get(videoFilm.Id))); }