Changeset 22 for trunk/Forms/UFormFields.pas
- Timestamp:
- Mar 24, 2018, 12:33:48 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormFields.pas
r20 r22 91 91 if FormField.ShowModal = mrOk then begin 92 92 FormField.Save(NewField); 93 Fields.Add(NewField); 93 Fields.Table.DbClient.Query('INSERT INTO ModelField ( Name , TextBefore) VALUES ( ' + 94 NewField.Name + ' , ' + NewField.TextBefore + ' )'); 94 95 ReloadList; 95 96 end else NewField.Free; … … 107 108 if FormField.ShowModal = mrOk then begin 108 109 FormField.Save(TField(ListView1.Selected.Data)); 110 Fields.Table.DbClient.Query('UPDATE ModelField SET TextBefore = ' + TField(ListView1.Selected.Data).TextBefore + 111 ' WHERE Name = ' + TField(ListView1.Selected.Data).Name); 109 112 ReloadList; 110 113 end; … … 120 123 begin 121 124 if Assigned(ListView1.Selected) then begin 122 Fields. Remove(ListView1.Selected.Data);125 Fields.Table.DbClient.Query('DELETE FROM ModelField WHERE Name = ' + TField(ListView1.Selected.Data).Name); 123 126 ReloadList; 124 127 UpdateInterface; … … 152 155 153 156 procedure TFormFields.ReloadList; 157 var 158 DbRows: TDbRows; 159 NewField: TField; 160 I: Integer; 154 161 begin 162 DbRows := TDbRows.Create; 163 Fields.Table.DbClient.Query('SELECT * FROM ModelField WHERE Model = ' + Fields.Table.Name, DbRows); 164 for I := 0 to DbRows.Count - 1 do begin 165 NewField := TField.Create; 166 NewField.Table := Fields.Table; 167 Fields.Add(NewField); 168 end; 169 DbRows.Free; 170 155 171 ListView1.Items.Count := Fields.Count; 156 172 ListView1.Repaint;
Note:
See TracChangeset
for help on using the changeset viewer.