Am_Yhgls.pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:4k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit Am_Yhgls;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, PrnDbgeh, XPBarMenu, DB, Grids, DBGridEh, StdCtrls, ComCtrls,
- ToolWin;
- type
- TAm_Yhgl = class(TForm)
- CoolBar1: TCoolBar;
- ToolBar1: TToolBar;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- ToolButton5: TToolButton;
- ToolButton6: TToolButton;
- ToolButton7: TToolButton;
- GroupBox1: TGroupBox;
- DBGridEh1: TDBGridEh;
- DataSource1: TDataSource;
- XPBarMenu1: TXPBarMenu;
- PrintDBGridEh1: TPrintDBGridEh;
- procedure ToolButton7Click(Sender: TObject);
- procedure ToolButton6Click(Sender: TObject);
- procedure ToolButton1Click(Sender: TObject);
- procedure ToolButton2Click(Sender: TObject);
- procedure ToolButton3Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure ToolButton4Click(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure ToolButton5Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Am_Yhgl: TAm_Yhgl;
- implementation
- uses dms,U_Public, Am_Yhgl_Zcs, yhz_bjs, logins, am_yhgl_xgs, xt_user_cxs;
- {$R *.dfm}
- procedure TAm_Yhgl.ToolButton7Click(Sender: TObject);
- begin
- close;
- end;
- procedure TAm_Yhgl.ToolButton6Click(Sender: TObject);
- begin
- PrintDBGridEh1.Preview;
- end;
- procedure TAm_Yhgl.ToolButton1Click(Sender: TObject);
- begin
- if am_yhgl_zc=nil then
- begin
- am_yhgl_zc:=Tam_yhgl_zc.create(application);
- //dm.xt_user.Close;
- //dm.xt_user.CommandText:='select * from user_dm='+''''+''''+'';
- //dm.xt_user.Open;
- dm.xt_user.Append;
- am_yhgl_zc.Label1.Caption:='增加新用户';
- am_yhgl_zc.showmodal;
- end;
- end;
- procedure TAm_Yhgl.ToolButton2Click(Sender: TObject);
- var s_user_dm:string;
- begin
- s_user_dm:=dm.xt_user.fieldbyname('user_dm').AsString;
- if s_user_dm<>user_dm then
- begin
- am_yhgl_xg:=Tam_yhgl_xg.create(self);
- Dm.xt_user.Close;
- dm.xt_user.CommandText:='select * from xt_user where user_dm='+''''+s_user_dm+''''+'';
- dm.xt_user.Open;
- DM.xt_user.Edit;
- //am_yhgl_zc.DBEditEh6.Text:=login.edit2.text;
- am_yhgl_xg.showmodal;
- end
- else
- begin
- am_yhgl_xg:=Tam_yhgl_xg.create(self);
- Dm.xt_user.Close;
- dm.xt_user.CommandText:='select * from xt_user where user_dm='+''''+s_user_dm+''''+'';
- dm.xt_user.Open;
- DM.xt_user.Edit;
- am_yhgl_xg.DBEditEh1.Color:=cl3DLight;
- am_yhgl_xg.DBEditEh1.Enabled:=false;
- am_yhgl_xg.showmodal;
- end;
- end;
- procedure TAm_Yhgl.ToolButton3Click(Sender: TObject);
- var s_user_dm:string;
- begin
- if application.MessageBox('你确定删除吗?','警告',mb_okcancel+mb_iconquestion)=idok then
- begin
- s_user_dm:=dm.xt_user.fieldbyname('user_dm').AsString;
- if s_user_dm=user_dm then
- begin
- application.MessageBox('当前用户数据正在被用,'+#13#10+'不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end
- else
- begin
- Dm.xt_user.Close;
- dm.xt_user.CommandText:='delete xt_user where user_dm='+''''+s_user_dm+''''+'';
- dm.xt_user.Execute;
- Dm.xt_user.Close;
- dm.xt_user.CommandText:='select * from xt_user';
- dm.xt_user.Open;
- toolbutton4.Click;
- end;
- end;
- end;
- procedure TAm_Yhgl.FormCreate(Sender: TObject);
- begin
- dm.xt_user.Active:=true;
- end;
- procedure TAm_Yhgl.ToolButton4Click(Sender: TObject);
- begin
- dm.xt_user.Close;
- dm.xt_user.CommandText:='select * from xt_user';
- dm.xt_user.Open;
- end;
- procedure TAm_Yhgl.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- dm.xt_user.Active:=false;
- action:=cafree;
- am_yhgl:=nil;
- end;
- procedure TAm_Yhgl.ToolButton5Click(Sender: TObject);
- begin
- if xt_user_cx=Nil then
- begin
- xt_user_cx:=Txt_user_cx.create(self);
- xt_user_cx.showmodal;
- end;
- end;
- end.