📄 weixiucx.~pas
字号:
unit WeixiuCX;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, Grids, DBGrids;
type
TCarweixiuCX = class(TForm)
Label1: TLabel;
DBGrid1: TDBGrid;
GroupBox1: TGroupBox;
CheckBox1: TCheckBox;
ComboBox1: TComboBox;
DateTimePicker1: TDateTimePicker;
ComboBox4: TComboBox;
CheckBox2: TCheckBox;
procedure FormShow(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
CarweixiuCX: TCarweixiuCX;
implementation
uses unit2;
{$R *.dfm}
procedure TCarweixiuCX.FormShow(Sender: TObject);
begin
combobox1.Items.Clear;
with datamodule2.CarclassQ do
begin
close;
sql.Clear;
sql.Add('select * from carweixiu.dbf');
open;
while not eof do
begin
combobox1.Items.Add(fieldbyname('carnum').AsString);
next;
end;
first;
end;
combobox1.ItemIndex:=0;
end;
procedure TCarweixiuCX.CheckBox1Click(Sender: TObject);
begin
if checkbox1.Checked then
begin
datetimepicker1.Enabled:=false;
combobox4.Enabled:=false;
combobox1.Enabled:=true;
if checkbox2.Checked then
begin
datetimepicker1.Enabled:=true;
combobox4.Enabled:=true;
with datamodule2.CarclassQ do
begin
close;
sql.Clear;
if combobox4.Text='之前' then
sql.Add('select * from carweixiu.dbf where weixiudt < :bdate and carnum = :can');
if combobox4.Text='当天' then
sql.Add('select * from carweixiu.dbf where weixiudt = :bdate and carnum = :can');
if combobox4.Text='之后' then
sql.Add('select * from carweixiu.dbf where weixiudt > :bdate and carnum = :can');
parambyname('bdate').AsDate:=datetimepicker1.Date;
parambyname('can').AsString:=combobox1.Text;
open;
end;
end
else
begin
with datamodule2.CarclassQ do
begin
close;
sql.Clear;
sql.Add('select * from carweixiu.dbf where carnum = :can');
parambyname('can').AsString:=combobox1.Text;
open;
end;
end;
end
else
if checkbox2.Checked then
begin
datetimepicker1.Enabled:=true;
combobox4.Enabled:=true;
combobox1.Enabled:=false;
with datamodule2.CarclassQ do
begin
close;
sql.Clear;
if combobox4.Text='之前' then
sql.Add('select * from carweixiu.dbf where weixiudt < :bdate');
if combobox4.Text='当天' then
sql.Add('select * from carweixiu.dbf where weixiudt = :bdate');
if combobox4.Text='之后' then
sql.Add('select * from carweixiu.dbf where weixiudt > :bdate');
parambyname('bdate').AsDate:=datetimepicker1.Date;
open;
end;
end
else
begin
datetimepicker1.Enabled:=false;
combobox4.Enabled:=false;
combobox1.Enabled:=false;
carweixiucx.FormShow(sender);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -