Example #1
0
 public static void LatestOrder2()
 {
     Console.WriteLine("Order History sorted by time from Latest to Earliest");
     for (int i = 0; i < Location.OrderHistory2.Count; i++)
     {
         PizzaRepos.WritePizzaOrder(i);
     }
 }
Example #2
0
 public static void EarliestOrder2()
 {
     Console.WriteLine("Order History sorted by time from Earliest to Latest");
     for (int i = 0; i < Location.OrderHistory2.Count; i++)
     {
         int marker = Location.OrderHistory2.Count - 1 - i;
         PizzaRepos.WritePizzaOrder(marker);
     }
 }
Example #3
0
        public static void CustomerOrderHistory2()
        {
            Console.WriteLine("Which Customer would you like to see an Order History for?");
            string input = Console.ReadLine();
            int    count = 0;

            for (int i = 0; i < Location.OrderHistory2.Count; i++)
            {
                int marker = Location.OrderHistory2.Count - 1 - i;
                if (Location.OrderHistory2[marker].Customer.CustomerName == input)
                {
                    count++;
                    PizzaRepos.WritePizzaOrder(marker);
                }
            }
            if (count == 0)
            {
                Console.WriteLine("Sorry, I couldn't find a Customer with that name.");
            }
        }
        public static void LocationOrderHistory2()
        {
            Console.WriteLine("Which Location would you like to see an Order History for?");
            string input = Console.ReadLine();
            int    count = 0;

            for (int i = 0; i < OrderHistory2.Count; i++)
            {
                int marker = OrderHistory2.Count - 1 - i;
                if (OrderHistory2[marker].Location.LocationName == input)
                {
                    count++;
                    PizzaRepos.WritePizzaOrder(marker);
                }
            }
            if (count == 0)
            {
                Console.WriteLine("Sorry, I couldn't find any order for that Location.");
            }
        }
Example #5
0
        public static void MostExpensiveOrder2()
        {
            List <int> used = new List <int> {
            };

            for (int a = 0; a < Location.OrderHistory2.Count; a++)
            {
                double highest = 0;
                int    marker  = 0;
                for (int i = 0; i < Location.OrderHistory2.Count; i++)
                {
                    if (!used.Contains(i) || Location.OrderHistory2[i].OrderCost > highest)
                    {
                        marker  = i;
                        highest = Location.OrderHistory2[i].OrderCost.Value;
                    }
                }
                used.Add(marker);
                PizzaRepos.WritePizzaOrder(marker);
            }
        }
Example #6
0
        public static void CheapestOrder2()
        {
            List <int> used = new List <int> {
            };

            for (int a = 0; a < Location.OrderHistory2.Count; a++)
            {
                double lowest = 500;
                int    marker = 0;
                for (int i = 0; i < Location.OrderHistory2.Count; i++)
                {
                    if (!used.Contains(i) || Location.OrderHistory2[i].OrderCost < lowest)
                    {
                        marker = i;
                        lowest = Location.OrderHistory2[i].OrderCost.Value;
                    }
                }
                used.Add(marker);
                PizzaRepos.WritePizzaOrder(marker);
            }
        }