public ActionResult Lister() { Films films = new Films(Session["DB_CINEMA"]); films.SelectAll(); return View(films.ToList()); }
public static void Lister_Films() { Films films = new Films(ConnectionString); films.SelectAll("Parution"); Console.WriteLine("Listes des films"); /* while (films.Next()) { Console.WriteLine("********************************"); Console.WriteLine(films.film.Titre); Console.WriteLine(films.film.Parution.ToLongDateString()); Console.WriteLine(films.film.Genre.ToString()); } */ List<Object> films_list = films.ToList(); foreach(Film film in films_list) { Console.WriteLine("********************************"); Console.WriteLine(film.Titre); Console.WriteLine(film.Parution.ToLongDateString()); Console.WriteLine(film.Genre.ToString()); } Console.WriteLine("********************************"); }
public ActionResult Lister() { Films films = new Films(Session["DB_CINEMA"]); String orderBy = ""; if (Session["Film_SortBy"] != null) orderBy = (String)Session["Film_SortBy"] + " " + (String)Session["Film_SortOrder"]; films.SelectAll(orderBy); return View(films.ToList()); }