复制不同table对象,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());

}

}

猜你喜欢

转载自www.cnblogs.com/xtwkh1973/p/10993114.html
今日推荐