示例#1
0
        protected override void RemoveItem(int index)
        {
            ActiveInventoryObject item = this[index];

            UPCDictionary.Remove(item.UPC.ToUpperInvariant());
            SKUDictionary.Remove(item.SKU.ToUpperInvariant());
            ProductIDDictionary.Remove(item.ProductID);
            item.UnSubscribeToChangeEvents(item_UPCChanged, item_SKUChanged);
            base.RemoveItem(index);
            TotalInvested -= (item.WholeSalePrice + item.AdditionalOverhead) * item.Quantity;
        }
示例#2
0
        void item_SKUChanged(object sender, ItemChangedEventArgs e)
        {
            string key = e.OldValue as string;

            if (!string.IsNullOrEmpty(key))
            {
                key = key.ToUpperInvariant();
                int index = SKUDictionary[key];
                SKUDictionary.Remove(key);
                key = e.NewValue as string;
                AddSKUItem(key, index);
            }
        }