gradechange.pas

来自「网络考试系统」· PAS 代码 · 共 49 行

PAS
49
字号
unit GradeChange;

interface

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

type
  TForm13 = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Edit_Name: TEdit;
    Edit_Des: TEdit;
    Edit_Grade: TEdit;
    Label2: TLabel;
    Label3: TLabel;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form13: TForm13;

implementation
uses GradeManage;
{$R *.dfm}

procedure TForm13.SpeedButton1Click(Sender: TObject);
begin
      form12.ADOQuery1.Close;
      form12.ADOQuery1.SQL.Clear;
      form12.ADOQuery1.SQL.Add('update tb_test_result set tr_grade=:grade');
      form12.ADOQuery1.SQL.Add('where tr_tp_id=(select tp_id from tb_test_paper where tp_des=:des)');
      form12.ADOQuery1.SQL.Add('and tr_sd_id=(select sd_id from tb_student where sd_username =:username)');
      form12.ADOQuery1.Parameters.ParamByName('username').Value:= form12.ADOQuery_Result.FieldValues['sd_username'];
      form12.ADOQuery1.Parameters.ParamByName('des').Value:= form12.ADOQuery_Result.FieldValues['tp_des'];
      form12.ADOQuery1.Parameters.ParamByName('grade').Value:=edit_grade.Text;
      form12.ADOQuery1.ExecSQL;
      showmessage('修改成功');
end;

end.

⌨️ 快捷键说明

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