156
c:=DataInfo.qQuery.RecordCount;
DataInfo.qQuery.Close;
if c>0 then
begin
MessageDlg('Данная норма уже используется! Удаление
невозможно!',mtError,[mbOk],0);
Exit
end;
if MessageDlg('Вы действительно хотите удалить норму
'+DataInfo.qListNorms.FieldByName('NormName').asString+'?',mtConfirmation,[
mbYes, mbNo],0)=mrNo then Exit;
DataInfo.qQuery.Close;
DataInfo.qQuery.SQL.Clear;
DataInfo.qQuery.SQL.Add('delete from Norms where
Id='+DataInfo.qListNorms.FieldByName('Id').asString);
DataInfo.qQuery.ExecSQL;
DataInfo.qListNorms.Close;
DataInfo.qListNorms.Open;
end;
end;
end;
end.