public IBedRecord AdaptRecord(IBedRecord record, ILogger logger) { ArrayDataRecord res = new ArrayDataRecord(record.Structure); for (int i = 0; i < res.FieldCount; i++) { record.ReadValue(i); res.SeekValue(i); m_dda.AdaptValue(record, m_dstColTypes[i], res, m_outputConv, logger); } return(res); }
public ICdlRecord AdaptRecord(ICdlRecord record) { var res = new ArrayDataRecord(record.Structure); for (int i = 0; i < Math.Min(res.FieldCount, record.FieldCount); i++) { var targetColumn = _columnMap.GetTargetColumnBySourceIndex(i); if (targetColumn == null) { continue; } record.ReadValue(i); res.SeekValue(i); _dda.AdaptValue(record, targetColumn.CommonType, res, _outputConv); } return(res); }
protected static void GetValues(DmlfUpdateFieldCollection fields, List<ChangeSetValue> values, TableInfo table, IDialectDataAdapter dda, ICdlValueConvertor converter) { var input = new CdlValueHolder(); var output = new CdlValueHolder(); foreach (var col in values) { var colinfo = table.FindColumn(col.Column); if (colinfo == null) continue; input.ReadFrom(col.Value); dda.AdaptValue(input, colinfo.CommonType, output, converter); fields.Add(new DmlfUpdateField { TargetColumn = colinfo.Name, Expr = new DmlfLiteralExpression { Value = output.GetValue(), } }); } }
protected static void GetValues(DmlfUpdateFieldCollection fields, List <ChangeSetValue> values, TableInfo table, IDialectDataAdapter dda, ICdlValueConvertor converter) { var input = new CdlValueHolder(); var output = new CdlValueHolder(); foreach (var col in values) { var colinfo = table.FindColumn(col.Column); if (colinfo == null) { continue; } input.ReadFrom(col.Value); dda.AdaptValue(input, colinfo.CommonType, output, converter); fields.Add(new DmlfUpdateField { TargetColumn = colinfo.Name, Expr = new DmlfLiteralExpression { Value = output.GetValue(), } }); } }