public void GetProductSearchPage()
        {
            Assert.IsNotNull(TestData.Category2CS);
            //
            Int32Collection l = new Int32Collection();
            for(int i = 0; i < TestData.Category2CS.Count; i++ )
            {
            CategoryType c = TestData.Category2CS[i];
            if( c.ProductSearchPageAvailableSpecified && c.ProductSearchPageAvailable
            && c.CharacteristicsSets != null && c.CharacteristicsSets.Count > 0
            )
            {
            l.Add(c.CharacteristicsSets[0].AttributeSetID);
            break;
            }
            }
            //
            GetProductSearchPageCall api = new GetProductSearchPageCall(this.apiContext);
            DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] {
               DetailLevelCodeType.ReturnAll
            };
            api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);

            api.AttributeSetIDList = l;
            // Make API call.
            ProductSearchPageTypeCollection searchPages = api.GetProductSearchPage();
            Assert.IsNotNull(searchPages);
            Assert.IsTrue(searchPages.Count > 0);
            TestData.ProductSearchPages = searchPages;
        }
Esempio n. 2
0
        private void BtnGetProductSearchPage_Click(object sender, System.EventArgs e)
        {
            try
            {
                LstProductData.Items.Clear();

                GetProductSearchPageCall apicall = new GetProductSearchPageCall(Context);
                apicall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);
                if (TxtSearchPageVersion.Text != String.Empty)
                    apicall.AttributeVersion = TxtSearchPageVersion.Text;

                if (TxtSearchPageSets.Text != String.Empty)
                {
                    apicall.AttributeSetIDList = new Int32Collection();

                    string[] atts = TxtSearchPageSets.Text.Split(',');
                    foreach (string att in atts)
                    {
                        apicall.AttributeSetIDList.Add(Convert.ToInt32(att));
                    }
                }

                ProductSearchPageTypeCollection spages = apicall.GetProductSearchPage();

                foreach (ProductSearchPageType page in spages)
                {

                    foreach (CharacteristicType val in page.SearchCharacteristicsSet.Characteristics)
                    {
                        string[] listparams = new string[3];

                        listparams[0] = val.AttributeID.ToString();
                        listparams[1] = val.DisplaySequence;
                        listparams[2] = val.Label.Name;

                        ListViewItem vi = new ListViewItem(listparams);
                        LstProductData.Items.Add(vi);
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }