cxtj.pas

来自「实现人力资源的管理」· PAS 代码 · 共 68 行

PAS
68
字号
unit cxtj;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls;

type
  Tcxtjfrm = class(TForm)
    Label1: TLabel;
    ComboBox1: TComboBox;
    Edit1: TEdit;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    Label2: TLabel;
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  cxtjfrm: Tcxtjfrm;

implementation

{$R *.dfm}

uses dbdata;

procedure Tcxtjfrm.SpeedButton1Click(Sender: TObject);
var
b:string;          
begin
if (trim(combobox1.Text)<>'') and (trim(edit1.Text)<>'') then
begin
if combobox1.Text='姓名' then
b:='姓名'
else
if combobox1.Text='编号' then
b:='编号';
with data.ADOpublic do
   begin
      close;
      sql.Clear;
      sql.Add('select * from 人事表 where');
      sql.Add(b);
      sql.Add('= :a');
      parameters.ParamByName('a').Value:=trim(edit1.Text);
      open;
   end;
   data.ADOpublic.Active:=true;
   close;
end
else
   application.MessageBox('请设置查询条件!','提示',0+64);
end;

procedure Tcxtjfrm.SpeedButton2Click(Sender: TObject);
begin
close;
end;

end.

⌨️ 快捷键说明

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