unit u_sys_employee; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, BusinessSkinForm, DB, ADODB, StdCtrls, Mask, DBCtrls, wwdbdatetimepicker; type Tfrm_sys_employee = class(TForm) bsBusinessSkinForm1: TbsBusinessSkinForm; bsSkinButton1: TbsSkinButton; bsSkinButton2: TbsSkinButton; t_sys_employee: TADOQuery; t_sys_employee1: TDataSource; Label1: TLabel; DBEdit1: TDBEdit; Label2: TLabel; DBEdit2: TDBEdit; Label3: TLabel; DBEdit3: TDBEdit; Label4: TLabel; DBEdit4: TDBEdit; Label5: TLabel; DBEdit5: TDBEdit; Label6: TLabel; DBEdit6: TDBEdit; Label7: TLabel; Label8: TLabel; DBEdit8: TDBEdit; Label9: TLabel; DBEdit9: TDBEdit; Label10: TLabel; DBEdit10: TDBEdit; wwDBDateTimePicker1: TwwDBDateTimePicker; Label11: TLabel; Edit1: TEdit; bsSkinButton3: TbsSkinButton; p_employee_change: TADOStoredProc; procedure FormShow(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormKeyPress(Sender: TObject; var Key: Char); procedure bsSkinButton3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_sys_employee: Tfrm_sys_employee; implementation uses u_main, u_data_share; {$R *.dfm} procedure Tfrm_sys_employee.FormShow(Sender: TObject); begin t_sys_employee.Parameters[0].value:=employee; t_sys_employee.open; Edit1.Text:=t_sys_employee.fieldbyname('密码').asstring; end; procedure Tfrm_sys_employee.bsSkinButton2Click(Sender: TObject); begin if t_sys_employee.State=dsedit then t_sys_employee.cancel; close; end; procedure Tfrm_sys_employee.bsSkinButton1Click(Sender: TObject); begin if t_sys_employee.State=dsedit then begin if DBEdit2.text<>edit1.Text then begin showmessage('验证密码与登陆密码不一直,请重新输入!'); exit; end; t_sys_employee.Post; close; end; end; procedure Tfrm_sys_employee.FormClose(Sender: TObject; var Action: TCloseAction); begin frm_data_share.t_load_employee.requery; end; procedure Tfrm_sys_employee.FormKeyPress(Sender: TObject; var Key: Char); begin if key=#13 then begin Perform(WM_NEXTDLGCTL,0,0); key:=#0; end; end; procedure Tfrm_sys_employee.bsSkinButton3Click(Sender: TObject); var old_str,str:string; begin str:=trim(InputBox('请输入职员新的名字', '新的名字:', '')); if str=''then begin exit; end; try old_str:=t_sys_employee['姓名']; t_sys_employee.Edit; t_sys_employee['姓名']:=str; t_sys_employee.post; p_employee_change.Parameters.ParamByName('old_name').Value:=old_str; p_employee_change.Parameters.ParamByName('new_name').Value:=str; p_employee_change.ExecProc; except showmessage('更改姓名失败'); end; end; end.