⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.~pas

📁 Delphi_7.0数据库开发源代码。有内容十一章节
💻 ~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);
  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;
      end;
    end;
end;

end.

⌨️ 快捷键说明

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