Am_Ygxzs.pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:3k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit Am_Ygxzs;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, DB, Buttons, Grids, DBGridEh, ExtCtrls, DBClient;
- type
- TAm_Ygxz = class(TForm)
- Panel1: TPanel;
- Panel2: TPanel;
- SpeedButton1: TSpeedButton;
- SpeedButton2: TSpeedButton;
- SpeedButton3: TSpeedButton;
- DataSource1: TDataSource;
- DBGridEh1: TDBGridEh;
- ClientDataSet1: TClientDataSet;
- procedure SpeedButton3Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure DBGridEh1DblClick(Sender: TObject);
- procedure SpeedButton2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Am_Ygxz: TAm_Ygxz;
- implementation
- uses dms, Am_Yhgl_Zcs, am_yhgl_xgs,u_public;
- {$R *.dfm}
- procedure TAm_Ygxz.SpeedButton3Click(Sender: TObject);
- begin
- close;
- end;
- procedure TAm_Ygxz.FormCreate(Sender: TObject);
- begin
- //dm.v_yggl.active:=true;
- dm.v_yggl.Close;
- dm.v_yggl.CommandText:='select * from v_yggl';
- dm.v_yggl.open;
- end;
- procedure TAm_Ygxz.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- dm.v_yggl.Active:=false;
- action:=cafree;
- am_ygxz:=nil;
- end;
- procedure TAm_Ygxz.DBGridEh1DblClick(Sender: TObject);
- var s:string;
- begin
- s:=dm.v_yggl.fieldbyname('yg_dm').AsString;
- Clientdataset1.Close;
- clientdataset1.CommandText:='select * from xt_user where user_ygdm='+''''+s+''''+'';
- Clientdataset1.Open;
- if clientdataset1.FieldByName('user_ygdm').AsString<>'' then
- begin
- application.MessageBox('一个员工只能对应一个用户,'+#13#10+'该用户资料已经存在','提示',mb_ok+mb_iconinformation);
- exit;
- end
- else
- begin//判断是修改还是增加
- if frm_name='am_yhgl_zc' then
- begin
- Am_Yhgl_Zc.DBEditeh4.Text:=dm.v_yggl.fieldbyname('yg_dm').AsString;
- am_yhgl_zc.dbediteh5.Text:=dm.v_yggl.fieldbyname('yg_xm').AsString;
- close;
- end
- else
- begin
- Am_Yhgl_xg.DBEditeh4.Text:=dm.v_yggl.fieldbyname('yg_dm').AsString;
- am_yhgl_xg.dbediteh5.Text:=dm.v_yggl.fieldbyname('yg_xm').AsString;
- close;
- end;
- end;
- end;
- procedure TAm_Ygxz.SpeedButton2Click(Sender: TObject);
- var s:string;
- begin
- s:=dm.v_yggl.fieldbyname('yg_dm').AsString;
- Clientdataset1.Close;
- clientdataset1.CommandText:='select * from xt_user where user_ygdm='+''''+s+''''+'';
- Clientdataset1.Open;
- if clientdataset1.FieldByName('user_ygdm').AsString<>'' then
- begin
- application.MessageBox('一个员工只能对应一个用户,'+#13#10+'该用户资料已经存在','提示',mb_ok+mb_iconinformation);
- exit;
- end
- else
- begin//判断是修改还是增加
- if frm_name='am_yhgl_zc' then
- begin
- Am_Yhgl_Zc.DBEditeh4.Text:=dm.v_yggl.fieldbyname('yg_dm').AsString;
- am_yhgl_zc.dbediteh5.Text:=dm.v_yggl.fieldbyname('yg_xm').AsString;
- close;
- end
- else
- begin
- Am_Yhgl_xg.DBEditeh4.Text:=dm.v_yggl.fieldbyname('yg_dm').AsString;
- am_yhgl_xg.dbediteh5.Text:=dm.v_yggl.fieldbyname('yg_xm').AsString;
- close;
- end;
- end;
- end;
- end.