I have couple of providers created with a smartform:
ID Title
90 Doctor A
102 Doctor B
10 Doctor C
26 Doctor D
495 Doctor E
I have three collections in CMS:
ID Title of Collection
12 IM Collection
43 UR Collection
9 EC Collection
The following code retrieves the content for the collection which is working for me:
ContentManager contentManager = new ContentManager();
ContentCollectionCriteria criteria = new ContentCollectionCriteria(ContentProperty.Id, EkEnumeration.OrderByDirection.Ascending);
criteria.AddFilter(Convert.ToInt64(ddlCollection.SelectedValue));
List<ContentData> contentList = contentManager.GetList(criteria);
I will be including the following variable:
iPName (int) = the provider ID
sColl (List<string>) = The collection(s) the provider should go in
How can I code a recursive function for each provider, which will take the iPName, remove from any collection the provider exist and use the sCol to add the provider to the collection(s).