Example #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);
                }
            }
        }
Example #2
0
 /// <summary>
 /// Edit a specific member menu
 /// </summary>
 /// <param name="a_member">model.Member, the member to be edited</param>
 private void EditMember(model.Member a_member)
 {
     m_console.EditMember(a_member);
     m_console.WriteMessage("New Name: ");
     string name = m_console.ReadResponse();
     string pNumber;
     while (true)
     {
         m_console.WriteMessage("New Personal Number: ");
         pNumber = m_console.ReadResponse();
         if (pNumber.All(char.IsNumber) && pNumber.Length == 12 && long.Parse(pNumber) >= 100000000000)
         {
             break;
         }
         m_console.WriteMessage("Wrong format, format should be YYYYMMDDXXXX");
     }
     m_memberList.ChangeMemberInfo(a_member.GetMemberID(), name, long.Parse(pNumber));
     m_console.SetCurrentMenu(view.Console.CurrentMenu.Member);
     GoToCurrentMenu(a_member);
 }