private static void PrintMovies() { List <Movie> movies = BLLMovie.ReturnAllMovies(); Console.WriteLine("*Movies"); Console.WriteLine(); foreach (var movie in movies) { Console.WriteLine($"{movie.MovieName} \n{movie.MovieDirector} \n{movie.Genre.GenreName}"); Console.WriteLine(); } Console.WriteLine("..............."); }
private void ListAllMovies() { //retrieve all movies and list them in the html innertext element List <Movie> movies = BLLMovie.ReturnAllMovies(); StringBuilder sb = new StringBuilder(); sb.Append(".............................."); sb.Append("<br/><br/>"); foreach (var movie in movies) { sb.Append(string.Format($"Title: {movie.MovieName} <br/>Director: {movie.MovieDirector} <br/>Genre: {movie.Genre.GenreName}")); sb.Append("<br/><br/>"); } sb.Append(".............................."); movieslisted.InnerHtml = sb.ToString(); }