예제 #1
1
        private NameRecommendationTypeCollection getCategorySpecific()
        {
            ApiContext asn = (ApiContext)Session[Global.APISESSION];
            GetCategorySpecificsCall api = new GetCategorySpecificsCall(asn);
            DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] {DetailLevelCodeType.ReturnAll};
            api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);
            eBay.Service.Core.Soap.StringCollection strCol=new eBay.Service.Core.Soap.StringCollection();
            strCol.Add(Session["CategoryId"].ToString());
            api.CategoryIDList=strCol;
            api.Execute();

            NameRecommendationTypeCollection nameRecommendationTypes=null;
            if ((api.ApiResponse.Ack==AckCodeType.Success || api.ApiResponse.Ack==AckCodeType.Warning)
                    &&	api.ApiResponse.Recommendations!=null
                    &&	api.ApiResponse.Recommendations.Count>0)
            {
                nameRecommendationTypes = api.ApiResponse.Recommendations[0].NameRecommendation;
            }

            return nameRecommendationTypes;
        }
예제 #2
0
        private bool isExcludedCategoryID(string catId, SiteWideCharacteristicsType swCharSet)
        {
            bool isExcluded = false;

            eBay.Service.Core.Soap.StringCollection excluded = swCharSet.ExcludeCategoryID;
            IEnumerator myEnumerator = excluded.GetEnumerator();

            while (myEnumerator.MoveNext())
            {
                string current = (string)myEnumerator.Current;
                if (current.Equals(catId))
                {
                    isExcluded = true;
                    break;
                }
            }
            return(isExcluded);
        }
예제 #3
0
        private void SyncNameRecommendationTypes()
        {
            GetCategorySpecificsCall api = new GetCategorySpecificsCall(this.apiContext);

            DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.ReturnAll };
            api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);
            eBay.Service.Core.Soap.StringCollection strCol = new eBay.Service.Core.Soap.StringCollection();
            strCol.Add(this.CategoryID);
            api.CategoryIDList = strCol;
            api.Execute();

            NameRecommendationTypeCollection nameRecommendationTypes = null;

            if ((api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning) &&
                api.ApiResponse.Recommendations != null &&
                api.ApiResponse.Recommendations.Count > 0)
            {
                nameRecommendationTypes = api.ApiResponse.Recommendations[0].NameRecommendation;
            }

            this.nameRecommendationTypes = nameRecommendationTypes;
        }
        /// <summary>
        /// construct a mapping between listing type and listing duration
        /// </summary>
        /// <param name="listingTypes"></param>
        /// <param name="listingDurations"></param>
        /// <returns>Hashtable</returns>
        private static Hashtable constructListingTypeDurationMapping(ListingDurationReferenceTypeCollection listingTypes, ListingDurationDefinitionsType listingDurations)
        {
            Hashtable listingTypeDurationMap = new Hashtable();

            eBay.Service.Core.Soap.StringCollection listingDuration = null;

            foreach (ListingDurationReferenceType listingType in listingTypes)
            {
                string key = listingType.type.ToString();
                //iterate listingDuration collection to find specific listingDuration whose durationSetID equals listingType id
                foreach (ListingDurationDefinitionType definition in listingDurations.ListingDuration)
                {
                    if (definition.durationSetID.Equals(listingType.Value))
                    {
                        listingDuration = definition.Duration;
                    }
                }

                listingTypeDurationMap.Add(key, listingDuration);
            }

            return(listingTypeDurationMap);
        }
예제 #5
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);
        }
예제 #6
0
        private void SyncNameRecommendationTypes()
        {
            GetCategorySpecificsCall api = new GetCategorySpecificsCall(this.apiContext);
            DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.ReturnAll };
            api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);
            eBay.Service.Core.Soap.StringCollection strCol = new eBay.Service.Core.Soap.StringCollection();
            strCol.Add(this.CategoryID);
            api.CategoryIDList = strCol;
            api.Execute();

            NameRecommendationTypeCollection nameRecommendationTypes = null;
            if ((api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning)
                    && api.ApiResponse.Recommendations != null
                    && api.ApiResponse.Recommendations.Count > 0)
            {
                nameRecommendationTypes = api.ApiResponse.Recommendations[0].NameRecommendation;
            }

            this.nameRecommendationTypes = nameRecommendationTypes;
        }
예제 #7
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;
        }