Ignore:
Timestamp:
Mar 26, 2018, 12:40:10 AM (6 years ago)
Author:
chronos
Message:
  • Modified: More changes to implement SQL over XML file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormTables.pas

    r22 r23  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ActnList, Menus, UDatabase;
     9  ActnList, Menus, UDatabase, SpecializedDictionary;
    1010
    1111type
     
    212212procedure TFormTables.FormCreate(Sender: TObject);
    213213begin
    214   FTables := TTables.Create(False);
     214  FTables := TTables.Create;
    215215end;
    216216
     
    232232procedure TFormTables.ReloadList;
    233233var
     234  DbRows: TDbRows;
     235  NewTable: TTable;
    234236  I: Integer;
    235237begin
    236   if Assigned(DbClient) then DbClient.LoadTables(Tables)
    237     else Tables.Clear;
     238  Tables.Clear;
     239  if Assigned(DbClient) then begin
     240    DbRows := TDbRows.Create;
     241    DbClient.Query('SELECT * FROM Model', DbRows);
     242    for I := 0 to DbRows.Count - 1 do begin
     243      NewTable := Tables.AddNew(TDictionaryStringString(DbRows[I]).Values['Name']);
     244      NewTable.Caption := TDictionaryStringString(DbRows[I]).Values['Caption'];
     245    end;
     246    DbRows.Free;
     247  end;
     248
    238249  for I := 0 to Tables.Count - 1 do
    239250    TTable(Tables[I]).LoadRecordsCount;
Note: See TracChangeset for help on using the changeset viewer.