Changeset 7 for trunk/Forms/UItemView.pas
- Timestamp:
- Dec 25, 2010, 9:53:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemView.pas
r6 r7 82 82 LastTop := 8; 83 83 Column := 0; 84 ObjectInfo := MainForm.Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject)); 84 try 85 ObjectInfo := TDbRows.Create; 86 MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject)); 85 87 if ObjectInfo.Count = 1 then begin 86 88 … … 89 91 90 92 // Load column names 91 Properties := MainForm.Database.Query('SELECT * FROM `Property` WHERE `Object`=' + 93 try 94 Properties := TDbRows.Create; 95 MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' + 92 96 IntToStr(MainForm.SelectedObject)); 93 Values := MainForm.Database.Query('SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' + 97 Values := TDbRows.Create; 98 MainForm.Database.Query(Values, 'SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' + 94 99 ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' + 95 100 IntToStr(MainForm.SelectedItem)); … … 110 115 Column := (Column + 1) mod 2; 111 116 if Column = 0 then LastTop := LastTop + NewControl.Height + 4; 112 end else ShowMessage('Položka nenalezena'); 113 Values.Destroy; 114 Properties.Destroy; 115 end else ShowMessage('Objekt nenalezen'); 116 ObjectInfo.Free; 117 end else ShowMessage(SItemNotFound); 118 finally 119 Values.Free; 120 Properties.Free; 121 end; 122 end else ShowMessage(SObjectNotFound); 123 finally 124 ObjectInfo.Free; 125 end; 117 126 end; 118 127
Note:
See TracChangeset
for help on using the changeset viewer.