duty.pas
来自「一个基于delphi7.0的客房管理系统。」· PAS 代码 · 共 64 行
PAS
64 行
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 + =
减小字号Ctrl + -
显示快捷键?