Пример #1
0
 public override string CSVFromDataTable(DataTable dt)
 {
     if (dt == null)
     {
         throw new ArgumentNullException(nameof(dt));
     }
     NormalizeColumnNames(dt);
     using (DataTable dtDst = new DataTable())
     {
         dtDst.Locale = dt.Locale;
         CSVImporter.InitializeDataTable(dtDst);
         foreach (DataRow dr in dt.Rows)
         {
             eLogSite els = new eLogSite(dr);
             CSVImporter.WriteEntryToDataTable(els.ToLogbookEntry(), dtDst);
         }
         return(CsvWriter.WriteToString(dtDst, true, true));
     }
 }
Пример #2
0
        public override string CSVFromDataTable(DataTable dt)
        {
            if (dt == null)
            {
                throw new ArgumentNullException("dt");
            }
            IEnumerable <CustomPropertyType> rgcpt = CustomPropertyType.GetCustomPropertyTypes();

            NormalizeColumnNames(dt);
            using (DataTable dtDst = new DataTable())
            {
                dtDst.Locale = dt.Locale;
                CSVImporter.InitializeDataTable(dtDst);
                foreach (DataRow dr in dt.Rows)
                {
                    eLogSite els = new eLogSite(dr, rgcpt);
                    CSVImporter.WriteEntryToDataTable(els.ToLogbookEntry(), dtDst);
                }
                return(CsvWriter.WriteToString(dtDst, true, true));
            }
        }