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(); }
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); } }
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; }
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); }
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; }); }
public ItemManager() { itemList = XmlLoader.LoadFromXmlResource <ItemModelList>("Xml/Item"); itemList.GenerateDictionary(); Debug.Log("Successfully loaded items: " + itemList.list.Count); }
public int Count() { ItemModelList obj = new ItemModelList(); return obj.Count(); }
public int Count() { ItemModelList obj = new ItemModelList(); return(obj.Count()); }