public static void ExportXmlCompanyList(int startPage = 1, int maxPage = 1, bool reload = false, bool loadImage = false) { //WriteLine("ExportXmlCompanyList : startPage {0} maxPage {1} reload {2} loadImage {3}", startPage, maxPage, reload, loadImage); Init(); //_ExportXmlCompanyList(Unea.LoadDetailCompanyList(startPage, maxPage, reload, loadImage)); //string dir = @"c:\pib\dev_data\exe\wrun\damien\export"; //string file = dir + @"\Unea.xml"; //string fileDetail = dir + @"\UneaDetail.xml"; WriteLine("export Unea"); WriteLine(" file \"{0}\"", __xmlCompanyListFile); WriteLine(" file detail \"{0}\"", __xmlDetailCompanyListFile); XmlWriterSettings settings = new XmlWriterSettings(); settings.Encoding = Encoding.UTF8; settings.Indent = true; Unea_Company_DuplicateExists duplicate = new Unea_Company_DuplicateExists(); Unea_CompanyUniqueValues uniqueValues = new Unea_CompanyUniqueValues(); using (XmlWriter xw = XmlWriter.Create(__xmlCompanyListFile, settings), xwDetail = XmlWriter.Create(__xmlDetailCompanyListFile, settings)) { xw.WriteStartElement("Unea"); xwDetail.WriteStartElement("Unea"); Unea.LoadDetailCompanyList(startPage, maxPage, reload, loadImage).zForEach(company => { ExportXml_Company(xw, company, false); ExportXml_Company(xwDetail, company, true); GetCompany_Duplicate(company, duplicate); AddUniqueValues(uniqueValues, company); }); xw.WriteEndElement(); xwDetail.WriteEndElement(); } string dir = Path.GetDirectoryName(__xmlCompanyListFile); Export_Duplicate(duplicate, dir); ExportUniqueValues(uniqueValues, dir); }
private static void Export_Duplicate(Unea_Company_DuplicateExists duplicate, string dir) { string file = Path.Combine(dir, "Unea_duplicate.txt"); using (StreamWriter sw = new StreamWriter(new FileStream(file, FileMode.Create, FileAccess.Write, FileShare.Read), Encoding.UTF8)) { sw.WriteLine("société2 : {0}", duplicate.detail1Name ? "contient des valeurs" : ""); sw.WriteLine("société3 : {0}", duplicate.detail2Name ? "contient des valeurs" : ""); sw.WriteLine("emplacement2 : {0}", duplicate.detail1Location ? "contient des valeurs" : ""); sw.WriteLine("adresse2 : {0}", duplicate.detail2Address ? "contient des valeurs" : ""); sw.WriteLine("tel2 : {0}", duplicate.detail1Phone ? "contient des valeurs" : ""); sw.WriteLine("tel3 : {0}", duplicate.detail2Phone ? "contient des valeurs" : ""); sw.WriteLine("fax2 : {0}", duplicate.detail1Fax ? "contient des valeurs" : ""); sw.WriteLine("fax3 : {0}", duplicate.detail2Fax ? "contient des valeurs" : ""); sw.WriteLine("email2 : {0}", duplicate.detail1Email ? "contient des valeurs" : ""); sw.WriteLine("email3 : {0}", duplicate.detail2Email ? "contient des valeurs" : ""); sw.WriteLine("site2 : {0}", duplicate.detail2WebSite ? "contient des valeurs" : ""); sw.WriteLine("présentation2 : {0}", duplicate.detail2Presentation ? "contient des valeurs" : ""); sw.WriteLine("client2 : {0}", duplicate.detail2Clients ? "contient des valeurs" : ""); sw.WriteLine("dirigeant2 : {0}", duplicate.detail2Leader ? "contient des valeurs" : ""); sw.WriteLine("nb_salarié2 : {0}", duplicate.detail2EmployeNumber ? "contient des valeurs" : ""); sw.WriteLine("chiffre_affaire2 : {0}", duplicate.detail2LastYearRevenue ? "contient des valeurs" : ""); sw.WriteLine("certification2 : {0}", duplicate.detail2Certification ? "contient des valeurs" : ""); sw.WriteLine("siret2 : {0}", duplicate.detail2Siret ? "contient des valeurs" : ""); sw.WriteLine("activité2 : {0}", duplicate.detail1Activities ? "contient des valeurs" : ""); sw.WriteLine("activité3 : {0}", duplicate.detail2Activities ? "contient des valeurs" : ""); sw.WriteLine("filière2 : {0}", duplicate.detail2Sectors ? "contient des valeurs" : ""); sw.WriteLine("document2 : {0}", duplicate.detail2DownloadDocuments ? "contient des valeurs" : ""); sw.WriteLine("image2 : {0}", duplicate.detail2Photos ? "contient des valeurs" : ""); sw.WriteLine("inconnu : {0}", duplicate.headerUnknowInfos ? "contient des valeurs" : ""); sw.WriteLine("inconnu2 : {0}", duplicate.detail1UnknowInfos ? "contient des valeurs" : ""); sw.WriteLine("inconnu3 : {0}", duplicate.detail2UnknowInfos ? "contient des valeurs" : ""); } }
public static void ExportXml_Company(XmlWriter xw, Unea_Company company, bool detail, Unea_Company_DuplicateExists duplicate = null) { IEnumerator<string> headerActivities = null; IEnumerator<string> detail1Activities = null; IEnumerator<string> detail2Activities = null; IEnumerator<string> detail1Sectors = null; IEnumerator<string> detail2Sectors = null; IEnumerator<Unea_Document> detail1DownloadDocuments = null; IEnumerator<Unea_Document> detail2DownloadDocuments = null; IEnumerator<string> detail1Photos = null; IEnumerator<string> detail2Photos = null; IEnumerator<string> headerUnknowInfos = null; IEnumerator<string> detail1UnknowInfos = null; IEnumerator<string> detail2UnknowInfos = null; if (detail) { headerActivities = ((IEnumerable<string>)company.headerActivities.Keys).GetEnumerator(); detail1Activities = ((IEnumerable<string>)company.detail1Activities.Keys).GetEnumerator(); detail2Activities = ((IEnumerable<string>)company.detail2Activities.Keys).GetEnumerator(); detail1Sectors = ((IEnumerable<string>)company.detail1Sectors.Keys).GetEnumerator(); detail2Sectors = ((IEnumerable<string>)company.detail2Sectors.Keys).GetEnumerator(); detail1DownloadDocuments = ((IEnumerable<Unea_Document>)company.detail1DownloadDocuments.Values).GetEnumerator(); detail2DownloadDocuments = ((IEnumerable<Unea_Document>)company.detail2DownloadDocuments.Values).GetEnumerator(); detail1Photos = ((IEnumerable<string>)company.detail1Photos.Keys).GetEnumerator(); detail2Photos = ((IEnumerable<string>)company.detail2Photos.Keys).GetEnumerator(); headerUnknowInfos = ((IEnumerable<string>)company.headerUnknowInfos).GetEnumerator(); detail1UnknowInfos = ((IEnumerable<string>)company.detail1UnknowInfos).GetEnumerator(); detail2UnknowInfos = ((IEnumerable<string>)company.detail2UnknowInfos).GetEnumerator(); } xw.WriteStartElement("Company"); xw.zWriteElementText("société", company.headerName); xw.zWriteElementText("société2", company.detail1Name); xw.zWriteElementText("société3", company.detail2Name); xw.zWriteElementText("emplacement", company.headerLocation); xw.zWriteElementText("emplacement2", company.detail1Location); if (detail) { string text1, text2; text1 = null; if (headerActivities.MoveNext()) text1 = headerActivities.Current; xw.zWriteElementText("activité", text1); text1 = null; if (detail1Activities.MoveNext()) text1 = detail1Activities.Current; xw.zWriteElementText("activité2", text1); text1 = null; if (detail2Activities.MoveNext()) text1 = detail2Activities.Current; xw.zWriteElementText("activité3", text1); text1 = null; if (detail1Sectors.MoveNext()) text1 = detail1Sectors.Current; xw.zWriteElementText("filière", text1); text1 = null; if (detail2Sectors.MoveNext()) text1 = detail2Sectors.Current; xw.zWriteElementText("filière2", text1); text1 = null; text2 = null; if (detail1DownloadDocuments.MoveNext()) { text1 = detail1DownloadDocuments.Current.name; text2 = detail1DownloadDocuments.Current.url; } xw.zWriteElementText("document", text1); xw.zWriteElementText("document_url", text2); text1 = null; text2 = null; if (detail2DownloadDocuments.MoveNext()) { text1 = detail2DownloadDocuments.Current.name; text2 = detail2DownloadDocuments.Current.url; } xw.zWriteElementText("document2", text1); xw.zWriteElementText("document2_url", text2); text1 = null; if (detail1Photos.MoveNext()) text1 = detail1Photos.Current; xw.zWriteElementText("image", text1); text1 = null; if (detail2Photos.MoveNext()) text1 = detail2Photos.Current; xw.zWriteElementText("image2", text1); text1 = null; if (headerUnknowInfos.MoveNext()) text1 = headerUnknowInfos.Current; xw.zWriteElementText("inconnu", text1); text1 = null; if (detail1UnknowInfos.MoveNext()) text1 = detail1UnknowInfos.Current; xw.zWriteElementText("inconnu2", text1); text1 = null; if (detail2UnknowInfos.MoveNext()) text1 = detail2UnknowInfos.Current; xw.zWriteElementText("inconnu3", text1); } xw.zWriteElementText("adresse", company.detail1Address); xw.zWriteElementText("adresse2", company.detail2Address); xw.zWriteElementText("tel", company.headerPhone); xw.zWriteElementText("tel2", company.detail1Phone); xw.zWriteElementText("tel3", company.detail2Phone); xw.zWriteElementText("fax", company.headerFax); xw.zWriteElementText("fax2", company.detail1Fax); xw.zWriteElementText("fax3", company.detail2Fax); xw.zWriteElementText("email", company.headerEmail); xw.zWriteElementText("email2", company.detail1Email); xw.zWriteElementText("email3", company.detail2Email); xw.zWriteElementText("site", company.detail1WebSite); xw.zWriteElementText("site2", company.detail2WebSite); xw.zWriteElementText("présentation", company.detail1Presentation); xw.zWriteElementText("présentation2", company.detail2Presentation); xw.zWriteElementText("client", company.detail1Clients); xw.zWriteElementText("client2", company.detail2Clients); xw.zWriteElementText("dirigeant", company.detail1Leader); xw.zWriteElementText("dirigeant2", company.detail2Leader); xw.zWriteElementText("nb_salarié", company.detail1EmployeNumber.ToString()); xw.zWriteElementText("nb_salarié2", company.detail2EmployeNumber.ToString()); xw.zWriteElementText("chiffre_affaire", company.detail1LastYearRevenue); xw.zWriteElementText("chiffre_affaire2", company.detail2LastYearRevenue); xw.zWriteElementText("certification", company.detail1Certification); xw.zWriteElementText("certification2", company.detail2Certification); xw.zWriteElementText("siret", company.detail1Siret); xw.zWriteElementText("siret2", company.detail2Siret); //xw.zWriteElementText("load_date", string.Format("{0:dd/MM/yyyy HH:mm}", company.loadFromWebDate)); //xw.zWriteElementText("url_entête", company.urlHeader); xw.zWriteElementText("url_detail1", company.urlDetail1); xw.zWriteElementText("url_detail2", company.urlDetail2); xw.WriteEndElement(); while (detail) { bool headerActivity = headerActivities.MoveNext(); bool detail1Activity = detail1Activities.MoveNext(); bool detail2Activity = detail2Activities.MoveNext(); bool detail1Sector = detail1Sectors.MoveNext(); bool detail2Sector = detail2Sectors.MoveNext(); bool detail1DownloadDocument = detail1DownloadDocuments.MoveNext(); bool detail2DownloadDocument = detail2DownloadDocuments.MoveNext(); bool detail1Photo = detail1Photos.MoveNext(); bool detail2Photo = detail2Photos.MoveNext(); bool headerUnknowInfo = headerUnknowInfos.MoveNext(); bool detail1UnknowInfo = detail1UnknowInfos.MoveNext(); bool detail2UnknowInfo = detail2UnknowInfos.MoveNext(); if (!headerActivity && !detail1Activity && !detail2Activity && !detail1Sector && !detail2Sector && !detail1DownloadDocument && !detail2DownloadDocument && !headerUnknowInfo && !detail1UnknowInfo && !detail2UnknowInfo) break; xw.WriteStartElement("Company"); if (headerActivity) xw.zWriteElementText("activité", headerActivities.Current); if (detail1Activity) xw.zWriteElementText("activité2", detail1Activities.Current); if (detail2Activity) xw.zWriteElementText("activité3", detail2Activities.Current); if (detail1Sector) xw.zWriteElementText("filière", detail1Sectors.Current); if (detail2Sector) xw.zWriteElementText("filière2", detail2Sectors.Current); if (detail1DownloadDocument) { xw.zWriteElementText("document", detail1DownloadDocuments.Current.name); xw.zWriteElementText("document_url", detail1DownloadDocuments.Current.url); } if (detail2DownloadDocument) { xw.zWriteElementText("document2", detail2DownloadDocuments.Current.name); xw.zWriteElementText("document2_url", detail2DownloadDocuments.Current.url); } if (detail1Photo) xw.zWriteElementText("image", detail1Photos.Current); if (detail2Photo) xw.zWriteElementText("image2", detail2Photos.Current); if (headerUnknowInfo) xw.zWriteElementText("inconnu", headerUnknowInfos.Current); if (detail1UnknowInfo) xw.zWriteElementText("inconnu2", detail1UnknowInfos.Current); if (detail2UnknowInfo) xw.zWriteElementText("inconnu3", detail2UnknowInfos.Current); xw.WriteEndElement(); } }
public static void GetCompany_Duplicate(Unea_Company company, Unea_Company_DuplicateExists duplicate) { if (company.detail1Name != null) duplicate.detail1Name = true; if (company.detail2Name != null) duplicate.detail2Name = true; if (company.detail1Location != null) duplicate.detail1Location = true; if (company.detail2Address != null) duplicate.detail2Address = true; if (company.detail1Phone != null) duplicate.detail1Phone = true; if (company.detail2Phone != null) duplicate.detail2Phone = true; if (company.detail1Fax != null) duplicate.detail1Fax = true; if (company.detail2Fax != null) duplicate.detail2Fax = true; if (company.detail1Email != null) duplicate.detail1Email = true; if (company.detail2Email != null) duplicate.detail2Email = true; if (company.detail2WebSite != null) duplicate.detail2WebSite = true; if (company.detail2Presentation != null) duplicate.detail2Presentation = true; if (company.detail2Clients != null) duplicate.detail2Clients = true; if (company.detail2Leader != null) duplicate.detail2Leader = true; if (company.detail2EmployeNumber != null) duplicate.detail2EmployeNumber = true; if (company.detail2LastYearRevenue != null) duplicate.detail2LastYearRevenue = true; if (company.detail2Certification != null) duplicate.detail2Certification = true; if (company.detail2Siret != null) duplicate.detail2Siret = true; if (company.detail1Activities.Count > 0) duplicate.detail1Activities = true; if (company.detail2Activities.Count > 0) duplicate.detail2Activities = true; if (company.detail2Sectors.Count > 0) duplicate.detail2Sectors = true; if (company.detail2DownloadDocuments.Count > 0) duplicate.detail2DownloadDocuments = true; if (company.detail2Photos.Count > 0) duplicate.detail2Photos = true; if (company.headerUnknowInfos.Count > 0) duplicate.headerUnknowInfos = true; if (company.detail1UnknowInfos.Count > 0) duplicate.detail1UnknowInfos = true; if (company.detail2UnknowInfos.Count > 0) duplicate.detail2UnknowInfos = true; }
private static void Export_Duplicate(Unea_Company_DuplicateExists duplicate, string dir) { string file = Path.Combine(dir, "Unea_duplicate.txt"); using (StreamWriter sw = new StreamWriter(new FileStream(file, FileMode.Create, FileAccess.Write, FileShare.Read), Encoding.UTF8)) { sw.WriteLine("société2 : {0}", duplicate.detail1Name ? "contient des valeurs" : ""); sw.WriteLine("société3 : {0}", duplicate.detail2Name ? "contient des valeurs" : ""); sw.WriteLine("emplacement2 : {0}", duplicate.detail1Location ? "contient des valeurs" : ""); sw.WriteLine("adresse2 : {0}", duplicate.detail2Address ? "contient des valeurs" : ""); sw.WriteLine("tel2 : {0}", duplicate.detail1Phone ? "contient des valeurs" : ""); sw.WriteLine("tel3 : {0}", duplicate.detail2Phone ? "contient des valeurs" : ""); sw.WriteLine("fax2 : {0}", duplicate.detail1Fax ? "contient des valeurs" : ""); sw.WriteLine("fax3 : {0}", duplicate.detail2Fax ? "contient des valeurs" : ""); sw.WriteLine("email2 : {0}", duplicate.detail1Email ? "contient des valeurs" : ""); sw.WriteLine("email3 : {0}", duplicate.detail2Email ? "contient des valeurs" : ""); sw.WriteLine("site2 : {0}", duplicate.detail2WebSite ? "contient des valeurs" : ""); sw.WriteLine("présentation2 : {0}", duplicate.detail2Presentation ? "contient des valeurs" : ""); sw.WriteLine("client2 : {0}", duplicate.detail2Clients ? "contient des valeurs" : ""); sw.WriteLine("dirigeant2 : {0}", duplicate.detail2Leader ? "contient des valeurs" : ""); sw.WriteLine("nb_salarié2 : {0}", duplicate.detail2EmployeNumber ? "contient des valeurs" : ""); sw.WriteLine("chiffre_affaire2 : {0}", duplicate.detail2LastYearRevenue ? "contient des valeurs" : ""); sw.WriteLine("certification2 : {0}", duplicate.detail2Certification ? "contient des valeurs" : ""); sw.WriteLine("siret2 : {0}", duplicate.detail2Siret ? "contient des valeurs" : ""); sw.WriteLine("activité2 : {0}", duplicate.detail1Activities ? "contient des valeurs" : ""); sw.WriteLine("activité3 : {0}", duplicate.detail2Activities ? "contient des valeurs" : ""); sw.WriteLine("filière2 : {0}", duplicate.detail2Sectors ? "contient des valeurs" : ""); sw.WriteLine("document2 : {0}", duplicate.detail2DownloadDocuments ? "contient des valeurs" : ""); sw.WriteLine("image2 : {0}", duplicate.detail2Photos ? "contient des valeurs" : ""); sw.WriteLine("inconnu : {0}", duplicate.headerUnknowInfos ? "contient des valeurs" : ""); sw.WriteLine("inconnu2 : {0}", duplicate.detail1UnknowInfos ? "contient des valeurs" : ""); sw.WriteLine("inconnu3 : {0}", duplicate.detail2UnknowInfos ? "contient des valeurs" : ""); } }
public static void ExportXmlCompanyList(int startPage = 1, int maxPage = 1, bool reload = false, bool loadImage = false) { //WriteLine("ExportXmlCompanyList : startPage {0} maxPage {1} reload {2} loadImage {3}", startPage, maxPage, reload, loadImage); Init(); //_ExportXmlCompanyList(Unea.LoadDetailCompanyList(startPage, maxPage, reload, loadImage)); //string dir = @"c:\pib\dev_data\exe\wrun\damien\export"; //string file = dir + @"\Unea.xml"; //string fileDetail = dir + @"\UneaDetail.xml"; WriteLine("export Unea"); WriteLine(" file \"{0}\"", __xmlCompanyListFile); WriteLine(" file detail \"{0}\"", __xmlDetailCompanyListFile); XmlWriterSettings settings = new XmlWriterSettings(); settings.Encoding = Encoding.UTF8; settings.Indent = true; Unea_Company_DuplicateExists duplicate = new Unea_Company_DuplicateExists(); Unea_CompanyUniqueValues uniqueValues = new Unea_CompanyUniqueValues(); using (XmlWriter xw = XmlWriter.Create(__xmlCompanyListFile, settings), xwDetail = XmlWriter.Create(__xmlDetailCompanyListFile, settings)) { xw.WriteStartElement("Unea"); xwDetail.WriteStartElement("Unea"); Unea.LoadDetailCompanyList(startPage, maxPage, reload, loadImage).zForEach(company => { ExportXml_Company(xw, company, false); ExportXml_Company(xwDetail, company, true); GetCompany_Duplicate(company, duplicate); AddUniqueValues(uniqueValues, company); }); xw.WriteEndElement(); xwDetail.WriteEndElement(); } string dir = Path.GetDirectoryName(__xmlCompanyListFile); Export_Duplicate(duplicate, dir); ExportUniqueValues(uniqueValues, dir); }
public static void ExportXml_Company(XmlWriter xw, Unea_Company company, bool detail, Unea_Company_DuplicateExists duplicate = null) { IEnumerator <string> headerActivities = null; IEnumerator <string> detail1Activities = null; IEnumerator <string> detail2Activities = null; IEnumerator <string> detail1Sectors = null; IEnumerator <string> detail2Sectors = null; IEnumerator <Unea_Document> detail1DownloadDocuments = null; IEnumerator <Unea_Document> detail2DownloadDocuments = null; IEnumerator <string> detail1Photos = null; IEnumerator <string> detail2Photos = null; IEnumerator <string> headerUnknowInfos = null; IEnumerator <string> detail1UnknowInfos = null; IEnumerator <string> detail2UnknowInfos = null; if (detail) { headerActivities = ((IEnumerable <string>)company.headerActivities.Keys).GetEnumerator(); detail1Activities = ((IEnumerable <string>)company.detail1Activities.Keys).GetEnumerator(); detail2Activities = ((IEnumerable <string>)company.detail2Activities.Keys).GetEnumerator(); detail1Sectors = ((IEnumerable <string>)company.detail1Sectors.Keys).GetEnumerator(); detail2Sectors = ((IEnumerable <string>)company.detail2Sectors.Keys).GetEnumerator(); detail1DownloadDocuments = ((IEnumerable <Unea_Document>)company.detail1DownloadDocuments.Values).GetEnumerator(); detail2DownloadDocuments = ((IEnumerable <Unea_Document>)company.detail2DownloadDocuments.Values).GetEnumerator(); detail1Photos = ((IEnumerable <string>)company.detail1Photos.Keys).GetEnumerator(); detail2Photos = ((IEnumerable <string>)company.detail2Photos.Keys).GetEnumerator(); headerUnknowInfos = ((IEnumerable <string>)company.headerUnknowInfos).GetEnumerator(); detail1UnknowInfos = ((IEnumerable <string>)company.detail1UnknowInfos).GetEnumerator(); detail2UnknowInfos = ((IEnumerable <string>)company.detail2UnknowInfos).GetEnumerator(); } xw.WriteStartElement("Company"); xw.zWriteElementText("société", company.headerName); xw.zWriteElementText("société2", company.detail1Name); xw.zWriteElementText("société3", company.detail2Name); xw.zWriteElementText("emplacement", company.headerLocation); xw.zWriteElementText("emplacement2", company.detail1Location); if (detail) { string text1, text2; text1 = null; if (headerActivities.MoveNext()) { text1 = headerActivities.Current; } xw.zWriteElementText("activité", text1); text1 = null; if (detail1Activities.MoveNext()) { text1 = detail1Activities.Current; } xw.zWriteElementText("activité2", text1); text1 = null; if (detail2Activities.MoveNext()) { text1 = detail2Activities.Current; } xw.zWriteElementText("activité3", text1); text1 = null; if (detail1Sectors.MoveNext()) { text1 = detail1Sectors.Current; } xw.zWriteElementText("filière", text1); text1 = null; if (detail2Sectors.MoveNext()) { text1 = detail2Sectors.Current; } xw.zWriteElementText("filière2", text1); text1 = null; text2 = null; if (detail1DownloadDocuments.MoveNext()) { text1 = detail1DownloadDocuments.Current.name; text2 = detail1DownloadDocuments.Current.url; } xw.zWriteElementText("document", text1); xw.zWriteElementText("document_url", text2); text1 = null; text2 = null; if (detail2DownloadDocuments.MoveNext()) { text1 = detail2DownloadDocuments.Current.name; text2 = detail2DownloadDocuments.Current.url; } xw.zWriteElementText("document2", text1); xw.zWriteElementText("document2_url", text2); text1 = null; if (detail1Photos.MoveNext()) { text1 = detail1Photos.Current; } xw.zWriteElementText("image", text1); text1 = null; if (detail2Photos.MoveNext()) { text1 = detail2Photos.Current; } xw.zWriteElementText("image2", text1); text1 = null; if (headerUnknowInfos.MoveNext()) { text1 = headerUnknowInfos.Current; } xw.zWriteElementText("inconnu", text1); text1 = null; if (detail1UnknowInfos.MoveNext()) { text1 = detail1UnknowInfos.Current; } xw.zWriteElementText("inconnu2", text1); text1 = null; if (detail2UnknowInfos.MoveNext()) { text1 = detail2UnknowInfos.Current; } xw.zWriteElementText("inconnu3", text1); } xw.zWriteElementText("adresse", company.detail1Address); xw.zWriteElementText("adresse2", company.detail2Address); xw.zWriteElementText("tel", company.headerPhone); xw.zWriteElementText("tel2", company.detail1Phone); xw.zWriteElementText("tel3", company.detail2Phone); xw.zWriteElementText("fax", company.headerFax); xw.zWriteElementText("fax2", company.detail1Fax); xw.zWriteElementText("fax3", company.detail2Fax); xw.zWriteElementText("email", company.headerEmail); xw.zWriteElementText("email2", company.detail1Email); xw.zWriteElementText("email3", company.detail2Email); xw.zWriteElementText("site", company.detail1WebSite); xw.zWriteElementText("site2", company.detail2WebSite); xw.zWriteElementText("présentation", company.detail1Presentation); xw.zWriteElementText("présentation2", company.detail2Presentation); xw.zWriteElementText("client", company.detail1Clients); xw.zWriteElementText("client2", company.detail2Clients); xw.zWriteElementText("dirigeant", company.detail1Leader); xw.zWriteElementText("dirigeant2", company.detail2Leader); xw.zWriteElementText("nb_salarié", company.detail1EmployeNumber.ToString()); xw.zWriteElementText("nb_salarié2", company.detail2EmployeNumber.ToString()); xw.zWriteElementText("chiffre_affaire", company.detail1LastYearRevenue); xw.zWriteElementText("chiffre_affaire2", company.detail2LastYearRevenue); xw.zWriteElementText("certification", company.detail1Certification); xw.zWriteElementText("certification2", company.detail2Certification); xw.zWriteElementText("siret", company.detail1Siret); xw.zWriteElementText("siret2", company.detail2Siret); //xw.zWriteElementText("load_date", string.Format("{0:dd/MM/yyyy HH:mm}", company.loadFromWebDate)); //xw.zWriteElementText("url_entête", company.urlHeader); xw.zWriteElementText("url_detail1", company.urlDetail1); xw.zWriteElementText("url_detail2", company.urlDetail2); xw.WriteEndElement(); while (detail) { bool headerActivity = headerActivities.MoveNext(); bool detail1Activity = detail1Activities.MoveNext(); bool detail2Activity = detail2Activities.MoveNext(); bool detail1Sector = detail1Sectors.MoveNext(); bool detail2Sector = detail2Sectors.MoveNext(); bool detail1DownloadDocument = detail1DownloadDocuments.MoveNext(); bool detail2DownloadDocument = detail2DownloadDocuments.MoveNext(); bool detail1Photo = detail1Photos.MoveNext(); bool detail2Photo = detail2Photos.MoveNext(); bool headerUnknowInfo = headerUnknowInfos.MoveNext(); bool detail1UnknowInfo = detail1UnknowInfos.MoveNext(); bool detail2UnknowInfo = detail2UnknowInfos.MoveNext(); if (!headerActivity && !detail1Activity && !detail2Activity && !detail1Sector && !detail2Sector && !detail1DownloadDocument && !detail2DownloadDocument && !headerUnknowInfo && !detail1UnknowInfo && !detail2UnknowInfo) { break; } xw.WriteStartElement("Company"); if (headerActivity) { xw.zWriteElementText("activité", headerActivities.Current); } if (detail1Activity) { xw.zWriteElementText("activité2", detail1Activities.Current); } if (detail2Activity) { xw.zWriteElementText("activité3", detail2Activities.Current); } if (detail1Sector) { xw.zWriteElementText("filière", detail1Sectors.Current); } if (detail2Sector) { xw.zWriteElementText("filière2", detail2Sectors.Current); } if (detail1DownloadDocument) { xw.zWriteElementText("document", detail1DownloadDocuments.Current.name); xw.zWriteElementText("document_url", detail1DownloadDocuments.Current.url); } if (detail2DownloadDocument) { xw.zWriteElementText("document2", detail2DownloadDocuments.Current.name); xw.zWriteElementText("document2_url", detail2DownloadDocuments.Current.url); } if (detail1Photo) { xw.zWriteElementText("image", detail1Photos.Current); } if (detail2Photo) { xw.zWriteElementText("image2", detail2Photos.Current); } if (headerUnknowInfo) { xw.zWriteElementText("inconnu", headerUnknowInfos.Current); } if (detail1UnknowInfo) { xw.zWriteElementText("inconnu2", detail1UnknowInfos.Current); } if (detail2UnknowInfo) { xw.zWriteElementText("inconnu3", detail2UnknowInfos.Current); } xw.WriteEndElement(); } }
public static void GetCompany_Duplicate(Unea_Company company, Unea_Company_DuplicateExists duplicate) { if (company.detail1Name != null) { duplicate.detail1Name = true; } if (company.detail2Name != null) { duplicate.detail2Name = true; } if (company.detail1Location != null) { duplicate.detail1Location = true; } if (company.detail2Address != null) { duplicate.detail2Address = true; } if (company.detail1Phone != null) { duplicate.detail1Phone = true; } if (company.detail2Phone != null) { duplicate.detail2Phone = true; } if (company.detail1Fax != null) { duplicate.detail1Fax = true; } if (company.detail2Fax != null) { duplicate.detail2Fax = true; } if (company.detail1Email != null) { duplicate.detail1Email = true; } if (company.detail2Email != null) { duplicate.detail2Email = true; } if (company.detail2WebSite != null) { duplicate.detail2WebSite = true; } if (company.detail2Presentation != null) { duplicate.detail2Presentation = true; } if (company.detail2Clients != null) { duplicate.detail2Clients = true; } if (company.detail2Leader != null) { duplicate.detail2Leader = true; } if (company.detail2EmployeNumber != null) { duplicate.detail2EmployeNumber = true; } if (company.detail2LastYearRevenue != null) { duplicate.detail2LastYearRevenue = true; } if (company.detail2Certification != null) { duplicate.detail2Certification = true; } if (company.detail2Siret != null) { duplicate.detail2Siret = true; } if (company.detail1Activities.Count > 0) { duplicate.detail1Activities = true; } if (company.detail2Activities.Count > 0) { duplicate.detail2Activities = true; } if (company.detail2Sectors.Count > 0) { duplicate.detail2Sectors = true; } if (company.detail2DownloadDocuments.Count > 0) { duplicate.detail2DownloadDocuments = true; } if (company.detail2Photos.Count > 0) { duplicate.detail2Photos = true; } if (company.headerUnknowInfos.Count > 0) { duplicate.headerUnknowInfos = true; } if (company.detail1UnknowInfos.Count > 0) { duplicate.detail1UnknowInfos = true; } if (company.detail2UnknowInfos.Count > 0) { duplicate.detail2UnknowInfos = true; } }