Пример #1
0
        private void CreateCustomerName()
        {
            bool isValidState = false;

            while (isValidState == false)
            {
                userState = io.PromptUserForString("Please enter your State abbreviation (OH format): ");

                if (userState.Length != 2)
                {
                    Console.WriteLine("Invalid entry, please try again");
                }
                else
                {
                    userState = userState.ToUpper();
                }

                taxResponse = manager.CheckTax(userState);

                if (taxResponse.Success)
                {
                    isValidState = true;
                }
                else
                {
                    Console.WriteLine("Does not match a State in our files");
                }
            }
        }
Пример #2
0
        public void ConfirmRemoveOrder(Order order)
        {
            Console.Clear();
            io.DisplayOrder(order, userDate);

            orderResponse.Order      = order;
            orderResponse.Orders     = displayResponse.Orders;
            orderResponse.StringDate = dateString;
            orderResponse.DateDate   = userDate;

            while (removeFile == false)
            {
                string save = io.PromptUserForString("This is the order information, would you like to remove the order (Y or N)? ");
                switch (save.ToUpper())
                {
                case "Y":
                    manager.RemoveOrder(orderResponse);
                    removeFile = true;
                    break;

                case "N":
                    removeFile = true;
                    break;

                default:
                    Console.WriteLine("Please enter Y or N");
                    break;
                }
            }
        }
Пример #3
0
        public void EditOrder(Order order)
        {
            bool saveFile = false;

            Console.Clear();
            io.DisplayOrder(order, userDate);
            Console.WriteLine();
            Console.WriteLine();

            string customerName = order.CustomerName;

            Console.WriteLine($"\nCurrent customer name: {order.CustomerName}\n");
            Console.WriteLine("Press enter to leave the name unchanged");
            string newName = EditCustomerName();

            if (newName != "")
            {
                order.CustomerName = newName;
            }

            string customerTax = order.OrderTax.StateAbbreviation;

            Console.WriteLine($"\nCurrent state: {order.OrderTax.StateAbbreviation}\n");
            Console.WriteLine("Press enter to leave the state unchanged");
            string newState = EditState();

            if (newState != "")
            {
                order.OrderTax.StateAbbreviation = newState;
            }

            string customerProduct = order.OrderProduct.ProductType;

            Console.WriteLine($"\nCurrent product: {order.OrderProduct.ProductType}\n");
            Console.WriteLine("Press enter to leave the product unchanged");
            string newProduct = EditProduct();

            if (newProduct != "")
            {
                order.OrderProduct.ProductType = newProduct;
            }

            decimal customerArea = order.Area;

            Console.WriteLine($"\nCurrent area: {order.Area}\n");
            Console.WriteLine("Press enter to leave the area unchanged");
            decimal newArea = EditArea();

            if (newArea != -1)
            {
                order.Area = newArea;
            }

            Console.Clear();
            io.DisplayOrder(order, userDate);
            while (saveFile == false)
            {
                string save = io.PromptUserForString("This is the new order information, would you like to save the order (Y or N)? ");
                switch (save.ToUpper())
                {
                case "Y":
                    manager.SaveEdit(orderResponse);
                    saveFile = true;
                    break;

                case "N":
                    saveFile = true;
                    break;

                default:
                    Console.WriteLine("Please enter Y or N");
                    break;
                }
            }
        }