Example #1
0
 private void ExportUniqueValues(Unea_CompanyUniqueValues uniqueValues)
 {
     //zfile.CreateFileDirectory(_activitiesFile);
     //ExportValues(_activitiesFile, uniqueValues.Activities.Keys);
     zfile.CreateFileDirectory(_sectorsFile);
     ExportValues(_sectorsFile, uniqueValues.Sectors.Keys);
     zfile.CreateFileDirectory(_downloadDocumentsNameFile);
     ExportValues(_downloadDocumentsNameFile, uniqueValues.DownloadDocumentsName.Keys);
     zfile.CreateFileDirectory(_downloadDocumentsUrlFile);
     ExportValues(_downloadDocumentsUrlFile, uniqueValues.DownloadDocumentsUrl.Keys);
     zfile.CreateFileDirectory(_photosFile);
     ExportValues(_photosFile, uniqueValues.Photos.Keys);
     zfile.CreateFileDirectory(_unknowInfosFile);
     ExportValues(_unknowInfosFile, uniqueValues.UnknowInfos.Keys);
 }
Example #2
0
 public static void AddUniqueValues(Unea_CompanyUniqueValues uniqueValues, Unea_Company company)
 {
     //AddUniqueValues(uniqueValues.Activities, company.HeaderActivities.Keys);
     //AddUniqueValues(uniqueValues.Activities, company.Detail1Activities.Keys);
     //AddUniqueValues(uniqueValues.Activities, company.Detail2Activities.Keys);
     //SortedDictionary<string, SortedDictionary<string, string>>
     AddUniqueValues(uniqueValues.Sectors, company.Detail1Sectors.Keys);
     AddUniqueValues(uniqueValues.Sectors, company.Detail2Sectors.Keys);
     AddUniqueValues(uniqueValues.DownloadDocumentsName, from doc in company.Detail1DownloadDocuments select doc.Value.Name);
     AddUniqueValues(uniqueValues.DownloadDocumentsUrl, from doc in company.Detail1DownloadDocuments select doc.Value.Url);
     AddUniqueValues(uniqueValues.DownloadDocumentsName, from doc in company.Detail2DownloadDocuments select doc.Value.Name);
     AddUniqueValues(uniqueValues.DownloadDocumentsUrl, from doc in company.Detail2DownloadDocuments select doc.Value.Url);
     AddUniqueValues(uniqueValues.Photos, company.Detail1Photos.Keys);
     AddUniqueValues(uniqueValues.Photos, company.Detail2Photos.Keys);
     AddUniqueValues(uniqueValues.UnknowInfos, company.HeaderUnknowInfos);
     AddUniqueValues(uniqueValues.UnknowInfos, company.Detail1UnknowInfos);
     AddUniqueValues(uniqueValues.UnknowInfos, company.Detail2UnknowInfos);
 }
Example #3
0
        public void ExportXml(IEnumerable <HeaderDetail <Unea_Header_v2, Unea_Detail_v2> > headerDetails)
        {
            Trace.WriteLine("export Unea");
            Trace.WriteLine($"   file        \"{_xmlFile}\"");
            Trace.WriteLine($"   file detail \"{_detailXmlFile}\"");
            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Encoding = Encoding.UTF8;
            settings.Indent   = true;

            zfile.CreateFileDirectory(_xmlFile);
            zfile.CreateFileDirectory(_detailXmlFile);

            Unea_Company_DuplicateExists duplicate    = new Unea_Company_DuplicateExists();
            Unea_CompanyUniqueValues     uniqueValues = new Unea_CompanyUniqueValues();

            using (XmlWriter xw = XmlWriter.Create(_xmlFile, settings), xwDetail = XmlWriter.Create(_detailXmlFile, settings))
            {
                xw.WriteStartElement("Unea");
                xwDetail.WriteStartElement("Unea");

                foreach (HeaderDetail <Unea_Header_v2, Unea_Detail_v2> headerDetail in headerDetails)
                {
                    Unea_Company company = UneaData.AggregateCompanyData(headerDetail.Header, headerDetail.Detail);
                    UneaData.AggregateDuplicateData(company);
                    ExportXml_Company(xw, company, false);
                    ExportXml_Company(xwDetail, company, true);
                    UneaData.GetCompany_Duplicate(company, duplicate);
                    UneaData.AddUniqueValues(uniqueValues, company);
                }

                xw.WriteEndElement();
                xwDetail.WriteEndElement();
            }

            Export_Duplicate(duplicate);
            ExportUniqueValues(uniqueValues);
        }