partial void DeletetblItem(tblItem instance);
 partial void InserttblItem(tblItem instance);
 partial void UpdatetblItem(tblItem instance);
示例#4
0
        public List<tblItem> FindByKeyWord(String items)
        {
            List<tblItem> prodlist = new List<tblItem> { };
            FindItemsAdvancedRequest request = new FindItemsAdvancedRequest();
            //request.affiliate.trackingId = null;
            //request.affiliate.networkId = "9";
            // Set request parameters
            request.keywords = items;
            ItemFilter filter1 = new ItemFilter();
            ItemFilter filter2 = new ItemFilter();
            ItemFilter filter3 = new ItemFilter();
            filter3.name = ItemFilterType.Condition;
            filter3.value = new string[] { "1000" };

            ItemFilter[] filters = { filter3/*, filter2, filter3*/ };

            request.itemFilter = filters;
            //request.categoryId = items;
            if (request.keywords == null)
            {
                request.keywords = "ipod";
            }
            PaginationInput pi = new PaginationInput();
            pi.entriesPerPage = 100;
            pi.entriesPerPageSpecified = true;
            request.paginationInput = pi;

            // Call the service
            FindItemsAdvancedResponse response = m_client.findItemsAdvanced(request);

            SearchItem[] listing = response.searchResult.item;

            if (listing != null)
            {

                foreach (SearchItem i in listing)
                {
                    tblItem items_tbl = new tblItem();
                    items_tbl.item_category = i.primaryCategory.categoryId;
                    items_tbl.item_title = i.title;
                    items_tbl.item_id = i.itemId;
                    items_tbl.gallery_url = i.galleryURL;
                    items_tbl.listing_url = i.viewItemURL;

                    prodlist.Add(items_tbl);
                    try
                    {
                        DataClasses1DataContext context = new DataClasses1DataContext();
                        context.tblItems.InsertOnSubmit(items_tbl);
                        context.SubmitChanges();
                    }
                    catch (Exception e)
                    {
                        string s = e.Message;
                    }

                }

                return prodlist;
            }

            return prodlist;
        }