——此文章摘自《Delphi 数据库开发经典案例解析》定价¥特价¥购买>>http://tracklinktechcn/?m_id=dangdang&a_id=A&l=&l_type= width= height= border= nosave> //当商品信息数量单价不为空时才能进行计算 if (currentRow<>)and(stringgridCells[currentRow]<>)and(stringgridCells[ currentRow]<>)and(stringgridCells[currentRow]<>)and(stringgridCells[ currentRow]<>) then begin //计算某条销售单明细的进货金额税额和不含税额 //这里开始添加的代码是判断出货量的 //销售商品的数量不允许大于库存中的储存数量 adoqueryClose; adoquerySQLClear; adoquerySQLAdd(select 库存数量 from 库存库 where 货号 =+stringgridCells[currentRow]+); adoqueryOpen; if strtoint(stringgridCells[currentRow])>adoquery FieldByName(库存数量)AsInteger then begin showmessage(该库中此种商品的最大储量小于您的输入将按照最大储量出货); stringgridCells[currentRow]:=adoqueryFieldByName(库存数量)AsString; end; //计算某条销售单明细的进货金额税额和不含税额 number:=strtofloat(stringgridCells[currentRow]); price:=strtofloat(stringgridCells[currentRow]); tax:=strtofloat(stringgridCells[currentRow])/; stringgridCells[currentRow]:=floattostr(number*price); stringgridCells[currentRow]:=floattostr(tax*number*price/(+tax)); stringgridCells[currentRow]:=floattostr(number*price/(+tax)); right>[http://developcsaicn/delphi/htm>] [http://developcsaicn/delphi/htm>] [http://developcsaicn/delphi/htm>] [] |