Пример #1
0
 public void Read(TProtocol iprot)
 {
     TField field;
     iprot.ReadStructBegin();
     while (true)
     {
       field = iprot.ReadFieldBegin();
       if (field.Type == TType.Stop) {
     break;
       }
       switch (field.ID)
       {
     case 0:
       if (field.Type == TType.Struct) {
     Success = new GeteBayOrderResponse();
     Success.Read(iprot);
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     case 1:
       if (field.Type == TType.Struct) {
     Te = new CBT.GEP.Thrift.Common.ThriftException();
     Te.Read(iprot);
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     default:
       TProtocolUtil.Skip(iprot, field.Type);
       break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }
Пример #2
0
        private eBayOrderT ConvertToeBayOrderT(GeteBayOrderResponse r)
        {
            DateTime? paymentDt = null;
            if (r.Response.CheckoutDate != null && r.Response.CheckoutDate != "")
            {
                paymentDt = DateTime.Parse(r.Response.CheckoutDate);
            }

            return new eBayOrderT
            {
                SiteId = r.Response.SiteID,
                TransactionId = r.Response.TransactionID,
                OrderId = r.Response.OrderID,
                ItemId = r.Response.ItemID,
                OrderCnt = r.Response.Quantity,
                OrderPrice = r.Response.Price,
                Currency = r.Response.PriceCurrency,
                DeliveryFee = r.Response.ShippingServiceCost,
                DeliveryFeeCurrency = r.Response.ShippingServiceCostCurrency,
                DeliveryCountryCode = r.Response.Country,
                DeliveryCountryName = r.Response.CountryName,
                BuyerId = r.Response.BuyerUserID,
                BuyerName = r.Response.BuyerName,
                BuyerTel = r.Response.BuyerPhone,
                BuyerFeedbackScore = r.Response.BuyerFeedbackScore,
                SellerId = r.Response.SellerUserID,
                TransportWay = r.Response.ShippingService,
                ReceiverName = r.Response.ShippingBuyerName,
                ReceiverTel = r.Response.ShippingBuyerPhone,
                ReceiverEmail = r.Response.BuyerEmail,
                ReceiverZipCode = r.Response.PostalCode,
                ReceiverAddress = r.Response.ShippingAddress,
                ReceiverState = r.Response.StateOrProvince,
                ReceiverCity = r.Response.CityName,
                ReceiverStreet1 = r.Response.Street1,
                ReceiverStreet2 = r.Response.Street2,
                OrderDt = DateTime.Parse(r.Response.CreatedDate),
                PaymentDt = paymentDt,
                ViewItemUrl = r.Response.ViewItemURL,
                ListingType = (EBayListingTypeEnum)Enum.Parse(typeof(EBayListingTypeEnum), r.Response.ListingType.ToString()),
                PaymentStatus = (EBayPaymentStatusEnum)Enum.Parse(typeof(EBayPaymentStatusEnum), r.Response.Status.ToString())
            };
        }