Exemplo n.º 1
0
        public FormItemEdit(OrderItem orderItem) : this()
        {
            this.OrderItem = orderItem;
            this.ItemBindingSource.DataSource = orderItem;
            List <Goods> goods = GoodsService.GetAll();

            if (goods.Count == 0)
            {
                GoodsService.Add(new Goods("apple", 100.0));
                GoodsService.Add(new Goods("egg", 200.0));
                goods = GoodsService.GetAll();
            }
            goodsBindingSource.DataSource = goods;
        }