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

📄 unit12.pas

📁 本系统规模较小,适合小型宿舍,公寓等人员的安排,管理.本系统采用delphi开发界面,使用文件型的数据库Access.,界面亲和力强,容易上手,使用方便.
💻 PAS
📖 第 1 页 / 共 2 页
字号:
unit Unit12;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TFlatSpeedButtonUnit, StdCtrls, TFlatComboBoxUnit,
  TFlatGroupBoxUnit, Grids, DBGrids, DB, ADODB, TFlatCheckBoxUnit,
  TFlatEditUnit, TFlatRadioButtonUnit;

type
  Tgjcx = class(TForm)
    FlatSpeedButton1: TFlatSpeedButton;
    FlatGroupBox1: TFlatGroupBox;
    FlatComboBox1: TFlatComboBox;
    FlatComboBox2: TFlatComboBox;
    FlatComboBox3: TFlatComboBox;
    FlatComboBox4: TFlatComboBox;
    FlatComboBox5: TFlatComboBox;
    FlatComboBox6: TFlatComboBox;
    FlatComboBox7: TFlatComboBox;
    FlatComboBox8: TFlatComboBox;
    DBGrid1: TDBGrid;
    ADOQuery1: TADOQuery;
    FlatGroupBox2: TFlatGroupBox;
    FlatCheckBox5: TFlatCheckBox;
    FlatCheckBox6: TFlatCheckBox;
    FlatCheckBox7: TFlatCheckBox;
    FlatCheckBox8: TFlatCheckBox;
    FlatCheckBox9: TFlatCheckBox;
    FlatCheckBox10: TFlatCheckBox;
    FlatCheckBox11: TFlatCheckBox;
    FlatCheckBox12: TFlatCheckBox;
    FlatComboBox9: TFlatComboBox;
    FlatComboBox10: TFlatComboBox;
    FlatGroupBox3: TFlatGroupBox;
    FlatEdit1: TFlatEdit;
    FlatSpeedButton2: TFlatSpeedButton;
    FlatGroupBox4: TFlatGroupBox;
    FlatRadioButton1: TFlatRadioButton;
    FlatRadioButton2: TFlatRadioButton;
    FlatRadioButton3: TFlatRadioButton;
    DataSource1: TDataSource;
    Label1: TLabel;
    FlatSpeedButton3: TFlatSpeedButton;
    FlatSpeedButton5: TFlatSpeedButton;
    procedure FlatSpeedButton1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure FlatCheckBox11Click(Sender: TObject);
    procedure FlatCheckBox12Click(Sender: TObject);
    procedure FlatComboBox1KeyPress(Sender: TObject; var Key: Char);
    procedure FlatSpeedButton2Click(Sender: TObject);
    procedure FlatSpeedButton3Click(Sender: TObject);
    procedure FlatSpeedButton5Click(Sender: TObject);
    procedure FlatEdit1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  gjcx: Tgjcx;

implementation

uses Unit2,datamodule;

{$R *.dfm}

procedure Tgjcx.FlatSpeedButton1Click(Sender: TObject);
var
xh1,xm1,xb1,jg1,yx1,zy1,nj1,bj1,sslh1,ssh1,
str:string;
begin
{if flatcombobox1.ItemIndex=0 then
  begin
  flatcombobox1.ItemIndex:=1
  end;

if flatcombobox2.ItemIndex=0 then
  begin
  flatcombobox2.ItemIndex:=1
  end;

if flatcombobox3.ItemIndex=0 then
  begin
  flatcombobox3.ItemIndex:=1
  end;

if flatcombobox4.ItemIndex=0 then
  begin
  flatcombobox4.ItemIndex:=1
  end;

if flatcombobox5.ItemIndex=0 then
  begin
  flatcombobox5.ItemIndex:=1
  end;

if flatcombobox6.ItemIndex=0 then
  begin
  flatcombobox6.ItemIndex:=1
  end;

if flatcombobox7.ItemIndex=0 then
  begin
  flatcombobox7.ItemIndex:=1
  end;

if flatcombobox8.ItemIndex=0 then
  begin
  flatcombobox8.ItemIndex:=1
  end; }
xh1:=flatcombobox1.Text;
xm1:=flatcombobox2.Text;
xb1:=flatcombobox3.Text;
jg1:=flatcombobox4.Text;
yx1:=flatcombobox5.Text;
zy1:=flatcombobox6.Text;
nj1:=flatcombobox7.Text;
bj1:=flatcombobox8.Text;
sslh1:=flatcombobox9.Text;
ssh1:=flatcombobox10.Text;
if flatcheckbox5.Checked then
  begin
  str:='xskxx.yx as 院系';
  end;
if flatcheckbox6.Checked then
  begin
  str:='xskxx.zy as 专业';
  end;
if flatcheckbox7.Checked then
  begin
  str:='xskxx.nj as 年级';
  end;
if flatcheckbox8.Checked then
  begin
  str:='xskxx.bj as 班级';
  end;
if flatcheckbox9.Checked then
  begin
  str:='zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox10.Checked then
  begin
  str:='zs.ssh as 所住宿舍号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业';
  end;
if flatcheckbox5.Checked and flatcheckbox7.checked then
  begin
  str:='xskxx.yx as 院系,xskxx.nj as 年级';
  end;
if flatcheckbox5.Checked and flatcheckbox8.checked then
  begin
  str:='xskxx.yx as 院系,xskxx.bj as 班级';
  end;
if flatcheckbox5.Checked and flatcheckbox9.checked then
  begin
  str:='xskxx.yx as 院系,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox5.Checked and flatcheckbox9.checked then
  begin
  str:='xskxx.yx as 院系,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox6.Checked and flatcheckbox7.checked then
  begin
  str:='xskxx.zy as 专业,xskxx.nj as 年级';
  end;
if flatcheckbox6.Checked and flatcheckbox8.checked then
  begin
  str:='xskxx.zy as 专业,xskxx.bj as 班级';
  end;
if flatcheckbox6.Checked and flatcheckbox9.checked then
  begin
  str:='xskxx.zy as 专业,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox6.Checked and flatcheckbox9.checked then
  begin
  str:='xskxx.zy as 专业,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox7.Checked and flatcheckbox8.checked then
  begin
  str:='xskxx.nj as 年级,xskxx.bj as 班级';
  end;
if flatcheckbox7.Checked and flatcheckbox9.checked then
  begin
  str:='xskxx.nj as 年级,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox7.Checked and flatcheckbox10.checked then
  begin
  str:='xskxx.nj as 年级,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox8.Checked and flatcheckbox9.checked then
  begin
  str:='xskxx.nj as 班级,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox8.Checked and flatcheckbox9.checked then
  begin
  str:='xskxx.nj as 班级,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox9.Checked and flatcheckbox10.checked then
  begin
  str:='zs.ssh as 所住宿舍号,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox7.checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.nj as 年级';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox8.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.bj as 班级';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox9.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox10.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox7.Checked and flatcheckbox8.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.nj as 年级,xskxx.bj as 班级';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox7.Checked and flatcheckbox9.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.nj as 年级,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox7.Checked and flatcheckbox10.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.nj as 年级,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox7.Checked and flatcheckbox10.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.nj as 年级,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox6.Checked and flatcheckbox7.checked and flatcheckbox8.Checked and flatcheckbox9.Checked then
  begin
  str:='xskxx.zy as 专业,xskxx.nj as 年级,xskxx.bj as 班级,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox6.Checked and flatcheckbox7.checked and flatcheckbox8.Checked and flatcheckbox10.Checked then
  begin
  str:='xskxx.zy as 专业,xskxx.nj as 年级,xskxx.bj as 班级,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox7.Checked and flatcheckbox8.checked and flatcheckbox9.Checked and flatcheckbox10.Checked then
  begin
  str:='xskxx.nj as 年级,xskxx.bj as 班级,zs.sslh as 所住宿舍楼号,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox7.Checked and flatcheckbox9.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.nj as 年级,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox7.Checked and flatcheckbox10.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.nj as 年级,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox8.Checked and flatcheckbox9.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.bj as 班级,zs.sslh as 所住宿舍楼号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox8.Checked and flatcheckbox10.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.bj as 班级,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox8.Checked and flatcheckbox10.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.bj as 班级,zs.ssh as 所住宿舍号';
  end;
if flatcheckbox5.Checked and flatcheckbox6.checked and flatcheckbox7.Checked and flatcheckbox8.Checked and flatcheckbox9.Checked and flatcheckbox10.Checked then
  begin
  str:='xskxx.yx as 院系,xskxx.zy as 专业,xskxx.nj as 年级,xskxx.bj as 班级,zs.sslh as 所住宿舍楼号,zs.ssh as 所住宿舍号';
  end;
//if flatcheckbox5.Checked:=false and flatcheckbox6.Checked:=false and flatcheckbox7.Checked:=false and flatcheckbox8.Checked:=false and flatcheckbox9.Checked:=false and flatcheckbox10.Checked:=false then
//  begin
 // str:='';
//  end;
if flatcheckbox12.Checked then
  begin
  str:=''' ''';
  end;



with adoquery1 do
  begin
  close;
  sql.Clear;
  sql.Add('select distinct xskxx.xh as 学号,xskxx.xm as 姓名,xskxx.xb as 性别,xskxx.jg as 籍贯,'+str+' from xskxx,zs');
  sql.Add('where xskxx.xh='''+xh1+''' and xskxx.xh=zs.xh');
  sql.Add('or xskxx.xm='''+xm1+''' and xskxx.xh=zs.xh');
  sql.Add('or xskxx.xb='''+xb1+''' and xskxx.xh=zs.xh');
  sql.Add('or xskxx.jg='''+jg1+''' and xskxx.xh=zs.xh');
  sql.Add('or xskxx.yx='''+yx1+''' and xskxx.xh=zs.xh');
  sql.Add('or xskxx.zy='''+zy1+''' and xskxx.xh=zs.xh');
  sql.Add('or xskxx.nj='''+nj1+''' and xskxx.xh=zs.xh');
  sql.Add('or xskxx.bj='''+bj1+''' and xskxx.xh=zs.xh');
  sql.Add('or zs.sslh='''+sslh1+''' and xskxx.xh=zs.xh');
  sql.Add('or zs.ssh='''+ssh1+''' and xskxx.xh=zs.xh');
  open;
  //showmessage(adoquery1.SQL.Text);
  end;
  dbgrid1.Columns[0].Width:=80;
  dbgrid1.Columns[1].Width:=100;
  dbgrid1.Columns[2].Width:=60;
  dbgrid1.Columns[3].Width:=120;
 { flatcombobox1.Clear;
  flatcombobox2.Clear;
  flatcombobox3.Clear;
  flatcombobox4.Clear;
  flatcombobox5.Clear;
  flatcombobox6.Clear;
  flatcombobox7.Clear;
  flatcombobox8.Clear;

  with dm.ADOQuery7 do
  begin
  close;
  sql.Clear;
  sql.Add('select xh as 学号,xm as 姓名 from xskxx');
  open;
  end;
  while not dm.ADOQuery7.Eof do
    begin
    flatcombobox1.Items.Add(dm.ADOQuery7.Fields[0].asstring);
    flatcombobox2.Items.Add(dm.ADOQuery7.Fields[1].asstring);
    dm.ADOQuery7.Next;
    end;
    //dm.ADOQuery7.Close;


with dm.ADOQuery7 do
  begin
  close;
  sql.Clear;
  sql.Add('select distinct jg as 籍贯 from xskxx');
  open;
  end;
  while not dm.ADOQuery7.Eof do
    begin
    flatcombobox4.Items.Add(dm.ADOQuery7.Fields[0].asstring);
    dm.ADOQuery7.Next;
    end;

with dm.ADOQuery7 do
  begin
  close;
  sql.Clear;
  sql.Add('select distinct yx as 院系 from xskxx');
  open;
  end;
  while not dm.ADOQuery7.Eof do
    begin
    flatcombobox5.Items.Add(dm.ADOQuery7.Fields[0].asstring);
    dm.ADOQuery7.Next;
    end;

with dm.ADOQuery7 do
  begin
  close;
  sql.Clear;
  sql.Add('select distinct zy as 专业 from xskxx');
  open;
  end;
  while not dm.ADOQuery7.Eof do
    begin
    flatcombobox6.Items.Add(dm.ADOQuery7.Fields[0].asstring);
    dm.ADOQuery7.Next;
    end;

with dm.ADOQuery7 do
  begin
  close;
  sql.Clear;
  sql.Add('select distinct nj as 年级 from xskxx');
  open;
  end;
  while not dm.ADOQuery7.Eof do
    begin
    flatcombobox7.Items.Add(dm.ADOQuery7.Fields[0].asstring);
    dm.ADOQuery7.Next;
    end;

with dm.ADOQuery7 do
  begin
  close;
  sql.Clear;
  sql.Add('select distinct bj as 班级 from xskxx');
  open;
  end;
  while not dm.ADOQuery7.Eof do
    begin
    flatcombobox8.Items.Add(dm.ADOQuery7.Fields[0].asstring);
    dm.ADOQuery7.Next;
    end;

with dm.ADOQuery7 do
  begin
  close;
  sql.Clear;
  sql.Add('select distinct sslh as 宿舍楼号 from zs');
  open;
  end;
  while not dm.ADOQuery7.Eof do
    begin
    flatcombobox9.Items.Add(dm.ADOQuery7.Fields[0].asstring);
    dm.ADOQuery7.Next;
    end;

with dm.ADOQuery7 do
  begin
  close;
  sql.Clear;
  sql.Add('select distinct ssh from zs');
  open;

⌨️ 快捷键说明

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