コード例 #1
0
ファイル: Amount.cs プロジェクト: HydAu/sitecore8ecommerce
 /// <summary>
 /// Asserts the currencies.
 /// </summary>
 /// <param name="a1">The amount1.</param>
 /// <param name="a2">The amount2.</param>
 /// <param name="operationName">The operationName.</param>
 /// <exception cref="System.ArgumentException"></exception>
 private static void AssertCurrencies(Amount a1, Amount a2, string operationName, string operationSign)
 {
   if (string.Compare(a1.CurrencyID, a2.CurrencyID, StringComparison.OrdinalIgnoreCase) != 0)
   {
     throw new ArgumentException(string.Format("Cannot {0} amounts in different currencies: {1} {2} {3}.", operationName, a1, operationSign, a2));
   }
 }
コード例 #2
0
ファイル: Amount.cs プロジェクト: HydAu/sitecore8ecommerce
 /// <summary>
 /// Equalses the specified other.
 /// </summary>
 /// <param name="other">The other.</param>
 /// <returns>The result.</returns>
 protected bool Equals(Amount other)
 {
   return string.Equals(this.currencyId, other.currencyId, StringComparison.InvariantCultureIgnoreCase) && this.value == other.value;
 }