public void SwitchCurrency(CurrencyUnit unit) { ICurrencyService srv = CurrencyServiceFactory.NextInstance; this.balance = srv.ConvertAmount(this.balance, this.unit, unit); this.unit = unit; }
public decimal GetRate(CurrencyUnit unit) { return unit.Rate; }
public decimal ConvertAmount(decimal amount, CurrencyUnit from, CurrencyUnit to) { return amount / from.Rate * to.Rate; }
public Account(CurrencyUnit unit) { this.unit = unit; }
public decimal GetRate(CurrencyUnit unit) { return(unit.Rate); }
public decimal ConvertAmount(decimal amount, CurrencyUnit from, CurrencyUnit to) { return(amount / from.Rate * to.Rate); }