예제 #1
0
        /// <summary>
        /// Display a member to the user
        /// </summary>
        /// <param name="a_member">model.Member. The member to be displayed</param>
        /// <param name="showPNumber">bool. True if the Personal Number should be displayed, false otherwise</param>
        /// <param name="showBoats">bool. True if the boats the user owns should be displayed, false if only the number of boats owned should be displayed</param>
        public void DisplayMember(model.Member a_member, bool showPNumber, bool showBoats)
        {
            System.Console.WriteLine("---");
            System.Console.WriteLine("MemberID: {0}", a_member.GetMemberID());
            System.Console.WriteLine("Name: {0}", a_member.GetName());

            if (showPNumber)
            {
                System.Console.WriteLine("Personal Number: {0}", a_member.GetPNumber());
            }

            List<model.Boat> boats = a_member.GetBoatList().GetBoats();

            if (boats.Count > 0)
            {
                if (showBoats)
                {
                    System.Console.WriteLine("Boats:");

                    foreach (model.Boat boat in boats)
                    {
                        DisplayBoat(boat);
                    }
                }
                else
                {
                    System.Console.WriteLine("Boats: {0}", boats.Count);
                }
            }
        }