Changeset 7 for trunk/Forms/UItemAdd.pas


Ignore:
Timestamp:
Dec 25, 2010, 9:53:55 PM (14 years ago)
Author:
george
Message:
  • Updated: USqlDatabase library.
  • Added: Dependency to TemplateGenerics package.
  • Modified: Rest of czech strings translated to english.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemAdd.pas

    r5 r7  
    7777  LastTop := 8;
    7878  Column := 0;
    79   ObjectInfo := MainForm.Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
     79  try
     80  ObjectInfo := TDbRows.Create;
     81  MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    8082  if ObjectInfo.Count = 1 then begin
    8183
    8284    for I := Panel1.ControlCount - 1 downto 0 do
    83       Panel1.Controls[I].Destroy;
     85      Panel1.Controls[I].Free;
    8486
    8587    // Load column names
    86     Properties := MainForm.Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     88    try
     89    Properties := TDbRows.Create;
     90    MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    8791      IntToStr(MainForm.SelectedObject));
    8892    for I := 0 to Properties.Count - 1 do begin
     
    145149      if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    146150    end;
    147     Properties.Destroy;
    148   end else ShowMessage('Objekt nenalezen');
    149   ObjectInfo.Destroy;
     151
     152    finally
     153      Properties.Free;
     154    end;
     155  end else ShowMessage(SObjectNotFound);
     156  finally
     157    ObjectInfo.Free;
     158  end;
    150159end;
    151160
Note: See TracChangeset for help on using the changeset viewer.