unitstat.pas
来自「这是我做的一个大学院系成绩管理系统」· PAS 代码 · 共 144 行
PAS
144 行
unit UnitStat;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Grids, DBGrids, TeEngine, Series, TeeProcs,
Chart, DbChart, DB, ADODB;
type
TFrmStat = class(TForm)
ImageBg: TImage;
GroupBox2: TGroupBox;
Label1: TLabel;
Label2: TLabel;
ComboBox2: TComboBox;
Label3: TLabel;
ComboBox3: TComboBox;
ComboBox1: TComboBox;
RadioGroup1: TRadioGroup;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label4: TLabel;
ComboBox4: TComboBox;
RadioButton3: TRadioButton;
Image2: TImage;
Image1: TImage;
Label5: TLabel;
DataSource1: TDataSource;
ADOQuery1: TADOQuery;
Edit1: TEdit;
GroupBox1: TGroupBox;
DBChart1: TDBChart;
Series1: TFastLineSeries;
procedure Image2Click(Sender: TObject);
procedure Image1Click(Sender: TObject);
procedure ImagePrintClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmStat: TFrmStat;
implementation
uses UnitDBConnect, UnitStatRpt, UnitStatQuery;
{$R *.dfm}
procedure TFrmStat.Image2Click(Sender: TObject);
begin
with FMDBConnect.ADOQueryStat do
begin
Close;
SQL.Clear;
SQL.Add('select * from dbo.ViewAvgScore order by AvgScore desc');
Active:=True;
Open;
end;
end;
procedure TFrmStat.Image1Click(Sender: TObject);
begin
if RadioButton1.Checked then
begin
if(ComboBox1.Text<>'') and (ComboBox3.Text<>'') and (ComboBox4.Text<>'') then
begin
with FMDBConnect.ADOQueryStat do
begin
Close;
SQL.Clear;
SQL.Add('select * from dbo.ViewAvgScore where Lyear='''+ComboBox3.Text+''' and Term='''+ComboBox4.Text+''' and SClassNo in( select ClNo from Class where ClSpec='''+ComboBox1.Text+''') order by AvgScore desc');
Active:= True;
Open;
FMStatQuery.ShowModal;
end;
end
else
begin
showmessage('请输入按专业查询的完整信息!');
end;
end
else if RadioButton2.Checked then
begin
if(ComboBox2.Text<>'') and (ComboBox3.Text<>'') and (ComboBox4.Text<>'') then
begin
with FMDBConnect.ADOQueryStat do
begin
Close;
SQL.Clear;
SQL.Add('select * from dbo.ViewAvgScore where Lyear='''+ComboBox3.Text+''' and Term='''+ComboBox4.Text+''' and SClassNo='''+ComboBox2.Text+''' order by AvgScore desc');
Active:= True;
Open;
FMStatQuery.ShowModal;
end;
end
else
begin
showmessage('请输入按班级查询的完整信息!');
end;
end
else if RadioButton3.Checked then
begin
if Edit1.Text<>'' then
begin
with Adoquery1 do
begin
SQL.Clear;
SQL.Add('select Lyear*2+Term-2 as Time,AvgScore from dbo.ViewAvgScore ' +
'where SNo='''+Edit1.Text+'''order by Time') ;
Open;
end;
with FMDBConnect.ADOQueryStat do
begin
SQL.Clear;
SQL.Add('select * from dbo.ViewAvgScore where SNo='''+Edit1.Text+
''' order by Lyear*2+Term-2') ;
Open;
DBChart1.Visible:=True;
FMStatQuery.ShowModal;
end
end
end
else
begin
showmessage('请选择查询的方法!');
end ;
end;
procedure TFrmStat.ImagePrintClick(Sender: TObject);
begin
FMStatRpt.QuickRep1.Refresh;
FMStatRpt.QuickRep1.Preview;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?