Beispiel #1
0
 // GET: seances/Delete/5
 public ActionResult Delete(int?id)
 {
     try
     {
         ManagerSeance manager = new ManagerSeance();
         seance        seance  = manager.GetSeance(id);
         return(PartialView("PartialDeleteSeance", seance));
     }
     catch (Exception e)
     {
         TempData.Add("Alert", e.Message);
         return(RedirectToAction("DetailsSalle", "cinemas", new { id = Session[SessionKeys.salleId] as int?, start = DateTime.Now }));
     }
 }
Beispiel #2
0
 // GET: seancesEJS/Details/5
 public ActionResult Details(int?id)
 {
     try
     {
         ManagerSeance manager = new ManagerSeance();
         seance        seance  = manager.GetSeance(id);
         return(View(seance));
     }
     catch (Exception e)
     {
         //MessageBox.Show(e.Message);
         return(RedirectToAction("Index", "Home"));
     }
 }
Beispiel #3
0
 // GET: seances/Details/5
 public ActionResult Details(int?id)
 {
     Session[SessionKeys.seanceId] = id;
     try
     {
         ManagerSeance manager = new ManagerSeance();
         seance        seance  = manager.GetSeance(id);
         ViewBag.id_film = new SelectList(new ManagerFilm().GetAllFilms(), "id", "titre");
         return(View(seance));
     }
     catch (Exception e)
     {
         TempData.Add("Alert", e.Message);
         return(RedirectToAction("Index", "Home"));
     }
 }
Beispiel #4
0
 // GET: seancesEJS/Edit/5
 public ActionResult Edit(int?id)
 {
     try
     {
         ManagerSeance manager = new ManagerSeance();
         seance        seance  = manager.GetSeance(id);
         ViewBag.film_id  = new SelectList(new ManagerFilm().GetAllFilms(), "id", "titre");
         ViewBag.salle_id = new SelectList(new ManagerSalle().GetAllSalle(), "id", "id", seance.salle_id);
         return(View(seance));
     }
     catch (Exception e)
     {
         //MessageBox.Show(e.Message);
         return(RedirectToAction("Index", "Home"));
     }
 }
Beispiel #5
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         ManagerSeance manager = new ManagerSeance();
         seance        seance  = manager.GetSeance(id);
         if (manager.DeleteSeance(id))
         {
             return(RedirectToAction("Index", new { id = seance.salle.cinema_id }));
         }
     }
     catch (Exception e)
     {
         //MessageBox.Show(e.Message);
     }
     return(RedirectToAction("Index", "Home"));
 }
Beispiel #6
0
 // GET: seances/Edit/5
 public ActionResult Edit(int?id, string titre, int?yearMin, int?yearMax, int?id_type)
 {
     Session["isOnRoom"]           = 0;
     Session[SessionKeys.seanceId] = id;
     try
     {
         ManagerSeance manager = new ManagerSeance();
         seance        seance  = manager.GetSeance(id);
         ViewBag.id_type      = new SelectList(new ManagerTypeFilm().GetAllType_film(), "id", "typage");
         ViewBag.films_id     = new SelectList(new ManagerFilm().GetFilmFiltre(titre, yearMin, yearMax, id_type), "id", "titre");
         ViewBag.filmsFiltred = new List <film>(new ManagerFilm().GetFilmFiltre(titre, yearMin, yearMax, id_type).OrderBy(x => x.titre));
         ViewBag.salle_id     = new SelectList(new ManagerSalle().GetAllSalle().Where(s => s.cinema_id == int.Parse(Session[SessionKeys.cinemaId].ToString())), "id", "numero_salle", seance.salle_id);
         return(View(seance));
     }
     catch (Exception e)
     {
         TempData.Add("Alert", e.Message);
         return(RedirectToAction("Index", "Home"));
     }
 }
Beispiel #7
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         ManagerSeance manager = new ManagerSeance();
         seance        seance  = manager.GetSeance(id);
         if (manager.DeleteSeance(id))
         {
             return(RedirectToAction("DetailsSalle", "cinemas", new { id = int.Parse(Session[SessionKeys.salleId].ToString()), start = DateTime.Now }));
         }
         else
         {
             throw new Exception();
         }
     }
     catch (Exception e)
     {
         TempData.Add("Alert", e.Message);
         Session[SessionKeys.seanceId]  = id;
         Session[SessionKeys.seanceTab] = "Delete";
         return(RedirectToAction("DetailsSalle", "cinemas", new { id = int.Parse(Session[SessionKeys.salleId].ToString()), start = DateTime.Now }));
     }
 }