private void onSearchBox_Enter_ItemSelected(int typeID, string name) { EnterInventory_Item.typeID = typeID; if (DataManager.QueryInventory(EnterInventory_Item) != null) { updateInventoryItem(EnterInventory_Item); } ItemName.Text = name; textBox4.Text = typeID.ToString(); var priceS = PriceService.GetPrice(typeID); float sell = priceS.sell.min; float buy = priceS.buy.max; SellPrice.Text = sell.ToString("###,###"); BuyPrice.Text = buy.ToString("###,###"); }
public void UpdateOREPrice(bool isBuyPrice) { foreach (var kv in oreDictionary.ORE_Dictionary) { if (useFullORE || kv.Value.isMain) { var price = PriceService.GetPrice(kv.Value.typeID); if (isBuyPrice) { kv.Value.price = (int)price.buy.max; } else { kv.Value.price = (int)price.sell.min; } } } }
private void updateBlueprintInfo() { Production_Materials_List.BeginUpdate(); int index = 0; int outNumber = 0; int production_Number = 1; int save = 0; float cost = 0; bool canProduction = true; if (int.TryParse(Production_Number.Text, out outNumber)) { if (outNumber == 0) { outNumber = 1; } production_Number = outNumber; } if (int.TryParse(Production_BlueprintSave.Text, out outNumber)) { save += outNumber; } if (int.TryParse(Production_BuildingsSave.Text, out outNumber)) { save += outNumber; } if (int.TryParse(Production_BlueprintCost.Text, out outNumber)) { cost += outNumber; } if (int.TryParse(Production_InventCost.Text, out outNumber)) { cost += outNumber; } if (int.TryParse(Production_BuildingsCost.Text, out outNumber)) { cost += outNumber; } cost = cost / production_Number; foreach (ListViewItem item in Production_Materials_List.Items) { EVEItem eveItem = Production_Materials_EVEList[index]; DataManager.QueryInventory(eveItem); int number = (int)Math.Round(eveItem.request_quantity * ((100 - save) * 0.01f)); float market_price = PriceService.GetPrice(eveItem.typeID).sell.min; item.SubItems[1].Text = (number * production_Number).ToString(); item.SubItems[2].Text = (eveItem.number).ToString(); if (number * production_Number > eveItem.number) { item.ForeColor = Color.Red; canProduction = false; } else { item.ForeColor = Color.Black; } item.SubItems[3].Text = (eveItem.price).ToString(); item.SubItems[4].Text = (market_price).ToString(); if (eveItem.number > 0) { cost += number * eveItem.price; } else { cost += number * market_price; } index++; } Production_Materials_List.EndUpdate(); var priceS = PriceService.GetPrice(Production_Blueprint.targetID); float sell = priceS.sell.min; float buy = priceS.buy.max; Production_SingleCost.Text = cost.ToString("###,###"); Production_Cost.Text = (cost * production_Number).ToString("###,###"); Production_Sell.Text = sell.ToString("###,###"); Production_Buy.Text = buy.ToString("###,###"); Production_SingleProfit.Text = (sell - cost).ToString("###,###"); Production_Profit.Text = ((sell - cost) * production_Number).ToString("###,###"); Production.Enabled = canProduction; }