📄 ckzpxx.pas
字号:
unit ckzpxx;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, DB, ADODB, StdCtrls;
type
Tfmckzpxx = class(TForm)
DBGrid1: TDBGrid;
Button1: TButton;
GroupBox1: TGroupBox;
Label1: TLabel;
ComboBox1: TComboBox;
Edit1: TEdit;
Button2: TButton;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fmckzpxx: Tfmckzpxx;
implementation
uses dm;
{$R *.dfm}
procedure Tfmckzpxx.Button1Click(Sender: TObject);
begin
fmdm.qryckzpxx.Close;
fmdm.qryckzpxx.SQL.Clear;
fmdm.qryckzpxx.SQL.Add('select * from tab_zpinf');
fmdm.qryckzpxx.Open;
end;
procedure Tfmckzpxx.Button2Click(Sender: TObject);
begin
if combobox1.Text='--请选择查询类别--' then
begin
messagedlg('请选择查询类别!',mtInformation, [mbYes],0);
exit;
end;
if edit1.Text='' then
begin
messagedlg('请输入查询条件!',mtInformation,[mbYes],0);
exit;
end;
fmdm.qryckzpxx.Close;
fmdm.qryckzpxx.SQL.Clear;
if combobox1.Text='按公司查询' then
begin
fmdm.qryckzpxx.SQL.Add('select * from tab_zpinf where zpinf_company=:A');
end;
if combobox1.Text='按职位查询' then
begin
fmdm.qryckzpxx.SQL.Add('select * from tab_zpinf where zpinf_position=:A');
end;
if combobox1.Text='按专业要求查询' then
begin
fmdm.qryckzpxx.SQL.Add('select * from tab_zpinf where zpinf_profession=:A');
end;
fmdm.qryckzpxx.Parameters.ParamByName('A').Value:=edit1.Text;
fmdm.qryckzpxx.Open;
if fmdm.qryckzpxx.RecordCount>0 then
begin
dbgrid1.Columns.Items[0].FieldName:='zpinf_id';
dbgrid1.Columns.Items[1].FieldName:='zpinf_company';
dbgrid1.Columns.Items[2].FieldName:='zpinf_position';
dbgrid1.Columns.Items[3].FieldName:='zpinf_profession';
dbgrid1.Columns.Items[4].FieldName:='zpinf_note';
end
else
begin
MessageDlg('没有相关记录!',mtInformation, [mbYes],0);
edit1.Text:='';
end;
end;
procedure Tfmckzpxx.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key in [#13] then button2.Click;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -