khth_find_unit.pas
来自「delphi进销存管理系统 很不错得进销存管理系统 有很多skin得」· PAS 代码 · 共 153 行
PAS
153 行
unit khth_find_unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
Tkhth_find_form = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Edit1: TEdit;
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
khth_find_form: Tkhth_find_form;
implementation
uses data_unit, khth_unit;
{$R *.dfm}
procedure Tkhth_find_form.SpeedButton2Click(Sender: TObject);
begin
close;
end;
procedure Tkhth_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 khthd where 单据编码=:bm');
adoq3.Parameters.ParamByName('bm').Value := edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from khthd where 单据编码 like :bm2');
adoq3.Parameters.ParamByName('bm2').Value := edit1.Text + '%';
end;
end;
end;
1:
begin
case combobox2.ItemIndex of
0:
begin
adoq3.SQL.Add('select * from khthd where 客户名称=:mc');
adoq3.Parameters.ParamByName('mc').Value := edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from khthd where 客户名称 like :mc2');
adoq3.Parameters.ParamByName('mc2').Value := edit1.Text + '%';
end;
end;
end;
2:
begin
case combobox2.ItemIndex of
0:
begin
adoq3.SQL.Add('select * from khthd where 经手人 =:jm');
adoq3.Parameters.ParamByName('jm').Value := edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from khthd where 经手人 like :jm2');
adoq3.Parameters.ParamByName('jm2').Value := edit1.Text + '%';
end;
end;
end
else
begin
adoq3.SQL.Clear;
adoq3.SQL.Add('select * from khthd order by 编码');
end;
end;
adoq3.Active := true;
if adoq3.Recordset.RecordCount > 0 then
begin
datas2.DataSet := nil;
datas2.DataSet := adoq3;
self.Hide;
khth_form.DBGrid1.DataSource := datas2;
khth_form.statusbar1.Panels[1].Text := inttostr(adoq3.Recordset.RecordCount);
end
else
showmessage('无此记录!');
end;
end;
procedure Tkhth_find_form.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key = vk_return then
speedbutton1click(nil);
end;
procedure Tkhth_find_form.FormCreate(Sender: TObject);
begin
self.Height := 147;
self.Top := 110;
self.Left := 221;
self.Width := 339;
end;
end.
//此源码由程序太平洋收集整理发布,任何人都可自由转载,但需保留本站信息
//╭⌒╮┅~ ¤ 欢迎光临程序太平洋╭⌒╮
//╭⌒╭⌒╮╭⌒╮~╭⌒╮ ︶ ,︶︶
//,︶︶︶︶,''︶~~ ,''~︶︶ ,''
//╔ ╱◥███◣═╬╬╬╬╬╬╬╬╬╗
//╬ ︱田︱田 田 ︱ ╬
//╬ http://www.5ivb.net ╬
//╬ ╭○╮● ╬
//╬ /■\/■\ ╬
//╬ <| || 有希望,就有成功! ╬
//╬ ╬
//╚╬╬╬╬╬╬╬╬╬╬╗ ╔╬╬╬╬╝
//
//说明:
//专业提供VB、.NET、Delphi、ASP、PB源码下载
//包括:程序源码,控件,商业源码,系统方案,开发工具,书籍教程,技术文档
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?