?? sorder.pas
字號:
unit SOrder;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unitmb, StdCtrls, Grids, DBGridEh, Buttons, ComCtrls, ExtCtrls,
ToolWin, ImgList, Menus;
type
TSOrderForm = class(TmbForm)
procedure cmdSaveClick(Sender: TObject);
procedure cbIdExit(Sender: TObject);
procedure cmdPriorClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure cmdPrintClick(Sender: TObject);
procedure cmdNextClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
SOrderForm: TSOrderForm;
implementation
uses datamodule1, report2;
{$R *.dfm}
procedure TSOrderForm.cmdSaveClick(Sender: TObject);
begin
inherited;
with datamodule2 do
begin
setDetail.updatebatch;
InsertSorder(nBillid,edtBillDate.date,'Comp','sUsrName','mktUsr','wUsr','sWhid');
end;
end;
procedure TSOrderForm.cbIdExit(Sender: TObject);
begin
inherited;
with datamodule2 do
begin
nBillId:=GetBillId('NEW');
if setDetail.active then setdetail.close;
setDetail.commandtext:='select o.*,s.name,s.units from S_orderD o,store s where o.billid= :billid and o.barcode=s.barcode';
setdetail.parameters[0].value:=nBillId;
setDetail.open;
nId:=1;
end;
end;
procedure TSOrderForm.cmdPriorClick(Sender: TObject);
begin
inherited;
with datamodule2 do
if GetPrior('S_order',nBillId) then
begin
nBillId:=adoquery1.fieldbyname('billId').asinteger;
if setDetail.active then setdetail.close;
setDetail.commandtext:='select o.*,s.name,s.units from S_orderD o,store s where o.billid= :billid and o.barcode=s.barcode';
setdetail.parameters[0].value:=nBillId;
setDetail.open;
end;
end;
procedure TSOrderForm.FormShow(Sender: TObject);
begin
inherited;
with datamodule2 do
begin
nBillId:=8888888;
if setDetail.active then setdetail.close;
end;
end;
procedure TSOrderForm.cmdPrintClick(Sender: TObject);
begin
inherited;
tablename:='S_OrderD';
sName:='銷售訂單';
FormRpt1.Printporder(false);
end;
procedure TSOrderForm.cmdNextClick(Sender: TObject);
begin
inherited;
with datamodule2 do
if GetNext('S_order',nBillId) then
begin
nBillId:=adoquery1.fieldbyname('billId').asinteger;
if setDetail.active then setdetail.close;
setDetail.commandtext:='select o.*,s.name,s.units from S_orderD o,store s where o.billid= :billid and o.barcode=s.barcode';
setdetail.parameters[0].value:=nBillId;
setDetail.open;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -