Example #1
0
        //Delete
        private void DeleteDeveloper()
        {
            Console.Clear();
            ViewDevelopers();
            Console.WriteLine("Enter the index number of the fired developer: ");
            string numOfDevString = (Console.ReadLine());

            int.TryParse(numOfDevString, out int k);

            while (k <= 0 || k > _developerRepo._listOfDevelopers.Count)
            {
                Console.WriteLine("Invalid entry.  Please try again.  ");

                Console.WriteLine("Enter the index number of the fired developer: ");
                numOfDevString = (Console.ReadLine());
                int.TryParse(numOfDevString, out k);
            }



            bool wasDeleted = _developerRepo.DeleteDeveloper(k);

            if (wasDeleted)
            {
                Console.WriteLine("The developer was deleted and removed from most recently assigned team.  \n" +
                                  "If developer was assigned to multiple teams you may have to manually remove from additional teams.");
            }
            else
            {
                Console.WriteLine("The developer could not be deleted.");
            }
        }
Example #2
0
        //Delete
        private void DeleteDeveloper()
        {
            Console.Clear();
            ViewDevelopers();
            Console.WriteLine("Enter the index number of the fired developer: ");
            string numOfDevString = (Console.ReadLine());

            int.TryParse(numOfDevString, out int k);

            if (k <= 0 || k > _developerRepo._listOfDevelopers.Count)
            {
                Console.Clear();
                Console.WriteLine("Invalid entry. Are you sure you entered the index number on the left?  Please try again.");
                Menu();
            }

            bool wasDeleted = _developerRepo.DeleteDeveloper(k);

            // bool wasDeletedFromTeam = _developerRepo.DeleteFromTeam();

            if (wasDeleted)
            {
                Console.WriteLine("The developer was deleted and removed from most recent assigned team.\n" +
                                  "If developer was assigned to multiple teams, you need to manually remove from other teams.");
            }
            else
            {
                Console.WriteLine("The developer could not be deleted.");
            }
        }