private void AssemberDomainesDIntervetion(CVSection sectionDomaines) { XmlDocTable domainesTable = sectionDomaines.Nodes.Skip(1).Cast <XmlDocTable>().First(); List <XmlDocParagraph> domainesParagraphs = domainesTable.GetParagraphsFromColumns(); DomaineDInterventionGraphRepository repo = new DomaineDInterventionGraphRepository(); DomaineDIntervention domaine; domainesParagraphs.ForEach(x => { domaine = DomaineDIntervention.CreateDomaineDIntervetion(x.GetParagraphText()); domaine = repo.CreateIfNotExists(new Dictionary <string, object> { { "Description", domaine.Description } }); conseiller.DomaineDInterventions.Add(domaine); }); }
public bool Match(XmlNode node, out string identificant) { string innerText; identificant = string.Empty; if (string.IsNullOrEmpty(node.InnerText)) { return(false); } //VĂ©rifie le texte dans un paragraphe if (node.Name == "w:p") { innerText = node.InnerText.Trim(); foreach (KeyValuePair <string, string[]> token in GetTokens()) { if (Comparaison(token, innerText)) { identificant = token.Key; return(true); } } } else //Ou dans le paragraphes dans une tableau { XmlDocTable table = new XmlDocTable(node); List <XmlDocParagraph> paragraphs = table.GetParagraphsFromColumns(); foreach (XmlDocParagraph paragraph in paragraphs) { innerText = paragraph.GetParagraphText().Trim(); foreach (KeyValuePair <string, string[]> token in GetTokens()) { if (token.Value.Any(x => innerText.ToUpper().Equals(x))) { identificant = token.Key; return(true); } } } } return(false); }