示例#1
0
		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);
		}
示例#2
0
		public Transaction(int pk, DateTime dtm, Money amount)
		{
			this.pk = pk;
			this.dtm = dtm;
			this.amount = amount;
		}