Exemple #1
0
        // Create new Developer
        private void CreateNewDeveloper()
        {
            Console.Clear();
            Developer newDeveloper = new Developer();

            //Developer Name
            Console.WriteLine("Enter the name of the Developer");
            newDeveloper.DeveloperName = Console.ReadLine();


            //Does Developer Have PluralSight
            Console.WriteLine("Does this Developer have PluralSight License?\n" +
                              "Y/N?");
            string pluralSightYN = Console.ReadLine().ToLower();
            string answer        = "y";

            if (pluralSightYN.Contains(answer))
            {
                newDeveloper.AccessPluralsight = true;
            }
            else
            {
                newDeveloper.AccessPluralsight = false;
            }
            _developerRepo.AddDeveloperToList(newDeveloper);
        }
        private void AddNewDev()
        {
            Console.Clear();
            Developer newDev = new Developer();

            //Name
            Console.WriteLine("Enter the name of the Developer:");
            newDev.Name = Console.ReadLine();

            //ID Number
            Console.WriteLine("Enter the unique ID number for the Developer:");
            newDev.IDNumber = Console.ReadLine();

            //HasAccess
            Console.WriteLine("Does this Developer currently have access to PluralSight? Please answer 'y' or 'n'.");
            string hasAccessString = Console.ReadLine().ToLower();

            if (hasAccessString == "y")
            {
                newDev.HasPluralSightAccess = true;
            }
            else
            {
                newDev.HasPluralSightAccess = false;
            }

            _DeveloperRepo.AddDeveloperToList(newDev);
        }
Exemple #3
0
        //Add new Dev
        private void AddNewDev()
        {
            Console.Clear();
            Developer newDev = new Developer();

            //FirstName
            Console.WriteLine("Enter Developer's first name.");
            newDev.FirstName = Console.ReadLine();

            //LastName
            Console.WriteLine("Enter Developer's last name.");
            newDev.LastName = Console.ReadLine();

            //HasPluralSight
            Console.WriteLine("Does this developer have PluralSight access? (y/n)");
            string pluralSightString = Console.ReadLine().ToLower();

            if (pluralSightString == "y")
            {
                newDev.HasPluralSight = true;
            }
            else
            {
                newDev.HasPluralSight = false;
            }

            _devsRepo.AddDeveloperToList(newDev);
        }
Exemple #4
0
        private void AddNewDeveloper()
        {
            Console.Clear();
            Developer newDeveloper = new Developer();

            Console.WriteLine("Enter the name of the developer.");
            newDeveloper.Name = Console.ReadLine();

            Console.WriteLine("Enter the ID for the developer.");
            string iDAsString = Console.ReadLine();

            newDeveloper.ID = int.Parse(iDAsString);

            Console.WriteLine("Does the developer have access to Pluralsight? Enter Y for yes and N for no.");
            string hasAccessString = Console.ReadLine().ToLower();

            if (hasAccessString == "y")
            {
                newDeveloper.HasPluralsightAccess = true;
            }
            else if (hasAccessString == "n")
            {
                newDeveloper.HasPluralsightAccess = false;
            }
            else
            {
                newDeveloper.HasPluralsightAccess = false;
                Console.WriteLine("Hmm... I did not recognize your entry. For now, I have marked that the developer does NOT have access to Pluralsight. You can update this information through the main menu later, if needed.");
            }

            _devRepo.AddDeveloperToList(newDeveloper);
        }
Exemple #5
0
        // Add a developer
        private void AddNewDeveloper()
        {
            Console.Clear();
            Developer newDeveloper = new Developer();

            // First Name
            Console.WriteLine("Please enter the developer's first name:");
            newDeveloper.FirstName = Console.ReadLine();

            // Last Name
            Console.WriteLine("Please enter the developer's last name:");
            newDeveloper.LastName = Console.ReadLine();

            // Individual ID
            Console.WriteLine("Please enter the developer's ID number:");
            string IDAsString = Console.ReadLine();

            newDeveloper.IndividualID = double.Parse(IDAsString);

            // Access to Pluralsight?
            Console.WriteLine("Does the developer have access to Pluralsight? (Y/N):");
            string PluralsightString = Console.ReadLine().ToLower();

            if (PluralsightString == "Y")
            {
                newDeveloper.AccessPluralsight = true;
            }
            else
            {
                newDeveloper.AccessPluralsight = false;
            }

            _developerRepository.AddDeveloperToList(newDeveloper);
        }
        public void Arrange()
        {
            _repo      = new DeveloperRepo();
            _developer = new Developer("Elon Musk", 21716, false);

            _repo.AddDeveloperToList(_developer);
        }
        private void CreateNewUser()
        {
            Console.Clear();
            Developer newDeveloper = new Developer();

            Console.WriteLine("Enter Developer Name:");
            newDeveloper.Name = Console.ReadLine();

            Console.WriteLine("Enter Developer ID:");
            string idAsString = Console.ReadLine();

            newDeveloper.DevID = int.Parse(idAsString);

            Console.WriteLine("Do you currently have PluralSight?(Y/N)");
            string pluralSight = Console.ReadLine().ToLower();

            if (pluralSight == "y")
            {
                newDeveloper.HasPluralsight = true;
            }
            else
            {
                newDeveloper.HasPluralsight = false;
            }

            _developer.AddDeveloperToList(newDeveloper);
        }
        private void AddNewDeveloper()
        {
            Console.Clear();
            Developer newDeveloper = new Developer();

            //Developer ID
            Console.WriteLine("Enter the ID number for the new developer:");
            newDeveloper.DeveloperIdNumber = int.Parse(Console.ReadLine());

            //Developer Name
            Console.WriteLine("Enter the new developer's name:");
            newDeveloper.DeveloperName = Console.ReadLine();

            //Has Access To Plurlsight
            Console.WriteLine("Does this developer have access to Pluralsight? (y/n)");
            string accessToPluralsightString = Console.ReadLine().ToLower();

            if (accessToPluralsightString == "y")
            {
                newDeveloper.HasAccessToPluralsight = true;
            }
            else
            {
                newDeveloper.HasAccessToPluralsight = false;
            }

            //Developer's known coding language
            Console.WriteLine("Enter the known language number:\n" +
                              "1.C#\n" +
                              "2. JavaScript\n" +
                              "3. Python\n" +
                              "4. SQL\n" +
                              "5. Java");

            string languageAsString = Console.ReadLine();
            int    languageAsInt    = int.Parse(languageAsString);

            newDeveloper.TypeOfLanguage = (LanguageType)languageAsInt;

            _developerRepo.AddDeveloperToList(newDeveloper);
        }
        public void AddToList_ShouldGetNotNull()
        {
            Developer developer = new Developer();

            developer.Name = "Elon Musk";
            DeveloperRepo repository = new DeveloperRepo();

            repository.AddDeveloperToList(developer);
            Developer contentFromDirectory = repository.GetDeveloperByName("Elon Musk");

            Assert.IsNotNull(contentFromDirectory);
        }
Exemple #10
0
        private void DisplayDeveloper()
        {
            Console.Clear();
            Developer newContent = new Developer();

            Console.WriteLine("Enter your Unique ID:");
            string idAsString = Console.ReadLine();

            newContent.IdNumber = double.Parse(idAsString);

            Console.WriteLine("Enter your First Name:");
            newContent.FirstName = Console.ReadLine();

            Console.WriteLine("Enter your Last Name:");
            newContent.LastName = Console.ReadLine();

            Console.WriteLine("Do you have Pluralsight Access? (y/n):");
            string pluralSightAccessString = Console.ReadLine().ToLower();

            if (pluralSightAccessString == "y")
            {
                newContent.PluralSightAccess = true;
            }
            else
            {
                newContent.PluralSightAccess = false;
            }

            Console.WriteLine("Enter the Team Number have you been assigned to:\n" +
                              "1. Front End\n" +
                              "2. Back End\n" +
                              "3. Full Stack\n" +
                              "4. Design");
            string teamNameAsString = Console.ReadLine();
            int    teamNameAsInt    = int.Parse(teamNameAsString);

            newContent.NameOfTeam = (TeamName)teamNameAsInt;

            _contentRepo.AddDeveloperToList(newContent);
        }
Exemple #11
0
        }     // end Menu()

        private void AddMultipleDevelopersToTeam()
        {
            Console.Clear();
            bool hasFilledAllPositions = false;

            Console.WriteLine("Please Input an Team id.");
            int inputTeamId = int.Parse(Console.ReadLine());

            List <Developer> developersToAdd = new List <Developer>();

            while (hasFilledAllPositions == false)
            {
                Console.WriteLine("Do you have any developers to add to the team y/n");
                string inputNeededDeveloper = Console.ReadLine();
                if (inputNeededDeveloper == "Y" || inputNeededDeveloper == "y")
                {
                    Console.Clear();
                    Developer newdeveloper = new Developer();


                    Console.WriteLine("Please Input Developer Title: ");
                    string developerTitleInput = Console.ReadLine();
                    newdeveloper.Title = developerTitleInput;

                    Console.WriteLine("Please Input Developer First Name: ");
                    string developerFirstNameInput = Console.ReadLine();
                    newdeveloper.FirstName = developerFirstNameInput;

                    Console.WriteLine("Please Input Developer Last Name: ");
                    string developerLastNameInput = Console.ReadLine();
                    newdeveloper.LastName = developerLastNameInput;


                    Console.WriteLine("Enter the Developer ID :");
                    // obtain user info / input about specific developer ( key : employeeID )
                    int inputEmployeeId = int.Parse(Console.ReadLine());
                    newdeveloper.EmployeeId = inputEmployeeId;
                    Console.WriteLine("Does this delvelopoer have a PluralsightLicense(Y or N)");
                    string inputpluralSight = Console.ReadLine();
                    if (inputpluralSight == "Y")
                    {
                        newdeveloper.PluralsightAccess = true;
                    }
                    else if (inputpluralSight == "N")
                    {
                        newdeveloper.PluralsightAccess = false;
                    }

                    developersToAdd.Add(newdeveloper);
                    _developerRepo.AddDeveloperToList(newdeveloper);
                    Console.Clear();
                }

                if (inputNeededDeveloper == "N" || inputNeededDeveloper == "n")
                {
                    _devTeamRepo.AddMultipleDevelopersToTeam(inputTeamId, developersToAdd);
                    hasFilledAllPositions = true;
                }
            }
        }
        private void SeedDeveloperList()
        {
            // Fill out a few developer objects and add them to the list

            Developer developer = new Developer(1, "Amy Martinez", true);


            // After we have filled out a few streaming content objects, we now want to call our developer repository
            _developerRepo.AddDeveloperToList(developer);

            // Now we need to call SeedContetList method, We see we have zero references, nothing is being referenced in the method
            // SCROLL BACK UP TO THE TOP TO RUN METHOD
        }
Exemple #13
0
        private void CreateNewDeveloper()
        {
            Console.Clear();
            Developer newDeveloper = new Developer();

            bool endErrorCheck = false;

            while (endErrorCheck == false)
            {
                int devID = 0;

                Console.WriteLine("Enter developer's ID:");

                if (int.TryParse(Console.ReadLine(), out int result) == true)
                {
                    devID = result;
                }

                if (devID <= 0)
                {
                    Console.WriteLine("ERROR: The developer ID must be numeric and greater than 0");
                }
                else
                {
                    Developer tempDev = _developerRepo.GetDeveloperById(devID);
                    if (tempDev != null)
                    {
                        Console.WriteLine("ERROR: The developer ID already exists.");
                    }
                    else
                    {
                        endErrorCheck         = true;
                        newDeveloper.UniqueID = devID;
                    }
                }
            }

            Console.WriteLine("Enter developer's name:");
            newDeveloper.DevName = Console.ReadLine();

            Console.WriteLine("Does the developer have Pluralsight? (y/n)");
            string pluralsightAccess = Console.ReadLine().ToLower();

            if (pluralsightAccess == "y")
            {
                newDeveloper.HasPluralsight = true;
            }
            else
            {
                newDeveloper.HasPluralsight = false;
            }

            _developerRepo.AddDeveloperToList(newDeveloper);
        }
        private void CreateNewDeveloper()
        {
            Console.Clear();

            Developer newDeveloper = new Developer();

            Console.WriteLine("Enter first name of developer:");
            newDeveloper.FirstName = Console.ReadLine();

            Console.WriteLine("Enter last name of developer:");
            newDeveloper.LastName = Console.ReadLine();

            Console.WriteLine("Enter in the developer's ID:");
            newDeveloper.DeveloperID = Console.ReadLine();

            Console.WriteLine("Does the developer have access to PluralSight (y /n):");
            newDeveloper.PluralSight = Console.ReadLine();

            Console.WriteLine("What Team are they a member?");
            newDeveloper.DeveloperTeamID = Console.ReadLine();

            _developerList.AddDeveloperToList(newDeveloper);
        }
Exemple #15
0
        //Create
        private void AddNewDev()
        {
            Console.Clear();
            //Name
            Console.WriteLine("Enter developer's name:");
            string name = Console.ReadLine();

            //Has Pluralsight Access
            Console.WriteLine("Does developer have access to Pluralsight? (y/n)");
            string pluralsightString = Console.ReadLine().ToLower();
            bool   hasPluralsightAccess;

            if (pluralsightString == "y")
            {
                hasPluralsightAccess = true;
            }
            else
            {
                hasPluralsightAccess = false;
            }

            _developerRepo.AddDeveloperToList(name, hasPluralsightAccess);
        }
Exemple #16
0
        //2. Add new developer
        private void AddNewDeveloper()
        {
            Developer        newDeveloper     = new Developer();
            List <Developer> listOfDevelopers = _developerRepo.GetDeveloperList();

            Console.Clear();
            //Ask for new developer's name
            Console.WriteLine("Enter the developer's name:");
            newDeveloper.Name = Console.ReadLine();
            //Ask if new developer already has an ID number
            Console.WriteLine("Does the developer have an ID number?\n" +
                              "1. Yes: the developer has an ID number\n" +
                              "2. No: the developer needs an ID number\n" +
                              "Enter 1 or 2");
            string IDnum      = Console.ReadLine();
            bool   NotValidID = true;
            int    tempID     = 1; //initial tempID

            if (IDnum == "1")      //user will input new ID number
            {
                Console.WriteLine("Enter the developer's six-digit ID number:");
                tempID = int.Parse(Console.ReadLine());
            }
            else  //program will randomly generate a new ID number
            {
                tempID = RandomNumber(100001, 999999);
            }
            while (NotValidID)
            {
                foreach (Developer developer in listOfDevelopers)
                {
                    if (tempID == developer.IDnumber) //determine whether ID number is unique and if not, produce unique ID
                    {
                        Console.WriteLine("That ID number is already in use.\n" +
                                          "A new ID number will be assigned.\n");
                        tempID = RandomNumber(100001, 999999);
                    }
                }
                newDeveloper.IDnumber = tempID;
                NotValidID            = false;
            }
            Console.WriteLine($"\n{newDeveloper.Name}'s ID number is {newDeveloper.IDnumber}.\n");
            //Pluralsight
            Console.WriteLine("\nDoes the developer have a Pluralsight license?\n" +
                              "1. Yes: the developer has a Pluralsight license\n" +
                              "2. No: the developer does NOT have a Pluralsight license\n" +
                              "Enter 1 or 2");
            string psLicense = Console.ReadLine();

            switch (psLicense)
            {
            case "1":
                newDeveloper.AccessToPluralsight = true;
                break;

            case "2":
                newDeveloper.AccessToPluralsight = false;
                break;
            }

            _developerRepo.AddDeveloperToList(newDeveloper);
            Console.WriteLine($"The following developer has been added:\n" +
                              $"    Name: {newDeveloper.Name}\n" +
                              $"    ID number: {newDeveloper.IDnumber}\n" +
                              $"    Pluralsight: {newDeveloper.AccessToPluralsight}");
        }
Exemple #17
0
        //Seed Method
        private void SeedDevelopers()
        {
            Developer jon       = new Developer("Jon Kinne", 121, true, TeamName.Alpha);
            Developer mike      = new Developer("Mike Jones", 122, false, TeamName.Beta);
            Developer travis    = new Developer("Travis Lockmiller", 123, true, TeamName.Gamma);
            Developer jose      = new Developer("Jose Garcia", 124, true, TeamName.Alpha);
            Developer michael   = new Developer("Michael Jenkins", 125, false, TeamName.Beta);
            Developer julian    = new Developer("Julian Sampedro", 126, false, TeamName.Gamma);
            Developer stephanie = new Developer("Stephanie Wu", 127, true, TeamName.Alpha);
            Developer justin    = new Developer("Justin Swans", 128, true, TeamName.Beta);
            Developer joe       = new Developer("Joe Smith", 129, true, TeamName.Gamma);
            Developer rob       = new Developer("Rob Hill", 130, true, TeamName.Alpha);
            Developer brittany  = new Developer("Brittany Lemons", 131, false, TeamName.Beta);
            Developer lucas     = new Developer("Lucas Nancy", 132, true, TeamName.Gamma);

            _developerRepo.AddDeveloperToList(jon);
            _developerRepo.AddDeveloperToList(mike);
            _developerRepo.AddDeveloperToList(travis);
            _developerRepo.AddDeveloperToList(jose);
            _developerRepo.AddDeveloperToList(michael);
            _developerRepo.AddDeveloperToList(julian);
            _developerRepo.AddDeveloperToList(stephanie);
            _developerRepo.AddDeveloperToList(justin);
            _developerRepo.AddDeveloperToList(joe);
            _developerRepo.AddDeveloperToList(rob);
            _developerRepo.AddDeveloperToList(brittany);
            _developerRepo.AddDeveloperToList(lucas);
        }