Added submodules + fix from Andrea Ciotti

This commit is contained in:
Daniele Teti 2018-03-14 12:30:41 +01:00
parent 47e8e05095
commit f09f12038f
4 changed files with 25 additions and 9 deletions

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "lib\\loggerpro"]
path = lib\\loggerpro
url = https://github.com/danieleteti/loggerpro.git
[submodule "lib\\dmustache"]
path = lib\\dmustache
url = https://github.com/synopse/dmustache.git

1
lib/dmustache Submodule

@ -0,0 +1 @@
Subproject commit bf2d1a881f9e6c91a5239209b16593c1d8e75de8

1
lib/loggerpro Submodule

@ -0,0 +1 @@
Subproject commit 583c1a319f0dacaf52bf3a86bfaab633071458ea

View File

@ -190,7 +190,7 @@ procedure TDataSetHelper.LoadFromJSONArray(AJSONArray: TJSONArray;
begin
Self.DisableControls;
try
raise Exception.Create('Not Implemented');
raise Exception.Create('Not Implemented');
finally
Self.EnableControls;
end;
@ -278,6 +278,7 @@ var
Value: TValue;
FoundAttribute: boolean;
FoundTransientAttribute: boolean;
LField: TField;
begin
_dict := TDictionary<string, string>.Create();
_keys := TDictionary<string, boolean>.Create();
@ -307,21 +308,28 @@ begin
end;
for _field in _fields do
begin
if not _dict.TryGetValue(_field.Name, field_name) then
Continue;
LField := ADataSet.FindField(field_name);
if not Assigned(LField) then
Continue;
case _field.PropertyType.TypeKind of
tkEnumeration: // tristan
begin
if _field.PropertyType.Handle = TypeInfo(boolean) then
begin
case ADataSet.FieldByName(field_name).DataType of
case LField.DataType of
ftInteger, ftSmallint, ftLargeint:
begin
Value := (ADataSet.FieldByName(field_name).AsInteger = 1);
Value := (LField.AsInteger = 1);
end;
ftBoolean:
begin
Value := ADataSet.FieldByName(field_name).AsBoolean;
Value := LField.AsBoolean;
end;
else
Continue;
@ -329,15 +337,15 @@ begin
end;
end;
tkInteger:
Value := ADataSet.FieldByName(field_name).AsInteger;
Value := LField.AsInteger;
tkInt64:
Value := ADataSet.FieldByName(field_name).AsLargeInt;
Value := LField.AsLargeInt;
tkFloat:
Value := ADataSet.FieldByName(field_name).AsFloat;
Value := LField.AsFloat;
tkString:
Value := ADataSet.FieldByName(field_name).AsString;
Value := LField.AsString;
tkUString, tkWChar, tkLString, tkWString:
Value := ADataSet.FieldByName(field_name).AsWideString;
Value := LField.AsWideString;
else
Continue;
end;