예제 #1
0
        // productId=1001 e göre
        static void UpdateStock()
        {
            ProductService         productService = ServiceProvider.getProductService();
            productServiceResponse response       = productService.updateStock("1001", "", 5, false, "tr");

            if (response != null && response.ackCode.ToString().Equals("success"))
            {
                Console.WriteLine("Result: " + response.result);
                Console.WriteLine("ProductId: " + response.productId);
            }
            else
            {
                Console.WriteLine("ErrorId: " + response.error.errorId);
                Console.WriteLine("ErrorCode: " + response.error.errorCode);
                Console.WriteLine("ErrorMessage: " + response.error.message);
            }
        }
예제 #2
0
        static void AddProduct()
        {
            ProductService productService = ServiceProvider.getProductService();
            productType    product        = new productType();

            product.categoryCode = "aaa";
            product.title        = "Test Ürünüdür";

            specType brandSpec = new specType();

            brandSpec.name     = "Marka";
            brandSpec.type     = "Combo";
            brandSpec.value    = "Nokia";
            brandSpec.required = true;
            specType modelSpec = new specType();

            modelSpec.name     = "Model";
            modelSpec.type     = "Combo";
            modelSpec.value    = "N73";
            modelSpec.required = true;
            specType statusSpec = new specType();

            statusSpec.name     = "Durumu";
            statusSpec.type     = "Combo";
            statusSpec.value    = "Sıfır";
            statusSpec.required = true;
            specType guaranteeSpec = new specType();

            guaranteeSpec.name     = "Garantisi";
            guaranteeSpec.type     = "Combo";
            guaranteeSpec.value    = "Yok";
            guaranteeSpec.required = true;
            specType[] specTypeArray = new specType[4];
            specTypeArray[0] = brandSpec;
            specTypeArray[1] = modelSpec;
            specTypeArray[2] = statusSpec;
            specTypeArray[3] = guaranteeSpec;
            product.specs    = specTypeArray;

            // set ProductPhoto
            photoType photo = new photoType();

            photo.photoId          = 0;
            photo.photoIdSpecified = true;
            photo.url = "http://img2.blogcu.com/images/o/r/g/orgudunyam1/cilek.jpg";
            photoType[] photoTypeArray = new photoType[1];
            photoTypeArray[0] = photo;
            product.photos    = photoTypeArray;

            product.pageTemplate          = 1;
            product.pageTemplateSpecified = true;
            product.description           = "Test ürünü açıklaması";
            product.format = "S";
            //product.startPrice = 3.50;
            //product.startPriceSpecified = true;
            product.buyNowPrice           = 49.50;
            product.buyNowPriceSpecified  = true;
            product.listingDays           = 30;
            product.listingDaysSpecified  = true;
            product.productCount          = 1;
            product.productCountSpecified = true;

            // set CargoDetail
            cargoDetailType cargoDetail = new cargoDetailType();

            cargoDetail.city = "34";
            String[] cargoCompany = new String[3];
            cargoCompany[0]            = "aras";
            cargoCompany[1]            = "mng";
            cargoDetail.cargoCompanies = cargoCompany;
            cargoCompanyDetailType cargoCompanyDetailType = new cargoCompanyDetailType();

            cargoCompanyDetailType.cityPrice    = "3.00";
            cargoCompanyDetailType.countryPrice = "5.00";
            cargoDetail.shippingPayment         = "B";
            cargoDetail.shippingWhere           = "city";
            product.cargoDetail = cargoDetail;

            product.affiliateOption = false;
            product.boldOption      = false;
            product.catalogOption   = false;
            product.vitrineOption   = false;
            product.startDate       = "2020-02-13 00:00:00";


            productServiceResponse response = productService.insertProduct("pc", product, true, false, "tr");

            if (response != null && response.ackCode.ToString().Equals("success"))
            {
                Console.WriteLine("Result: " + response.result);
                Console.WriteLine("ProductId: " + response.productId);
            }
            else
            {
                Console.WriteLine("ErrorId: " + response.error.errorId);
                Console.WriteLine("ErrorCode: " + response.error.errorCode);
                Console.WriteLine("ErrorMessage: " + response.error.message);
            }
        }