() 设置凭证输入窗体的代码如下
public { Public declarations } procedure SetToolBar(isEnable:bool); procedure SumAccount(); //执行新增和编辑操作后保存时会执行不同的代码 procedure OpType(opname:string); end; //对将要从dll中的调用的函数的声明 type Tshowdllform=function(Ahandle:Thandle; Acaption:string; tablename:string):string; stdcall; Ttable=array[] of string; var DocuInput: TDocuInput; maxnumrecordnumcurRowcurCol:integer; mytable:Ttable; op:string; implementation {$R *dfm} procedure TDocuInputFormClose(Sender: TObject; var Action: TCloseAction); begin action:=cafree; end; //初始化表 procedure TDocuInputDataSourceDataChange(Sender: TObject; Field: TField); var ij:integer; begin //设置数据表宽度 dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; //显示与凭证编号对应的分录表 adoqueryClose; adoquerySQLClear; adoquerySQLAdd(select distinct a*c科目名称 from 分录表 a凭证表 b科目表 c where (a凭证编号=+dbeditText+)and(a科目代码=c科目代码) order by 编号); adoqueryOpen; //初始化表将表格清空 for i:= to do for j:= to do if op<>insert then stringgridCells[ji]:=; //将分录表数据读入表格并保存编号数据以供后面的数据库操作使用 i:=; recordnum:=; while not adoqueryEof do begin stringgridCells[i]:=adoqueryfieldbyname(科目代码)AsString; stringgridCells[i]:=adoqueryfieldbyname(科目名称)AsString; stringgridCells[i]:=adoqueryfieldbyname(借方)AsString; stringgridCells[i]:=adoqueryfieldbyname(贷方)AsString; stringgridCells[i]:=adoqueryfieldbyname(摘要)AsString; mytable[i]:=adoqueryfieldbyname(编号)AsString; i:=i+; recordnum:=recordnum+; adoqueryNext; end; //设置分录表的列宽度 stringgridColWidths[]:=; stringgridColWidths[]:=; stringgridColWidths[]:=; stringgridColWidths[]:=; stringgridColWidths[]:=; //显示凭证数 labelCaption:=inttostr(datasourceDataSetRecordCount); end; [] [] [] |