private void AssamblerTechnologies(CVSection sectionTechnologies) { TechnologieGraphRepository technologieGraphRepository = new TechnologieGraphRepository(); CategorieDeTechnologieGraphRepository categorieDeTechnologieGraphRepository = new CategorieDeTechnologieGraphRepository(); XmlDocTable tableTechnologies = (XmlDocTable)sectionTechnologies.Nodes.First(x => x is XmlDocTable); List <XmlDocParagraph> lineParagraphsColumn1 = new List <XmlDocParagraph>(), lineParagraphsColumn2 = new List <XmlDocParagraph>(); List <KeyValuePair <string, string> > listOfTech = new List <KeyValuePair <string, string> >(); Technologie technologie; CategorieDeTechnologie categorie = null; string techNom, mois; for (int i = 1; i <= tableTechnologies.CountColumns(); i = i + 3) { lineParagraphsColumn1 = tableTechnologies.GetParagraphsFromColumn(i); lineParagraphsColumn2 = tableTechnologies.GetParagraphsFromColumn(i + 1); for (int j = 1; j < lineParagraphsColumn1.Count; j++) { if (string.IsNullOrEmpty(lineParagraphsColumn1[j].GetParagraphText())) { continue; } if (string.IsNullOrEmpty(lineParagraphsColumn2[j].GetParagraphText())) { categorie = categorieDeTechnologieGraphRepository.CreateIfNotExists(new Dictionary <string, object> { { "Nom", lineParagraphsColumn1[j].GetParagraphText().Replace(":", "").Trim() } }); } else { techNom = lineParagraphsColumn1[j].GetParagraphText(); mois = lineParagraphsColumn2[j].GetParagraphText().Replace(".", ","); technologie = technologieGraphRepository.CreateIfNotExists(new Dictionary <string, object> { { "Nom", techNom } }); technologie.MoisDExperience = Convert.ToInt32(mois); if (categorie != null) { technologie.Categorie = categorie; } conseiller.Technologies.Add(technologie); } } } }
private void AssemblerEnvironnementTecnologic(CVSection environnementSection, Projet projet) { var x = (XmlDocParagraph)environnementSection.Nodes.First(); if (x.GetParagraphText().ToUpper().StartsWith("ENVIRONNEMENT TECHNOLOGIQUE")) { var environnement = x.GetParagraphText().ToUpper().Replace("ENVIRONNEMENT TECHNOLOGIQUE", "").Trim(); if (environnement.Count() == 0) { return; } if (environnement.First().Equals(':')) { environnement = environnement.Substring(1); } if (environnement.Count() == 0) { return; } if (environnement.Last().Equals('.')) { environnement = environnement.Substring(0, environnement.Length - 1); } if (environnement.Count() == 0) { return; } var technologies = environnement.Split(","); TechnologieGraphRepository technologieGraphRepository = new TechnologieGraphRepository(); for (int i = 0; i < technologies.Length; i++) { var tech = technologies[i].Trim(); var technologie = technologieGraphRepository.CreateIfNotExists(new Dictionary <string, object> { { "Nom", tech } }); if (technologie != null) { projet.Technologies.Add(technologie); } } } }