public decimal GetTotalPriceOf(Types.PriceValue priceType) { switch (priceType) { case Types.PriceValue.InitialBoughtValue: case Types.PriceValue.CurrentValue: case Types.PriceValue.CurrentProfitLoss: return(HoldingCoins.Sum(x => x.GetPrice(priceType))); case Types.PriceValue.InitialSoldValue: case Types.PriceValue.SoldEndValue: case Types.PriceValue.SoldProfitLoss: return(SoldCoins.Sum(x => x.GetPrice(priceType))); } return(0); }
public decimal GetPrice(Types.PriceValue priceType) { switch (priceType) { case Types.PriceValue.InitialBoughtValue: case Types.PriceValue.InitialSoldValue: return(GetGeneratedInitialPricePaid()); case Types.PriceValue.CurrentValue: return(GetGeneratedCurrentHoldingValue()); case Types.PriceValue.CurrentProfitLoss: return(GetGeneratedProfitInCurrency()); case Types.PriceValue.SoldEndValue: return(GetGeneratedSoldEndValue()); case Types.PriceValue.SoldProfitLoss: return((GetGeneratedSoldEndValue() - GetGeneratedInitialPricePaid()).ToDecimalPrecision(8)); } return(0); }
public string ViewPrice(Types.PriceValue priceType) { return(ToCurrencyDisplayFormat(GetPrice(priceType))); }