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/UItemEdit.pas

    r6 r7  
    7878  LastTop := 8;
    7979  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));
    8183  if ObjectInfo.Count = 1 then begin
    8284
    8385    for I := Panel1.ControlCount - 1 downto 0 do
    84       Panel1.Controls[I].Destroy;
     86      Panel1.Controls[I].Free;
    8587
    8688    // 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`=' +
    8892      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'] + '`.`' +
    9095      ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' +
    9196      IntToStr(MainForm.SelectedItem));
     
    155160      Column := (Column + 1) mod 2;
    156161      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;
    162171end;
    163172
Note: See TracChangeset for help on using the changeset viewer.