/// <summary>
        /// Add a new member to the member collection
        /// </summary>
        static void registerMember()
        {
            //Retrieve new member's first and last name
            Console.Write("Please enter member's first name: ");
            string memberFirstName = Console.ReadLine();

            Console.Write("Please enter member's last name: ");
            string memberLastName = Console.ReadLine();

            //Concat new member's full name together and check if the new member doesn't already exist in member collection
            string memberUserName = memberLastName + memberFirstName;
            bool   foundDupe      = MemberCollection.findDuplicateMember(memberUserName);

            //If duplicate member found, don't add to collection
            if (foundDupe == true)
            {
                //State member already exists in collection
                Console.WriteLine("{0} {1} is already registered",
                                  memberFirstName, memberLastName);
            }
            else //If member doesn't exist yet
            {
                //ask additional information about new member
                Member newMem = new Member(memberFirstName, memberLastName);
                Console.Write("Please enter member's contact number: ");
                newMem.contactNum = Console.ReadLine();

                Console.Write("Please enter member's address: ");
                newMem.resAddress = Console.ReadLine();

                Console.Write("Please enter a 4 digit password: "******"Invalid password. Please re-enter a 4 digit password: "******"Successfully added {0} {1}", newMem.firstName, newMem.lastName);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handling menu option inputs for staff and member login
        /// </summary>
        /// <returns></returns>
        static bool mainInput()
        {
            bool endProgram = false;
            int  response   = int.Parse(Console.ReadLine());

            switch (response)
            {
            case 1:
                Console.WriteLine("\nStaff verification...");
                //staff input and verification
                if (StaffMenu.Login() == true)
                {
                    Console.WriteLine("Successful Login!\nLoading staff menu...");
                    StaffMenu.menuFunctions();
                }
                else
                {
                    //return to main menu
                    Console.WriteLine("\nReturning to main menu...");
                    mainMenu();
                }
                break;

            case 2:
                Console.WriteLine("\nMember verification...");
                //member input and verification
                MemberMenu.memberLogin();
                break;

            default:
                Console.WriteLine("\nEnd Program...");
                endProgram = true;
                break;
            }//end switch

            return(endProgram);
        }//end MainInput