📄 tongji.pas
字号:
unit tongji;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
Ttongjifrm = class(TForm)
cxbox: TGroupBox;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label1: TLabel;
Label2: TLabel;
tj1: TComboBox;
tj2: TComboBox;
zdz: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
n1: TEdit;
y1: TEdit;
r1: TEdit;
n21: TEdit;
y21: TEdit;
r21: TEdit;
n22: TEdit;
y22: TEdit;
r22: TEdit;
RadioGroup1: TRadioGroup;
CheckBox1: TCheckBox;
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure RadioGroup1Exit(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure setenable(state:boolean);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
cxsql:string;
{ Public declarations }
end;
var
tongjifrm: Ttongjifrm;
implementation
uses tjjieguo;
{$R *.dfm}
procedure Ttongjifrm.Button3Click(Sender: TObject);
begin
tongjifrm.Close ;
end;
procedure Ttongjifrm.Button1Click(Sender: TObject);
var
cxrq11,cxrq12,cxrq21,cxrq22,max:string;
begin
if checkbox1.Checked then
begin
case tj2.ItemIndex of
0:max:=' and 最大值 ='+zdz.Text;
1:max:=' and 最大值 >'+zdz.Text ;
2:max:=' and 最大值 <'+zdz.Text ;
end;
end
else
max:='';
if radiogroup1.ItemIndex=1 then
begin
cxrq21:=y21.Text +'/'+r21.Text +'/'+n21.Text;
cxrq22:=y22.Text +'/'+r22.Text +'/'+n22.Text;
cxsql:='where 开始时间 >= "'+cxrq21+'" '+'and 开始时间 < "'+cxrq22+'"'+max;
end
else begin
cxrq11:=y1.Text +'/'+r1.Text +'/'+n1.Text;
cxrq12:=y1.Text +'/'+inttostr(strtoint(r1.Text)+1)+'/'+n1.Text ;
case tj1.ItemIndex of
0:cxsql:='where 开始时间 >= "'+cxrq11+'" '+'and 开始时间 < "'+cxrq12+'"'+max;
1:cxsql:='where 开始时间 < "'+cxrq11+'" '+max ;
2:cxsql:='where 开始时间 >= "'+cxrq11+'" '+max ;
end;
end;
tjjieguofrm.Show ;
end;
procedure Ttongjifrm.RadioGroup1Exit(Sender: TObject);
begin
case radiogroup1.ItemIndex of
0: label1.Enabled :=true;
1: label2.Enabled :=true;
end;
end;
procedure Ttongjifrm.RadioGroup1Click(Sender: TObject);
begin
case radiogroup1.ItemIndex of
0: begin setenable(true);n1.SetFocus ;end;
1: begin setenable(false);n21.SetFocus ;end;
end;
end;
procedure Ttongjifrm.setenable(state:boolean);
begin
label1.Enabled :=state;
n1.Enabled :=state;
y1.Enabled :=state;
r1.Enabled :=state;
tj1.Enabled :=state;
label2.Enabled :=not state;
n21.Enabled :=not state;
n22.Enabled :=not state;
y21.Enabled :=not state;
y22.Enabled :=not state;
r21.Enabled :=not state;
r22.Enabled :=not state;
label9.Enabled :=not state;
label10.Enabled :=not state;
label11.Enabled :=not state;
label12.Enabled :=not state;
label13.Enabled :=not state;
label14.Enabled :=not state;
end;
procedure Ttongjifrm.Button2Click(Sender: TObject);
begin
n1.Text :='';
y1.Text :='';
r1.Text :='';
n21.Text :='';
y21.Text :='';
r21.Text :='';
n22.Text :='';
y22.Text :='';
r22.Text :='';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -