📄 dzdyunit.pas
字号:
unit dzdyunit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
Tdzdy = class(TForm)
Panel1: TPanel;
Button1: TButton;
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label1: TLabel;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Label2: TLabel;
Edit1: TEdit;
Label3: TLabel;
procedure ComboBox1Exit(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
dzdy: Tdzdy;
implementation
uses datadomule, dzdyfrmunit;
{$R *.dfm}
procedure Tdzdy.ComboBox1Exit(Sender: TObject);
begin
combobox2.Items.Clear;
with datamodule1.qry_bycp do
begin
close;
sql.Clear;
sql.add('select * from bjb0 where zymc=:name');
parambyname('name').asstring:=combobox1.text;
open;
if recordcount>0 then
combobox2.text:=Fields[0].asstring;
repeat
combobox2.items.add(fields[0].asstring);
until findnext=false;
end;
end;
procedure Tdzdy.FormCreate(Sender: TObject);
begin
combobox1.Items.clear;
with datamodule1.qry_bycp do
begin
close;
sql.clear;
sql.add('select * from zyb0') ;
open;
first;
if recordcount>0 then
// combobox1.text:=Fields[1].asstring;
repeat
combobox1.items.add(fields[1].asstring);
until findnext=false;
end;
end;
procedure Tdzdy.Button1Click(Sender: TObject);
begin
if radiobutton1.Checked=true then
begin
with datamodule1.qry_dzdy do
begin
close;
sql.Clear ;
sql.add('select * from xsmc where bjh0=:id');
parambyname('id').AsString:=combobox2.text;
open;
end;
end;
if radiobutton2.Checked=true then
begin
with datamodule1.qry_dzdy do
begin
close;
sql.Clear ;
sql.add('select * from xsmc where xsxh_id=:id');
parambyname('id').AsString:=edit1.text;
open;
end;
end;
dzdyfrm:=tdzdyfrm.create(self);
dzdyfrm.showmodal;
end;
procedure Tdzdy.RadioButton1Click(Sender: TObject);
begin
label1.Visible:=true;
label2.Visible:=true;
label3.Visible:=false;
combobox1.Visible:=true;
combobox2.Visible:=true;
edit1.Visible:=false;
end;
procedure Tdzdy.RadioButton2Click(Sender: TObject);
begin
label1.Visible:=false;
label2.Visible:=false;
label3.Visible:=true;
combobox1.Visible:=false;
combobox2.Visible:=false;
edit1.Visible:=true;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -