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

📄 bdcxunit.pas

📁 高校学生学籍管理系统源码
💻 PAS
字号:
unit bdcxunit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, ExtCtrls, StdCtrls, ToolWin, ComCtrls,datadomule;

type
  Tbdcx = class(TForm)
    ToolBar1: TToolBar;
    ComboBox1: TComboBox;
    Label1: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Panel1: TPanel;
    DBGrid1: TDBGrid;
    procedure Button1Click(Sender: TObject);
    procedure Edit1Enter(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  bdcx: Tbdcx;

implementation

{$R *.dfm}

procedure Tbdcx.Button1Click(Sender: TObject);

begin
if combobox1.text='按学号查询' then
begin
with datamodule1.qry_bdcx do
begin
close;
sql.Clear ;
sql.Add('select * from xsbd where xsxh_id=:id');


parambyname('id').AsString:=edit1.text;
open;
if recordcount=0 then
begin
application.messagebox('没有检索到该学生的信息!','提示',mb_ok+mb_iconinformation);
end;
end;
end;

if combobox1.text='按时间查询' then
begin
with datamodule1.qry_bdcx do
begin

close;
sql.Clear ;
{sql.Add('select * from xsbd where bdsj like :time');   //也可以用的,等价于下面的语句
parambyname('time').AsString:=edit1.text+'%';    }
SQL.Add('select * from xsbd where bdsj like '+''''+edit1.text+'%'+'''');
open;
if recordcount=0 then
begin
application.messagebox('没有检索到信息!','提示',mb_ok+mb_iconinformation);
end;
end;
end;
end;

procedure Tbdcx.Edit1Enter(Sender: TObject);
begin

edit1.clear

end;

procedure Tbdcx.ComboBox1Change(Sender: TObject);
begin
if combobox1.text='按时间查询' then
begin
edit1.text:='请输入年份';

end;
if combobox1.text='按学号查询' then
begin
edit1.text:='请输入学号';

end;
end;

end.

⌨️ 快捷键说明

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