Beispiel #1
0
        // Delete existing developer
        private void DeleteExistingDeveloper()
        {
            DisplayAllDevelopers();

            // Get the Developer ID of the developer they want to remove
            Console.WriteLine("\nEnter the Developer ID of the developer you'd like to remove:");

            string    devIDNumber  = Console.ReadLine();
            Developer newDeveloper = new Developer();

            newDeveloper.IDNumber = int.Parse(devIDNumber);

            // Call the delete method
            bool wasDeleted = _programmerRepo.RemoveDeveloperFromList(newDeveloper.IDNumber);

            // If the content was deleted, say so
            // Otherwise state it could not be deleted
            if (wasDeleted)
            {
                Console.WriteLine("The developer was successfully deleted.");
            }
            else
            {
                Console.WriteLine("The developer could not be deleted.");
            }

            DevRepo _repo = new DevRepo();
        }
Beispiel #2
0
        public void RemoveDeveloperFromList()
        {
            CreateNewTeam();

            Console.WriteLine("Enter the ID of the user you'd like to remove.");

            int input = Convert.ToInt32(Console.ReadLine());

            bool wasDeleted = _devRepo.RemoveDeveloperFromList(input);

            if (wasDeleted)
            {
                Console.WriteLine("The Dev was successfully removed");
            }
            else
            {
                Console.WriteLine("The Dev could not be removed.");
            }
        }
        private void DeleteExistingEmployee()
        {
            //display
            DisplayAllEmployees();
            //input
            Console.WriteLine("\nPlease enter a employee ID to remove: ");
            string input = Console.ReadLine();
            //delete
            bool wasDeleted = _devRepo.RemoveDeveloperFromList(int.Parse(input));

            if (wasDeleted)
            {
                Console.WriteLine("The employee was deleted");
            }
            else
            {
                Console.WriteLine("Employee could not be deleted");
            }
        }
        // Remove developers
        private void RemoveDevelopers()
        {
            Console.Clear();
            ViewAllDevelopers();

            Console.WriteLine("\nEnter full name of developer you would like to remove");

            string input = Console.ReadLine();

            bool wasDeleted = _developerRepo.RemoveDeveloperFromList(input);

            if (wasDeleted)
            {
                Console.WriteLine("Developer was deleted");
            }
            else
            {
                Console.WriteLine("The developer could not be deleted. Please be sure to enter the full name as stated");
            }
        }