Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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(),
                     }
             });
     }
 }
Ejemplo n.º 4
0
        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(),
                    }
                });
            }
        }