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

📄 unit8.~pas

📁 成绩管理系统 主要实现:学生(学号
💻 ~PAS
字号:
unit Unit8;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Grids, DBGrids, ExtCtrls, DB, ADODB;

type
  TForm8 = class(TForm)
    RadioGroup1: TRadioGroup;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    ComboBox1: TComboBox;
    DBGrid1: TDBGrid;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    DataSource1: TDataSource;
    ADOQuery1: TADOQuery;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
     private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form8: TForm8;
  vara,vari:integer;
implementation
 uses Unit1;
{$R *.dfm}

procedure TForm8.Button2Click(Sender: TObject);
begin
   form8.Close;
end;


procedure TForm8.Button1Click(Sender: TObject);
begin
     if (Edit1.Text='') then
           showmessage('学号不能够为空,请确认后重新输入!')
     else
        begin
          if radiobutton2.Checked then
          begin
                label1.Caption:='班号';
                adoquery1.Close;
                adoquery1.SQL.Clear;
                adoquery1.SQL.Add('select * from student where stu_class='''+Edit1.Text+'''');
                adoquery1.Open;
                if adoquery1.RecordCount=0 then
                    showmessage('不存在班号为'''+Edit1.Text+'''的成绩信息,请确认后重新输入!')
                 else
                     begin
                            if ComboBox1.Text='60以下' then
                                begin
                                  adoquery1.Close;
                                  adoquery1.SQL.Clear;
                                  adoquery1.SQL.Add('select stu_no as"学号",cour_no as"课程号",cour_time as"考试时间",score as"分数"from stud_score where 0<score and score<=60 and stu_no');
                                  adoquery1.SQL.Add('in(select stu_no from student where stu_class='''+Edit1.Text+''')');      //有问题
                                  adoquery1.Open;
                                  end
                               else
                                         begin
                                                if ComboBox1.Text='60以上' then
                                                   begin
                                                   adoquery1.Close;
                                                   adoquery1.SQL.Clear;
                                                   adoquery1.SQL.Add('select stu_no as"学号",cour_no as"课程号",cour_time as"考试时间",score as"分数"from stud_score where 60<score and score<=100 and stu_no');
                                                   adoquery1.SQL.Add('in(select stu_no from student where stu_class='''+Edit1.Text+''')');      //有问题
                                                   adoquery1.Open;
                                                   end
                                                  else
                                                        begin
                                                              if ComboBox1.Text='60-69' then
                                                                  begin
                                                                   adoquery1.Close;
                                                                   adoquery1.SQL.Clear;
                                                                   adoquery1.SQL.Add('select stu_no as"学号",cour_no as"课程号",cour_time as"考试时间",score as"分数"from stud_score where 60<score and score<=69 and stu_no');
                                                                   adoquery1.SQL.Add('in(select stu_no from student where stu_class='''+Edit1.Text+''')');      //有问题
                                                                   adoquery1.Open;
                                                                   end
                                                              else
                                                                     begin
                                                                         if ComboBox1.Text='70-79' then
                                                                         begin
                                                                          adoquery1.Close;
                                                                         adoquery1.SQL.Clear;
                                                                         adoquery1.SQL.Add('select stu_no as"学号",cour_no as"课程号",cour_time as"考试时间",score as"分数"from stud_score where 70<score and score<=79 and stu_no');
                                                                         adoquery1.SQL.Add('in(select stu_no from student where stu_class='''+Edit1.Text+''')');      //有问题
                                                                         adoquery1.Open;
                                                                         end
                                                                         else
                                                                            begin
                                                                                if ComboBox1.Text='80-89' then
                                                                                begin
                                                                                adoquery1.Close;
                                                                                adoquery1.SQL.Clear;
                                                                                adoquery1.SQL.Add('select stu_no as"学号",cour_no as"课程号",cour_time as"考试时间",score as"分数"from stud_score where 80<score and score<=89 and stu_no');
                                                                                adoquery1.SQL.Add('in(select stu_no from student where stu_class='''+Edit1.Text+''')');      //有问题
                                                                                adoquery1.Open;
                                                                                end
                                                                                else
                                                                                   begin
                                                                                      if ComboBox1.Text='60以下' then
                                                                                      begin
                                                                                       adoquery1.Close;
                                                                                      adoquery1.SQL.Clear;
                                                                                      adoquery1.SQL.Add('select stu_no as"学号",cour_no as"课程号",cour_time as"考试时间",score as"分数"from stud_score where 0<score and score<=60 and stu_no');
                                                                                      adoquery1.SQL.Add('in(select stu_no from student where stu_class='''+Edit1.Text+''')');      //有问题
                                                                                      adoquery1.Open;
                                                                                      end
                                                                                      else
                                                                                          begin
                                                                                              if ComboBox1.Text='90-100' then
                                                                                               begin
                                                                                                adoquery1.Close;
                                                                                              adoquery1.SQL.Clear;
                                                                                              adoquery1.SQL.Add('select stu_no as"学号",cour_no as"课程号",cour_time as"考试时间",score as"分数"from stud_score where 90<score and score<=100 and stu_no');
                                                                                              adoquery1.SQL.Add('in(select stu_no from student where stu_class='''+Edit1.Text+''')');      //有问题
                                                                                              adoquery1.Open;
                                                                                               end
                                                                                              else    showmessage('没有所要查找的信息!')
                                                                                          end
                                                                                   end
                                                                             end
                                                                      end
                                                             end
                                                    end
                   end
          end
         else
            begin
                if(Edit1.Text='')then
                     showmessage('学号不能够为空')
                else
                    begin
                                           adoquery1.Close;
                                           adoquery1.SQL.Clear;
                                           adoquery1.SQL.Add('select stu_no as"学号",stu_name as"姓名",stu_sex as"性别",stu_bithd as"出生日期",');
                                           adoquery1.SQL.Add('stu_National as"民族",stu_Origin as"籍贯",stu_Political as"政治面貌",stu_cmday as"入学日期",');
                                           adoquery1.SQL.Add('stu_Category as"学生类别",stu_Faculties as"院系",stu_class as"班级",stu_Structure as"学制",');
                                           adoquery1.SQL.Add('stu_Professional as"专业",stu_Languages as"外语语种",Quarters_address as"宿舍地址",');
                                           adoquery1.SQL.Add('Graduation_date as"毕业日期" from student where stu_class='''+Edit1.text+'''');
                                           adoquery1.Open;
                         if adoquery1.RecordCount=0 then
                               showmessage('不存在'''+Edit1.Text+'''的学绩信息,请确认后重新输入!')
                         else
                              begin

                              end

                     end
            end
        end


end;

end.

⌨️ 快捷键说明

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