AM_dzs.~pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:4k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit AM_dzs;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, DB, Grids, DBGridEh, XPBarMenu, ComCtrls, ToolWin, DBClient,
- FR_Class, PrnDbgeh;
- type
- Tam_dz = class(TForm)
- CoolBar1: TCoolBar;
- ToolBar1: TToolBar;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- ToolButton5: TToolButton;
- ToolButton6: TToolButton;
- ToolButton7: TToolButton;
- XPBarMenu1: TXPBarMenu;
- DBGridEh1: TDBGridEh;
- DS_V_DZ: TDataSource;
- PrintDBGridEh1: TPrintDBGridEh;
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure ToolButton7Click(Sender: TObject);
- procedure ToolButton2Click(Sender: TObject);
- procedure ToolButton3Click(Sender: TObject);
- procedure ToolButton4Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure DBGridEh1DblClick(Sender: TObject);
- procedure ToolButton1Click(Sender: TObject);
- procedure ToolButton6Click(Sender: TObject);
- procedure ToolButton5Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- am_dz: Tam_dz;
- implementation
- uses dms, am_dzbjs, am_dz_cxs, Am_dz_Ps;
- {$R *.dfm}
- procedure Tam_dz.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- Dm.am_dz.Active:=false;
- dm.am_jygz.Active:=false;
- DM.sz_zjlb.Active:=false;
- dm.V_DZ.Active:=false;
- action:=cafree;
- Am_dz:=nil;
- end;
- procedure Tam_dz.ToolButton7Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tam_dz.ToolButton2Click(Sender: TObject);
- var s:string;
- begin
- s:=dm.V_DZ.fieldbyname('dz_dm').AsString;
- am_dzbj:=Tam_dzbj.create(self);
- am_dzbj.Label1.Caption:='修改读者';
- Dm.am_dz.Close;
- dm.am_dz.CommandText:='select * from Am_dz where DZ_dm='+''''+s+''''+'';
- dm.am_dz.Open;
- DM.am_dz.Edit;
- am_dzbj.MaskEdit1.Text:=dm.am_dz.fieldbyname('dz_lxdh').AsString;
- am_dzbj.ShowModal;
- end;
- procedure Tam_dz.ToolButton3Click(Sender: TObject);
- var s:string;
- begin
- s:=dm.V_DZ.fieldbyname('dz_dm').AsString;
- if Dm.am_dz.RecordCount=0 then
- begin
- application.MessageBox('表中没有数据不能删除!','提示',mb_iconinformation+mb_defbutton1);
- Abort;
- end
- else
- if application.MessageBox('您确定要删除当前纪录吗?','警告',mb_okcancel+mb_iconquestion)=idok then
- begin
- dm.am_dz.Close;
- dm.am_dz.CommandText:='select * from am_dz where dz_dm='+''''+s+''''+'';
- dm.am_dz.Open;
- Dm.am_dz.Delete;
- Dm.am_dz.ApplyUpdates(0);
- toolbutton4.Click;
- end;
- end;
- procedure Tam_dz.ToolButton4Click(Sender: TObject);
- begin
- dm.am_dz.Close;
- dm.am_dz.CommandText:='select * from am_dz';
- dm.am_dz.Open;
- //刷新视图
- dm.V_DZ.Close;
- dm.V_DZ.CommandText:='select * from V_DZ';
- dm.V_DZ.Open;
- end;
- procedure Tam_dz.FormCreate(Sender: TObject);
- begin
- Dm.am_dz.Active:=true;
- dm.am_jygz.Active:=true;
- DM.sz_zjlb.Active:=true;
- dm.V_DZ.Active:=true;
- end;
- procedure Tam_dz.DBGridEh1DblClick(Sender: TObject);
- begin
- Toolbutton4.Click;
- Toolbutton2.Click;
- end;
- procedure Tam_dz.ToolButton1Click(Sender: TObject);
- begin
- am_dzbj:=Tam_dzbj.create(application);
- dm.am_dz.Close;
- dm.am_dz.CommandText:='select * from am_dz where dz_dm='+''''+''''+'';
- dm.am_dz.Open;
- am_dzbj.Label1.Caption:='增加读者';
- am_dzbj.showmodal;
- end;
- procedure Tam_dz.ToolButton6Click(Sender: TObject);
- begin
- { DbGrideh1.Columns[0].Width:=60;
- DBgrideh1.columns[1].Width:=60;
- printDbGrideh1.Title.Text:='读者管理';
- printdbgrideh1.BeforeGridText.Text:='生产通知单汇总打印';
- printDBGrideh1.AfterGridText.Text:=datetostr(date);
- PrintDBGridEh1.Preview;}
- am_dz_p:=Tam_dz_P.create(application);
- //am_dz_P.QuickRep1.Preview;
- am_dz_p.QuickRep1.Preview;
- end;
- procedure Tam_dz.ToolButton5Click(Sender: TObject);
- begin
- if am_dz_cx=Nil then
- begin
- am_dz_cx:=Tam_dz_cx.create(self);
- am_dz_cx.showmodal;
- end;
- end;
- end.