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

📄 unit7.pas

📁 教学管理系统源码
💻 PAS
字号:
unit Unit7;

interface

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

type
  TForm7 = class(TForm)
    ComboBox1: TComboBox;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    ADOQuery1: TADOQuery;
    BitBtn1: TBitBtn;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure ComboBox1Change(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form7: TForm7;

implementation

uses Unit6, Unit5, Unit1;

{$R *.dfm}

procedure TForm7.FormClose(Sender: TObject; var Action: TCloseAction);
begin
//Action:=caFree;
    //Form6:=nil;
end;

procedure TForm7.ComboBox1Change(Sender: TObject);
begin
if ComboBox1.ItemIndex=0 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 教学计划表');
ADOQuery1.SQL.Add('where 学期<>''''');
ADOQuery1.SQL.Add('and 学期=''99-1''');
ADOQuery1.SQL.Add('order by 学期');
ADOQuery1.Open;
if (ADOQuery1.RecordCount=0) then
Application.MessageBox('查找无效,目标可能不存在','警告!',MB_OK);
end;
if ComboBox1.ItemIndex=1 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 教学计划表');
ADOQuery1.SQL.Add('where 学期<>''''');
ADOQuery1.SQL.Add('and 学期=''99-2''');
ADOQuery1.SQL.Add('order by 学期');
ADOQuery1.Open;
if (ADOQuery1.RecordCount=0) then
Application.MessageBox('查找无效,目标可能不存在','警告!',MB_OK);
end;
if  ComboBox1.ItemIndex=2 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 教学计划表');
ADOQuery1.SQL.Add('where 学期<>''''');
ADOQuery1.SQL.Add('and 学期=''00-1''');
ADOQuery1.SQL.Add('order by 学期');
ADOQuery1.Open;
if (ADOQuery1.RecordCount=0) then
Application.MessageBox('查找无效,目标可能不存在','警告!',MB_OK);
end;
if  ComboBox1.ItemIndex=3 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 教学计划表');
ADOQuery1.SQL.Add('where 学期<>''''');
ADOQuery1.SQL.Add('and 学期=''00-2''');
ADOQuery1.SQL.Add('order by 学期');
ADOQuery1.Open;
if (ADOQuery1.RecordCount=0) then
Application.MessageBox('查找无效,目标可能不存在','警告!',MB_OK);
end;
if  ComboBox1.ItemIndex=4 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 教学计划表');
ADOQuery1.SQL.Add('where 学期<>''''');
ADOQuery1.SQL.Add('and 学期=''01-1''');
ADOQuery1.SQL.Add('order by 学期');
ADOQuery1.Open;
if (ADOQuery1.RecordCount=0) then
Application.MessageBox('查找无效,目标可能不存在','警告!',MB_OK);
end;
if  ComboBox1.ItemIndex=5 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 教学计划表');
ADOQuery1.SQL.Add('where 学期<>''''');
ADOQuery1.SQL.Add('and 学期=''01-2''');
ADOQuery1.SQL.Add('order by 学期');
ADOQuery1.Open;
if (ADOQuery1.RecordCount=0) then
Application.MessageBox('查找无效,目标可能不存在','警告!',MB_OK);
end;
if  ComboBox1.ItemIndex=6 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 教学计划表');
ADOQuery1.SQL.Add('where 学期<>''''');
ADOQuery1.SQL.Add('and 学期=''02-1''');
ADOQuery1.SQL.Add('order by 学期');
ADOQuery1.Open;
if (ADOQuery1.RecordCount=0) then
Application.MessageBox('查找无效,目标可能不存在','警告!',MB_OK);
end;
if  ComboBox1.ItemIndex=7 then
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 教学计划表');
ADOQuery1.SQL.Add('where 学期<>''''');
ADOQuery1.SQL.Add('and 学期=''02-2''');
ADOQuery1.SQL.Add('order by 学期');
ADOQuery1.Open;
if (ADOQuery1.RecordCount=0) then
Application.MessageBox('查找无效,目标可能不存在','警告!',MB_OK);
end;
end;

procedure TForm7.BitBtn1Click(Sender: TObject);
begin
form7.Hide;
form5.Show;
end;

end.

⌨️ 快捷键说明

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