static void ViewOrderHistory(User user) { System.Console.WriteLine("- Your orders " + user.Name); var orders = user.Orders; var counter = 1; foreach (var o in orders) { System.Console.WriteLine($"Order {counter++}:"); ManagePizza.DisplayCart3(o); System.Console.WriteLine($"Date and Time: {o.TimeOrdered}"); System.Console.WriteLine(); } }
static void AddOrder(Starter starter, User user, Store store) { var order = new Order(); try { order = starter.CreateOrder(user, store); ManagePizza.Menu(order); var userRepository = new UserRepository(); userRepository.Create(user); } catch (Exception ex) { System.Console.WriteLine("Whoops, something went wrong!"); System.Console.WriteLine(ex.Message); } System.Console.WriteLine("ORDERS: " + user.Orders.Count()); System.Console.WriteLine(); }