Ignore:
Timestamp:
Sep 10, 2022, 10:54:56 PM (2 years ago)
Author:
chronos
Message:
  • Fixed: Load table fields in records list and record edit form.
  • Fixed: Record add needs to insert new row into database.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormFields.pas

    r28 r29  
    160160
    161161procedure TFormFields.ReloadList;
    162 var
    163   DbRows: TDbRows;
    164   NewField: TField;
    165   I: Integer;
    166162begin
    167   Fields.Clear;
    168   DbRows := TDbRows.Create;
    169   try
    170     Fields.Table.DbClient.Query('SELECT * FROM ModelField WHERE Model = ' + Fields.Table.Name, DbRows);
    171     for I := 0 to DbRows.Count - 1 do begin
    172       NewField := Fields.AddNew(DbRows[I].Items['Name'],
    173         Fields.Table.DbClient.DbManager.DataTypes.SearchByName(DbRows[I].Items['DataType']));
    174       NewField.TextBefore := DbRows[I].Items['Caption'];
    175     end;
    176   finally
    177     DbRows.Free;
    178   end;
     163  Fields.Load;
    179164
    180165  ListView1.Items.Count := Fields.Count;
Note: See TracChangeset for help on using the changeset viewer.