public void WelcomeToGym()
        {
            while (lContinue)
            {
                SingleMember sMember = new SingleMember();
                MultiMember  mMember = new MultiMember();
                Club         club    = new Club();
                Console.ForegroundColor = ConsoleColor.DarkMagenta;
                Console.WriteLine($"Welcome to {ClubLocations[Program.clubLocationIndex].Name} {ClubLocations[Program.clubLocationIndex].ClubID}!");
                Console.WriteLine("What would you like to do?");
                Console.WriteLine();
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("1. Check-in");
                Console.WriteLine("2. Add Member");
                Console.WriteLine("3. Remove Member");
                Console.WriteLine("4. Check Points");
                Console.WriteLine("5. Create Bill");
                Console.WriteLine("6. Show Member Info");
                Console.WriteLine("7. Quit");
                Console.WriteLine();

                Console.ForegroundColor = ConsoleColor.DarkMagenta;
                string selection = Common.GetUserInput("Please enter a number 1 - 7: ");
                int    option    = Common.CheckNumber(selection, true, 7);

                bool validID = true;


                if (option == 1)
                {
                    Console.Clear();
                    string tempMemberID = Common.GetUserInput("Please enter your Member ID to check-in: ");
                    int    memberID     = Common.CheckNumber(tempMemberID, false, 0);

                    Common.CheckMemberStatus(memberID, out validID);

                    if (validID)
                    {
                        bool bFound = CheckIfMemberExists(memberID);
                        if (bFound)
                        {
                            CheckMembership(sMember, mMember, memberID);
                        }
                        else
                        {
                            Console.ForegroundColor = ConsoleColor.DarkRed;
                            Console.WriteLine("Invalid Member ID! Try again!");
                            Console.ForegroundColor = ConsoleColor.DarkMagenta;
                        }
                    }
                    else
                    {
                        Console.ForegroundColor = ConsoleColor.DarkRed;
                        Console.WriteLine("This doesn't appear to be your club. Back to your spaceship!");
                        Console.ForegroundColor = ConsoleColor.DarkMagenta;
                    }
                }
                else if (option == 2)
                {
                    AddMember();
                }
                else if (option == 3)
                {
                    RemoveMember();
                }
                else if (option == 4)
                {
                    string tempMemberID = Common.GetUserInput("Please enter your Member ID: ");
                    int    memberID     = Common.CheckNumber(tempMemberID, false, 0);
                    Common.CheckMemberStatus(memberID, out validID);
                    Console.ForegroundColor = ConsoleColor.DarkYellow;
                    Console.WriteLine();
                    if (memberID >= 5000)
                    {
                        Console.WriteLine($"Current Point Balance: {mMember.CheckPoints(memberID)} Gorgals");
                    }
                    else
                    {
                        Console.WriteLine("Sorry, you are not a multi-club member.");
                    }

                    Console.ForegroundColor = ConsoleColor.DarkMagenta;
                }
                else if (option == 5)
                {
                    Console.Clear();
                    string tempMemberID = Common.GetUserInput("Please enter your Member ID: ");
                    int    memberID     = Common.CheckNumber(tempMemberID, false, 0);
                    Common.CheckMemberStatus(memberID, out validID);

                    CreateBill(memberID);
                }
                else if (option == 6)
                {
                    string tempMemberID = Common.GetUserInput("Please enter your Member ID: ");
                    int    memberID     = Common.CheckNumber(tempMemberID, false, 0);

                    Common.CheckMemberStatus(memberID, out validID);

                    int index = 0;

                    if (validID)
                    {
                        bool bFound = CheckIfMemberExists(memberID);

                        if (bFound)
                        {
                            for (int i = 0; i < MemberInfo.Count; i++)
                            {
                                if (memberID == MemberInfo[i].MemberID)
                                {
                                    index = i;
                                    break;
                                }
                            }

                            Console.WriteLine();
                            Console.ForegroundColor = ConsoleColor.DarkYellow;

                            if (memberID < 5000)
                            {
                                SingleMember singleMember = new SingleMember(MemberInfo[index].MemberID, MemberInfo[index].FirstName, MemberInfo[index].LastName, MemberInfo[index].MemberFees, MemberInfo[index].PaidBill);

                                singleMember.PrintInfo();
                            }

                            if (memberID >= 5000)
                            {
                                MultiMember multiMember = new MultiMember(MemberInfo[index].MemberID, MemberInfo[index].FirstName, MemberInfo[index].LastName, MemberInfo[index].MemberFees, MemberInfo[index].PaidBill, MemberInfo[index].MemberPoints);
                                multiMember.PrintInfo();
                            }
                            Console.WriteLine();
                            Console.ForegroundColor = ConsoleColor.DarkMagenta;
                        }
                        else
                        {
                            Console.ForegroundColor = ConsoleColor.DarkRed;
                            Console.WriteLine("Invalid Member ID! Try again!");
                            Console.ForegroundColor = ConsoleColor.DarkMagenta;
                        }
                    }
                }
                else if (option == 7)
                {
                    Console.Clear();
                    Console.WriteLine("Thanks for visiting Space JALS!");
                    Console.WriteLine("Enjoy your day!");
                    Console.WriteLine();
                    lContinue = false;
                }
                Console.WriteLine("Press any \'space\' key to continue!");
                Console.ReadKey();
                Console.Clear();
            }
        }
Exemple #2
0
 public abstract void CheckIn(Club club, int MemberID);