private void SetGrid(NeedClass _needClass) { GameObject item = GameObject.Instantiate(NeedItem) as GameObject; NeedItem n = item.AddComponent <NeedItem>(); n.id = _needClass.id; n.imageTr = ImageTr; item.transform.Find("Image").GetComponent <Image>().sprite = SpritesManager.Instance.GetSprite(_needClass.id); item.transform.SetParent(NeedGrid); item.transform.localScale = new Vector3(1, 1, 1); item.transform.Find("Count").GetComponent <Text>().text = _needClass.count.ToString(); }
public async Task AddNeedItem(Guid needId, string link, string name, double price, string picture, string platformName) { Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); var NeedItem = new NeedItem { NeedId = needId, Link = link, Name = name, Price = (decimal)price, Picture = picture, PlatformName = platformName, }; await Context.AddAsync(NeedItem); NeedItem.Need.TotalCharge += NeedItem.Price; await Context.SaveChangesAsync(); }
public async Task AddItemOnDBAndFixTotalCharge(long needId, string link, string name, decimal price, string picture, string platformName) { var NeedItem = new NeedItem { NeedId = needId, Link = link, Name = name, Price = price, Picture = picture, PlatformName = platformName, IsRemoved = false, IsWrong = false }; await Context.AddAsync(NeedItem); NeedItem.Need.TotalCharge += NeedItem.Price; await Context.SaveChangesAsync(); }