📄 frmsum1.pas
字号:
unit frmsum1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, ExtCtrls, Buttons, StdCtrls, ComCtrls;
type
TForm35 = class(TForm)
Panel1: TPanel;
DBGrid1: TDBGrid;
RadioGroup1: TRadioGroup;
DateTimePicker1: TDateTimePicker;
DateTimePicker2: TDateTimePicker;
Label1: TLabel;
Label2: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form35: TForm35;
implementation
uses data;
{$R *.dfm}
procedure TForm35.SpeedButton1Click(Sender: TObject);
begin
if radiogroup1.Items [radiogroup1.ItemIndex ]='入库统计' then
begin
with dm.inquery do
begin
close;
sql.clear;
sql.add('select sum(number) as 入库图书总数 from inrecord where indate between :indate1 and :indate2');
parameters.parambyname('indate1').Value :=DateTimePicker1.date;
parameters.parambyname('indate2').Value :=DateTimePicker2.date;
open;
end;
DBGrid1.DataSource:=dm.insource;
end
else if radiogroup1.Items [radiogroup1.ItemIndex ]='出库统计' then
begin
with dm.outquery do
begin
close;
sql.clear;
sql.add('select sum(number2)as 出库图书总数 from outrecord where outdate between :outdate1 and :outdate2');
parameters.parambyname('outdate1').Value :=DateTimePicker1.date;
parameters.parambyname('outdate2').Value :=DateTimePicker2.date;
open;
end;
DBGrid1.DataSource:=dm.outsource;
end;
if radiogroup1.Items [radiogroup1.ItemIndex ]='员工统计' then
begin
with dm.empquery do
begin
close;
sql.clear;
sql.add('select count(*)as 在职人员总数 from employee where workdate between :outdate1 and :outdate2');
parameters.parambyname('outdate1').Value :=DateTimePicker1.date;
parameters.parambyname('outdate2').Value :=DateTimePicker2.date;
open;
end;
DBGrid1.DataSource:=dm.empsource;
end;
end;
procedure TForm35.SpeedButton2Click(Sender: TObject);
begin
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -