📄 jh_th_find_unit.pas
字号:
unit jh_th_find_unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,data,jh_th_unit;
type
Tjh_th_find_form = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
ComboBox2: TComboBox;
Edit1: TEdit;
ComboBox1: TComboBox;
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
jh_th_find_form: Tjh_th_find_form;
implementation
{$R *.dfm}
procedure Tjh_th_find_form.SpeedButton2Click(Sender: TObject);
begin
close;
end;
procedure Tjh_th_find_form.SpeedButton1Click(Sender: TObject);
begin
begin
with data.Database do
begin
data.Database.ADOQ3.Connection :=data.Database.ADOC;
data.Database.ADOQ3.SQL.Clear;
case combobox1.ItemIndex of
0:
begin
case combobox2.ItemIndex of
0:
begin
data.Database.ADOQ3.SQL.Add('select * from jhthd where 单据编码=:bm');
data.Database.adoq3.Parameters.ParamByName('bm').Value :=edit1.Text;
end;
1:
begin
data.Database.adoq3.SQL.Add('select * from jhthd where 单据编码 like :bm2');
data.Database.adoq3.Parameters.ParamByName('bm2').Value :=edit1.Text+'%';
end;
end;
end;
1:
begin
case combobox2.ItemIndex of
0:
begin
data.Database.adoq3.SQL.Add('select * from jhthd where 供货商名称=:lx');
data.Database.adoq3.Parameters.ParamByName('lx').Value :=edit1.Text;
end;
1:
begin
data.Database.adoq3.SQL.Add('select * from jhthd where 供货商名称 like :lx2');
data.Database.adoq3.Parameters.ParamByName('lx2').Value :=edit1.Text+'%';
end;
end;
end;
2:
begin
case combobox2.ItemIndex of
0:
begin
data.Database.adoq3.SQL.Add('select * from jhthd where 经手人=:jsr');
data.Database.adoq3.Parameters.ParamByName('jsr').Value :=edit1.Text;
end;
1:
begin
data.Database.adoq3.SQL.Add('select * from jhthd where 经手人 like :jsr2');
data.Database.adoq3.Parameters.ParamByName('jsr2').Value :=edit1.Text+'%';
end;
end;
end
else
begin
data.Database.adoq3.SQL.Clear ;
data.Database.adoq3.SQL.Add('select * from jhthd order by 录单日期');
end;
end;
data.Database.adoq3.Active :=true;
if data.Database.adoq3.Recordset.RecordCount >0 then
begin
data.Database.datas2.DataSet :=nil;
data.Database.datas2.DataSet :=data.Database.adoq3;
self.Hide ;
jh_th_unit.jh_th_form.DBGrid1.DataSource:=data.Database.datas2;
jh_th_unit.jh_th_form.statusbar1.Panels[1].Text :=inttostr(data.Database.adoq3.Recordset.RecordCount);
end
else
showmessage('无此记录!');
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -