Пример #1
0
 public PaymentOffer(
     decimal exchangeRateIncludingMargin,
     Money paymentValue)
 {
     this.ExchangeRateIncludingMargin = exchangeRateIncludingMargin;
     this.PaymentValue = paymentValue;
 }
Пример #2
0
 public OrderEntry(
     OrderEntryType type,
     Money value,
     DateTimeOffset timestamp)
 {
     this.Type = type;
     this.Value = value;
     this.Timestamp = timestamp;
 }
Пример #3
0
        private Money DetermineNetPaymentsValue()
        {
            var _accumulatorSeed = new Money(this.Entries.First().Value.Currency, 0M);

            return this.c_entries
                .Aggregate(
                    _accumulatorSeed,
                    (accumulatedValue, entry) =>
                        {
                            if (entry.Type == OrderEntryType.Debit) { return accumulatedValue + entry.Value; }
                            return accumulatedValue - entry.Value;
                        });
        }
Пример #4
0
 private static void EnsureCommonOperatorPreConditionsAreSatisfied(
     Money value1,
     Money value2)
 {
     ESInv.DBC.Ensure.That(value1 != null, "value 1 cannot be null");
     ESInv.DBC.Ensure.That(value2 != null, "value 2 cannot be null");
     ESInv.DBC.Ensure.That(value1.Currency == value2.Currency, "Currencies must be the same");
 }