示例#1
0
        public void OutputInformation(IUserManager userManager, IAwardManager awardManager,
                                      IUserAndAwardsManager userAndAwardsManager, int typeOfOutputInformation)
        {
            if (typeOfOutputInformation == 1)
            {
                Console.WriteLine("All users' information:");
                foreach (var user in userManager.GetAllUsers())
                {
                    Console.WriteLine(user.ToString());
                }
            }
            else if (typeOfOutputInformation == 2)
            {
                Console.WriteLine("All awards' information:");
                foreach (var award in awardManager.GetAllAwards())
                {
                    Console.WriteLine(award.ToString());
                }
            }
            else if (typeOfOutputInformation == 3)
            {
                Console.WriteLine("All information about users and their awards:");

                for (int i = 0; i < userAndAwardsManager.GetAllUsersAndAwards().Count; i++)
                {
                    foreach (var user in userManager.GetAllUsers())
                    {
                        if (user.Id == userAndAwardsManager.GetAllUsersAndAwards().ElementAt(i).UserId)
                        {
                            Console.WriteLine("User:"******"Awards:");
                        }
                    }

                    foreach (var award in awardManager.GetAllAwards())
                    {
                        if (userAndAwardsManager.GetAllUsersAndAwards().ElementAt(i).ListOfAwards.Contains(award.Id))
                        {
                            Console.WriteLine(award.ToString());
                        }
                    }

                    Console.WriteLine();
                }
            }
        }
示例#2
0
 private void GetAllAwards(IAwardManager awardManager)
 {
     awardManager.GetAllAwards();
 }