gmaddusr.pas

来自「delphi通用信息管理系统源码 供学习使用」· PAS 代码 · 共 73 行

PAS
73
字号
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 + =
减小字号Ctrl + -
显示快捷键?