📄 ps_comwareamount.pas
字号:
unit PS_comwareamount;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Mask, DBCtrls,db, Menus;
type
TF_comwareamount = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
L_presentamount: TLabel;
E_productid: TDBEdit;
E_warehouseid: TDBEdit;
E_earlyamount: TDBEdit;
E_presentamount: TDBEdit;
procedure E_productidClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure beforeInsert;
procedure insert;
procedure afterinsert;
procedure HaveRecord;
procedure NoRecord;
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_comwareamount: TF_comwareamount;
firstappend:integer;
implementation
uses PS_db, PS_main;
{$R *.DFM}
//自定义函数部分
procedure TF_comwareamount.beforeInsert;
begin
with tf_comwareamount(f_main.ActiveMDIChild) do begin
e_productid.setfocus;
E_presentamount.ReadOnly:=false;
E_presentamount.TabStop:=true;
end;
end;
procedure TF_comwareamount.insert;
begin
with comdatabase.comwareamount do begin
f_comwareamount.beforeinsert;
if f_main.savetocache then
append;
end;
end;
procedure TF_comwareamount.afterinsert;
begin
with tf_comwareamount(f_main.ActiveMDIChild) do begin
E_presentamount.ReadOnly:=true;
E_presentamount.TabStop:=false;
end;
end;
procedure TF_comwareamount.NoRecord;
begin
with tf_comwareamount(f_main.activemdichild) do begin
E_productid.Enabled:=false;
E_warehouseid.Enabled:=false;
E_earlyamount.Enabled:=false;
E_presentamount.Enabled:=false;
end;
end;
procedure TF_comwareamount.HaveRecord;
begin
with tf_comwareamount(f_main.activemdichild) do begin
E_productid.Enabled:=true;
E_warehouseid.Enabled:=true;
E_earlyamount.Enabled:=true;
E_presentamount.Enabled:=true;
end;
end;
//程序正体部分
procedure TF_comwareamount.FormActivate(Sender: TObject);
begin
with comdatabase do begin
comwareamount.open;
end;
f_main.currentTable:=comdatabase.comwareamount;
f_main.TableName:=Rcomwareamount;
f_main.buttonstate;
end;
procedure TF_comwareamount.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
canclose:=f_main.savetocache;
end;
procedure TF_comwareamount.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
with comdatabase do begin
comwareamount.close;
end;
f_main.currentTable:=nil;
action:=cafree;
end;
procedure TF_comwareamount.E_productidClick(Sender: TObject);
begin
tedit(sender).selectall;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -