Changeset 35 for trunk/USystem.pas
- Timestamp:
- Nov 25, 2011, 9:17:21 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/USystem.pas
r34 r35 147 147 implementation 148 148 149 uses 150 UCore; 151 149 152 resourcestring 150 153 SUnsupportedType = 'Unsupported property type "%s"'; … … 709 712 procedure TChronisObject.Load(ObjectId: Integer); 710 713 var 711 DbRows: TDbRows; 712 begin 713 try 714 DbRows := TDbRows.Create; 715 Base.Database.Query(DbRows, 'SELECT * FROM `' + ObjectTable + 716 '` WHERE `Id`=' + IntToStr(ObjectId)); 717 if DbRows.Count = 1 then begin 714 List: TListProxy; 715 begin 716 try 717 List := TListProxy.Create; 718 List.Client := Core.System.Client; 719 List.ObjectName := ObjectTable; 720 List.SchemaName := Core.System.Database.Database; 721 List.SetCondition('Id', IntToStr(ObjectId)); 722 List.Load; 723 if List.Objects.Count = 1 then begin 718 724 Id := ObjectId; 719 with DbRows[0]do begin720 Name := Values['Name'];721 Schema := Values['Schema'];722 GroupId := StrToInt( Values['Group']);723 Table := Values['Table'];724 PrimaryKey := Values['PrimaryKey'];725 with TObjectProxy(List.Objects[0]) do begin 726 Name := Properties.Values['Name']; 727 Schema := Properties.Values['Schema']; 728 GroupId := StrToInt(Properties.Values['Group']); 729 Table := Properties.Values['Table']; 730 PrimaryKey := Properties.Values['PrimaryKey']; 725 731 end; 726 732 end; 727 733 finally 728 DbRows.Free;734 List.Free; 729 735 end; 730 736 end;
Note:
See TracChangeset
for help on using the changeset viewer.