Esempio n. 1
0
        private void AddDevToTeam()
        {
            SeeAllDev();

            Console.WriteLine("\nEnter ID of developer you would like to add to Team:");
            string     identAsInt = Console.ReadLine();
            int        devID      = Convert.ToInt32(identAsInt);
            DevContent pulledID   = _contentRepo.GetDevContentByID(devID);

            GetDevTeamList();

            Console.WriteLine("\nWhat is the ID of the team you would like to add to:");
            string         teamIdentAsInt = Console.ReadLine();
            int            devTeamID      = Convert.ToInt32(teamIdentAsInt);
            DevTeamContent pulledTeamID   = _teamRepo.GetDevTeamByID(devTeamID);

            //add pulledID to pulledTeamID??????

            pulledTeamID.ListOfDevs.Add(pulledID);

            //COME BACK LATER
            //bool wasAdded =  _teamRepo.RemoveFromTeam();
            //if (wasAdded)
            //{
            //    Console.WriteLine("Developer successfully added to Team.");
            //}
            //else
            //{
            //    Console.WriteLine("Error... Developer could not be added.");
            //}
        }
Esempio n. 2
0
        private void AddNewDevTeamMember()
        {
            Console.Clear();

            DisplayAllDevTeams();

            Console.WriteLine("\nEnter the unique ID of the DevTeam you'd like to add a member to:");

            //Get that Name
            string oldID = Console.ReadLine();

            //Call Object
            DevTeam newDevTeam = _DevTeamRepo.GetDevTeamByID(oldID);

            //Current Team Members
            DisplayAllDevs();
            Console.WriteLine("Please enter the ID number of the Developer you'd like to add.");

            string    responseID = Console.ReadLine();
            Developer developer  = _DeveloperRepo.GetDeveloperByID(responseID);

            newDevTeam.DevTeamMembers.Add(developer);

            //Verify update worked
            bool updateWorked = _DevTeamRepo.UpdateExistingDevTeams(oldID, newDevTeam);

            if (updateWorked)
            {
                Console.WriteLine("DevTeam succesfully updated!");
            }
            else
            {
                Console.WriteLine("Could not update DevTeam.");
            }
        }
Esempio n. 3
0
        private void ViewDeveloperTeamByTeamID()
        {
            Console.Clear();
            Console.WriteLine("Please input developer team ID.");

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

            DevTeam devTeam = _devTeamRepo.GetDevTeamByID(inputDevTeamID);

            DisplayDevTeamInfo(devTeam);
        }
Esempio n. 4
0
        private void ViewDevsInTeam()
        {
            Console.Clear();
            Console.WriteLine("Enter the Dev Team ID you'd like to view");
            int              devTeamToView    = int.Parse(Console.ReadLine());
            DevTeam          devTeam          = _devTeamRepo.GetDevTeamByID(devTeamToView);
            List <Developer> listOfDevelopers = devTeam._devTeam;

            foreach (Developer dev in listOfDevelopers)
            {
                Console.WriteLine($"Name: {dev.Name}\n" +
                                  $"Developer ID: {dev.DevID}\n" +
                                  $"Currently Using Pluralsight?: {dev.HasPluralsight}");
            }
            Console.ReadLine();
        }
Esempio n. 5
0
        private void DisplayDevTeamsByIDNum()
        {
            Console.Clear();
            Console.WriteLine("Enter the Team ID number of the team you would like to see:");
            string  input   = Console.ReadLine();
            int     num     = int.Parse(input);
            DevTeam devteam = _devTeamRepo.GetDevTeamByID(num);

            if (devteam != null)
            {
                Console.WriteLine($"Team Name: {devteam.TeamName}\n" +
                                  $"Team ID Number: {devteam.TeamIDNum}");
            }
            else
            {
                Console.WriteLine("Sorry could not find a developer team related to that ID number");
            }
        }
        //create
        private void AddDeveloperTeam()
        {
            Console.Clear();
            DevTeam newTeam = new DevTeam();

            Console.WriteLine("Please enter developer's id you like to add to the team:");
            string input = Console.ReadLine();

            newTeam.IDNumber = int.Parse(input);
            ViewDevelopersByID();
            Console.WriteLine("Please select developer Id from the list you like to Add:");
            string inPut2 = Console.ReadLine();
            int    val    = int.Parse(inPut2);

            DevTeam dev = _devTeamRepo.GetDevTeamByID(val);

            _devTeamRepo.AddDevTeamTolist(dev);
        }