【delphi开源代码栏目提醒】:网学会员--在 delphi开源代码编辑为广大网友搜集整理了:MRKHMYD_CX.pas绩等信息,祝愿广大网友取得需要的信息,参考学习。
unit MRKHMYD_CX;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TFRM_KHMYD_CX = class(TForm)
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure FormShow(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FRM_KHMYD_CX: TFRM_KHMYD_CX;
implementation
uses DATA, MRKHMYD;
{$R *.dfm}
procedure TFRM_KHMYD_CX.FormShow(Sender: TObject);
begin
combobox1.Clear;
combobox2.Clear;
with database.ADO_KHMYD do
begin
close;
sql.Clear;
sql.Add('SELECT * FROM tb_Client_KHMYD');
open;
end;
IF DATABASE.ADO_KHMYD.RecordCount>0 THEN
BEGIN
while not database.ADO_KHMYD.Eof do
begin
combobox1.Items.Add(Trim(database.ADO_KHMYD.fieldbyname('KHMYD_id').AsString));
combobox2.Items.Add(Trim(database.ADO_KHMYD.fieldbyname('KHMYD_myd').AsString));
database.ADO_KHMYD.Next;
end;
database.ADO_KHMYD.First;
END;
end;
procedure TFRM_KHMYD_CX.BitBtn1Click(Sender: TObject);
begin
if RadioButton1.Checked = true then
begin
if combobox1.Text = '' then
begin
showmessage('查询条件不能为空。');
end
else
begin
with database.ADO_KHMYD do
begin
close;
sql.Clear;
sql.Add('SELECT * FROM tb_Client_KHMYD where KHMYD_id='+''''+trim(combobox1.Text)+'''');
open;
end;
FRM_KHMYD.Edit1.Text := database.ADO_KHMYD.fieldbyname('KHMYD_id').AsString;
FRM_KHMYD.edit2.Text := database.ADO_KHMYD.fieldbyname('KHMYD_MYD').AsString;
FRM_KHMYD.edit3.Text := database.ADO_KHMYD.fieldbyname('KHMYD_bz').AsString;
end;
end;
if RadioButton2.Checked = true then
begin
if combobox2.Text = '' then
begin
showmessage('
查询条件不能为空。');
end
else
begin
with database.ADO_KHMYD do
begin
close;
sql.Clear;
sql.Add('SELECT * FROM tb_Client_KHMYD where KHMYD_MYD='+''''+trim(combobox2.Text)+'''');
open;
end;
FRM_KHMYD.Edit1.Text := database.ADO_KHMYD.fieldbyname('KHMYD_id').AsString;
FRM_KHMYD.edit2.Text := database.ADO_KHMYD.fieldbyname('KHMYD_MYD').AsString;
FRM_KHMYD.edit3.Text := database.ADO_KHMYD.fieldbyname('KHMYD_bz').AsString;
end;
end;
end;
procedure TFRM_KHMYD_CX.BitBtn2Click(Sender: TObject);
begin
CLOSE;
end;
procedure TFRM_KHMYD_CX.RadioButton1Click(Sender: TObject);
begin
combobox2.Text := '';
end;
procedure TFRM_KHMYD_CX.RadioButton2Click(Sender: TObject);
begin
combobox1.Text := '';
end;
end.