Exemple #1
0
        public string EditProduct()
        {
            string userProduct    = "";
            bool   isValidProduct = false;
            CheckProductResponse productResponse = new CheckProductResponse();

            while (isValidProduct == false)
            {
                io.DisplayProducts(manager.GetProducts());

                userProduct = io.PromptUserForString("Please enter your product type: ");

                productResponse = manager.CheckProduct(userProduct);

                if (userProduct == "")
                {
                    isValidProduct = true;
                }
                if (productResponse.Success)
                {
                    isValidProduct = true;
                }
                else
                {
                    Console.WriteLine("Does not match a product type in our files");
                }
            }
            return(userProduct);
        }
        private void CreateCustomerProduct()
        {
            bool isValidProduct = false;

            while (isValidProduct == false)
            {
                io.DisplayProducts(manager.GetProducts());

                userProduct = io.PromptUserForString("Please enter your product type: ");

                productResponse = manager.CheckProduct(userProduct);

                if (productResponse.Success)
                {
                    isValidProduct = true;
                }
                else
                {
                    Console.WriteLine("Does not match a product type in our files");
                }
            }
        }