14. Juli 2015 17:28
IF DataOutbound_l.FIND('-') THEN BEGIN
Arr := Arr.CreateInstance(GETDOTNETTYPE(Type),1);
Arr.SetValue(GETDOTNETTYPE(BsonDocument),0);
Type := GETDOTNETTYPE(Dict);
Type := Type.MakeGenericType(Arr);
Dict := Activator.CreateInstance(Type);
REPEAT
Counter_l := 1;
RecRef_l.GETTABLE(DataOutbound_l);
BsonDocument.Clear;
BsonString := BsonString.BsonString(FORMAT(DataOutbound_l."Item No_"+'_'+DataOutbound_l.Variant_Code+'_'+DataOutbound_l.Supplier_No_));
BsonDocument.Add('_id',BsonString);
WHILE FieldNo_l[Counter_l]>0 DO
BEGIN
FieldRef_l := RecRef_l.FIELD(FieldNo_l[Counter_l]);
BsonString := BsonString.BsonString(FORMAT(FieldRef_l.VALUE));
BsonDocument.Add(FieldRef_l.NAME,BsonString);
Counter_l += 1;
END;
Dict.Add(BsonDocument);
UNTIL DataOutbound_l.NEXT=0;
MongoNAV.InsertMany2MongoDB(DataSetup_p.Database,DataSetup_p.Table,Dict);
END;
14. Juli 2015 18:14