am_yhgl_mms.pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:3k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit am_yhgl_mms;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, StdCtrls, Buttons, Mask, DBCtrlsEh, DB;
- type
- Tam_yhgl_mm = class(TForm)
- Image1: TImage;
- Label1: TLabel;
- GroupBox1: TGroupBox;
- GroupBox2: TGroupBox;
- DataSource1: TDataSource;
- DBEditEh1: TDBEditEh;
- DBEditEh2: TDBEditEh;
- DBEditEh4: TDBEditEh;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- SpeedButton1: TSpeedButton;
- SpeedButton2: TSpeedButton;
- DBEditEh3: TDBEditEh;
- procedure SpeedButton2Click(Sender: TObject);
- procedure DBEditEh2KeyPress(Sender: TObject; var Key: Char);
- procedure DBEditEh3KeyPress(Sender: TObject; var Key: Char);
- procedure DBEditEh4KeyPress(Sender: TObject; var Key: Char);
- procedure DBEditEh2Exit(Sender: TObject);
- procedure DBEditEh4Exit(Sender: TObject);
- procedure SpeedButton1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- am_yhgl_mm: Tam_yhgl_mm;
- implementation
- uses dms,u_public,mainfrms;
- {$R *.dfm}
- procedure Tam_yhgl_mm.SpeedButton2Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tam_yhgl_mm.DBEditEh2KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- begin
- key:=#0;
- selectNext(ActiveControl,true,true);
- end;
- end;
- procedure Tam_yhgl_mm.DBEditEh3KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- begin
- key:=#0;
- selectNext(ActiveControl,true,true);
- end;
- end;
- procedure Tam_yhgl_mm.DBEditEh4KeyPress(Sender: TObject; var Key: Char);
- begin
- {if key=#13 then
- begin
- key:=#0;
- selectNext(ActiveControl,true,true);
- end;}
- end;
- procedure Tam_yhgl_mm.DBEditEh2Exit(Sender: TObject);
- begin
- if user_passWord<>Encrypt(trim(dbediteh2.Text)) then
- begin
- application.MessageBox('旧密码不正确','提示',mb_ok+mb_iconinformation);
- dbediteh2.Text:='';
- dbediteh2.SetFocus;
- exit;
- end;
- end;
- procedure Tam_yhgl_mm.DBEditEh4Exit(Sender: TObject);
- begin
- if dbediteh4.Text<>dbediteh3.Text then
- begin
- application.MessageBox('请输入相同的密码','提示',mb_ok+mb_iconinformation);
- dbediteh3.SetFocus;
- exit;
- end;
- end;
- procedure Tam_yhgl_mm.SpeedButton1Click(Sender: TObject);
- var N:integer;
- begin
- if dbediteh4.Text<>dbediteh3.Text then
- begin
- application.MessageBox('请输入相同的密码','提示',mb_ok+mb_iconinformation);
- dbediteh3.SetFocus;
- exit;
- end;
- dm.xt_user.Edit;
- dm.xt_user.FieldByName('user_dm').AsString:=user_dm;
- dm.xt_user.FieldByName('user_name').AsString:=user_name;
- dm.xt_user.FieldByName('user_passWord').AsString:=Encrypt(trim(dbediteh3.Text));
- N:=dm.xt_user.ApplyUpdates(0);
- if n=0 then
- begin
- application.MessageBox('密码修改成功','提示',mb_ok+mb_iconinformation);
- close;
- end
- else
- begin
- application.MessageBox('密码修改失败','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- end;
- procedure Tam_yhgl_mm.FormCreate(Sender: TObject);
- begin
- dm.xt_user.Active:=true;
- dm.xt_user.Edit;
- dbediteh1.Text:=user_dm;
- end;
- procedure Tam_yhgl_mm.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- dm.xt_user.Active:=false;
- action:=cafree;
- am_yhgl_mm:=nil;
- end;
- end.