示例#1
0
        public void saveCartChecks(ItemModel obj)
        {
            // add new item to the cart
            if (Singleton.getCart().CartItemList.Where(x => x.Item.ID == obj.Item.ID).Count() == 0)
            {
                var cart_itemModel = new Cart_itemModel();
                obj.IsItemSelected         = true;
                cart_itemModel.Item        = obj.Item;
                cart_itemModel.TxtQuantity = 1.ToString();
                Singleton.getCart().AddItem(cart_itemModel);
            }

            // delete item from the cart
            else
            {
                // unselect item
                var itemFound = ItemModelList.Where(x => x.Item.ID == obj.Item.ID).FirstOrDefault();
                if (itemFound != null)
                {
                    itemFound.IsItemSelected = false;
                }

                foreach (var cart_itemModel in Singleton.getCart().CartItemList.Where(x => x.Item.ID == obj.Item.ID && x.TxtRef == obj.TxtRef).ToList())
                {
                    Singleton.getCart().RemoveItem(cart_itemModel);
                }
            }
            GoToQuoteCommand.raiseCanExecuteActionChanged();
        }
示例#2
0
    public int[] AmmoBackpackMax; // store the maximum value of carried ammo here.

    //public ItemData emptyItem;

    public void Start()
    {
        for (int i = 0; i < inventoryListSlotRestriction.Length; i++)
        {
            inventoryList.Add(emptyItem.gameObject);
            ItemModelList.Add(emptyItem.gameObject);
        }
    }
示例#3
0
 public ItemModelList GetAll()
 {
     ItemModelList items = new ItemModelList();
     // MOCKUP: Generate data for return
     for (int i = 0; i < 100; i++)
     {
         items.Add(new ItemModel() {Id=i,ItemName="item "+i,Description="Desc "+i, Cost=i, Price= i+1, Qty=i });
     }
     return items;
 }
示例#4
0
        public ItemModelList GetAll()
        {
            ItemModelList items = new ItemModelList();

            // MOCKUP: Generate data for return
            for (int i = 0; i < 100; i++)
            {
                items.Add(new ItemModel()
                {
                    Id = i, ItemName = "item " + i, Description = "Desc " + i, Cost = i, Price = i + 1, Qty = i
                });
            }
            return(items);
        }
示例#5
0
        public async Task loadItemsAsync()
        {
            await Task.Factory.StartNew(() =>
            {
                Singleton.getDialogueBox().showSearch(ConfigurationManager.AppSettings["load_message"]);

                // if not in searching mode
                if (!_isSearchResult)
                {
                    var itemFoundList = Bl.BlItem.GetItemData(999);
                    ProviderList      = providerListToModelList(Bl.BlItem.GetProviderData(999));
                    FamilyList        = new HashSet <string>(itemFoundList.Select(x => x.Type_sub).ToList());
                    BrandList         = new HashSet <string>(itemFoundList.Select(x => x.Type).ToList());

                    // close items picture file before reloading
                    foreach (var itemModel in ItemModelList)
                    {
                        if (itemModel.Image != null)
                        {
                            itemModel.Image.closeImageSource();
                        }
                    }

                    // loading items
                    ItemModelList = itemListToModelViewList(itemFoundList);

                    // update the selected item in case of a refresh
                    if (SelectedItemModel != null && SelectedItemModel.Item.ID != 0)
                    {
                        SelectedItemModel = ItemModelList.Where(x => x.TxtID == SelectedItemModel.TxtID).SingleOrDefault();
                        if (SelectedItemModel != null)
                        {
                            SelectedItemModel.PropertyChanged -= ItemDetailViewModel.onItemNameChange_generateReference;
                            SelectedItemModel.PropertyChanged += ItemDetailViewModel.onItemNameChange_generateReference;
                        }
                    }
                    onPropertyChange("CurrencyModel");
                    _cbSearchCriteriaList = new List <string>();
                }
                _isSearchResult = false;
                Singleton.getDialogueBox().IsDialogOpen = false;
            });
        }
示例#6
0
 public ItemManager()
 {
     itemList = XmlLoader.LoadFromXmlResource <ItemModelList>("Xml/Item");
     itemList.GenerateDictionary();
     Debug.Log("Successfully loaded items: " + itemList.list.Count);
 }
示例#7
0
 public int Count()
 {
     ItemModelList obj = new ItemModelList();
     return obj.Count();
 }
示例#8
0
        public int Count()
        {
            ItemModelList obj = new ItemModelList();

            return(obj.Count());
        }