Ejemplo n.º 1
0
        // Dispaly all badges
        private void DisplayAllBadges()
        {
            Console.Clear();
            Dictionary <int, List <string> > badgesDic = _badgesRepo.DisplayDictionary();

            // Display header
            var header = string.Format("{0,-9}{1,-9}\n",
                                       $"Badge #", "Door Access");

            Console.WriteLine(header);

            // Display list of doors
            //List<string> newListOfDoors = _badgesRepo.GetListOfDoors(int badgeID);
            //string newDoorAccess = String.Join(",", newListOfDoors);

            // Display dictionary
            foreach (KeyValuePair <int, List <string> > badges in badgesDic)
            {
                List <string> doors      = _badgesRepo.GetListOfDoors(badges.Key);
                string        doorAccess = String.Join(",", doors);
                Console.WriteLine($"{badges.Key,-9} {doorAccess}");
            }
            Console.ReadLine();
        }