} //Ürün stok miktarı public void TemelOzellikleriGuncelle() { String strAppKey = "***"; String strAppSecret = "***"; String strProdSellerCode = ""; String strDiscountStartDate = ""; String strDiscountEndDate = ""; String strSellerStockCode = ""; double priceDec = 125.00; long productIdVal = 258491025; int discountTypeVal = 2; int discountValueVal = 25; int stockQuantityVal = 0; int stockIdVal = 0; double stockOptionPriceVal = 0; Authentication authentication = new Authentication(); authentication.appKey = strAppKey; authentication.appSecret = strAppSecret; SellerProductDiscount sellerProductDiscount = new SellerProductDiscount(); sellerProductDiscount.discountType = discountTypeVal.ToString(); sellerProductDiscount.discountValue = discountValueVal; sellerProductDiscount.discountStartDate = strDiscountStartDate; sellerProductDiscount.discountEndDate = strDiscountEndDate; ProductUpdateSkuBasicRequest productUpdateSkuBasicRequest = new ProductUpdateSkuBasicRequest(); productUpdateSkuBasicRequest.sellerStockCode = strSellerStockCode; productUpdateSkuBasicRequest.optionPrice = (decimal)stockOptionPriceVal; productUpdateSkuBasicRequest.id = stockIdVal; List <ProductUpdateSkuBasicRequest> productUpdateSkuBasicRequestItemList = new List <ProductUpdateSkuBasicRequest>(); productUpdateSkuBasicRequestItemList.Add(productUpdateSkuBasicRequest); UpdateProductBasicRequest request = new UpdateProductBasicRequest(); request.productSellerCode = strProdSellerCode; request.price = (decimal)priceDec; request.auth = authentication; request.productId = productIdVal; request.productDiscount = sellerProductDiscount; request.stockItems = productUpdateSkuBasicRequestItemList.ToArray(); ProductServicePortService port = new ProductServicePortService(); UpdateProductBasicResponse response = port.UpdateProductBasic(request); //System.out.println(response.getProduct().getId() + " Display price:" // + response.getProduct().getDisplayPrice() + " Price:" + response.getProduct().getPrice()); }
public UpdateProductBasicResponse UpdateProductBasic(Urun urun) { string siteUrl = string.Format("{0}://{1}{2}{3}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port == 80 ? string.Empty : ":" + HttpContext.Current.Request.Url.Port, HttpContext.Current.Request.ApplicationPath); #if DEBUG siteUrl = "https://aysemtuhafiye.com"; #endif Product product = GetProductBySellerCode(urun.urunID); com.n11Product.api.Authentication authentication = new com.n11Product.api.Authentication { appKey = apiKey, appSecret = apiSecret }; ProductImage[] productImages = new ProductImage[urun.urunResimleri.Count]; for (int i = 0; i < urun.urunResimleri.Count; i++) { ProductImage productImage = new ProductImage(); productImage.url = siteUrl + "/Content/icerik/urun/orjinal/" + urun.urunResimleri[i].resim; productImage.order = urun.urunResimleri[i].sira.ToString(); productImages[i] = productImage; } ProductUpdateSkuBasicRequest[] productUpdateSkuBasicRequests = new ProductUpdateSkuBasicRequest[1]; ProductUpdateSkuBasicRequest productUpdateSkuBasicRequest = new ProductUpdateSkuBasicRequest(); productUpdateSkuBasicRequest.quantity = urun.miktar.ToString(); productUpdateSkuBasicRequest.optionPrice = urun.entegrasyonBilgi.GetN11Fiyat(urun.fiyat); productUpdateSkuBasicRequest.id = product.stockItems.stockItem[0].id; productUpdateSkuBasicRequests[0] = productUpdateSkuBasicRequest; UpdateProductBasicRequest updateProductBasicRequest = new UpdateProductBasicRequest(); updateProductBasicRequest.auth = authentication; updateProductBasicRequest.description = urun.urunAciklamasi; updateProductBasicRequest.images = productImages; updateProductBasicRequest.price = urun.entegrasyonBilgi.GetN11Fiyat(urun.fiyat); updateProductBasicRequest.productId = urun.entegrasyonBilgi.n11UrunID; //updateProductBasicRequest.productSellerCode = urun.urunID.ToString(); updateProductBasicRequest.stockItems = productUpdateSkuBasicRequests; ProductServicePortService port = new ProductServicePortService(); UpdateProductBasicResponse updateProductBasicResponse = port.UpdateProductBasic(updateProductBasicRequest); return(updateProductBasicResponse); }