📄 mrlld_zcx.pas
字号:
unit MRLLD_ZCX;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, Buttons, Grids, DBGrids, ComCtrls;
type
TFRM_LLD_ZCX = class(TForm)
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Datalb: TDataSource;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
DBGrid1: TDBGrid;
DateTimePicker1: TDateTimePicker;
ComboBox3: TComboBox;
procedure FormShow(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton4Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FRM_LLD_ZCX: TFRM_LLD_ZCX;
implementation
uses MR_DATA, MRLL_DY;
{$R *.dfm}
procedure TFRM_LLD_ZCX.FormShow(Sender: TObject);
begin
combobox1.Clear;
combobox2.Clear;
combobox3.Text := '';
DateTimePicker1.Date := now();
with data.ADOb do
begin
close;
sql.Clear;
sql.Add('select distinct scddh from tb_ll');
open;
end;
if data.ADOb.RecordCount>0 then
begin
while not data.adob.Eof do
begin
combobox1.Items.Add(data.adob.fieldbyname('scddh').AsString);
data.ADOb.Next;
end;
end;
with data.ADOb do
begin
close;
sql.Clear;
sql.Add('select distinct cpmc from tb_ll');
open;
end;
if data.ADOb.RecordCount>0 then
begin
while not data.adob.Eof do
begin
combobox2.Items.Add(data.adob.fieldbyname('cpmc').AsString);
data.ADOb.Next;
end;
end;
with data.ADOa do
begin
close;
sql.Clear;
sql.Add('select * from tb_ll');
open;
end;
end;
procedure TFRM_LLD_ZCX.BitBtn1Click(Sender: TObject);
var
s,p : string;
year,month,day : word;
begin
p := 'aa';
if RadioButton1.Checked = true then
begin
s := 'scddh';
p := combobox1.Text;
end;
if RadioButton2.Checked = true then
begin
s := 'cpmc';
p := combobox2.Text;
end;
if RadioButton3.Checked = true then
begin
s := 'll';
decodedate(DateTimePicker1.Date,year,month,day);
with data.ADOa do
begin
close;
sql.Clear;
sql.Add('select * from tb_ll where year(lltime)='+floattostr(year)+' and month(lltime)='+floattostr(month)+' and day(lltime)='+floattostr(day));
open;
end;
end;
if RadioButton4.Checked = true then
begin
s := 'yn';
p := combobox3.Text;
end;
if s <> 'll' then
begin
if (p = '')or(p = 'aa') then
begin
showmessage('查询条件不能为空。');
end
else
begin
with data.ADOa do
begin
close;
sql.Clear;
sql.Add('select * from tb_ll where '+s+'='+''''+p+'''');
open;
end;
end;
end;
end;
procedure TFRM_LLD_ZCX.RadioButton1Click(Sender: TObject);
begin
combobox2.Text := '';
combobox3.Text := '';
end;
procedure TFRM_LLD_ZCX.RadioButton2Click(Sender: TObject);
begin
combobox1.Text := '';
combobox3.Text := '';
end;
procedure TFRM_LLD_ZCX.RadioButton4Click(Sender: TObject);
begin
combobox2.Text := '';
combobox1.Text := '';
end;
procedure TFRM_LLD_ZCX.RadioButton3Click(Sender: TObject);
begin
combobox1.Text := '';
combobox2.Text := '';
combobox3.Text := '';
end;
procedure TFRM_LLD_ZCX.BitBtn3Click(Sender: TObject);
begin
close;
end;
procedure TFRM_LLD_ZCX.BitBtn2Click(Sender: TObject);
begin
application.CreateForm(TFRM_LL_DY, FRM_LL_DY);
FRM_LL_DY.QuickRep1.PreviewModeless;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -