コード例 #1
0
        public void PrintTable()
        {
            Console.Clear();
            PrintCMD.ThisMenu(3);
            string lineWide   = PrintCMD.GetMultipliedToken('-', _spaceCellTableWide);
            string lineNarrow = PrintCMD.GetMultipliedToken('-', _spaceCellTableNarrow);

            Console.WriteLine("|{0, " + _spaceCellTableNarrow + "}|{1, " + _spaceCellTableWide + "}|{2, " + _spaceCellTableNarrow + "}|{3, " + _spaceCellTableNarrow + "}|", "Id", "Название", "Рейтинг", "Просмотрено");
            Console.WriteLine("|{0, " + _spaceCellTableNarrow + "}|{1, " + _spaceCellTableWide + "}|{2, " + _spaceCellTableNarrow + "}|{3, " + _spaceCellTableNarrow + "}|", lineNarrow, lineWide, lineNarrow, lineNarrow);
            string tmpViewed;//для отображения просмотренного

            foreach (var item in Singleton.Instance.Film.Read())
            {
                if (item.Viewed)
                {
                    tmpViewed = "+";
                }
                else
                {
                    tmpViewed = "-";
                }
                Console.WriteLine("|{0, " + _spaceCellTableNarrow + "}|{1, " + _spaceCellTableWide + "}|{2, " + _spaceCellTableNarrow + "}|{3, " + _spaceCellTableNarrow + "}|", item.Id, item.Title, item.Rating, tmpViewed);
            }
            Console.Write("\n");
        }
コード例 #2
0
        public void PrintTable()
        {
            Console.Clear();
            PrintCMD.ThisMenu(2);
            string line = PrintCMD.GetMultipliedToken('-', _spaceCellTable);

            Console.WriteLine("|{0, " + _spaceCellTable + "}|{1, " + _spaceCellTable + "}|", "Id", "Имя");
            Console.WriteLine("|{0, " + _spaceCellTable + "}|{1, " + _spaceCellTable + "}|", line, line);
            foreach (var item in Singleton.Instance.Actor.Read())
            {
                Console.WriteLine("|{0, " + _spaceCellTable + "}|{1, " + _spaceCellTable + "}|", item.Id, item.Name);
            }
            Console.Write("\n");
        }