📄 bycpunit.pas
字号:
unit bycpunit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DBTables, DB;
type
Tbycp = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure ComboBox1Exit(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
bycp: Tbycp;
implementation
uses datadomule, byfplrunit;
{$R *.dfm}
procedure Tbycp.FormCreate(Sender: TObject); //添加班级号和专业号
begin
combobox1.Items.clear;
with datamodule1.qry_bycp do
begin
close;
sql.clear;
sql.add('select * from zyb0') ;
open;
first;
if recordcount>0 then
// combobox1.text:=Fields[1].asstring;
repeat
combobox1.items.add(fields[1].asstring);
until findnext=false;
end;
end;
procedure Tbycp.ComboBox1Exit(Sender: TObject);
begin
combobox2.Items.Clear;
with datamodule1.qry_bycp do
begin
close;
sql.Clear;
sql.add('select * from bjb0 where zymc=:name');
parambyname('name').asstring:=combobox1.text;
open;
if recordcount>0 then
combobox2.text:=Fields[0].asstring;
repeat
combobox2.items.add(fields[0].asstring);
until findnext=false;
end;
end;
procedure Tbycp.Button1Click(Sender: TObject);
begin
with datamodule1.qry_bycp do
begin
close;
sql.Clear;
sql.add('select * from byqk where bjh0=:dd');
parambyname('dd').asstring:=combobox2.text;
open;
if findfirst then
begin
application.MessageBox('该班的毕业信息已经输入了!','提示',mb_ok+mb_iconinformation);
exit;
end;
end;
bycpfrm:=tbycpfrm.create(self);
bycpfrm.showmodal;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -