//查询数据并显示 procedure TDocuInputBitBtnClick(Sender: TObject); begin adoqueryClose; adoquerySQLClear; adoquerySQLAdd(select * from 凭证表 where (凭证编号 like %+editText+%)and); adoquerySQLAdd((会计期间 like %+editText+%)and(日期 like %+editText+%)); adoqueryOpen; end; //为凭证录入分录表 procedure TDocuInputBitBtnClick(Sender: TObject); begin datasourceDataSetDelete; end; //统计分录表中的各项信息以储存到数据库 procedure TDocuInputSumAccount; var sumoutputsuminput:double; i:integer; begin suminput:=; sumoutput:=; //统计借贷双方的数额 for i:= to do if (stringgridCells[i]<>)and(stringgridCells[i]<>) then begin suminput:=suminput+strtofloat(stringgridCells[i]); sumoutput:=sumoutput+strtofloat(stringgridCells[i]); end; dbeditText:=floattostr(suminput); dbeditText:=floattostr(sumoutput); end; procedure TDocuInputDBEditExit(Sender: TObject); begin SumAccount; end; //设置分录表表头 procedure TDocuInputFormShow(Sender: TObject); begin stringgridCells[]:=科目编码; stringgridCells[]:=科目名称(双击选择); stringgridCells[]:=借方; stringgridCells[]:=贷方; stringgridCells[]:=摘要; end; //当在分录表中输入时不允许在上面有空行的情况下输入一行新的数据 procedure TDocuInputStringGridSelectCell(Sender: TObject; ACol ARow: Integer; var CanSelect: Boolean); begin //防止在输入数据时上面有空行 if stringgridCells[Arow]= then begin showmessage(请先完成上行中空的项目); exit; end; //保存选取的单元行列值 curRow:=ARow; curCol:=ACol; if (curCol<=)and(curCol>=) then stringgridOptions:=stringgridOptions+[goEditing]; //防止选中标题栏 if ARow= then curRow:=ARow+; //统计借贷双方信息 sumAccount(); end; [] [] [] |