unit regUser;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, TntStdCtrls, ExtCtrls, buttonFrame;

type
  TFrmRegUser = class(TForm)
    frameButtons1: TframeButtons;
    Label3: TLabel;
    Label11: TLabel;
    Label10: TLabel;
    Image1: TImage;
    Label1: TLabel;
    cboServer: TTntComboBox;
    txtPassword: TTntEdit;
    txtUser: TTntEdit;
    Label2: TLabel;
    txtconfirm: TTntEdit;
    procedure frameButtons1btnOKClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FrmRegUser: TFrmRegUser;

implementation

uses RiserWindow, Jabber1;

{$R *.dfm}

procedure TFrmRegUser.frameButtons1btnOKClick(Sender: TObject);
begin
  if trim(txtUser.Text) = '' then
  begin
    ShowRiserWindow(nil, '请输入用户名！', ico_info);
    abort;
    //raise Exception.Create('请输入用户名！');
  end;
  if trim(cboServer.Text) = '' then
  begin
    ShowRiserWindow(nil, '请输入企业名！', ico_info);
    abort;
    //raise Exception.Create('请输入企业名！');
  end;
  if trim(txtPassword.Text) = '' then
  begin
    ShowRiserWindow(nil, '请输入密码！', ico_info);
    abort;
    //raise Exception.Create('请输入密码！');
  end;
  if trim(txtPassword.Text) <> trim(txtconfirm.Text) then
  begin
    ShowRiserWindow(nil, '密码不一致，请重新输入！', ico_info);
    abort;
    //raise Exception.Create('请输入密码！');
  end;
  if pos('@', txtUser.Text) > 0 then
  begin
    ShowRiserWindow(nil, '用户名中不能包含“@”！', ico_info);
    abort;
    //raise Exception.Create('请输入用户名！');
  end;
  ModalResult := mrOk;
end;

end.
