コード例 #1
0
        public void PrintBands(DBContext context, BandEngine bandEngine, Manager manager)
        {
            var bands   = bandEngine.GetBands(context, manager);
            int counter = 2;

            foreach (var band in bands)
            {
                if (counter % 2 == 0)
                {
                    Console.ForegroundColor = ConsoleColor.DarkYellow;
                    Console.WriteLine($"{band.Name} {band.Country} {band.PlayGenre} {band.DateofCreation.ToString("yyyy/MM/dd")}");
                    Console.ResetColor();
                    Console.WriteLine();
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.DarkGreen;
                    Console.WriteLine($"{band.Name} {band.Country} {band.PlayGenre} {band.DateofCreation.ToString("yyyy/MM/dd")}");
                    Console.ResetColor();
                    Console.WriteLine();
                }
                counter++;
            }
        }