public void ItemtempDelete(int id) { Itemtemp itemtemp = itemtemp_repo.Get(d => d.id == id); itemtemp_repo.Delete(itemtemp); SubmitChanges(); }
public mItemTemp ItemtempUpdate(mItemTemp upitem) { Itemtemp item = itemtemp_repo.Get(d => d.id == upitem.Id); upitem.ToDb(item); SubmitChanges(); return(new mItemTemp(item)); }
public int ItemtempAdd(mItemTemp itemtemp) { Itemtemp newitem = new Itemtemp(); itemtemp_repo.Add(itemtemp.ToDb(newitem)); SubmitChanges(); return(newitem.id); }
public mItemTemp(Itemtemp it) { Id = it.id; Act = (eAct)it.act; Name = it.name; ToHtml = it.toHtml; Props = it.props; }
public void Setup(Itemtemp currentItem, ShopScrollList currentScrollList) { item = currentItem; nameLabel.text = item.itemName; priceLabel.text = item.price.ToString(); iconImage.sprite = item.icon; scrollList = currentScrollList; }
private void RemoveItem(Itemtemp itemToRemove, ShopScrollList shopList) { for (int i = shopList.itemList.Count - 1; i >= 0; i--) { if (shopList.itemList[i] == itemToRemove) { shopList.itemList.RemoveAt(i); } } }
public void TryTransferItemToOtherShop(Itemtemp item) { if (otherShop.gold >= item.price) { gold += item.price; otherShop.gold -= item.price; AddItem(item, otherShop); RemoveItem(item, this); RefreshDisplay(); otherShop.RefreshDisplay(); } }
private void AddButtons() { for (int i = 0; i < itemList.Count; i++) { Itemtemp item = itemList[i]; GameObject newButton = buttonObjectPool.GetObject(); newButton.transform.SetParent(contentPanel, false); SampleButton sampleButton = newButton.GetComponent <SampleButton>(); sampleButton.Setup(item, this); } }
public Itemtemp ToDb(Itemtemp db) { if (!string.IsNullOrEmpty(Name)) { db.name = Name; } if (!string.IsNullOrEmpty(ToHtml)) { db.toHtml = ToHtml; } if (!string.IsNullOrEmpty(Props)) { db.props = Props; } db.act = (int)Act; return(db); }
private void AddItem(Itemtemp itemToAdd, ShopScrollList shopList) { shopList.itemList.Add(itemToAdd); }
public mItemTemp ItemtempGet(int id) { Itemtemp item = itemtemp_repo.Get(d => d.id == id); return(new mItemTemp(item)); }