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

    r6 r7  
    8282  LastTop := 8;
    8383  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));
    8587  if ObjectInfo.Count = 1 then begin
    8688
     
    8991
    9092    // 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`=' +
    9296      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'] + '`.`' +
    9499      ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' +
    95100      IntToStr(MainForm.SelectedItem));
     
    110115      Column := (Column + 1) mod 2;
    111116      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;
    117126end;
    118127
Note: See TracChangeset for help on using the changeset viewer.