109
begin
with DM do begin
if Q3posetiteli.State in [dsInsert,dsEdit] then
Q3posetiteli.Cancel;
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
with DM do begin
if Q3posetiteli.State=dsBrowse then
if MessageDlg('Удалить запись?'+#10#13+
'При этом соответствующие записи в '+
'подчиненных таблицах средствами СУБД будут удалены! ',
mtConfirmation,[mbYes,mbNo],0)=mrYes then
Q3posetiteli.Delete;
end;
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
with DM do begin
if NOT Q1zanyatiya.IsEmpty then begin
PRIM.Close;
PRIM.SQL.Clear;
PRIM.SQL.Add('select * from Zapis');
PRIM.SQL.Add('where
kod_zanyztiya='+Q1zanyatiya.FieldByName('kod_zanyztiya').AsString);
PRIM.SQL.Add('order by Nomer_zapisy');