public void FetchOrderInfoToRemove()
        {
            var response = _oops.GetOrderInfo(_orderToRemove);

            Console.Clear();

            if (response.Success)
            {
                Console.WriteLine("This is the information for the order you want to remove.");
                _orderToRemove.CustomerName           = response.Order.CustomerName;
                _orderToRemove.State                  = response.Order.State;
                _orderToRemove.TaxRate                = response.Order.TaxRate;
                _orderToRemove.ProductType            = response.Order.ProductType;
                _orderToRemove.Area                   = response.Order.Area;
                _orderToRemove.CostPerSquareFoot      = response.Order.CostPerSquareFoot;
                _orderToRemove.LaborCostPerSquareFoot = response.Order.LaborCostPerSquareFoot;
                _orderToRemove.MaterialCost           = response.Order.MaterialCost;
                _orderToRemove.LaborCost              = response.Order.LaborCost;
                _orderToRemove.Tax   = response.Order.Tax;
                _orderToRemove.Total = response.Order.Total;

                DisplayOrderInfoToRemove();
            }

            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(response.Message);
                Console.WriteLine("Press ENTER to continue...");
                Console.ResetColor();
                Console.ReadLine();
            }
        }
        public bool FetchOrderInfoToEdit()
        {
            var    response = _oops.GetOrderInfo(_orderToEdit);
            string input    = "";

            if (response.Success)
            {
                do
                {
                    Console.Clear();
                    Console.WriteLine("Order to modify:");
                    Console.WriteLine();

                    response.Order.OrderDate = _orderToEdit.OrderDate;
                    _orderToEdit             = response.Order;

                    DisplayOrderInfo();

                    Console.WriteLine("Is this the correct order?");
                    Console.Write("(Y)es, (N)o, or (Q)uit: ");
                    input = Console.ReadLine().ToUpper();

                    if (input == "Y")
                    {
                        return(true);
                    }
                    if (input == "N")
                    {
                        return(false);
                    }
                    if (input == "Q")
                    {
                        exitToMainMenu = true;
                        return(true);
                    }

                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine();
                    Console.WriteLine("That is an invalid entry.");
                    Console.WriteLine("Press ENTER to continue...");
                    Console.ResetColor();
                    Console.ReadLine();
                } while (true);
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine();
                Console.WriteLine(response.Message);
                Console.WriteLine("Press ENTER to continue...");
                Console.ResetColor();
                Console.ReadLine();
                return(false);
            }
        }
Beispiel #3
0
        public void GetOrderInfoTest()
        {
            Order orderInput = new Order()
            {
                OrderNumber = 1, OrderDate = DateTime.Parse("06/01/2013")
            };

            var returnedOrderInfo = _oops.GetOrderInfo(orderInput);

            Assert.AreEqual(returnedOrderInfo.Order.CustomerName, "Wise");
            Assert.AreEqual(returnedOrderInfo.Order.State, "OH");
            Assert.AreEqual(returnedOrderInfo.Order.ProductType, "Wood");
        }