- Регистрация
- 1 Мар 2015
- Сообщения
- 1,481
- Баллы
- 155
Код:
var
FDQ: TFDQuery;
begin
FDQ := TFDQuery.Create(Nil);
ListViewHavuz.BeginUpdate;
try
if ListViewHavuz.Selected = Nil then
Exit;
for I := Pred(ListViewHavuz.ItemCount) downto 0 do
begin
if ListViewHavuz.Items[I].Data['Select'].AsInteger = 2 then
begin
FDQ.Connection := FDConnection;
FDQ.Active := False;
FDQ.Close;
FDQ.SQL.Clear;
FDQ.SQL.Add('Delete From HAVUZ Where ID=:ID');
FDQ.ParamByName('ID').AsInteger := ListViewHavuz.Items[I].Data['Id'].AsInteger;
FDQ.ExecSQL;
ListViewHavuz.Items.Delete(ListViewHavuz.Items[I].Index);
end;
end;
finally
ListViewHavuz.EndUpdate;
FDQ.Free;
end;
end;