【delphi开源代码栏目提醒】:网学会员为广大网友收集整理了,jcdyunit.pas,希望对大家有所帮助!
unit jcdyunit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls,datadomule;
type
Tjcdy = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Edit1: TEdit;
Button1: TButton;
GroupBox2: TGroupBox;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
Edit2: TEdit;
Button2: TButton;
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure Edit1Enter(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure RadioButton4Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure Edit2Enter(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
jcdy: Tjcdy;
implementation
uses jldyfrmunit, cfdyfrmunit;
{$R *.dfm}
procedure Tjcdy.RadioButton2Click(Sender: TObject);
begin
edit1.text:='请输入';
end;
procedure Tjcdy.RadioButton1Click(Sender: TObject);
begin
edit1.text:='请输入年份';
end;
procedure Tjcdy.Edit1Enter(Sender: TObject);
begin
edit1.Clear ;
end;
procedure Tjcdy.Button1Click(Sender: TObject);
begin
if radiobutton1.Checked then
begin
with datamodule1.qry_jcdy1 do
begin
close;
sql.Clear ;
sql.Add('select * from viewjlcx where sj00 like :id' );
parambyname('id').asstring:=edit1.text+'%';
open;
if not findfirst then
begin
application.MessageBox('没有检索到符合条件的信息','提示',mb_ok+mb_iconinformation);
exit;
end;
end;
end;
if radiobutton2.Checked then
begin
with datamodule1.qry_jcdy1 do
begin
close;
sql.Clear ;
sql.Add('select * from viewjlcx where xsxh_id=:id' );
parambyname('id').asstring:=edit1.text;
open;
if not findfirst then
begin
application.MessageBox('没有检索到符合条件的信息','提示',mb_ok+mb_iconinformation);
exit;
end;
end;
end;
jldyfrm:=tjldyfrm.create(self);
jldyfrm.showmodal;
end;
procedure Tjcdy.RadioButton4Click(Sender: TObject);
begin
edit2.text:='请输入';
end;
procedure Tjcdy.RadioButton3Click(Sender: TObject);
begin
edit2.text:='请输入年份';
end;
procedure Tjcdy.Edit2Enter(Sender: TObject);
begin
edit2.Clear ;
end;
procedure Tjcdy.Button2Click(Sender: TObject);
begin
if radiobutton3.Checked then
begin
with datamodule1.qry_jcdy do
begin
close;
sql.Clear ;
sql.Add('select * from viewcfcx where sj00 like :id' );
parambyname('id').asstring:=edit2.text+'%';
open;
if not findfirst then
begin
application.MessageBox('没有检索到符合条件的信息','提示',mb_ok+mb_iconinformation);
exit;
end;
end;
end;
if radiobutton4.Checked then
begin
with datamodule1.qry_jcdy do
begin
close;
sql.Clear ;
sql.Add('select * from viewcfcx where xsxh_id=:id' );
parambyname('id').asstring:=edit2.text;
open;
if not findfirst then
begin
application.MessageBox('没有检索到符合条件的信息','提示',mb_ok+mb_iconinformation);
exit;
end;
end;
end;
cfdyfrm:=tcfdyfrm.create(self);
cfdyfrm.showmodal;
end;
end.