public void Execute() { OrderManager manager = OrderManagerFactory.Create(); Console.Clear(); string userInput = SystemIO.OrderDateRequest(); DateTime order = Convert.ToDateTime(userInput); int orderNumber = SystemIO.OrderNumberRequest(); LookupOrderResponse response = manager.AccountByDateAndNumber(order, orderNumber); if (response.Success) { SystemIO.DisplaySingleOrderDetails(response.Order); Console.ReadKey(); SystemIO.EditOrderMenu(response.Order); } else { Console.WriteLine(response.Message); Console.WriteLine("An error has occured: "); } Console.ReadKey(); }
public void Execute() { OrderManager manager = OrderManagerFactory.Create(); Order order = new Order(); string dateInput = SystemIO.OrderDateRequest(); DateTime orderDate = Convert.ToDateTime(dateInput); order.Date = orderDate; string input = SystemIO.EditCustName(); order.CustomerName = input; string userInput = SystemIO.EditState(); FindStateResponse stateResponse = manager.GetStateTax(userInput); order.State = userInput; if (stateResponse.Success) { order.TaxData = stateResponse.StateTax.TaxRate; } else { stateResponse.Success = false; } string productInput = SystemIO.EditGetProduct(); OrderManager productManager = OrderManagerFactory.Create(); FindProductTypeResponse findProduct = productManager.GetProductData(productInput); order.ProductType = productInput; if (findProduct.Success) { order.ProductType = findProduct.Product.ProductType; order.CostPerSquareFoot = findProduct.Product.CostPerSquareFoot; order.LaborCostPerSquareFoot = findProduct.Product.LaborCostPerSquareFoot; } else { findProduct.Success = false; } decimal areaInput = SystemIO.EditGetArea(); order.Area = areaInput; manager.SaveNewOrder(order); SystemIO.DisplaySingleOrderDetails(order); Console.ReadKey(); }
public void Execute() { OrderManager manager = OrderManagerFactory.Create(); Console.Clear(); string userInput = SystemIO.OrderDateRequest(); DateTime order = Convert.ToDateTime(userInput); OrderResponse response = manager.LookupOrder(order); if (response.Success) { SystemIO.DisplayOrderDetails(response.Order); } else { Console.WriteLine("An error occured: "); Console.WriteLine(response.Message); } Console.ReadKey(); }
public void Execute() { OrderManager manager = OrderManagerFactory.Create(); string dateInput = SystemIO.OrderDateRequest(); DateTime orderDate = Convert.ToDateTime(dateInput); int orderNumber = SystemIO.OrderNumberRequest(); LookupOrderResponse response = manager.AccountByDateAndNumber(orderDate, orderNumber); if (response.Success) { manager.DeleteOrder(response.Order); Console.WriteLine("Order has been deleted."); } else { Console.WriteLine("An error has occured: "); Console.WriteLine(response.Message); } Console.ReadKey(); }