?? unitprisch.pas
字號:
unit UnitPriSch;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ToolWin, Grids, DBGrids, ExtCtrls, StdCtrls, Mask,
DBCtrls, DB, DBTables;
type
TPriSch = class(TForm)
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
GroupBox1: TGroupBox;
Label1: TLabel;
Label3: TLabel;
Label2: TLabel;
CheckBox1: TCheckBox;
Edit1: TEdit;
Bevel2: TBevel;
DBGrid1: TDBGrid;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Splitter1: TSplitter;
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
PriSch: TPriSch;
implementation
uses unit1;
{$R *.dfm}
procedure TPriSch.ToolButton1Click(Sender: TObject);
var a:string;
begin
if checkbox1.Checked=true then
with datamodule1.ADOQryPriSch do
begin
sql.Clear;
sql.Text:='select * from 供應商信息';
a:=sql.Text;
if edit2.Text<>'' then begin sql.Text:=a+' where 供應商編號 like '+'''NS%''';open;end;
if edit3.Text<>'' then begin
sql.Text:=a+' where '+'供應商名稱 like '+'''上海%'''+' or '+'供應商名稱 like '+'''北京%'''+'or'+'供應商名稱 like '+'''廈門%''';
open;
end;
if edit4.Text<>'' then begin
sql.Text:=a+' where '+'所在城市 like '+'''上%'''+' or '+'所在城市 like '+'''北'''+ ' or '+'所在城市 like '+'''廈''';
open;
end;
edit1.Text:=edit1.Text+inttostr(datamodule1.ADOQryPriSch.RecordCount);
end
else
with datamodule1.ADOQryPriSch do
begin
sql.Clear;
sql.Text:='select * from 供應商信息';
a:=sql.Text;
if edit2.Text<>'' then begin sql.Text:=a+' where 供應商編號='+quotedstr(edit2.Text);open; end;
if edit3.Text<>'' then begin sql.Text:=a+' where 供應商名稱='+quotedstr(edit3.Text);open; end;
if edit4.Text<>'' then begin sql.Text:=a+' where 所在城市='+quotedstr(edit4.Text);open;end;
edit1.Text:=edit1.Text+inttostr(datamodule1.ADOQryPriSch.RecordCount);
end;
end;
procedure TPriSch.ToolButton5Click(Sender: TObject);
begin
PriSch.Close;
end;
procedure TPriSch.ToolButton3Click(Sender: TObject);
begin
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
end;
procedure TPriSch.FormCreate(Sender: TObject);
begin
datamodule1.ADOQryPriSch.open;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -