📄 epouqr.pas
字号:
unit EPOUQR;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids, DB;
type
TFormEPOUQR = class(TForm)
DBGrid1: TDBGrid;
Button1: TButton;
Button2: TButton;
Label1: TLabel;
DataSource1: TDataSource;
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormEPOUQR: TFormEPOUQR;
DocNum,CustCode: string;
implementation
Uses DataHJ;
{$R *.dfm}
procedure TFormEPOUQR.FormShow(Sender: TObject);
begin
if DocNum='0' then
begin
try
DataModHJ.ADOQuP0.Close;
DataModHJ.ADOQuP0.SQL.Clear;
DataModHJ.ADOQuP0.SQL.Add('select * from SDSLOR where CardCode=:P0');
DataModHJ.ADOQuP0.Parameters[0].Value:=CustCode;
DataModHJ.ADOQuP0.Prepared;
DataModHJ.ADOQuP0.Open;
except
exit;
end;
Label1.Caption:='订单 ';
end;// 从订单
if DocNum='1' then
begin
Label1.Caption:='交货 ';
try
DataModHJ.ADOQuP0.Close;
DataModHJ.ADOQuP0.SQL.Clear;
DataModHJ.ADOQuP0.SQL.Add('select * from SDODLN where CardCode=:P0');
DataModHJ.ADOQuP0.Parameters[0].Value:=CustCode;
DataModHJ.ADOQuP0.Prepared;
DataModHJ.ADOQuP0.Open;
except
exit;
end;
end;//交货
if DocNum='2' then
begin
Label1.Caption:='发票 ';
try
DataModHJ.ADOQuP0.Close;
DataModHJ.ADOQuP0.SQL.Clear;
DataModHJ.ADOQuP0.SQL.Add('select * from SDOINV where CardCode=:P0');
DataModHJ.ADOQuP0.Parameters[0].Value:=CustCode;
DataModHJ.ADOQuP0.Prepared;
DataModHJ.ADOQuP0.Open;
except
exit;
end;
end;//发票
end;
procedure TFormEPOUQR.Button1Click(Sender: TObject);
begin
if DataSource1.DataSet.RecordCount>0 then
DocNum:= (DBGrid1.Fields[0].Value);
DataModHJ.ADOQuP0.Close;
Close;
end;
procedure TFormEPOUQR.Button2Click(Sender: TObject);
begin
DataModHJ.ADOQuP0.Close;
Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -