📄 unit14.pas
字号:
unit Unit14;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB;
type
Txiugai = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
ADODataSet1: TADODataSet;
Label5: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
xiugai: Txiugai;
implementation
uses unit13,unit3, Unit12;
{$R *.dfm}
procedure Txiugai.Button1Click(Sender: TObject);
begin
if (edit1.Text='')or (edit2.Text='')or(edit3.Text='')then
begin
showmessage('请输入完整数据!');
exit;
end;
adodataset1.Active:=false;
if xitongdenglu.flag=true then
begin
adodataset1.CommandText:='select * from manager where manager_no='+''''+xitongdenglu.Edit1.Text+''''+' and password='+''''+edit1.Text+'''';
adodataset1.Active:=true;
if adodataset1.RecordCount=0 then
begin
showmessage('原始密码不正确!');
exit;
end
else
if edit2.Text<>edit3.Text then
begin
showmessage('新密码不相符合');
exit;
end
else
begin
adodataset1.Active:=true;
adodataset1.Edit;
adodataset1.FieldByName('password').AsString:=edit2.Text;
adodataset1.Post;
end;
end
else
begin
adodataset1.CommandText:='select * from reader where reader_no='+''''+xitongdenglu.Edit1.Text+''''+' and password='+''''+edit1.Text+'''';
adodataset1.Active:=true;
if adodataset1.RecordCount=0 then
begin
showmessage('原始密码不正确!');
exit;
end
else
if edit2.Text<>edit3.Text then
begin
showmessage('新密码不相符合');
exit;
end
else
begin
adodataset1.Active:=true;
adodataset1.Edit;
adodataset1.FieldByName('password').AsString:=edit2.Text;
adodataset1.Post;
end;
end;
end;
procedure Txiugai.Button2Click(Sender: TObject);
begin
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -