Exemple #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is Card other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((CardBrand == null && other.CardBrand == null) || (CardBrand?.Equals(other.CardBrand) == true)) &&
                   ((Last4 == null && other.Last4 == null) || (Last4?.Equals(other.Last4) == true)) &&
                   ((ExpMonth == null && other.ExpMonth == null) || (ExpMonth?.Equals(other.ExpMonth) == true)) &&
                   ((ExpYear == null && other.ExpYear == null) || (ExpYear?.Equals(other.ExpYear) == true)) &&
                   ((CardholderName == null && other.CardholderName == null) || (CardholderName?.Equals(other.CardholderName) == true)) &&
                   ((BillingAddress == null && other.BillingAddress == null) || (BillingAddress?.Equals(other.BillingAddress) == true)) &&
                   ((Fingerprint == null && other.Fingerprint == null) || (Fingerprint?.Equals(other.Fingerprint) == true)) &&
                   ((CardType == null && other.CardType == null) || (CardType?.Equals(other.CardType) == true)) &&
                   ((PrepaidType == null && other.PrepaidType == null) || (PrepaidType?.Equals(other.PrepaidType) == true)) &&
                   ((Bin == null && other.Bin == null) || (Bin?.Equals(other.Bin) == true)));
        }
Exemple #2
0
 /// <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 (CustomerId != null)
         {
             hashCode = hashCode * 59 + CustomerId.GetHashCode();
         }
         if (ExpiryMonth != null)
         {
             hashCode = hashCode * 59 + ExpiryMonth.GetHashCode();
         }
         if (ExpiryYear != null)
         {
             hashCode = hashCode * 59 + ExpiryYear.GetHashCode();
         }
         if (BillingDetails != null)
         {
             hashCode = hashCode * 59 + BillingDetails.GetHashCode();
         }
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Last4 != null)
         {
             hashCode = hashCode * 59 + Last4.GetHashCode();
         }
         if (PaymentMethod != null)
         {
             hashCode = hashCode * 59 + PaymentMethod.GetHashCode();
         }
         if (Fingerprint != null)
         {
             hashCode = hashCode * 59 + Fingerprint.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (CvvCheck != null)
         {
             hashCode = hashCode * 59 + CvvCheck.GetHashCode();
         }
         if (AvsCheck != null)
         {
             hashCode = hashCode * 59 + AvsCheck.GetHashCode();
         }
         return(hashCode);
     }
 }
        public override int GetHashCode()
        {
            int hashCode = 805936600;

            if (BeginTime != null)
            {
                hashCode += BeginTime.GetHashCode();
            }

            if (EndTime != null)
            {
                hashCode += EndTime.GetHashCode();
            }

            if (SortOrder != null)
            {
                hashCode += SortOrder.GetHashCode();
            }

            if (Cursor != null)
            {
                hashCode += Cursor.GetHashCode();
            }

            if (LocationId != null)
            {
                hashCode += LocationId.GetHashCode();
            }

            if (Total != null)
            {
                hashCode += Total.GetHashCode();
            }

            if (Last4 != null)
            {
                hashCode += Last4.GetHashCode();
            }

            if (CardBrand != null)
            {
                hashCode += CardBrand.GetHashCode();
            }

            if (Limit != null)
            {
                hashCode += Limit.GetHashCode();
            }

            return(hashCode);
        }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is ListPaymentsRequest other &&
                   ((BeginTime == null && other.BeginTime == null) || (BeginTime?.Equals(other.BeginTime) == true)) &&
                   ((EndTime == null && other.EndTime == null) || (EndTime?.Equals(other.EndTime) == true)) &&
                   ((SortOrder == null && other.SortOrder == null) || (SortOrder?.Equals(other.SortOrder) == true)) &&
                   ((Cursor == null && other.Cursor == null) || (Cursor?.Equals(other.Cursor) == true)) &&
                   ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) &&
                   ((Total == null && other.Total == null) || (Total?.Equals(other.Total) == true)) &&
                   ((Last4 == null && other.Last4 == null) || (Last4?.Equals(other.Last4) == true)) &&
                   ((CardBrand == null && other.CardBrand == null) || (CardBrand?.Equals(other.CardBrand) == true)) &&
                   ((Limit == null && other.Limit == null) || (Limit?.Equals(other.Limit) == true)));
        }
Exemple #5
0
        public override int GetHashCode()
        {
            int hashCode = 1370361237;

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (CardBrand != null)
            {
                hashCode += CardBrand.GetHashCode();
            }

            if (Last4 != null)
            {
                hashCode += Last4.GetHashCode();
            }

            if (ExpMonth != null)
            {
                hashCode += ExpMonth.GetHashCode();
            }

            if (ExpYear != null)
            {
                hashCode += ExpYear.GetHashCode();
            }

            if (CardholderName != null)
            {
                hashCode += CardholderName.GetHashCode();
            }

            if (BillingAddress != null)
            {
                hashCode += BillingAddress.GetHashCode();
            }

            if (Fingerprint != null)
            {
                hashCode += Fingerprint.GetHashCode();
            }

            if (CardType != null)
            {
                hashCode += CardType.GetHashCode();
            }

            if (PrepaidType != null)
            {
                hashCode += PrepaidType.GetHashCode();
            }

            if (Bin != null)
            {
                hashCode += Bin.GetHashCode();
            }

            return(hashCode);
        }
Exemple #6
0
        void ReleaseDesignerOutlets()
        {
            if (AmountDue != null)
            {
                AmountDue.Dispose();
                AmountDue = null;
            }

            if (btnAddNewCard != null)
            {
                btnAddNewCard.Dispose();
                btnAddNewCard = null;
            }

            if (btnRetry != null)
            {
                btnRetry.Dispose();
                btnRetry = null;
            }

            if (DateOfTransaction != null)
            {
                DateOfTransaction.Dispose();
                DateOfTransaction = null;
            }

            if (IbsOrder != null)
            {
                IbsOrder.Dispose();
                IbsOrder = null;
            }

            if (lblAmountDue != null)
            {
                lblAmountDue.Dispose();
                lblAmountDue = null;
            }

            if (lblDate != null)
            {
                lblDate.Dispose();
                lblDate = null;
            }

            if (lblInstructions != null)
            {
                lblInstructions.Dispose();
                lblInstructions = null;
            }

            if (lblOrderId != null)
            {
                lblOrderId.Dispose();
                lblOrderId = null;
            }

            if (lblTransactionId != null)
            {
                lblTransactionId.Dispose();
                lblTransactionId = null;
            }

            if (TransactionId != null)
            {
                TransactionId.Dispose();
                TransactionId = null;
            }

            if (lblSelectedCreditCard != null)
            {
                lblSelectedCreditCard.Dispose();
                lblSelectedCreditCard = null;
            }

            if (lblNoCreditCard != null)
            {
                lblNoCreditCard.Dispose();
                lblNoCreditCard = null;
            }

            if (lblCompany != null)
            {
                lblCompany.Dispose();
                lblCompany = null;
            }

            if (Company != null)
            {
                Company.Dispose();
                Company = null;
            }

            if (lblLast4 != null)
            {
                lblLast4.Dispose();
                lblLast4 = null;
            }

            if (Last4 != null)
            {
                Last4.Dispose();
                Last4 = null;
            }
        }
Exemple #7
0
        /// <summary>
        /// Returns true if Card instances are equal
        /// </summary>
        /// <param name="other">Instance of Card to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CardSource other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CustomerId == other.CustomerId ||
                     CustomerId != null &&
                     CustomerId.Equals(other.CustomerId)
                     ) &&
                 (
                     ExpiryMonth == other.ExpiryMonth ||
                     ExpiryMonth != null &&
                     ExpiryMonth.Equals(other.ExpiryMonth)
                 ) &&
                 (
                     ExpiryYear == other.ExpiryYear ||
                     ExpiryYear != null &&
                     ExpiryYear.Equals(other.ExpiryYear)
                 ) &&
                 (
                     BillingDetails == other.BillingDetails ||
                     BillingDetails != null &&
                     BillingDetails.Equals(other.BillingDetails)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Last4 == other.Last4 ||
                     Last4 != null &&
                     Last4.Equals(other.Last4)
                 ) &&
                 (
                     PaymentMethod == other.PaymentMethod ||
                     PaymentMethod != null &&
                     PaymentMethod.Equals(other.PaymentMethod)
                 ) &&
                 (
                     Fingerprint == other.Fingerprint ||
                     Fingerprint != null &&
                     Fingerprint.Equals(other.Fingerprint)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     CvvCheck == other.CvvCheck ||
                     CvvCheck != null &&
                     CvvCheck.Equals(other.CvvCheck)
                 ) &&
                 (
                     AvsCheck == other.AvsCheck ||
                     AvsCheck != null &&
                     AvsCheck.Equals(other.AvsCheck)
                 ));
        }