?? duty.pas
字號(hào):
unit Duty;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, DBTables;
type
TDutyForm = class(TForm)
ComboBox1: TComboBox;
Button1: TButton;
Button2: TButton;
Label1: TLabel;
DataSource1: TDataSource;
UserTable: TTable;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
DutyForm: TDutyForm;
implementation
uses frmMain;
{$R *.dfm}
procedure TDutyForm.Button2Click(Sender: TObject);
begin
close;
end;
procedure TDutyForm.Button1Click(Sender: TObject);
var
P: integer;
begin
if ComboBox1.Text = '管理員' then
begin
P := 1;
end;
if ComboBox1.Text = '員工' then
begin
P := 2;
end;
if ComboBox1.Text = '訪客' then
begin
P := 3;
end;
UserTable.FieldValues['Name'] := MainForm.userName;
UserTable.FieldValues['Password'] := MainForm.userPwd;
UserTable.FieldValues['Power'] := P;
//提交操作
UserTable.Post;
close;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -