private NameValueListType GetSingleItemSpecific(string key, string value)
 {
     NameValueListType nv1 = new NameValueListType();
     nv1.Name = key;
     StringCollection nv1Col = new StringCollection();
     nv1Col.Add(value);
     nv1.Value = nv1Col;
     return nv1;
 }
Пример #2
0
        protected NameValueListType BuildItemSpecific(string name, string[] values)
        {
            NameValueListType itemSpecific = new NameValueListType();

            itemSpecific.Name  = name;
            itemSpecific.Value = new StringCollection(values);

            return(itemSpecific);
        }
        private NameValueListType GetSingleItemSpecific(string key, string value)
        {
            NameValueListType nv1 = new NameValueListType();

            nv1.Name = key;
            StringCollection nv1Col = new StringCollection();

            nv1Col.Add(value);
            nv1.Value = nv1Col;
            return(nv1);
        }
Пример #4
0
        private NameValueListType GetColorItemSpecific()
        {
            NameValueListType nv = new NameValueListType();

            string label = "Color";

            if (_item.Dimensions.ContainsKey(DimensionName.Color))
            {
                nv = BuildItemSpecific(label, new string[1] {
                    _item.Dimensions[DimensionName.Color].Value
                });
            }

            return(nv);
        }
Пример #5
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            credencialesEbay.cuenta = "ofertasparati";
            GetItemCall getItemcall = new GetItemCall(credencialesEbay.context);

            getItemcall.ItemID = "272416907107";
            getItemcall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);
            getItemcall.IncludeItemSpecifics = true;
            getItemcall.Execute();
            ItemType          item = getItemcall.ApiResponse.Item;
            NameValueListType i    = item.Variations.VariationSpecificsSet.ItemAt(0);
            //item.SKU = "pepe";
            //ReviseItemCall RIC = new ReviseItemCall(credencialesEbay.context);
            //RIC.Item = item;
            //RIC.Execute();
            //ReviseFixedPriceItemCall RI = new ReviseFixedPriceItemCall(credencialesEbay.context);
            //RI.Item = item;
            //RI.Execute();
        }
Пример #6
0
        /// <summary>
        /// Build sample item specifics
        /// </summary>
        /// <returns>ItemSpecifics object</returns>
        private NameValueListTypeCollection buildItemSpecifics(string sneakerID)
        {
            //create the content of item specifics
            NameValueListTypeCollection nvCollection = new NameValueListTypeCollection();
            NameValueListType           nv0          = new NameValueListType();

            nv0.Name = "Code";
            StringCollection nv0Col = new StringCollection();

            String[] strArr0 = new string[] { sneakerID };
            nv0Col.AddRange(strArr0);
            nv0.Value = nv0Col;
            NameValueListType nv1 = new NameValueListType();

            nv1.Name = "Name";
            StringCollection nv1Col = new StringCollection();

            String[] strArr1 = new string[] { SQLConnect.Select("Select ShoeName from Shoe where ShoeID = '" + sneakerID + "';") };
            nv1Col.AddRange(strArr1);
            nv1.Value = nv1Col;
            NameValueListType nv2 = new NameValueListType();

            nv2.Name = "Size";
            StringCollection nv2Col = new StringCollection();

            String[] strArr2 = new string[] { SQLConnect.Select("Select Size from Shoe where ShoeID = '" + sneakerID + "';") };
            nv2Col.AddRange(strArr2);
            nv2.Value = nv2Col;
            NameValueListType nv3 = new NameValueListType();

            nv3.Name = "Color";
            StringCollection nv3Col = new StringCollection();

            String[] strArr3 = new string[] { SQLConnect.Select("Select Color from Shoe where ShoeID = '" + sneakerID + "';") };
            nv3Col.AddRange(strArr3);
            nv3.Value = nv3Col;
            nvCollection.Add(nv0);
            nvCollection.Add(nv1);
            nvCollection.Add(nv1);
            nvCollection.Add(nv3);
            return(nvCollection);
        }
Пример #7
0
        /// <summary>
        /// Specify custom item specify
        /// </summary>
        /// <returns></returns>
        private NameValueListTypeCollection getCIS()
        {
            NameValueListTypeCollection list = new NameValueListTypeCollection();
            StringCollection            tmp  = new StringCollection();

            NameValueListType nameValue1 = new NameValueListType();

            nameValue1.Name = "test specifics(add name1)";
            tmp.Add("test specifics(add value1)");
            nameValue1.Value = tmp;

            NameValueListType nameValue2 = new NameValueListType();

            nameValue2.Name = "test specifics(add name2)";
            tmp.Clear();
            tmp.Add("test specifics(add value2)");
            nameValue2.Value = tmp;

            list.Add(nameValue1);
            list.Add(nameValue2);

            return(list);
        }
Пример #8
0
        private NameValueListTypeCollection GetAllCustomItemSpecificsNameValue(NameValueCollection request)
        {
            NameValueListTypeCollection atts = new NameValueListTypeCollection();
            NameValueListType           nvList;

            foreach (string key in request.AllKeys)
            {
                int index;
                index = key.IndexOf(EBAY_CUSTOM_ITEM_SPECIFICS_NAME);
                if (index >= 0 && request[key] != string.Empty)
                {
                    string suffix = key.Substring(index + EBAY_CUSTOM_ITEM_SPECIFICS_NAME.Length);
                    nvList      = new NameValueListType();
                    nvList.Name = request[EBAY_CUSTOM_ITEM_SPECIFICS_NAME_CACHE + suffix];
                    eBay.Service.Core.Soap.StringCollection strCol = new eBay.Service.Core.Soap.StringCollection();
                    strCol.Add(request[key]);
                    nvList.Value = strCol;
                    atts.Add(nvList);
                    continue;
                }

                index = key.IndexOf(CUSTOME_ITEM_SPECIFICS_VALUE);
                if (index >= 0 && request[key] != string.Empty)
                {
                    string suffix = key.Substring(index + CUSTOME_ITEM_SPECIFICS_VALUE.Length);
                    nvList      = new NameValueListType();
                    nvList.Name = request[CUSTOME_ITEM_SPECIFICS_NAME + suffix];
                    eBay.Service.Core.Soap.StringCollection strCol = new eBay.Service.Core.Soap.StringCollection();
                    strCol.Add(request[key]);
                    nvList.Value = strCol;
                    atts.Add(nvList);
                    continue;
                }
            }

            return(atts);
        }
Пример #9
0
        /// <summary>
        /// Build sample item specifics
        /// </summary>
        /// <returns>ItemSpecifics object</returns>
        static NameValueListTypeCollection buildItemSpecifics()
        {
            //create the content of item specifics
            NameValueListTypeCollection nvCollection = new NameValueListTypeCollection();
            NameValueListType           nv1          = new NameValueListType();

            nv1.Name = "Platform";
            StringCollection nv1Col = new StringCollection();

            String[] strArr1 = new string[] { "Microsoft Xbox 360" };
            nv1Col.AddRange(strArr1);
            nv1.Value = nv1Col;
            NameValueListType nv2 = new NameValueListType();

            nv2.Name = "Genre";
            StringCollection nv2Col = new StringCollection();

            String[] strArr2 = new string[] { "Simulation" };
            nv2Col.AddRange(strArr2);
            nv2.Value = nv2Col;
            nvCollection.Add(nv1);
            nvCollection.Add(nv2);
            return(nvCollection);
        }
Пример #10
0
        /// <summary>
        /// Specify custom item specify
        /// </summary>
        /// <returns></returns>
        private NameValueListTypeCollection getCIS()
        {
            NameValueListTypeCollection list = new NameValueListTypeCollection();
            StringCollection tmp=new StringCollection();

            NameValueListType nameValue1=new NameValueListType();
            nameValue1.Name="test specifics(add name1)";
            tmp.Add("test specifics(add value1)");
            nameValue1.Value=tmp;

            NameValueListType nameValue2=new NameValueListType();
            nameValue2.Name="test specifics(add name2)";
            tmp.Clear();
            tmp.Add("test specifics(add value2)");
            nameValue2.Value=tmp;

            list.Add(nameValue1);
            list.Add(nameValue2);

            return list;
        }
Пример #11
0
        private NameValueListType GetSizeItemSpecific()
        {
            NameValueListType nv = new NameValueListType();

            if (_item.Dimensions.ContainsKey(DimensionName.EUSize))
            {
                string gender = _item.SubDescription3.Trim().ToUpper();

                string label = string.Empty;

                switch (gender)
                {
                case "BOYS":
                case "GIRLS":
                case "UNISEX-CHILD":
                    label = "US Shoe Size (Youth)"; break;

                case "BABY-BOYS":
                case "BABY-GIRLS":
                case "UNISEX-BABY":
                    label = "US Shoe Size (Baby & Toddler)"; break;

                case "UNISEX-ADULT":
                case "MENS":
                case "MEN":
                    label = "US Shoe Size (Men's)"; break;

                case "WOMENS":
                case "WOMEN":
                    label = "US Shoe Size (Women's)"; break;

                default: throw new NotImplementedException("could not recognize gender");
                }

                nv = BuildItemSpecific(label, new string[1] {
                    _item.Dimensions[DimensionName.EUSize].Value
                });
            }
            else if (_item.Dimensions.ContainsKey(DimensionName.USMenSize))
            {
                nv = BuildItemSpecific("US Shoe Size (Men's)", new string[1] {
                    _item.Dimensions[DimensionName.USMenSize].Value
                });
            }
            else if (_item.Dimensions.ContainsKey(DimensionName.USWomenSize))
            {
                nv = BuildItemSpecific("US Shoe Size (Women's)", new string[1] {
                    _item.Dimensions[DimensionName.USWomenSize].Value
                });
            }
            else if (_item.Dimensions.ContainsKey(DimensionName.USYouthSize))
            {
                nv = BuildItemSpecific("US Shoe Size (Youth)", new string[1] {
                    _item.Dimensions[DimensionName.USYouthSize].Value
                });
            }
            else if (_item.Dimensions.ContainsKey(DimensionName.USBabySize))
            {
                nv = BuildItemSpecific("US Shoe Size (Baby & Toddler)", new string[1] {
                    _item.Dimensions[DimensionName.USBabySize].Value
                });
            }

            return(nv);
        }
Пример #12
0
        private NameValueListTypeCollection GetAllCustomItemSpecificsNameValue(NameValueCollection request)
        {
            NameValueListTypeCollection atts = new NameValueListTypeCollection();
            NameValueListType nvList;

            foreach (string key in request.AllKeys)
            {
                int index;
                index = key.IndexOf(EBAY_CUSTOM_ITEM_SPECIFICS_NAME);
                if (index >= 0 && request[key] != string.Empty)
                {
                    string suffix = key.Substring(index + EBAY_CUSTOM_ITEM_SPECIFICS_NAME.Length);
                    nvList = new NameValueListType();
                    nvList.Name = request[EBAY_CUSTOM_ITEM_SPECIFICS_NAME_CACHE + suffix];
                    eBay.Service.Core.Soap.StringCollection strCol = new eBay.Service.Core.Soap.StringCollection();
                    strCol.Add(request[key]);
                    nvList.Value = strCol;
                    atts.Add(nvList);
                    continue;
                }

                index = key.IndexOf(CUSTOME_ITEM_SPECIFICS_VALUE);
                if (index >= 0 && request[key] != string.Empty)
                {
                    string suffix = key.Substring(index + CUSTOME_ITEM_SPECIFICS_VALUE.Length);
                    nvList = new NameValueListType();
                    nvList.Name = request[CUSTOME_ITEM_SPECIFICS_NAME + suffix];
                    eBay.Service.Core.Soap.StringCollection strCol = new eBay.Service.Core.Soap.StringCollection();
                    strCol.Add(request[key]);
                    nvList.Value = strCol;
                    atts.Add(nvList);
                    continue;
                }

            }

            return atts;
        }
Пример #13
0
        /// <summary>
        /// Build sample item specifics
        /// </summary>
        /// <returns>ItemSpecifics object</returns>
        static NameValueListTypeCollection buildItemSpecifics()
        {        	  
	        //create the content of item specifics
            NameValueListTypeCollection nvCollection = new NameValueListTypeCollection();
            NameValueListType nv1 = new NameValueListType();
            nv1.Name = "Platform";
            StringCollection nv1Col = new StringCollection();
            String[] strArr1 = new string[] { "Microsoft Xbox 360" };
            nv1Col.AddRange(strArr1);
            nv1.Value = nv1Col;
            NameValueListType nv2 = new NameValueListType();
            nv2.Name = "Genre";
            StringCollection nv2Col = new StringCollection();
            String[] strArr2 = new string[] { "Simulation" };
            nv2Col.AddRange(strArr2);
            nv2.Value = nv2Col;
            nvCollection.Add(nv1);
            nvCollection.Add(nv2);
            return nvCollection;
         }
