📄 sfkfs_find_unit.pas
字号:
unit sfkfs_find_unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
Tsfkfs_find_form = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Edit1: TEdit;
procedure SpeedButton1Click(Sender: TObject);
procedure Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure SpeedButton2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
sfkfs_find_form: Tsfkfs_find_form;
implementation
uses sfkfs_unit, data_unit, dw_unit;
{$R *.dfm}
procedure Tsfkfs_find_form.SpeedButton1Click(Sender: TObject);
begin
with database do
begin
adoq3.Connection :=adoc;
adoq3.SQL.Clear;
case combobox1.ItemIndex of
0:
begin
case combobox2.ItemIndex of
0:
begin
adoq3.SQL.Add('select * from sfkfs where 方式编码=:fsbm');
adoq3.Parameters.ParamByName('fsbm').Value :=edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from sfkfs where 方式编码 like :fsbm2');
adoq3.Parameters.ParamByName('fsbm2').Value :=edit1.Text+'%';
end;
end;
end;
1:
begin
case combobox2.ItemIndex of
0:
begin
adoq3.SQL.Add('select * from sfkfs where 收付款方式=:sfkfs');
adoq3.Parameters.ParamByName('sfkfs').Value :=edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from sfkfs where 收付款方式 like :sfkfs2');
adoq3.Parameters.ParamByName('sfkfs2').Value :=edit1.Text+'%';
end;
end;
end;
2:
begin
case combobox2.ItemIndex of
0:
begin
adoq3.SQL.Add('select * from sfkfs where 说明=:sm');
adoq3.Parameters.ParamByName('sm').Value :=edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from sfkfs where 说明 like :sm2');
adoq3.Parameters.ParamByName('sm2').Value :=edit1.Text+'%';
end;
end;
end
else
begin
adoq3.SQL.Clear ;
adoq3.SQL.Add('select * from sfkfs order by 方式编码');
end;
end;
adoq3.Active :=true;
if adoq3.Recordset.RecordCount >0 then
begin
datas2.DataSet :=nil;
datas2.DataSet :=adoq3;
self.Hide ;
sfkfs_form.DBGrid1.DataSource:=datas2;
sfkfs_form.statusbar1.Panels[1].Text :=inttostr(adoq3.Recordset.RecordCount);
end
else
begin
showmessage('无此记录!');
end;
end;
end;
procedure Tsfkfs_find_form.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=vk_return then
speedbutton1click(nil);
end;
procedure Tsfkfs_find_form.SpeedButton2Click(Sender: TObject);
begin
close;
end;
procedure Tsfkfs_find_form.FormCreate(Sender: TObject);
begin
self.Height :=147;
self.Top :=110;
self.Left :=221;
self.Width :=339;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -