Beispiel #1
0
        private void BtnGetAllBidders_Click(object sender, System.EventArgs e)
        {
            try
            {
                LstHighBids.Items.Clear();

                GetAllBiddersCall   apicall = new GetAllBiddersCall(Context);
                OfferTypeCollection bids    = apicall.GetAllBidders(TxtItemId.Text, (GetAllBiddersModeCodeType)Enum.Parse(typeof(GetAllBiddersModeCodeType), CboCallMode.SelectedItem.ToString()));

                foreach (OfferType offer in bids)
                {
                    string[] listparams = new string[6];
                    listparams[0] = offer.Action.ToString();
                    listparams[1] = offer.User.UserID;
                    listparams[2] = offer.Currency.ToString();
                    listparams[3] = offer.MaxBid.Value.ToString();
                    listparams[4] = offer.Quantity.ToString();
                    listparams[5] = offer.TimeBid.ToString();

                    ListViewItem vi = new ListViewItem(listparams);
                    this.LstHighBids.Items.Add(vi);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public void GetAllBidders()
        {
            Assert.IsNotNull(TestData.NewItem, "Failed because no item available -- requires successful AddItem test");
            GetAllBiddersCall api = new GetAllBiddersCall(this.apiContext);

            api.ItemID   = TestData.NewItem.ItemID;
            api.CallMode = GetAllBiddersModeCodeType.ViewAll;
            // Make API call.
            OfferTypeCollection bidders = api.GetAllBidders(api.ItemID, api.CallMode);

            // No bidders for the new item.
            Assert.IsTrue(bidders == null || bidders.Count == 0);
        }
Beispiel #3
0
        static void Main(string[] args)
        {//{"AccessToken":""}
            var eBayToken = "";
            var context   = new ApiContext {
                ApiCredential = new ApiCredential {
                    eBayToken = eBayToken
                }, CallRetry = new CallRetry {
                    MaximumRetries = 5
                }
            };
            //GetApiAccessRulesCall apicall = new GetApiAccessRulesCall(context);
            //var rules = apicall.GetApiAccessRules();

            //GetItemCall apical2 = new GetItemCall(context);

            //var rules11 = apical2.GetItem("323269291886");

            var apical3  = new GetAllBiddersCall(context);
            var ssdsfsdf = apical3.GetAllBidders("323269291886", eBay.Service.Core.Soap.GetAllBiddersModeCodeType.ViewAll);
        }
Beispiel #4
0
        public IHttpActionResult GetSellerItems()
        {
            //[Step 1] Initialize eBay ApiContext object
            apiContext = GetApiContext();

            GetSellerListCall call = new GetSellerListCall(apiContext);

            call.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);
            call.Pagination = new PaginationType()
            {
                EntriesPerPage = 200
            };
            call.EndTimeFrom = DateTime.UtcNow.AddDays(-1);
            call.EndTimeTo   = DateTime.UtcNow.AddDays(30);

            call.IncludeWatchCount = true;

            ItemTypeCollection items = call.GetSellerList();

            foreach (ItemType item in items)
            {
                try
                {
                    List <ZohoLead> leads = new List <ZohoLead>();

                    GetMemberMessagesCall messages = new GetMemberMessagesCall(apiContext);
                    messages.GetMemberMessages(item.ItemID, MessageTypeCodeType.AskSellerQuestion, MessageStatusTypeCodeType.Unanswered);

                    foreach (MemberMessageExchangeType message in messages.MemberMessageList)
                    {
                        leads = GetMemberMessageLead(leads, item, message);
                    }

                    if (item.BestOfferEnabled)
                    {
                        GetBestOffersCall boCall = new GetBestOffersCall(apiContext);
                        boCall.GetBestOffers(item.ItemID, null, BestOfferStatusCodeType.All, new PaginationType()
                        {
                            EntriesPerPage = 200
                        });
                        foreach (BestOfferType offer in boCall.BestOfferList)
                        {
                            leads = GetBestOfferLead(leads, item, offer);
                        }
                    }

                    GetAllBiddersCall bidderCall = new GetAllBiddersCall(apiContext);
                    var bidders = bidderCall.GetAllBidders(item.ItemID, GetAllBiddersModeCodeType.ViewAll);
                    foreach (OfferType bidder in bidders)
                    {
                        leads = GetBidderLead(leads, item, bidder);
                    }

                    if (leads.Count > 0)
                    {
                        leads = GetLeadInformation(leads);
                        InsertZohoLeads(leads);
                    }
                }
                catch (Exception ex)
                {
                    Trace.TraceError(ex.Message);
                }
            }

            return(Ok());
        }