📄 duty.~pas
字号:
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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -