Exemplo n.º 1
0
 static void OrderOrHistory(User u)
 {
     Console.WriteLine("--- Hello Returning User -- type 1 to view your order history or 0 to start a new order");
     int.TryParse(System.Console.ReadLine(), out int input);
     if (input == 1)
     {
         _sql.ReadUsersPizzas(_sql.UsersOrders(u));
     }
     else
     {
         var ThisOrder = new Order();
         ThisOrder.UserEntityId = u.EntityId;
         PrintAllStoresEF();
         Console.WriteLine("--- Type Store Name to select a store ---");
         u.SelectedStore = _sql.SelectStore();
         u.SelectedStore.CreateOrder();
         u.Orders = u.SelectedStore.Orders;
         u.Orders.Add(u.SelectedStore.Orders.Last());
         ThisOrder = u.SelectedStore.Orders.Last();
         ThisOrder.DisplayPizzaOptions();
         ThisOrder.AddPizza();
         _sql.Update();
         _sql.ReviewOrder(ThisOrder);
         u.SelectedStore.Revenue = u.SelectedStore.Revenue + ThisOrder.Total;
         _sql.Update();
         Console.WriteLine(u);
         ViewStoreRev(u.SelectedStore);
     }
 }