Unlike copy table object, the same data field name field

static void WL_YZF_CopyFromRecord2ToRecord(Common _fromRecord,Common _toRecord)

{

DictTable fromDicTable,toDicTable;

DictField fromDictField;

fieldId tofieldId;

int fieldCnt,m;

;

fromDicTable = new DictTable(_fromRecord.TableId);

fieldCnt     = fromDicTable.fieldCnt();

toDicTable = new DictTable (_toRecord.TableId);

if(toDicTable.isMap() || toDicTable.isSystemTable() || toDicTable.isView())

return;

for(m = 1;m <= fieldCnt; m++)

{

fromDictField = new DictField(fromDicTable.id(),fromDicTable.fieldCnt2Id(m));

if(fromDictField.isSystem())

continue;

tofieldId = toDicTable.fieldName2Id(fromDictField.name());

if(tofieldId <=0)

continue;

_toRecord.(tofieldId) = _fromRecord.(fromDictField.id());

}

}

Guess you like

Origin www.cnblogs.com/xtwkh1973/p/10993114.html