/// <summary> /// Retrieves member's phone number given their full name /// </summary> static void findMemberNumber() { Console.Write("Please enter member's first name: "); string fName = Console.ReadLine(); Console.Write("Please enter member's last name: "); string lName = Console.ReadLine(); MemberCollection.findNumber(fName, lName); }
/// <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); } }
/// <summary> /// Member login verification /// </summary> public static void memberLogin() { //Retrieve input for username and password Console.Write("Please enter member's username (LastnameFirstname): "); string username = Console.ReadLine(); Console.Write("Please enter member's password (4 digits): "); string pass = Console.ReadLine(); //if a valid password was given if (memberPassVerification(pass) == true) { //Find a member that contains same login credentials verifiedMember = MemberCollection.findDuplicateMember(username, Convert.ToInt32(pass)); //if the member could be found, display the member menu options and welcome user if (verifiedMember != null) { Console.WriteLine("Welcome {0}...", verifiedMember.firstName); menuFunctions(); } else { // if user credentials don't match, return to menu Console.WriteLine("Could not verify user..."); Console.WriteLine("Returning to main menu..."); MainMenu.mainMenu(); } } else {//if an invalid password was entered, return to menu Console.WriteLine("Invalid password entered..."); Console.WriteLine("Returning to main menu..."); MainMenu.mainMenu(); } }