📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids,unit2;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
GroupBox1: TGroupBox;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
temp:integer;
begin
try
temp:=StrToInt(Edit1.Text);
except
on E: Exception do
begin
ShowMessage('输入非法!');
exit;
end;
end;
if ((temp<1001)or(temp>1015)) then
begin
ShowMessage('没有对应的雇员记录!');
exit;
end;
with DataModule1 do
begin
StoredProc1.Close;
StoredProc1.ParamByName('CUST_NO').AsInteger:=temp;
if StoredProc1.Prepared=false then
begin
StoredProc1.Prepare;
StoredProc1.ExecProc;
Label2.Caption:=StoredProc1.ParamByName('LINE1').AsString;
Label3.Caption:=StoredProc1.ParamByName('LINE2').AsString;
Label4.Caption:=StoredProc1.ParamByName('LINE3').AsString;
Label5.Caption:=StoredProc1.ParamByName('LINE4').AsString;
Label6.Caption:=StoredProc1.ParamByName('LINE5').AsString;
Label7.Caption:=StoredProc1.ParamByName('LINE6').AsString;
StoredProc1.UnPrepare;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Label2.Caption:='';
Label3.Caption:='';
Label4.Caption:='';
Label5.Caption:='';
Label6.Caption:='';
Label7.Caption:='';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -