📄 gmaddusr.pas
字号:
unit GMaddusr;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, Db, DBTables,GMRight;
type
TAddUser = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
security:TTable;
mUserName: TEdit;
mPassword1: TEdit;
mPassword2: TEdit;
OKBtn: TBitBtn;
CancelBtn: TBitBtn;
procedure CancelBtnClick(Sender: TObject);
procedure OKBtnClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AddUser: TAddUser;
UserUnRight:String[200];
implementation
uses GMMSmain;
{$R *.DFM}
procedure TAddUser.CancelBtnClick(Sender: TObject);
begin
Close;
end;
procedure TAddUser.OKBtnClick(Sender: TObject);
var
SetRight:TSetRight;
begin
security.Open;
security.SetKey;
security.FieldByName('UserName').AsString:=mUserName.Text;
if security.GotoKey then
begin
Application.MessageBox('没有发现本用户!','出错',mb_OK+mb_ICONQUESTION);
ModalResult:=0;
end
else
if (mPassword1.Text=mPassword2.Text) and (length(mPassword1.Text)=length(mPassword2.Text)) then
begin
gmUserName:=mUserName.Text;
gmPassword:=mPassword1.Text;
gmUnRight:='';
SetRight:=TSetRight.Create(Self);
SetRight.ShowModal;
security.Close;
ModalResult:=mrAll;
Close;
end
else
begin
Application.MessageBox('再次输入的密码不同','出错',mb_OK+mb_ICONQUESTION);
ModalResult:=0;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -