if CB1.Checked = true then
begin
Ndm.AQ_common.Close;
Ndm.AQ_common.SQL.Clear;
Ndm.AQ_common.SQL.Add('delete courses where type = 31 and a_id = '''+inttostr(criterions_id)+'''');
Ndm.AQ_common.ExecSQL;
CB1.Checked := false;
exit;
end
else
begin
Ndm.AQ_common.Close;
Ndm.AQ_common.SQL.Clear;
Ndm.AQ_common.SQL.Add('insert into courses (a_id,type) values ('''+inttostr(criterions_id)+''',31)');
Ndm.AQ_common.ExecSQL;
CB1.Checked := true;
exit;
end;
begin
Ndm.AQ_common.Close;
Ndm.AQ_common.SQL.Clear;
Ndm.AQ_common.SQL.Add('delete courses where type = 31 and a_id = '''+inttostr(criterions_id)+'''');
Ndm.AQ_common.ExecSQL;
CB1.Checked := false;
exit;
end
else
begin
Ndm.AQ_common.Close;
Ndm.AQ_common.SQL.Clear;
Ndm.AQ_common.SQL.Add('insert into courses (a_id,type) values ('''+inttostr(criterions_id)+''',31)');
Ndm.AQ_common.ExecSQL;
CB1.Checked := true;
exit;
end;
begin
try
Ndm.AQ_common.Close;
Ndm.AQ_common.SQL.Clear;
Ndm.AQ_common.SQL.Add('select * from courses where type = 31 and a_id = '''+inttostr(criterions_id)+'''');
Ndm.AQ_common.Open;
if not Ndm.AQ_common.Eof then
begin
CB1.Checked := true;
end;
except
end; try
Ndm.AQ_common.Close;
Ndm.AQ_common.SQL.Clear;
Ndm.AQ_common.SQL.Add('select * from courses where type = 32 and a_id = '''+inttostr(criterions_id)+'''');
Ndm.AQ_common.Open;
if not Ndm.AQ_common.Eof then
begin
CB2.Checked := true;
end;
except
end;
end;