Пример #1
0
        private void AddExistingBadgeDoors()
        {
            Console.Clear();

            List <string> doorNames = new List <string>();

            Console.WriteLine("What badge would you like to update?");
            string inputAsInt = Console.ReadLine();
            int    oldID      = int.Parse(inputAsInt);


            Console.WriteLine("What new door would you like this badge to access?");
            string doorOne = Console.ReadLine();

            doorNames.Add(doorOne);
            Console.WriteLine("Would you like to add another door?");
            string input = Console.ReadLine();

            switch (input)
            {
            case "Y":
            case "Yes":
            case "yes":
            case "y":
                Console.WriteLine("What is the name of the door this badge accesses?");
                string doorTwo = Console.ReadLine();
                doorNames.Add(doorTwo);
                Console.WriteLine("Would you like to add a third door?");
                string input2 = Console.ReadLine();

                if (input2 == "y" || input2 == "Y")
                {
                    Console.WriteLine("What is the name of the third door?");
                    string doorThree = Console.ReadLine();
                    doorNames.Add(doorThree);
                }
                break;

            case "N":
            case "No":
            case "no":
            case "n":
            default:
                break;
            }
            Badge Badge1 = new Badge(oldID, doorNames);

            _badgeRepo.UpdateBadge(Badge1, oldID);
        }