public void GetProductFinder()
 {
     Assert.IsNotNull(TestData.Category2CS);
     GetProductFinderCall api = new GetProductFinderCall(this.apiContext);
     api.DetailLevelList = new DetailLevelCodeTypeCollection();
     api.DetailLevelList.Add(DetailLevelCodeType.ReturnAll) ;
     //
     Int32Collection l = new Int32Collection();
     for(int i = 0; i < TestData.Category2CS.Count; i++ )
     {
     CategoryType c = TestData.Category2CS[i];
     if( c.ProductFinderIDs != null && c.ProductFinderIDs.Count > 0 )
     {
     for(int n = 0; n < c.ProductFinderIDs.Count; n++ )
     l.Add(c.ProductFinderIDs[n].ProductFinderID);
     break;
     }
     }
     //
     //int[] ids = new int[l.Count()];
     //for(int i = 0; i < l.Count(); i++)
     //ids[i] = ((Integer)l.get(i)).intValue();
     api.ProductFinderIDList = l;
     // Make API call.
     String pfData = api.GetProductFinder();
 }
Exemple #2
0
        private void BtnGetProductFinder_Click(object sender, System.EventArgs e)
        {
            try
            {
                TxtFinderData.Text = "";

                GetProductFinderCall apicall = new GetProductFinderCall(Context);
                apicall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);

                if (TxtFinderVersion.Text != String.Empty)
                    apicall.AttributeVersion = TxtFinderVersion.Text;

                if (TxtFinderSets.Text != String.Empty)
                {
                    apicall.ProductFinderIDList = new Int32Collection();
                    string[] atts = TxtFinderSets.Text.Split(',');
                    foreach (string att in atts)
                        apicall.ProductFinderIDList.Add(Convert.ToInt32(att));
                }

                string finderdata = apicall.GetProductFinder();

                if (finderdata != null)
                    TxtFinderData.Text = finderdata.Replace("\n", "\r\n");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }