/// <summary> /// Updates the pricing listing of an item /// </summary> /// <param name="item">The item to update the price for</param> public void UpdatePricing(Item item) { PricingJSON json = null; if (_prices.ContainsKey(item.ItemReaderText)) { json = _prices[item.ItemReaderText]; } else { json = new PricingJSON(); json.Name = item.ItemReaderText; _prices.Add(json.Name, json); } json.PricePDs = item.PricePDs; json.PriceMeseta = item.PriceMeseta; json.PriceCustom = item.PriceCustom; json.CustomCurrency = item.CustomCurrency; json.Notes = item.Notes; }
/// <summary> /// Checks the pricing listing and applies it to the item input /// </summary> /// <param name="item">The item to check the price for</param> public void ApplyPricing(Item item) { if (_prices.ContainsKey(item.ItemReaderText)) { PricingJSON json = _prices[item.ItemReaderText]; item.PricePDs = json.PricePDs; item.PriceMeseta = json.PriceMeseta; item.PriceCustom = json.PriceCustom; item.CustomCurrency = json.CustomCurrency; item.Notes = json.Notes; } else { PricingJSON json = new PricingJSON(); json.Name = item.ItemReaderText; json.PricePDs = item.PricePDs; json.PriceMeseta = item.PriceMeseta; json.PriceCustom = item.PriceCustom; json.CustomCurrency = item.CustomCurrency; json.Notes = item.Notes; _prices.Add(json.Name, json); } }