예제 #1
0
파일: Program.cs 프로젝트: Galiks/EPAM
        //показывает информацию
        private static void Showing()
        {
            while (true)
            {
                Console.WriteLine();
                Console.WriteLine($"1: Show all men");
                Console.WriteLine($"2: Show all awards");
                Console.WriteLine($"3: Show all User's award by id");
                Console.WriteLine($"4: EXIT");

                Console.Write($"Choose action: ");

                var userAction = Console.ReadLine();

                switch (userAction)
                {
                case "1":
                    foreach (var item in userLogic.GetUsers())
                    {
                        Console.WriteLine($"{item.IdUser} : {item.Name} : {item.Birthday.Value.Year}-{item.Birthday.Value.Month}-{item.Birthday.Value.Day} : {item.Age}{Environment.NewLine}");
                    }
                    break;

                case "2":
                    foreach (var item in awardLogic.GetAwards())
                    {
                        Console.WriteLine($"{item.IdAward} : {item.Title} : {item.Description}{Environment.NewLine}");
                    }
                    break;

                case "3":
                    Console.Write($"User's id: ");
                    var id_3         = Console.ReadLine();
                    var awardsByUser = userLogic.GetAwardFromUserAward(id_3);
                    foreach (var item in awardsByUser)
                    {
                        Console.WriteLine(item);
                    }
                    break;

                case "4":
                    return;

                default:
                    break;
                }
            }
        }