?? ibuild.pas
字號(hào):
unit IBuild;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unitmb, StdCtrls, Grids, DBGridEh, Buttons, ComCtrls, ExtCtrls,
ToolWin, ImgList, Menus,adodb, FR_Ctrls;
type
TIBuildForm = class(TmbForm)
edtOutStore: TfrComboEdit;
Label1: TLabel;
edtQty: TEdit;
procedure cmdSaveClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
nOutStoreid:integer;
procedure InsertDetail;override;
public
{ Public declarations }
end;
var
IBuildForm: TIBuildForm;
implementation
uses datamodule1;
{$R *.dfm}
procedure TIBuildForm.InsertDetail;
var
sSql:string;
begin
with dataE2 do
begin
sSql:='( :billid, :itemno, :goodsid, :qty, :price, :memo1)';
adoCmd.commandtext:='insert into '+myTable+'D values '+sSql;
adoCmd.parameters[0].value:=nBillId;
adoCmd.parameters[1].value:=queryDetail.fieldbyname('itemno').asinteger;
adoCmd.parameters[2].value:=nGoodsId;
adoCmd.parameters[3].value:=nQty;
adoCmd.parameters[4].value:=queryDetail.fieldbyname('price').ascurrency;
adoCmd.parameters[5].value:=queryDetail.fieldbyname('memo1').asstring;
//插入或修改onhand
//InsertOnhand(nGoodsid,nStoreid,0,0,nQty);
adoCmd.execute;
end;
end;
procedure TIBuildForm.cmdSaveClick(Sender: TObject);
var
sStatus:TRecordStatusset;
sInvono:string;
begin
inherited;
with DataE2 do
begin
queryDetail.First;
while not queryDetail.eof do
begin
sStatus:=queryDetail.RecordStatus;
UpdateBatchDetail(sStatus);
queryDetail.Next;
end;
DeleteDetail;
sInvoNo:=getInvono(mytable,'NEW');
//queryDetail.updatebatch;
if bNew then
InsertIBuildTear(bNew,nBillid,nStoreid,nOutStoreId,nEmployid,nGoodsId,edtBillDate.date,edtInvoNo.text,edtmemo.text,myTable,0,0);
end;
end;
procedure TIBuildForm.FormShow(Sender: TObject);
begin
inherited;
mySql:='select o.*,s.code,s.name,s.units from I_BuildD o inner join goods s on o.goodsid=s.GoodsId where billid= :billid ';
myTable:='I_Build';
nTableid:=11;
with dataE2 do
begin
nBillId:=8888888;
if queryDetail.active then queryDetail.close;
querydetail.sql.clear;
queryDetail.sql.add(mySql);
end;
// DatePicker.Date:=now;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -