private DataRow getVersion1Row(IVersionAgnostic csvData, IList <string> csvColumnNames, DataRow dataRow)
 {
     for (int columnCount = 0; columnCount < csvColumnNames.Count; columnCount++)
     {
         dataRow[csvColumnNames[columnCount]] = csvWithDataVersionPropertyValueService.version1(csvData, csvColumnNames[columnCount]);
     }
     return(dataRow);
 }
        private DataRow getRow(TableVersion.Value tableVersion, IVersionAgnostic csvData, IList <string> csvColumnNames, DataTable dataTable)
        {
            var dataRow = dataTable.NewRow();

            if (tableVersion == TableVersion.Value.Version1)
            {
                return(getVersion1Row(csvData, csvColumnNames, dataRow));
            }

            return(getVersion2Row(csvData, csvColumnNames, dataRow));
        }
 private string getCsvRow(TableVersion.Value tableVersion, IVersionAgnostic csvData, IList <string> csvColumnNames)
 {
     if (tableVersion == TableVersion.Value.Version1)
     {
         var csvDataList = new List <string>();
         for (int columnCount = 0; columnCount < csvColumnNames.Count; columnCount++)
         {
             csvDataList.Add(csvWithDataVersionPropertyValueService.version1(csvData, csvColumnNames[columnCount]).ToString());
         }
         return(String.Join(",", csvDataList));
     }
     else
     {
         var csvDataList = new List <string>();
         for (int columnCount = 0; columnCount < csvColumnNames.Count; columnCount++)
         {
             csvDataList.Add(csvWithDataVersionPropertyValueService.version2(csvData, csvColumnNames[columnCount]).ToString());
         }
         return(String.Join(",", csvDataList));
     }
 }
コード例 #4
0
 public object version1(IVersionAgnostic csvData, string csvColumnName)
 {
     return(new csvWithDataVersion1().GetType().GetProperty(csvColumnName).GetValue((csvWithDataVersion1)csvData, null));
 }