Exemplo n.º 1
0
        public void Update(int RowID, int id, int qty, double price)
        {
            SItem Item = _items[RowID];

            Item.id     = id;
            Item.qty    = qty;
            Item.price  = price;
            _lastUpdate = DateTime.Now;
        }
Exemplo n.º 2
0
        public void Insert(int id, double price, int qty, string name, string image)
        {
            int ItemIndex = ItemIndexOfID(id);

            if (ItemIndex == -1)
            {
                SItem NewItem = new SItem();
                NewItem.id    = id;
                NewItem.qty   = qty;
                NewItem.price = price;
                NewItem.name  = name;
                NewItem.image = image;
                _items.Add(NewItem);
            }
            else
            {
                _items[ItemIndex].qty += 1;
            }
            _lastUpdate = DateTime.Now;
        }