⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 autochoose.pas

📁 网络考试系统
💻 PAS
字号:
unit AutoChoose;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls, Spin, DB, ADODB, jpeg;

type
  TForm11 = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    SpinEdit2: TSpinEdit;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    SpinEdit1: TSpinEdit;
    SpinEdit3: TSpinEdit;
    SpinEdit4: TSpinEdit;
    SpinEdit5: TSpinEdit;
    SpinEdit6: TSpinEdit;
    Label6: TLabel;
    Edit_sls: TEdit;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    edit_fls: TEdit;
    Label11: TLabel;
    GroupBox4: TGroupBox;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    SpinEdit7: TSpinEdit;
    SpinEdit8: TSpinEdit;
    SpinEdit9: TSpinEdit;
    edit_jds: TEdit;
    Label16: TLabel;
    edit_total: TEdit;
    Image1: TImage;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    Label17: TLabel;
    Label18: TLabel;
    Label19: TLabel;
    SpeedButton3: TSpeedButton;
    ADOQuery1: TADOQuery;
    ADOStoredProc1: TADOStoredProc;
    procedure chanyChange(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form11: TForm11;


implementation
uses paper,servermain;

{$R *.dfm}

procedure TForm11.chanyChange(Sender: TObject);
begin
    edit_sls.Text:=inttostr(spinedit1.value+ spinedit2.value+spinedit3.value );
    edit_fls.Text:=inttostr(2*(spinedit4.value+ spinedit5.value+spinedit6.value ));
    edit_jds.Text:=inttostr(spinedit7.value+ spinedit8.value+spinedit9.value );
    edit_total.Text := inttostr( strtoint(edit_sls.Text) + strtoint(edit_fls.Text)+strtoint(edit_jds.Text) );  ;
    if (spinedit1.Value<>0) then spinedit1.ReadOnly:=false else begin spinedit1.Value:=0;spinedit1.ReadOnly:=false;end;
    if (spinedit2.Value<>0) then spinedit2.ReadOnly:=false else begin spinedit2.Value:=0;spinedit2.ReadOnly:=false;end;
    if (spinedit3.Value<>0) then spinedit3.ReadOnly:=false else begin spinedit3.Value:=0;spinedit3.ReadOnly:=false;end;
    if (spinedit4.Value<>0) then spinedit4.ReadOnly:=false else begin spinedit4.Value:=0;spinedit4.ReadOnly:=false;end;
    if (spinedit5.Value<>0) then spinedit5.ReadOnly:=false else begin spinedit5.Value:=0;spinedit5.ReadOnly:=false;end;
    if (spinedit6.Value<>0) then spinedit6.ReadOnly:=false else begin spinedit6.Value:=0;spinedit6.ReadOnly:=false;end;
    if (spinedit7.Value<>0) then spinedit7.ReadOnly:=false else begin spinedit7.Value:=0;spinedit7.ReadOnly:=false;end;
    if (spinedit8.Value<>0) then spinedit8.ReadOnly:=false else begin spinedit8.Value:=0;spinedit8.ReadOnly:=false;end;
    if (spinedit9.Value<>0) then spinedit9.ReadOnly:=false else begin spinedit9.Value:=0;spinedit9.ReadOnly:=false;end;
    

end;

procedure TForm11.FormShow(Sender: TObject);
begin

     edit1.Text:=form9.combobox1.Text;
     edit2.Text:=form9.Edit_Paper.Text;
    SpinEdit1.Value := 0 ;
    SpinEdit2.Value := 0 ;
    SpinEdit3.Value := 0 ;
    SpinEdit4.Value := 0 ;
     SpinEdit5.Value := 0 ;
      SpinEdit6.Value := 0 ;
       SpinEdit7.Value := 0 ;
        SpinEdit8.Value := 0 ;
         SpinEdit9.Value := 0 ;
        edit_sls.Text:='';
        edit_fls.Text:='';
        edit_jds.Text:='';
        edit_total.Text:='';

    chanychange(self);
    ADOQuery1.Close;
    ADOQuery1.SQL.Clear;
    ADOQuery1.SQL.Add('select * from tb_course where cr_name=:name');
     ADOQuery1.Parameters.ParamByName('name').Value:=edit1.Text;
    ADOQuery1.Open;
end;

procedure TForm11.SpeedButton3Click(Sender: TObject);
begin
     form9.Show;
     self.Close;
end;

procedure TForm11.SpeedButton1Click(Sender: TObject);
begin

      ADOStoredProc1.Parameters.ParamByName('@teacherId').Value:=1;
      ADOStoredProc1.Parameters.ParamByName('@des').Value:=edit2.Text;
      ADOStoredProc1.Parameters.ParamByName('@totalVal').Value:=strtoint(edit_total.Text);
      ADOStoredProc1.Parameters.ParamByName('@seleVal').Value:=strtoint(edit_sls.Text);
      ADOStoredProc1.Parameters.ParamByName('@fillVal').Value:=strtoint(edit_fls.Text);
     ADOStoredProc1.Parameters.ParamByName('@judgeVal').Value:=strtoint(edit_jds.Text);
      ADOStoredProc1.Parameters.ParamByName('@crId').Value:=ADOQuery1.FieldValues['cr_id'];
      ADOStoredProc1.Parameters.ParamByName('@tpId').Value:=1;
      ADOStoredProc1.Prepared:=true;
      ADOStoredProc1.ExecProc;
      showmessage('成功生成试卷!!!');
end;

end.
procedure TForm11.SpinEdit1Change(Sender: TObject);
begin

end;


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -