📄 addfymc_u.pas
字号:
unit ADDFYMC_U;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, DB;
type
TAddFYMC = class(TForm)
Panel1: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
Panel2: TPanel;
Panel3: TPanel;
Label3: TLabel;
Edit1: TEdit;
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo);
message WM_GETMINMAXINFO;
public
{ Public declarations }
end;
var
AddFYMC: TAddFYMC;
implementation
uses DB_U;
{$R *.dfm}
procedure TADDFYMC.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo);
begin
with Message.MinMaxInfo^ do
begin
ptMinTrackSize := Point(440, 129);
ptMaxTrackSize := Point(440, 129);
end;
end;
procedure TAddFYMC.SpeedButton1Click(Sender: TObject);
begin
with customerdata.ADOQuery4 do begin
edit1.text:=Trim(edit1.text);
close;
SQL.clear;
SQL.ADD('select * from FYMC where 用品名称='''+edit1.Text+'''');
open;
if RecordCount<>0 then
Application.MessageBox('用品名称重复!请再次录入!','注意',MB_Iconexclamation+MB_oK)
else begin
close;
SQL.clear;
SQL.ADD('Insert into FYMC(用品名称)');
SQL.ADD('Values(:MC)');
Parameters.ParamByName('MC').Value:=edit1.text;
ExecSQL;
// close;
customerdata.ADOQuery3.close;
customerdata.ADOQuery3.SQL.Clear;
customerdata.ADOQuery3.SQL.Add('Select * from FYMC ');
customerdata.ADOQuery3.open;
customerdata.ADOQuery3.Locate('用品名称',edit1.Text, [loCaseInsensitive,loPartialKey]);
end;//else begin
end;
end;
procedure TAddFYMC.SpeedButton2Click(Sender: TObject);
begin
Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -