Пример #1
1
        private void button1_Click_1(object sender, EventArgs e)
        {
            var authentication1 = new com.n11.api.Authentication();
            authentication1.appKey = apiAnahtari1; //api anahtarınız
            authentication1.appSecret = apiSifresi1;//api şifeniz

            ProductServicePortService prodServ = new ProductServicePortService();

            SaveProductRequest saveRequest = new SaveProductRequest();
            //marka, tarih aralığı
            saveRequest.auth = authentication1;
            saveRequest.product = new ProductRequest();
            saveRequest.product.productSellerCode = txtMagazaKodu.Text;

            saveRequest.product.title = txtUrunBasligi.Text;
            saveRequest.product.subtitle = txtaltBaslik.Text;
            saveRequest.product.description = richTextBox1.Text;
            saveRequest.product.category = new CategoryRequest();
            saveRequest.product.category.id = Convert.ToInt32(txtUrunKategoriNo.Text);
            saveRequest.product.price = Convert.ToDecimal(txtFiyati.Text);
            saveRequest.product.currencyType = comboBox1.Text;

            ProductImage prImg = new ProductImage();
            ProductImage[] pr = new ProductImage[1];
            pr[0] = prImg;
            string resimUrl = urunResimlericmbBox.Text.Replace("https", "http");
            prImg.url = resimUrl;
            prImg.order = "1";
            saveRequest.product.images = pr;

            saveRequest.product.productCondition = txtUrunDurumu.Text;
            saveRequest.product.preparingDay = txtprodPrepDay.Text;
            saveRequest.product.shipmentTemplate = txtKargoSablonu.Text;

            ProductSkuRequest prStock = new ProductSkuRequest();
            prStock.quantity = txtStokMiktari.Text;
            prStock.optionPrice = Convert.ToDecimal(txtFiyati.Text);
            ProductSkuRequest[] prStockList = new ProductSkuRequest[1];
            prStockList[0] = prStock;

            saveRequest.product.stockItems = prStockList;

            SaveProductResponse saveResponse = prodServ.SaveProduct(saveRequest);
            if (saveResponse.result.errorCode == null)
            {
                MessageBox.Show("ürün kaydedildi");
            }
            else
            {
                MessageBox.Show("ürün kaydedilmedi");
                MessageBox.Show(saveResponse.result.errorMessage);
            }
        }
Пример #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            ProductImage prImg = new ProductImage();
            ProductImage[] pr = new ProductImage[prImgAdet];
            string resimUrl = urunResimlericmbBox.Text.Replace("https", "http");
            prImg.url = resimUrl;

            prImg.order = txtBxUrunResimOrder.Text;

            urunResimlericmbBox.Items.Add(prImg);

            prImgAdet++;
        }