示例#1
0
        protected virtual MerchantName GetMerchantNameFromReader(IDataReader reader)
        {
            EntityConverter <MerchantName> merchantNameEntity = new EntityConverter <MerchantName>();
            MerchantName merchantName = merchantNameEntity.Convert(reader);

            return(merchantName);
        }
示例#2
0
        /// <summary>
        /// Gets the hash code for this object.
        /// </summary>
        /// <returns>
        /// The hash code for this object.
        /// </returns>
        public override int GetHashCode()
        {
            int result = PartnerMerchantId.GetHashCode()
                         + MerchantName.GetHashCode()
                         + ReimbursementTender.GetHashCode();

            return(result);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (entityId_ != null)
            {
                hash ^= EntityId.GetHashCode();
            }
            if (merchantId_ != null)
            {
                hash ^= MerchantId.GetHashCode();
            }
            if (MerchantName.Length != 0)
            {
                hash ^= MerchantName.GetHashCode();
            }
            if (Result != 0)
            {
                hash ^= Result.GetHashCode();
            }
            if (ProcessorBatchId != 0)
            {
                hash ^= ProcessorBatchId.GetHashCode();
            }
            if (TransactionCount != 0)
            {
                hash ^= TransactionCount.GetHashCode();
            }
            if (totalAmount_ != null)
            {
                hash ^= TotalAmount.GetHashCode();
            }
            if (createdAt_ != null)
            {
                hash ^= CreatedAt.GetHashCode();
            }
            hash ^= captures_.GetHashCode();
            hash ^= refunds_.GetHashCode();
            if (SequenceNumber != 0)
            {
                hash ^= SequenceNumber.GetHashCode();
            }
            return(hash);
        }
示例#4
0
        /// <summary>
        /// Gets the hash code for this object.
        /// </summary>
        /// <returns>
        /// The hash code for this object.
        /// </returns>
        /// <remarks>
        /// * CA2218:
        ///   * If two objects are equal in value based on the Equals override, they must both return the same value for calls
        ///     to GetHashCode.
        ///   * GetHashCode must be overridden whenever Equals is overridden.
        /// * It is fine if the value overflows.
        /// </remarks>
        public override int GetHashCode()
        {
            int result = GlobalId.GetHashCode() +
                         ParentDealId.GetHashCode() +
                         ProviderId.GetHashCode() +
                         MerchantId.GetHashCode() +
                         ProviderCategory.GetHashCode() +
                         StartDate.GetHashCode() +
                         EndDate.GetHashCode() +
                         Amount.GetHashCode() +
                         Count.GetHashCode() +
                         UserLimit.GetHashCode() +
                         MinimumPurchase.GetHashCode() +
                         MaximumDiscount.GetHashCode() +
                         DealStatusId.GetHashCode();

            if (MerchantName != null)
            {
                result += MerchantName.GetHashCode();
            }

            if (Currency != null)
            {
                result += Currency.GetHashCode();
            }

            if (DiscountSummary != null)
            {
                result += DiscountSummary.GetHashCode();
            }

            foreach (PartnerDealInfo partnerDealInfo in PartnerDealInfoList)
            {
                result += partnerDealInfo.GetHashCode();
            }

            if (DayTimeRestrictions != null)
            {
                result += DayTimeRestrictions.GetHashCode();
            }

            return(result);
        }
示例#5
0
 public override string ToString()
 {
     return($"{TransactionDate.ToString(Formats.DateFormat)} {MerchantName.PadRight(10)} {string.Format(Formats.DecimalFormat, Fee)}");
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (AccountId != null)
         {
             hashCode = hashCode * 59 + AccountId.GetHashCode();
         }
         if (TransactionId != null)
         {
             hashCode = hashCode * 59 + TransactionId.GetHashCode();
         }
         if (IsDetailAvailable != null)
         {
             hashCode = hashCode * 59 + IsDetailAvailable.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Status != null)
         {
             hashCode = hashCode * 59 + Status.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (PostingDateTime != null)
         {
             hashCode = hashCode * 59 + PostingDateTime.GetHashCode();
         }
         if (ValueDateTime != null)
         {
             hashCode = hashCode * 59 + ValueDateTime.GetHashCode();
         }
         if (ExecutionDateTime != null)
         {
             hashCode = hashCode * 59 + ExecutionDateTime.GetHashCode();
         }
         if (Amount != null)
         {
             hashCode = hashCode * 59 + Amount.GetHashCode();
         }
         if (Currency != null)
         {
             hashCode = hashCode * 59 + Currency.GetHashCode();
         }
         if (Reference != null)
         {
             hashCode = hashCode * 59 + Reference.GetHashCode();
         }
         if (MerchantName != null)
         {
             hashCode = hashCode * 59 + MerchantName.GetHashCode();
         }
         if (MerchantCategoryCode != null)
         {
             hashCode = hashCode * 59 + MerchantCategoryCode.GetHashCode();
         }
         if (BillerCode != null)
         {
             hashCode = hashCode * 59 + BillerCode.GetHashCode();
         }
         if (BillerName != null)
         {
             hashCode = hashCode * 59 + BillerName.GetHashCode();
         }
         if (Crn != null)
         {
             hashCode = hashCode * 59 + Crn.GetHashCode();
         }
         if (ApcaNumber != null)
         {
             hashCode = hashCode * 59 + ApcaNumber.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if BankingTransaction instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingTransaction to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingTransaction other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AccountId == other.AccountId ||
                     AccountId != null &&
                     AccountId.Equals(other.AccountId)
                     ) &&
                 (
                     TransactionId == other.TransactionId ||
                     TransactionId != null &&
                     TransactionId.Equals(other.TransactionId)
                 ) &&
                 (
                     IsDetailAvailable == other.IsDetailAvailable ||
                     IsDetailAvailable != null &&
                     IsDetailAvailable.Equals(other.IsDetailAvailable)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     PostingDateTime == other.PostingDateTime ||
                     PostingDateTime != null &&
                     PostingDateTime.Equals(other.PostingDateTime)
                 ) &&
                 (
                     ValueDateTime == other.ValueDateTime ||
                     ValueDateTime != null &&
                     ValueDateTime.Equals(other.ValueDateTime)
                 ) &&
                 (
                     ExecutionDateTime == other.ExecutionDateTime ||
                     ExecutionDateTime != null &&
                     ExecutionDateTime.Equals(other.ExecutionDateTime)
                 ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     Currency == other.Currency ||
                     Currency != null &&
                     Currency.Equals(other.Currency)
                 ) &&
                 (
                     Reference == other.Reference ||
                     Reference != null &&
                     Reference.Equals(other.Reference)
                 ) &&
                 (
                     MerchantName == other.MerchantName ||
                     MerchantName != null &&
                     MerchantName.Equals(other.MerchantName)
                 ) &&
                 (
                     MerchantCategoryCode == other.MerchantCategoryCode ||
                     MerchantCategoryCode != null &&
                     MerchantCategoryCode.Equals(other.MerchantCategoryCode)
                 ) &&
                 (
                     BillerCode == other.BillerCode ||
                     BillerCode != null &&
                     BillerCode.Equals(other.BillerCode)
                 ) &&
                 (
                     BillerName == other.BillerName ||
                     BillerName != null &&
                     BillerName.Equals(other.BillerName)
                 ) &&
                 (
                     Crn == other.Crn ||
                     Crn != null &&
                     Crn.Equals(other.Crn)
                 ) &&
                 (
                     ApcaNumber == other.ApcaNumber ||
                     ApcaNumber != null &&
                     ApcaNumber.Equals(other.ApcaNumber)
                 ));
        }