Пример #14
0
        /// <summary>
        /// Build sample item Variations
        /// </summary>
        /// <returns>Variations object</returns>
        static VariationsType buildVariationsType()
        {
            // listing variations
            VariationsType variations = new VariationsType();

            // first variation
            VariationType variation1 = new VariationType();
            // create the content of VariationSpecifics
            NameValueListTypeCollection nvcol1 = new NameValueListTypeCollection();
            NameValueListType           nv11   = new NameValueListType();

            nv11.Name = "Color";
            StringCollection nv1StrCol = new StringCollection();

            String[] strArr1 = new string[] { "RED" };
            nv1StrCol.AddRange(strArr1);
            nv11.Value = nv1StrCol;
            NameValueListType nv12 = new NameValueListType();

            nv12.Name = "Size";
            StringCollection nv2StrCol = new StringCollection();

            String[] strArr2 = new string[] { "M" };
            nv2StrCol.AddRange(strArr2);
            nv12.Value = nv2StrCol;
            nvcol1.Add(nv11);
            nvcol1.Add(nv12);
            // set variation-level specifics for first variation
            variation1.VariationSpecifics = nvcol1;
            // set start price
            AmountType amount1 = new AmountType();

            amount1.Value         = 100;
            amount1.currencyID    = CurrencyCodeType.USD;
            variation1.StartPrice = amount1;
            // set quantity
            variation1.Quantity = 10;
            // set variation name
            variation1.VariationTitle = "RED,M";

            // second variation
            VariationType variation2 = new VariationType();
            // create the content of specifics for each variation
            NameValueListTypeCollection nvcol2 = new NameValueListTypeCollection();
            NameValueListType           nv21   = new NameValueListType();

            nv21.Name = "Color";
            StringCollection nv21StrCol = new StringCollection();

            String[] strArr21 = new string[] { "BLACK" };
            nv21StrCol.AddRange(strArr21);
            nv21.Value = nv21StrCol;
            NameValueListType nv22 = new NameValueListType();

            nv22.Name = "Size";
            StringCollection nv22StrCol = new StringCollection();

            String[] strArr22 = new string[] { "L" };
            nv22StrCol.AddRange(strArr22);
            nv22.Value = nv22StrCol;
            nvcol2.Add(nv21);
            nvcol2.Add(nv22);
            // set variation-level specifics for first variation
            variation2.VariationSpecifics = nvcol2;
            // set start price
            AmountType amount2 = new AmountType();

            amount2.Value         = 110;
            amount2.currencyID    = CurrencyCodeType.USD;
            variation2.StartPrice = amount2;
            // set quantity
            variation2.Quantity = 20;
            // set variation name
            variation2.VariationTitle = "BLACK,L";

            // set variation
            VariationTypeCollection varCol = new VariationTypeCollection();

            varCol.Add(variation1);
            varCol.Add(variation2);
            variations.Variation = varCol;

            // create the content of specifics for variations
            NameValueListTypeCollection nvcol3 = new NameValueListTypeCollection();
            NameValueListType           nv31   = new NameValueListType();

            nv31.Name = "Color";
            StringCollection nv31StrCol = new StringCollection();

            String[] strArr31 = new string[] { "BLACK", "RED" };
            nv31StrCol.AddRange(strArr31);
            nv31.Value = nv31StrCol;
            NameValueListType nv32 = new NameValueListType();

            nv32.Name = "Size";
            StringCollection nv32StrCol = new StringCollection();

            String[] strArr32 = new string[] { "M", "L" };
            nv32StrCol.AddRange(strArr32);
            nv32.Value = nv32StrCol;
            nvcol3.Add(nv31);
            nvcol3.Add(nv32);
            // set variationSpecifics
            variations.VariationSpecificsSet = nvcol3;
            return(variations);
        }