f_xgmm.pas
上传用户:lcqxtx
上传日期:2013-02-15
资源大小:530k
文件大小:2k
- unit f_xgmm;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Buttons, DB, ADODB;
- type
- Tw_xgmm = class(TForm)
- Edit1: TEdit;
- Edit2: TEdit;
- Edit3: TEdit;
- Label3: TLabel;
- Label2: TLabel;
- Label1: TLabel;
- StaticText1: TStaticText;
- ADOQuery1: TADOQuery;
- DataSource1: TDataSource;
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- ADOQuery1user_id: TIntegerField;
- ADOQuery1user_name: TStringField;
- ADOQuery1user_job: TStringField;
- ADOQuery1user_power: TStringField;
- ADOQuery1user_password: TStringField;
- procedure BitBtn1Click(Sender: TObject);
- procedure BitBtn2Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- w_xgmm: Tw_xgmm;
- implementation
- uses data_1, Unit1, f_main;
- {$R *.dfm}
- procedure Tw_xgmm.BitBtn1Click(Sender: TObject);
- begin
- if trim(edit2.Text)<>trim(edit3.Text) then
- begin
- showmessage('你输入新密码不一致');
- end
- else
- begin
- if trim(edit1.Text)<> trim(s_mima) then
- begin
- showmessage('输入的原密码不正确');
- end
- else
- begin
- adoquery1.Close;
- adoquery1.SQL.Clear;
- adoquery1.SQL.Add('update username set user_password='+char(39)+trim(edit2.Text)
- +char(39)+'where user_name ='+char(39)+trim(w_Main.auser.name)+char(39));
- adoquery1.execsql;
- application.MessageBox('修改密码成功了',char(48));
- edit1.Clear;
- edit2.Clear;
- edit3.Clear;
- //self.Close;
- //w_main.Enabled:=true;
- end;
- end;
- end;
- procedure Tw_xgmm.BitBtn2Click(Sender: TObject);
- begin
- close;
- w_main.Enabled:=true;
- end;
- procedure Tw_xgmm.FormCreate(Sender: TObject);
- begin
- w_main.Enabled:=FALSE;
- end;
- procedure Tw_xgmm.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- w_main.Enabled:=true;
- end;
- end.