private void BtnReviseItem_Click(object sender, System.EventArgs e) { try { TxtItemId.Text = ""; TxtListingFee.Text = ""; BtnGetItem.Visible = false; // Populate the Item ItemType item = new ItemType(); item.ItemID = TxtReviseItemId.Text; CurrencyCodeType currencyCode = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site); if (TxtTitle.Text.Length > 0) { item.Title = this.TxtTitle.Text; } if (TxtDescription.Text.Length > 0) { item.Description = this.TxtDescription.Text; } if (CboDuration.SelectedIndex != -1) { item.ListingDuration = CboDuration.SelectedItem.ToString(); } if (TxtStartPrice.Text.Length > 0) { item.StartPrice = new AmountType(); item.StartPrice.currencyID = currencyCode; item.StartPrice.Value = Double.Parse(this.TxtStartPrice.Text, NumberStyles.Currency); } if (TxtReservePrice.Text.Length > 0) { item.ReservePrice = new AmountType(); item.ReservePrice.currencyID = currencyCode; item.ReservePrice.Value = Double.Parse(this.TxtReservePrice.Text, NumberStyles.Currency); } if (TxtBuyItNowPrice.Text.Length > 0) { item.BuyItNowPrice = new AmountType(); item.BuyItNowPrice.currencyID = currencyCode; item.BuyItNowPrice.Value = Double.Parse(this.TxtBuyItNowPrice.Text, NumberStyles.Currency); } if (CboEnableBestOffer.SelectedIndex != -1) { item.BestOfferDetails = new BestOfferDetailsType(); item.BestOfferDetails.BestOfferEnabled = Boolean.Parse(CboEnableBestOffer.SelectedItem.ToString()); } StringCollection deletedFields = new StringCollection(); if (ChkPayPalEmailAddress.Checked) deletedFields.Add ("Item.payPalEmailAddress"); if (ChkApplicationData.Checked) deletedFields.Add ("Item.applicationData"); ReviseItemCall apicall = new ReviseItemCall(Context); if (ListPictures.Items.Count > 0) { apicall.PictureFileList = new StringCollection(); item.PictureDetails = new PictureDetailsType(); item.PictureDetails.PhotoDisplay = (PhotoDisplayCodeType) Enum.Parse(typeof(PhotoDisplayCodeType), CboPicDisplay.SelectedItem.ToString()); } foreach (string pic in ListPictures.Items) { apicall.PictureFileList.Add(pic); } apicall.DeletedFieldList = deletedFields; apicall.ReviseItem(item, deletedFields, false); TxtItemId.Text = item.ItemID; FeeTypeCollection fees = apicall.FeeList; BtnGetItem.Visible = true; foreach (FeeType fee in fees) { if (fee.Name == "ListingFee") { TxtListingFee.Text = fee.Fee.Value.ToString(); break; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
static DateTime UpdateItem(string ItemId, string ItemSkU) { var apiContext = eBayServiceSettingHelper.GetApiContext(); ReviseItemCall apicall = new ReviseItemCall(apiContext); if (string.IsNullOrEmpty(ItemId) == true) // if item not provided try lookup by sku from ebay { ItemType itemOnline = null; itemOnline = GetItembySku(ItemSkU);// get thay use get item method by passing sku if (itemOnline == null)// try get that from Active item { itemOnline = getITembySkuUsingActiveITems(ItemSkU); } ItemId = itemOnline.ItemID; } //Note when update item pas itemtype then asign the ItemId value that all use the method GetItembyId(Itemid); to get ebay item by sku ItemType item = new ItemType(); item.ItemID = ItemId; item.SKU = ItemSkU; //item.InventoryTrackingMethod = InventoryTrackingMethodCodeType.SKU; var t = apicall.ReviseItem(item, null, false); return t; }
private string modifyItem(string itemId,string SKU,ushort quantity) { string returnId = "-1"; ItemType item = new ItemType(); item.SKU = SKU; item.ItemID = itemId; item.Quantity = quantity; StringCollection deleteFieldList = new StringCollection(); ReviseItemCall apiCall = new ReviseItemCall(context); apiCall.ReviseItem(item, deleteFieldList); returnId = apiCall.ItemID; return returnId; }