/// <summary>
        /// Returns true if InitiateTradeModel1 instances are equal
        /// </summary>
        /// <param name="other">Instance of InitiateTradeModel1 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InitiateTradeModel1 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     InputCoinType == other.InputCoinType ||
                     InputCoinType != null &&
                     InputCoinType.Equals(other.InputCoinType)
                     ) &&
                 (
                     OutputCoinType == other.OutputCoinType ||
                     OutputCoinType != null &&
                     OutputCoinType.Equals(other.OutputCoinType)
                 ) &&
                 (
                     OutputAddress == other.OutputAddress ||
                     OutputAddress != null &&
                     OutputAddress.Equals(other.OutputAddress)
                 ) &&
                 (
                     OutputMemo == other.OutputMemo ||
                     OutputMemo != null &&
                     OutputMemo.Equals(other.OutputMemo)
                 ) &&
                 (
                     RefundAddress == other.RefundAddress ||
                     RefundAddress != null &&
                     RefundAddress.Equals(other.RefundAddress)
                 ) &&
                 (
                     RefundMemo == other.RefundMemo ||
                     RefundMemo != null &&
                     RefundMemo.Equals(other.RefundMemo)
                 ) &&
                 (
                     InputAddressType == other.InputAddressType ||
                     InputAddressType != null &&
                     InputAddressType.Equals(other.InputAddressType)
                 ) &&
                 (
                     SessionToken == other.SessionToken ||
                     SessionToken != null &&
                     SessionToken.Equals(other.SessionToken)
                 ) &&
                 (
                     AffiliateId == other.AffiliateId ||
                     AffiliateId != null &&
                     AffiliateId.Equals(other.AffiliateId)
                 ));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns true if SimpleFixedPriceTradeInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of SimpleFixedPriceTradeInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SimpleFixedPriceTradeInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     InputAddress == other.InputAddress ||
                     InputAddress != null &&
                     InputAddress.Equals(other.InputAddress)
                     ) &&
                 (
                     InputCoinType == other.InputCoinType ||
                     InputCoinType != null &&
                     InputCoinType.Equals(other.InputCoinType)
                 ) &&
                 (
                     InputAmount == other.InputAmount ||
                     InputAmount != null &&
                     InputAmount.Equals(other.InputAmount)
                 ) &&
                 (
                     OutputAddress == other.OutputAddress ||
                     OutputAddress != null &&
                     OutputAddress.Equals(other.OutputAddress)
                 ) &&
                 (
                     OutputCoinType == other.OutputCoinType ||
                     OutputCoinType != null &&
                     OutputCoinType.Equals(other.OutputCoinType)
                 ) &&
                 (
                     OutputAmount == other.OutputAmount ||
                     OutputAmount != null &&
                     OutputAmount.Equals(other.OutputAmount)
                 ) &&
                 (
                     RefundAddress == other.RefundAddress ||
                     RefundAddress != null &&
                     RefundAddress.Equals(other.RefundAddress)
                 ) &&
                 (
                     ExpirationTime == other.ExpirationTime ||
                     ExpirationTime != null &&
                     ExpirationTime.Equals(other.ExpirationTime)
                 ) &&
                 (
                     FlatTransactionFeeInInputCoinType == other.FlatTransactionFeeInInputCoinType ||
                     FlatTransactionFeeInInputCoinType != null &&
                     FlatTransactionFeeInInputCoinType.Equals(other.FlatTransactionFeeInInputCoinType)
                 ));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns true if InitiateFixedPriceTradeModel1 instances are equal
        /// </summary>
        /// <param name="other">Instance of InitiateFixedPriceTradeModel1 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InitiateFixedPriceTradeModel1 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     InputCoinType == other.InputCoinType ||
                     InputCoinType != null &&
                     InputCoinType.Equals(other.InputCoinType)
                     ) &&
                 (
                     OutputCoinType == other.OutputCoinType ||
                     OutputCoinType != null &&
                     OutputCoinType.Equals(other.OutputCoinType)
                 ) &&
                 (
                     OutputAddress == other.OutputAddress ||
                     OutputAddress != null &&
                     OutputAddress.Equals(other.OutputAddress)
                 ) &&
                 (
                     DesiredOutputAmount == other.DesiredOutputAmount ||
                     DesiredOutputAmount != null &&
                     DesiredOutputAmount.Equals(other.DesiredOutputAmount)
                 ) &&
                 (
                     AllOrNothing == other.AllOrNothing ||
                     AllOrNothing != null &&
                     AllOrNothing.Equals(other.AllOrNothing)
                 ) &&
                 (
                     OutputMemo == other.OutputMemo ||
                     OutputMemo != null &&
                     OutputMemo.Equals(other.OutputMemo)
                 ) &&
                 (
                     RefundAddress == other.RefundAddress ||
                     RefundAddress != null &&
                     RefundAddress.Equals(other.RefundAddress)
                 ) &&
                 (
                     InputAddressType == other.InputAddressType ||
                     InputAddressType != null &&
                     InputAddressType.Equals(other.InputAddressType)
                 ) &&
                 (
                     RefundMemo == other.RefundMemo ||
                     RefundMemo != null &&
                     RefundMemo.Equals(other.RefundMemo)
                 ));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Returns true if SimpleTradeInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of SimpleTradeInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SimpleTradeInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     InputAddress == other.InputAddress ||
                     InputAddress != null &&
                     InputAddress.Equals(other.InputAddress)
                     ) &&
                 (
                     InputMemo == other.InputMemo ||
                     InputMemo != null &&
                     InputMemo.Equals(other.InputMemo)
                 ) &&
                 (
                     InputCoinType == other.InputCoinType ||
                     InputCoinType != null &&
                     InputCoinType.Equals(other.InputCoinType)
                 ) &&
                 (
                     OutputAddress == other.OutputAddress ||
                     OutputAddress != null &&
                     OutputAddress.Equals(other.OutputAddress)
                 ) &&
                 (
                     OutputCoinType == other.OutputCoinType ||
                     OutputCoinType != null &&
                     OutputCoinType.Equals(other.OutputCoinType)
                 ) &&
                 (
                     RefundAddress == other.RefundAddress ||
                     RefundAddress != null &&
                     RefundAddress.Equals(other.RefundAddress)
                 ) &&
                 (
                     FlatTransactionFeeInInputCoinType == other.FlatTransactionFeeInInputCoinType ||
                     FlatTransactionFeeInInputCoinType != null &&
                     FlatTransactionFeeInInputCoinType.Equals(other.FlatTransactionFeeInInputCoinType)
                 ));
        }
Exemplo n.º 5
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 (InputAddress != null)
         {
             hashCode = hashCode * 59 + InputAddress.GetHashCode();
         }
         if (InputCoinType != null)
         {
             hashCode = hashCode * 59 + InputCoinType.GetHashCode();
         }
         if (InputAmount != null)
         {
             hashCode = hashCode * 59 + InputAmount.GetHashCode();
         }
         if (OutputAddress != null)
         {
             hashCode = hashCode * 59 + OutputAddress.GetHashCode();
         }
         if (OutputCoinType != null)
         {
             hashCode = hashCode * 59 + OutputCoinType.GetHashCode();
         }
         if (OutputAmount != null)
         {
             hashCode = hashCode * 59 + OutputAmount.GetHashCode();
         }
         if (RefundAddress != null)
         {
             hashCode = hashCode * 59 + RefundAddress.GetHashCode();
         }
         if (ExpirationTime != null)
         {
             hashCode = hashCode * 59 + ExpirationTime.GetHashCode();
         }
         if (FlatTransactionFeeInInputCoinType != null)
         {
             hashCode = hashCode * 59 + FlatTransactionFeeInInputCoinType.GetHashCode();
         }
         return(hashCode);
     }
 }
 /// <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 (InputCoinType != null)
         {
             hashCode = hashCode * 59 + InputCoinType.GetHashCode();
         }
         if (OutputCoinType != null)
         {
             hashCode = hashCode * 59 + OutputCoinType.GetHashCode();
         }
         if (OutputAddress != null)
         {
             hashCode = hashCode * 59 + OutputAddress.GetHashCode();
         }
         if (OutputMemo != null)
         {
             hashCode = hashCode * 59 + OutputMemo.GetHashCode();
         }
         if (RefundAddress != null)
         {
             hashCode = hashCode * 59 + RefundAddress.GetHashCode();
         }
         if (RefundMemo != null)
         {
             hashCode = hashCode * 59 + RefundMemo.GetHashCode();
         }
         if (InputAddressType != null)
         {
             hashCode = hashCode * 59 + InputAddressType.GetHashCode();
         }
         if (SessionToken != null)
         {
             hashCode = hashCode * 59 + SessionToken.GetHashCode();
         }
         if (AffiliateId != null)
         {
             hashCode = hashCode * 59 + AffiliateId.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 7
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 (InputCoinType != null)
         {
             hashCode = hashCode * 59 + InputCoinType.GetHashCode();
         }
         if (OutputCoinType != null)
         {
             hashCode = hashCode * 59 + OutputCoinType.GetHashCode();
         }
         if (OutputAddress != null)
         {
             hashCode = hashCode * 59 + OutputAddress.GetHashCode();
         }
         if (DesiredOutputAmount != null)
         {
             hashCode = hashCode * 59 + DesiredOutputAmount.GetHashCode();
         }
         if (AllOrNothing != null)
         {
             hashCode = hashCode * 59 + AllOrNothing.GetHashCode();
         }
         if (OutputMemo != null)
         {
             hashCode = hashCode * 59 + OutputMemo.GetHashCode();
         }
         if (RefundAddress != null)
         {
             hashCode = hashCode * 59 + RefundAddress.GetHashCode();
         }
         if (InputAddressType != null)
         {
             hashCode = hashCode * 59 + InputAddressType.GetHashCode();
         }
         if (RefundMemo != null)
         {
             hashCode = hashCode * 59 + RefundMemo.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// 退货地址回调
        /// </summary>
        /// <param name="result"></param>
        public static void OrderRefundAddress(RefundAddress result)
        {
            try
            {
                Guid orderId;
                Guid.TryParse(result.orderId, out orderId);
                LogHelper.Debug("进入 YXOrderHelper.OrderRefundAddress,Input:" + JsonConvert.SerializeObject(result));
                var orderRefund = OrderRefundAfterSales.ObjectSet().Where(_ => _.ApplyId == result.applyId).FirstOrDefault();
                if (orderRefund == null)
                {
                    LogHelper.Error("YXOrderHelper.OrderRefundAddress 失败,未找到退款记录,Input:" + JsonConvert.SerializeObject(result));
                }
                var refundResult = OrderHelper.ApproveOrderRefundAfterSales(orderId, orderRefund.OrderItemId ?? Guid.Empty);
                if (refundResult.ResultCode != 0)
                {
                    // 失败
                    LogHelper.Error("YXOrderHelper.OrderRefundAddress 失败," + refundResult.Message + ",Input:" + JsonConvert.SerializeObject(result));
                }
                else
                {
                    ContextSession contextSession = ContextFactory.CurrentThreadContext;
                    orderRefund.RefundReturnType         = result.type;
                    orderRefund.RefundReceiveFullAddress = result.returnAddr.fullAddress;
                    orderRefund.RefundReceiveMobile      = result.returnAddr.mobile;
                    orderRefund.RefundReceiveName        = result.returnAddr.name;
                    //orderRefund.EntityState = System.Data.EntityState.Added;
                    contextSession.SaveObject(orderRefund);
                    contextSession.SaveChanges();
                }

                //if (result.applyId.StartsWith("s"))
                //{
                //    // 售后
                //    var orderRefund = OrderRefundAfterSales.FindByID(new Guid(result.applyId.Substring(1)));
                //    if (orderRefund == null)
                //    {
                //        LogHelper.Error("YXOrderHelper.OrderRefundAddress 失败,未找到退款记录,Input:" + JsonConvert.SerializeObject(result));
                //    }
                //    var refundResult = OrderHelper.ApproveOrderRefund(orderId, orderRefund.OrderItemId ?? Guid.Empty);
                //    if (refundResult.ResultCode != 0)
                //    {
                //        // 失败
                //        LogHelper.Error("YXOrderHelper.OrderRefundAddress 失败," + refundResult.Message + ",Input:" + JsonConvert.SerializeObject(result));
                //    }
                //}
                //else
                //{
                //    //售前
                //    var orderRefund = OrderRefund.FindByID(new Guid(result.applyId));
                //    if (orderRefund == null)
                //    {
                //        LogHelper.Error("YXOrderHelper.OrderRefundAddress 失败,未找到退款记录,Input:" + JsonConvert.SerializeObject(result));
                //    }
                //    var refundResult = OrderHelper.ApproveOrderRefundAfterSales(orderId, orderRefund.OrderItemId ?? Guid.Empty);
                //    if (refundResult.ResultCode != 0)
                //    {
                //        // 失败
                //        LogHelper.Error("YXOrderHelper.OrderRefundAddress 失败," + refundResult.Message + ",Input:" + JsonConvert.SerializeObject(result));
                //    }
                //}
            }
            catch (Exception ex)
            {
                LogHelper.Error("YXOrderHelper.OrderRefundAddress 异常,Input:" + JsonConvert.SerializeObject(result), ex);
            }
        }