//Edit #region // GET: films/Edit/5 public ActionResult Edit(int?id) { if (Request.IsAjaxRequest()) { try { ManagerFilm manager = new ManagerFilm(); film film = manager.GetFilm(id); ViewBag.id_type = new SelectList(new ManagerTypeFilm().GetType_film(), "id", "typage"); ViewBag.id_film = new SelectList(new ManagerFilm().GetAllFilms(), "id", "titre"); ManagerFilm m = new ManagerFilm(); film f = m.GetFilm(id); if (f != null) { return(PartialView("PartialEdit", f)); } } catch (Exception e) { TempData.Add("Alert", e.Message); } } return(RedirectToAction("Index")); }
//Delete #region // GET: films/Delete/5 public ActionResult Delete(int?id) { try { ManagerFilm m = new ManagerFilm(); film f = m.GetFilm(id); if (f != null) { return(PartialView("PartialDelete", f)); } } catch (Exception e) { TempData.Add("Alert", e.Message); } return(RedirectToAction("Index")); }
// GET: films/Details/5 public ActionResult Details(int?id) { try { ManagerFilm m = new ManagerFilm(); film f = m.GetFilm(id); if (f != null) { return(PartialView("PartialDetails", f)); } else { throw new NullIdExecption("film"); } } catch (Exception e) { TempData.Add("Alert", e.Message); return(RedirectToAction("Index")); } }