if queTopic- IsEmpty return TfrmTask new TfrmTask this f- edtTaskName-

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if(queTopic->IsEmpty()){
return;
}
TfrmTask *f = new TfrmTask(this);
f->edtTaskName->Text="";
f->edtMark->Text="";
if(f->ShowModal()!=mrOk){
delete f;
return;
}
TADOStoredProc *st=CreateStProc(DataMod->ADOConnection,
"dbo.InsTask",
"@TaskName",ftString,ptInput,(Variant)f->edtTaskName->Text,
"@Topic_ID",ftInteger,ptInput,
(Variant)queTopic->FieldByName("Topic_ID")->Value,
"@Mark",ftInteger,ptInput,(Variant)f->edtMark->Text,
"@ID",ftInteger,ptOutput,(Variant)0,
0);
st->ExecProc();
int id=(int)st->Parameters->ParamByName("@ID")->Value;
SetCursorPosition(queTask,"Task_ID", id);
delete st;
delete f;