/// <summary> /// Get all taxa for the species observations /// that matches the search criteria. /// </summary> /// <param name="searchCriteria">The search criteria for the species observations.</param> /// <returns>Taxa information.</returns> public static TaxonList GetTaxaBySpeciesObservations(SpeciesObservationSearchCriteria searchCriteria) { WebSpeciesObservationSearchCriteria webSearchCriteria; List <WebTaxon> webTaxa; // Check arguments. searchCriteria.CheckNotNull("searchCriteria"); // Get data from web service. webSearchCriteria = GetSpeciesObservationSearchCriteria(searchCriteria); webTaxa = WebServiceClient.GetTaxaBySpeciesObservations(webSearchCriteria); return(TaxonManager.GetTaxa(webTaxa)); }
/// <summary> /// Reades one row from the xml format. /// </summary> /// <param name='xmlDoc'>The xml document that the row node will be read from.</param> /// <param name="nsmgr">Namespacemanager containing all namespaces used by the excel compatible xml format</param> protected override void ReadXmlRows(XmlDocument xmlDoc, XmlNamespaceManager nsmgr) { List <int> taxonIDs = new List <int>(); XmlNodeList rowNodes = xmlDoc.SelectNodes("/ss:Workbook/ss:Worksheet/ss:Table/ss:Row", nsmgr); foreach (XmlNode rowNode in rowNodes) { XmlNode dataNode = rowNode.SelectSingleNode("ss:Cell/ss:Data", nsmgr); int taxonId = Convert.ToInt32(dataNode.InnerText); taxonIDs.Add(taxonId); } this.AddRange(TaxonManager.GetTaxa(taxonIDs, ArtDatabanken.Data.WebService.TaxonInformationType.Basic)); }