コード例 #1
0
        public void FirstMenuAsync()
        {
            Console.WriteLine("Are you a returning User press Y if you are press any Key if your not (to Exit press x)");
            string input = Console.ReadLine();

            switch (input)
            {
            case "y":

                var AllUser = new List <User>();
                AllUser.AddRange(GetAllUserFromFile());
                foreach (var item in AllUser)
                {
                    Console.WriteLine(item.firstName + " " + item.LastName);
                }
                bool loop = true;
                while (loop)
                {
                    Console.WriteLine("write your first name to be selected\n");
                    input = Console.ReadLine();


                    Session = search.SearchingByName(AllUser, input.ToLower());

                    if (!Session.Any())
                    {
                        Console.WriteLine("Try Again, try writing the name better \nto Register your Name Press Y now (press x to exit)");
                        input = Console.ReadLine();
                        if (input.ToUpper() == "Y")
                        {
                            RegisterNameAsync();
                        }
                        else if (input.ToUpper() == "X")
                        {
                            Exit();
                        }
                    }
                    else
                    {
                        loop = false;
                    }
                }
                break;

            case "x":
                Exit();
                break;

            default:
                RegisterNameAsync();
                break;
            }
            SecondMenuAsync();
        }