Beispiel #1
0
        private void GetInput()
        {
            Console.Write("\nFirst name: ");
            var fname = Console.ReadLine();

            Console.Write("\nLast name: ");
            var lname = Console.ReadLine();

            Console.Write("\nHandle/Alias: ");
            var handle = Console.ReadLine();

            Console.Write("\nSocial Security Number: ");
            if (!int.TryParse(Console.ReadLine(), out int i))
            {
                Console.WriteLine("Invalid input detected - press return to go back");
                Console.ReadLine();
            }

            Console.WriteLine($"\nAdd {fname} with handle {handle}?\n(Y)es - (N)o");
            ConsoleKey input = Console.ReadKey(true).Key;

            if (input == ConsoleKey.Y)
            {
                Console.WriteLine("Adding Stylist - may take a few seconds..");
                eh.AddStylist(new Stylist(fname, lname, handle, i));
                Console.WriteLine("Stylist added, returning to main menu..");
                Thread.Sleep(3000);
            }
            else
            {
                Console.WriteLine("Cancelling and returning to main menu..");
                Thread.Sleep(3000);
            }
        }