📄 personinfo.pas
字号:
unit PersonInfo;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, DBCtrls;
type
TPersonInfoForm = class(TForm)
Label1: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Edit1: TEdit;
Edit3: TEdit;
Edit7: TEdit;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
ComboBox3: TComboBox;
ComboBox4: TComboBox;
Memo1: TMemo;
procedure OnShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
PersonInfoForm: TPersonInfoForm;
implementation
uses DataModule,Login;
{$R *.dfm}
procedure TPersonInfoForm.OnShow(Sender: TObject);
begin
with DataModuleForm.A_PersonInfo do
if Login.Types = '学生' then
begin
ComboBox1.Text := '学生';
Close;
SQL.Clear;
SQL.Add('select * from 学生基础信息');
SQL.Add('where 学号 = ''' + Login.UseId + ''' and 口令 = ''' + Login.Passwd +'''');
Open;
Edit1.Text := FieldByName('学号').AsString;
Edit3.Text := FieldByName('姓名').AsString;
ComboBox2.Text := FieldByName('性别').AsString;
ComboBox3.Text := FieldByName('学院').AsString;
ComboBox4.Text := FieldByName('专业').AsString;
Edit7.Text := FieldByName('联系电话').AsString;
Memo1.Text := FieldByName('备注').AsString;
end
else if Login.Types = '教师' then
begin
ComboBox1.Text := '教师';
Label1.Caption := '工号';
Close;
SQL.Clear;
SQL.Add('select * from 教师基础信息');
SQL.Add('where 工号 = ''' + Login.UseId + ''' and 口令 = ''' + Login.Passwd +'''');
Open;
Edit1.Text := FieldByName('工号').AsString;
Edit3.Text := FieldByName('姓名').AsString;
ComboBox2.Text := FieldByName('性别').AsString;
ComboBox3.Text := FieldByName('学院').AsString;
Edit7.Text := FieldByName('联系电话').AsString;
Memo1.Text := FieldByName('备注').AsString;
end
else if Login.Types = '管理员' then
begin
ComboBox1.Text := '管理员';
Label1.Caption := '编号';
Close;
SQL.Clear;
SQL.Add('select * from 管理员信息');
SQL.Add('where 编号 = ''' + Login.UseId + ''' and 口令 = ''' + Login.Passwd +'''');
Open;
Edit1.Text := FieldByName('编号').AsString;
Edit3.Text := FieldByName('姓名').AsString;
ComboBox2.Text := FieldByName('性别').AsString;
Edit7.Text := FieldByName('联系电话').AsString;
Memo1.Text := FieldByName('备注').AsString;
end
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -