Changeset 22 for trunk/Forms/UFormTables.pas
- Timestamp:
- Mar 24, 2018, 12:33:48 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormTables.pas
r21 r22 119 119 if FormTable.ShowModal = mrOk then begin 120 120 FormTable.Save(NewTable); 121 Tables.DbClient.Query('CREATE TABLE ' + NewTable.Name + ' (ID INTEGER)'); 121 Tables.DbClient.Query('INSERT INTO Model ( Name , Caption ) VALUES ( ' + 122 NewTable.Name + ' , ' + NewTable.Caption + ' )'); 122 123 ReloadList; 123 124 end else NewTable.Free; … … 130 131 if FormTable.ShowModal = mrOk then begin 131 132 FormTable.Save(TTable(ListView1.Selected.Data)); 133 DbClient.Query('UPDATE Model SET Name = ' + TTable(ListView1.Selected.Data).Name); 132 134 ReloadList; 133 135 end; … … 138 140 begin 139 141 if Assigned(ListView1.Selected) then begin 140 if MessageDlg(SRemoveTable, Format(SRemoveTableConfirm, [TTable(ListView1.Selected.Data). Name]),142 if MessageDlg(SRemoveTable, Format(SRemoveTableConfirm, [TTable(ListView1.Selected.Data).Caption]), 141 143 mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin 142 Tables.DbClient.Query('D ROP TABLE' + TTable(ListView1.Selected.Data).Name);144 Tables.DbClient.Query('DELETE FROM Model WHERE Name = ' + TTable(ListView1.Selected.Data).Name); 143 145 ReloadList; 144 146 end; … … 175 177 end; 176 178 for C := 0 to FormFields.Fields.Count - 1 do begin 177 OldField := OldTable.Fields. FindByName(TField(FormFields.Fields[C]).Name);179 OldField := OldTable.Fields.SearchByName(TField(FormFields.Fields[C]).Name); 178 180 if Assigned(OldField) then begin 179 181 FI := OldTable.Fields.IndexOf(OldField); … … 210 212 procedure TFormTables.FormCreate(Sender: TObject); 211 213 begin 212 FTables := TTables.Create ;214 FTables := TTables.Create(False); 213 215 end; 214 216
Note:
See TracChangeset
for help on using the changeset viewer.