Esempio n. 1
0
        static void Main(string[] args)
        {
            //Set loop sentinels
            bool   mainProgramLoop   = false;
            bool   preferredMenuLoop = false;
            string input;
            //Set index to track number of  non-preferred customer transactions.
            int index = 1;

            //Store preferred and non-preferred customer information in lists
            List <PreferredCustomer>    customer             = new List <PreferredCustomer>();
            List <NonPreferredCustomer> nonPreferredCustomer = new List <NonPreferredCustomer>();

            Console.WriteLine(StandardMessages.DisplayProgramInstructions());
            Console.ReadLine();
            Console.Clear();
            do
            {
                //Display main program menu
                Console.WriteLine(StandardMessages.DisplayMainMenu());
                //get input from user
                input = Console.ReadLine();
                switch (input)
                {
                case "1":
                    //Build preferred customer and complete customer transaction
                    BuildCustomer.BuildACustomer(customer, preferredMenuLoop, input);
                    CustomerTransaction.CustomerItemPurchasePreferred(customer, input, preferredMenuLoop);
                    break;

                case "2":
                    //Complete non-preferred customer transaction
                    CustomerTransaction.CustomerItemPurchaseNotPreferred(nonPreferredCustomer, index, input);
                    index++;
                    break;

                case "3":
                    //Display all preferred customers for the day
                    DisplayCustomerInfo.DisplayPreferredCustomerInformation(customer);

                    break;

                case "4":
                    //Display all non-preferred customer **Transactions** for the day
                    DisplayCustomerInfo.DisplayNotPreferredCustomerInformation(nonPreferredCustomer);

                    break;

                case "5":
                    //Exits program
                    mainProgramLoop = true;

                    break;

                default:
                    //Display for invalid selection
                    Console.WriteLine(StandardMessages.DisplayInvalidChoice());
                    break;
                }
                Console.Clear();
            } while (mainProgramLoop == false);
        }