Changeset 7 for trunk/Forms/UItemEdit.pas
- Timestamp:
- Dec 25, 2010, 9:53:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemEdit.pas
r6 r7 78 78 LastTop := 8; 79 79 Column := 0; 80 ObjectInfo := MainForm.Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject)); 80 try 81 ObjectInfo := TDbRows.Create; 82 MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject)); 81 83 if ObjectInfo.Count = 1 then begin 82 84 83 85 for I := Panel1.ControlCount - 1 downto 0 do 84 Panel1.Controls[I]. Destroy;86 Panel1.Controls[I].Free; 85 87 86 88 // Load column names 87 Properties := MainForm.Database.Query('SELECT * FROM `Property` WHERE `Object`=' + 89 try 90 Properties := TDbRows.Create; 91 MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' + 88 92 IntToStr(MainForm.SelectedObject)); 89 Values := MainForm.Database.Query('SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' + 93 Values := TDbRows.Create; 94 MainForm.Database.Query(Values, 'SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' + 90 95 ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' + 91 96 IntToStr(MainForm.SelectedItem)); … … 155 160 Column := (Column + 1) mod 2; 156 161 if Column = 0 then LastTop := LastTop + NewControl.Height + 4; 157 end else ShowMessage('Položka nenalezena'); 158 Values.Destroy; 159 Properties.Destroy; 160 end else ShowMessage('Objekt nenalezen'); 161 ObjectInfo.Destroy; 162 end else ShowMessage(SItemNotFound); 163 finally 164 Values.Free; 165 Properties.Free; 166 end; 167 end else ShowMessage(SObjectNotFound); 168 finally 169 ObjectInfo.Free; 170 end; 162 171 end; 163 172
Note:
See TracChangeset
for help on using the changeset viewer.