示例#1
0
        private Stock _CreateDummyData()
        {
            Stock stock = new Stock();

            Juice appleJuice = new Juice() { Id = 0, Name = "Brädhult", Type = "Apple", Marking = "Krav", StockCount = 20 };
            Juice orangeJuice = new Juice() { Id = 0, Name = "Plankhult", Type = "Orange", Marking = "EG", StockCount = 25 };

            Plate redPlate = new Plate() { Id = 0, Name = "Plåthult", Type = "Deep", StockCount = 125 };
            Plate bluePlate = new Plate() { Id = 0, Name = "Porslinhult", Type = "Flat", StockCount = 321 };

            stock.AddItem((StockItem)appleJuice);
            stock.AddItem((StockItem)orangeJuice);
            stock.AddItem((StockItem)redPlate);
            stock.AddItem((StockItem)bluePlate);

            return stock;
        }
示例#2
0
        private void _InitialiseStock()
        {
            ActiveStock = _CreateDummyData();

            //for (int i = 0; i < stock.Length; i++)
            //{
            //    Console.WriteLine(stock.GetItem(i));
            //    Console.WriteLine("--------------");
            //}
        }