Exemplo n.º 1
0
 public void DoesUserWantToSeeCompactList(MemberRegistry memberRegistry)
 {
     int key = GetMenuChoice("1. Compact list.\n2. Verbose list", 2);
     if (key == 1)
     {
         ShowCompactList(memberRegistry);
     }
     else if (key == 2)
     {
         ShowVerboseList(memberRegistry);
     }
 }
Exemplo n.º 2
0
        private void ShowVerboseList(MemberRegistry memberRegistry)
        {
            //TODO: FORMATTING OF STRINGS
            Console.Clear();
            Console.BackgroundColor = ConsoleColor.DarkYellow;

            Console.WriteLine(String.Format("{0,-15} {1,-15} {2,-22} {3,-8}", "Firstname", "Lastname", "Social Security Number", "Member ID"));
            Console.ResetColor();
            Console.WriteLine();
            foreach (var member in memberRegistry.Members)
            {
                Console.WriteLine(String.Format("{0,-15} {1,-15} {2,-22} {3,-8}", member.FirstName, member.LastName, member.SocialSecurityNumber, member.MemberID));

                if (member.Boats.Count > 0)
                {

                    Console.WriteLine("{0,10}", "Boats");
                    Console.BackgroundColor = ConsoleColor.DarkBlue;
                    Console.WriteLine(String.Format("     {0,-15} {1,-5}", "Type", "Length"));
                    Console.ResetColor();
                    foreach (var boat in member.Boats)
                    {
                        Console.WriteLine(String.Format("     {0,-15} {1,-5}", boat.Type, boat.Length));
                    }
                }
                Console.WriteLine();

            }
        }
Exemplo n.º 3
0
 public void SaveMemberRegistry(MemberRegistry memberRegistry)
 {
     MemberDAL.Save(memberRegistry);
 }
Exemplo n.º 4
0
        private void ShowCompactList(MemberRegistry memberRegistry)
        {
            Console.Clear();
            Console.BackgroundColor = ConsoleColor.DarkYellow;

            Console.WriteLine(String.Format("{0,-15} {1,-15} {2,-15} {3,-8}", "Firstname", "Lastname", "Member ID", "Number of boats"));
            Console.ResetColor();
            Console.WriteLine();

            foreach (var member in memberRegistry.Members)
            {
                Console.WriteLine(String.Format("{0,-15} {1,-15} {2,-15} {3,-8}", member.FirstName, member.LastName, member.MemberID, member.Boats.Count));
            }
        }
Exemplo n.º 5
0
 public BaseController()
 {
     _memberRegistry = Service.LoadMemberRegistry();
 }