Beispiel #1
0
        static void AddDeveloper()
        {
            var newDev = new Developer();

            Console.Write("Enter The Developer Id Number: ");
            newDev.Id = int.Parse(Console.ReadLine());

            Console.Write("Enter The Developer's First Name: ");
            newDev.FirstName = Console.ReadLine();

            Console.Write("Enter The Developer's Last Name: ");
            newDev.LastName = Console.ReadLine();

            bool getAccess = true;

            while (getAccess)
            {
                Console.Write("Does The Developer Have Pluralsight Access (y/n)?: ");
                var hasAccess = Console.ReadLine().ToLower();
                if (hasAccess == "y")
                {
                    newDev.HasPluralsightAccess = true;
                    getAccess = false;
                }
                else if (hasAccess == "n")
                {
                    newDev.HasPluralsightAccess = false;
                    getAccess = false;
                }
                else
                {
                    Console.Write("Please enter a valid option (y/n)...");
                }
            }

            _devRepo.CreateDeveloper(newDev);
        }