ioutstore.pas

来自「飞恒进销存(超市批发)管理系统V5.1(含源程序) 语言:Delphi 6/7」· PAS 代码 · 共 91 行

PAS
91
字号
unit IOutStore;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Unitmb, StdCtrls, Grids, DBGridEh, Buttons, ComCtrls, ExtCtrls,
  ToolWin, DB, ADODB, ImgList, Menus;

type
  TIOutStoreForm = class(TmbForm)
    procedure cbIdExit(Sender: TObject);
    procedure cmdSaveClick(Sender: TObject);
    procedure cmdPriorClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure cmdPrintClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  IOutStoreForm: TIOutStoreForm;

implementation

uses datamodule1, report2;

{$R *.dfm}

procedure TIOutStoreForm.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 I_outStoreD o,store s  where o.billid= :billid and o.barcode=s.barcode';
    setdetail.parameters[0].value:=nBillId;
    setDetail.open;

    nId:=1;
  end;
end;

procedure TIOutStoreForm.cmdSaveClick(Sender: TObject);
begin
  inherited;
  with  datamodule2  do
  begin
    setDetail.updatebatch;
    InsertIOutstore(nBillid,edtBillDate.date,'Comp','sUsrName','mktUsr','wUsr','sWhid');
  end;
end;

procedure TIOutStoreForm.cmdPriorClick(Sender: TObject);
begin
  inherited;
  with datamodule2 do
   if GetPrior('I_OutStore',nBillId) then
   begin
    nBillId:=adoquery1.fieldbyname('billId').asinteger;
    if setDetail.active then setdetail.close;
    setDetail.commandtext:='select o.*,s.name from I_outStoreD o,store s  where o.billid= :billid and o.barcode=s.barcode';
    setdetail.parameters[0].value:=nBillId;
    setDetail.open;
   end;
end;

procedure TIOutStoreForm.FormShow(Sender: TObject);
begin
  inherited;
  with datamodule2 do
  begin
    nBillId:=8888888;
    if setDetail.active then setdetail.close;
  end;
end;


procedure TIOutStoreForm.cmdPrintClick(Sender: TObject);
begin
  inherited;
    tablename:='I_OutstoreD';
    sName:='出仓单';
    FormRpt1.Printporder(false);
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?