public double Convert(Money moneyIn, string currencyCodeOut) { if (moneyIn.Code == currencyCodeOut) return moneyIn.Amount; if ((moneyIn.Code == "USD") && (currencyCodeOut == "EUR")) return moneyIn.Amount * .85d; if ((moneyIn.Code == "EUR") && (currencyCodeOut == "USD")) return moneyIn.Amount / .85d; throw new Exception("CurrencyConverter can not convert from " + moneyIn.Code + " to " + currencyCodeOut); }
public Transaction(int pk, DateTime dtm, Money amount) { this.pk = pk; this.dtm = dtm; this.amount = amount; }