📄 statistics.pas
字号:
unit Statistics;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, Grids, DBGrids, DB, DBTables,
Buttons,PublicUnit, jpeg;
type
TStatisticsForm = class(TForm)
Panel4: TPanel;
Label1: TLabel;
DataSource1: TDataSource;
SQLQuery: TQuery;
Panel2: TPanel;
Title: TLabel;
RadioGroup1: TRadioGroup;
RadioButton2: TRadioButton;
RadioButton4: TRadioButton;
DBGrid1: TDBGrid;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Image1: TImage;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
StatisticsForm: TStatisticsForm;
implementation
uses DataModule;
{$R *.dfm}
procedure TStatisticsForm.BitBtn1Click(Sender: TObject);
var
today,year,month:string;
begin
today:=CalTodayDate;
year:=today[1]+today[2]+today[3]+today[4];
month:=today[5]+today[6];
if radiobutton2.checked=true then
begin
with SQLQuery do
begin
Title.Caption:=year+'年'+month+'月已到期合同统计';
Close;
SQL.Clear;
SQL.Add('select 合同号,租期,起租日期,到期日期,付款期限,履约金,乙方单位,联系人,月租金,电话,手机,Email,租金总额');
SQL.Add('from Contract');
SQL.Add('where (到期日期< :ToDate) or (标志 = ''2'')');
ParamByName('ToDate').Asstring:=today;
Prepare;
Open;
end;
end;
if radiobutton4.checked=true then
begin
with SQLQuery do
begin
Title.Caption:=year+'年'+month+'月空闲房屋统计';
Close;
SQL.Clear;
SQL.Add('select 房屋号,座落,面积 ');
SQL.Add('from House');
SQL.Add('where 状态=''闲置''');
prepare;
Open;
end;
end;
end;
procedure TStatisticsForm.BitBtn2Click(Sender: TObject);
begin
Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -