📄 examarrange.pas
字号:
unit ExamArrange;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, DB, ADODB;
type
TForm6 = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
ComboBox1: TComboBox;
Label2: TLabel;
ComboBox2: TComboBox;
Label3: TLabel;
ComboBox3: TComboBox;
CheckBox1: TCheckBox;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
ADOQuery_Exam: TADOQuery;
Label4: TLabel;
ComboBox4: TComboBox;
procedure FormShow(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
uses servermain;
{$R *.dfm}
procedure TForm6.FormShow(Sender: TObject);
begin
combobox1.Clear;
ADOQuery_Exam.Close;
ADOQuery_Exam.SQL.Clear;
ADOQuery_Exam.SQL.Add('select * from tb_course ');
ADOQuery_Exam.Open;
ADOQuery_Exam.First;
while( not ADOQuery_Exam.Eof) do
begin
combobox1.Items.Add(ADOQuery_Exam.FieldValues['cr_name']);
ADOQuery_Exam.Next;
end;
combobox1.ItemIndex:=-1;
combobox3.ItemIndex:=-1;
combobox2.ItemIndex:=0;
combobox4.ItemIndex:=0;
end;
procedure TForm6.ComboBox1Change(Sender: TObject);
begin
ADOQuery_Exam.Close;
ADOQuery_Exam.SQL.Clear;
ADOQuery_Exam.SQL.Add('select * from tb_test_paper,tb_course where tp_cr_id=cr_id and cr_name=:name ');
ADOQuery_Exam.Parameters.ParamByName('name').Value:=combobox1.Text;
ADOQuery_Exam.Open;
ADOQuery_Exam.First;
combobox3.Clear;
while( not ADOQuery_Exam.Eof) do
begin
combobox3.Items.Add(ADOQuery_Exam.FieldValues['tp_des']);
ADOQuery_Exam.Next;
end;
combobox3.ItemIndex:=0;
end;
procedure TForm6.SpeedButton1Click(Sender: TObject);
begin
if combobox3.Text='' then
begin
showmessage('您没有选择试卷,请选择?');
exit;
end
else
showmessage('试卷已经发出,学生可以进行考试!!!');
end;
procedure TForm6.SpeedButton2Click(Sender: TObject);
begin
self.Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -