【delphi开源代码栏目提醒】:网学会员为需要delphi开源代码的朋友们搜集整理了Fghdw.pas相关资料,希望对各位网友有所帮助!
unit Fghdw;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Fbase, Grids, DBGrids, DB, ADODB, StdCtrls, Buttons, ToolWin,
ComCtrls;
type
TF_ghdw = class(TF_base)
ToolBar1: TToolBar;
SpeedButton2: TSpeedButton;
SpeedButton1: TSpeedButton;
Edit1: TEdit;
ADOQuery1: TADOQuery;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
SpeedButton3: TSpeedButton;
ComboBox1: TComboBox;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure DBGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_ghdw: TF_ghdw;
implementation
uses Fdm,Fjhd,Fzct, Fjhthd,Fxsd, Fxsthd,Fzyxx,Ffk,Fsk,Fybfy;
{$R *.dfm}
procedure TF_ghdw.SpeedButton3Click(Sender: TObject);
var
searchwhat:string;
begin
inherited;
searchwhat:='';
case combobox1.ItemIndex of
0: searchwhat:='unitcode';
1: searchwhat:='fullname';
2: searchwhat:='name';
3: searchwhat:='shortcode';
end;
try
with ADoquery1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from tb_units ');
SQL.Add('where '+''+searchwhat+''+' like :a');
parameters.ParamByName('a').Value:='%'+Trim(Edit1.Text)+'%';
open;
end;
if Application.MessageBox('是否刷新表?','提示',mb_yesno)=Id_yes then
with ADoquery1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from tb_units order by unitcode asc');
open;
end;
except
Application.MessageBox('请正确输入条件','提示',mb_ok);
end;
end;
procedure TF_ghdw.SpeedButton2Click(Sender: TObject);
begin
inherited;
if F_zct.wf=1 then
F_jhd.Edit3.Text:=Adoquery1.Fields[1].AsString;
if F_zct.wf=2 then
F_jhthd.Edit3.Text:=Adoquery1.Fields[1].AsString;
if F_zct.wf=3 then
F_xsd.Edit3.Text:=adoquery1.Fields[1].AsString;
if F_zct.wf=4 then
F_xsthd.Edit3.Text:=adoquery1.Fields[1].AsString;
if F_zct.wf=5 then
F_zyxx.Edit1.Text:=adoquery1.Fields[1].AsString;
if F_zct.wf=6 then
F_fk.Edit3.Text:=adoquery1.Fields[1].AsString;
if F_zct.wf=7 then
F_sk.Edit3.Text:=adoquery1.Fields[1].AsString;
if F_zct.wf=9 then
F_ybfy.Edit3.Text:=adoquery1.Fields[1].AsString;
Close;
end;
procedure TF_ghdw.FormShow(Sender: TObject);
begin
inherited;
with ADoquery1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from tb_units order by unitcode asc');
open;
end;
end;
procedure TF_ghdw.SpeedButton1Click(Sender: TObject);
begin
inherited;
close;
end;
procedure TF_ghdw.DBGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
inherited;
if key=13 then speedbutton2.Click;
end;
end.