📄 jgchgpwd.pas
字号:
unit JGChgPwd;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TJGChgPWDGL = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
JGChgPWDGL: TJGChgPWDGL;
implementation
uses DataModule,UserFace;
{$R *.dfm}
procedure TJGChgPWDGL.FormCreate(Sender: TObject);
begin
Edit1.Text := LoginUser;
end;
procedure TJGChgPWDGL.Button2Click(Sender: TObject);
begin
Close;
end;
procedure TJGChgPWDGL.Button1Click(Sender: TObject);
var
iret : smallint;
cUid,cPwd,cUser,cQx,cDs: string;
begin
if Edit2.Text <> LoginPassword then
begin
Application.MessageBox('原密码不正确,请重新输入!',MsgCaption,48);
Edit2.SetFocus ;
exit;
end;
if Edit2.Text = Edit3.Text then
begin
Application.MessageBox('密码没有更改,请重新输入!',MsgCaption,48);
Edit3.SetFocus ;
exit;
end;
if Edit3.Text <> Edit4.Text then
begin
Application.MessageBox('密码输入不一致,请重新输入!',MsgCaption,48);
Edit3.SetFocus ;
exit;
end;
cUid := LoginUserID;
cUser := LoginUser;
cPwd := trim(Edit3.Text) ;
cQx := LoginUserQx;
cDs := LoginUserSsds;
iRet := DM.F_UserSave(cUid,cUser,cPwd,cQx,cDs);
case iRet of
0: begin
Application.MessageBox('密码修改成功。',MsgCaption,64);
LoginPassword := cPwd;
close;
end;
1: Application.MessageBox('用户代码已被其他人删除!',MsgCaption,48);
else
Application.MessageBox('密码修改失败,请稍候再重试!',MsgCaption,16);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -