コード例 #1
0
        public void GetDeveloperByID()
        {
            Console.Clear();
            Console.WriteLine("Enter The ID of The Employee.");

            int originId = Convert.ToInt32(Console.ReadLine());
            Dev content  = _devRepo.GetDeveloperByID(originId);


            if (content != null)
            {
                Console.WriteLine($"Name: {content.Name}\n" +
                                  $" ID Number: {content.ID}\n" +
                                  $"Plural Access: {content.HasPluralSightAccess}");
            }
            else
            {
                Console.WriteLine("No ID number present.");
            }
        }
コード例 #2
0
        private void DisplayEmployeeById()
        {
            Console.Clear();
            //Prompt
            Console.WriteLine("Please enter the employee ID: ");
            //Get input
            string devId = Console.ReadLine();
            //find by ID
            DevPOCO devPoco = _devRepo.GetDeveloperByID(devId);

            //display if null
            if (devPoco != null)
            {
                Console.WriteLine($"Developer ID: {devPoco.DeveloperID}\n" +
                                  $" First Name: {devPoco.FirstName}\n" +
                                  $" Last name: {devPoco.LastName}\n" +
                                  $"PluralSight Account: {devPoco.PluralSightAccount}");
            }
            else
            {
                Console.WriteLine("Can find employee by that ID.");
            }
        }