示例#1
0
        public static string GetItem(Dictionary <string, MarkdownItem> markdownList)
        {
            string category = "";

            switch (StoreItemView.GetItemCategory())
            {
            case "1":
                UserInput.Message("I see you have chosen Produce : choose from our selection. What would you like to add to your cart.", false);
                category = "Produce";

                break;

            case "2":
                UserInput.Message("Meat it is ! Choose from our selection.", false);
                category = "Meat";
                break;

            case "3":
                UserInput.Message("Quench your thirst with these items", false);
                category = "Beverage";
                break;

            case "4":
                UserInput.Message("Choose from our wonderful selection of berads.", false);
                category = "Bread";
                break;

            case "5":
                UserInput.Message("I often tell people my house was clean yesterday, you should of been there !.... Lets get you some cleaning supplies so you wont have to say that.", false);
                category = "Cleaning Supply";
                break;

            default:

                UserInput.Message("Not valid selecton.", false);

                break;
            }

            if (category != string.Empty)
            {
                KartController.ListItemByCategory(category, markdownList);
            }

            string name = UserInput.GetInput("Enter name of item:");

            while (!IsItemNameValid(name))
            {
                UserInput.Message("Not a valid name. Names are case sensitive.", false);
                name = UserInput.GetInput("Enter name of item:");
            }

            return(name);
        }
示例#2
0
        private static void ShowKartMenu(Dictionary <string, MarkdownItem> markdownList)
        {
            bool   proceed = true;
            string name    = "";

            while (proceed)
            {
                bool skip = false;

                switch (MainMenuView.KartMenu())
                {
                case "0":
                    proceed = false;
                    skip    = true;
                    break;

                case "1":
                    UserInput.Message("I see you have chosen Produce : choose from our selection. What would you like to add to your cart.", false);
                    name = "Produce";

                    break;

                case "2":
                    UserInput.Message("Meat it is ! Choose from our selection.", false);
                    name = "Meat";
                    break;

                case "3":
                    UserInput.Message("Quench your thirst with these items", false);
                    name = "Beverage";
                    break;

                case "4":
                    UserInput.Message("Choose from our wonderful selection of berads.", false);
                    name = "Bread";
                    break;

                case "5":
                    UserInput.Message("I often tell people my house was clean yesterday, you should of been there !.... Lets get you some cleaning supplies so you wont have to say that.", false);
                    name = "Cleaning Supply";
                    break;

                case "6":
                    KartController.DisplayKart(kartItem);
                    skip = true;
                    break;

                case "7":
                    KartController.RemoveItem(kartItem);
                    skip = true;
                    break;

                default:
                    skip = true;
                    break;
                }

                if (name != string.Empty)
                {
                    KartController.ListItemByCategory(name, markdownList);
                }

                if (!skip)
                {
                    KartController.AddItemToKart(kartItem, markdownList);
                }
            }
        }