示例#1
0
        public void SetPizzaOrder()
        {
            var ef = new EfData();

            Po                = new PizzaOrder();
            Po.OrderID        = prevOrder.OrderId;
            Po.CustomerName   = ef.GetCustomerNameByID(prevOrder.CustomerId);
            Po.OrderValue     = prevOrder.TotalValue.Value;
            Po.OrderTime      = prevOrder.OrderTime;
            Po.LocationString = ef.GetLocationByID(ef.GetLocationIDForOrder(prevOrder.OrderId));
            Po.PizzaStrings   = GetAllPizzasInOrder(ef.GetPizza2sForOrder(prevOrder.OrderId));
        }
示例#2
0
        public void SetPizzaOrders()
        {
            var ef = new EfData();

            AllPizzaOrders = new List <PizzaOrder>();

            List <int> orderIDs = ef.GetOrderIdsForCustomer(CustomerID);

            foreach (int orderID in orderIDs)
            {
                PizzaOrder po = new PizzaOrder();
                po.OrderID = orderID;
                Console.WriteLine("Found previous order: {0}", orderID);
                Order order = ef.GetOrderById(orderID);
                po.CustomerName   = ef.GetCustomerNameByID(CustomerID);
                po.OrderValue     = order.TotalValue.Value;
                po.OrderTime      = order.OrderTime;
                po.LocationString = ef.GetLocationByID(ef.GetLocationIDForOrder(orderID));
                po.PizzaStrings   = GetAllPizzasInOrder(ef.GetPizza2sForOrder(orderID));

                AllPizzaOrders.Add(po);
            }
            Console.WriteLine("There are {0} total orders.", AllPizzaOrders.Count);
        }