📄 frmpjglogin.pas
字号:
unit frmPJgLogin;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComObj, Spin; //,SOAPHTTPClient ;
type
TJGLoginGL = class(TForm)
Panel2: TPanel;
Label3: TLabel;
Label4: TLabel;
Edit3: TEdit;
Edit4: TEdit;
Panel1: TPanel;
Label1: TLabel;
Edit1: TEdit;
SpinEdit1: TSpinEdit;
CheckBox1: TCheckBox;
Label5: TLabel;
Edit2: TEdit;
Panel3: TPanel;
Button2: TButton;
Button1: TButton;
Button3: TButton;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
SpinEdit2: TSpinEdit;
CheckBox4: TCheckBox;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure CheckBox3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
JGLoginGL: TJGLoginGL;
implementation
{$R *.dfm}
uses uConstUtils, uVarUtils, uDMFunc, uSystemIni, uUserFunc;
procedure TJGLoginGL.Button2Click(Sender: TObject);
begin
Close;
end;
procedure TJGLoginGL.Button1Click(Sender: TObject);
var
sWsDir, sWsIP, sWsVIP, sUid, sPwd, sName, sSsDs, sQx: String;
iRet: Smallint;
iWsPort, iWsVPort: Word;
lSys, bReLoad: Boolean;
begin
pubLoginConnect := False;
sWsIP := trim(Edit1.Text);
iWsPort := IIF(CheckBox2.Checked, SpinEdit1.Value, 0);
sWsVIP := '';
iWsVPort := 0;
bReLoad := CheckBox4.Checked;
if CheckBox1.Checked then
begin
sWsVIP := Trim(Edit2.Text);
iWsVPort := IIF(CheckBox3.Checked, SpinEdit2.Value, 0);
end;
WriteWSInfo(_PVNJGWEBSEVICE,sWsIP, sWsVIP, iWsPort, iWsVPort, bReLoad);
sWsDir := ReadWSInfo(_PVNJGWEBSEVICE);
if not ConnectWS(sWSDir) then
begin
Application.MessageBox('无法连接Web Sevice服务器,请输入正确地址!',PMsgCaption,16);
if Panel1.Visible then
Edit1.SetFocus;
exit;
end;
sUid := trim(Edit3.Text);
sPwd := trim(Edit4.Text);
iRet := Login(sUid,sPwd,sName,sQx,sSsds,lSys);
case iRet of
0: begin
pubLoginUserID := uppercase(sUid);
pubLoginUser := sName;
pubLoginQX := sQx;
pubLoginSsds := sSsds;
pubLoginPassword := sPwd;
pubLoginSys := lSys;
pubLoginConnect := True;
Close;
end;
1: begin
Application.MessageBox('操作员不存在,请更换操作员!',PMsgCaption,64);
Edit3.SetFocus;
end;
2: begin
Application.MessageBox('操作员密码不正确!',PMsgCaption,64);
Edit4.SetFocus;
end;
-1: begin
Application.MessageBox('无法启动COM+服务!',PMsgCaption,64);
end;
-2: begin
Application.MessageBox('无法连接Web Sevice服务器!',PMsgCaption,64);
end;
else
Application.MessageBox('未知错误,无法登录!',PMsgCaption,16);
Close;
end;
end;
procedure TJGLoginGL.FormCreate(Sender: TObject);
var
sWsIP, sWsVIP: String;
iWsPort, iWsVPort: Word;
bReLoad: Boolean;
begin
ReadWSInfo(_PVNJGWEBSEVICE,sWsIP,sWsVIP,iWsPort,iWsVPort, bReLoad);
CheckBox4.Checked := bReLoad;
Edit1.Text := sWsIP;
Edit2.Text := sWsVIP;
SpinEdit1.Value := iWsPort;
SpinEdit2.Value := iWsVPort;
if iWsPort =0 then
begin
CheckBox2.Checked := False;
SpinEdit1.Enabled := False;
end;
if sWsVIP='' then
begin
CheckBox1.Checked := False;
CheckBox3.Checked := False;
Edit2.Enabled := False;
end;
if iWsVPort =0 then
begin
CheckBox3.Checked := False;
SpinEdit2.Enabled := False;
end;
end;
procedure TJGLoginGL.Button3Click(Sender: TObject);
begin
Panel1.Visible := not Panel1.Visible;
Button3.Caption := IIF(Panel1.Visible, '选项<<','选项>>');
end;
procedure TJGLoginGL.CheckBox2Click(Sender: TObject);
begin
SpinEdit1.Enabled := CheckBox2.Checked;
end;
procedure TJGLoginGL.CheckBox1Click(Sender: TObject);
begin
Edit2.Enabled := CheckBox1.Checked;
CheckBox3.Enabled := CheckBox1.Checked;
if CheckBox1.Checked then
SpinEdit2.Enabled := CheckBox3.Checked
else
SpinEdit2.Enabled := False;
end;
procedure TJGLoginGL.CheckBox3Click(Sender: TObject);
begin
SpinEdit2.Enabled := CheckBox3.Checked;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -