am_jygls.~pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:5k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit am_jygls;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Grids, DBGridEh, ComCtrls, ToolWin, DB, XPBarMenu, PrnDbgeh,
- StdCtrls, ExtCtrls, DBClient;
- type
- Tam_jygl = class(TForm)
- CoolBar1: TCoolBar;
- ToolBar1: TToolBar;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- ToolButton5: TToolButton;
- ToolButton6: TToolButton;
- ToolButton7: TToolButton;
- DBGridEh1: TDBGridEh;
- v_jy: TDataSource;
- XPBarMenu1: TXPBarMenu;
- PrintDBGridEh1: TPrintDBGridEh;
- RadioGroup1: TRadioGroup;
- ClientDataSet1: TClientDataSet;
- procedure ToolButton1Click(Sender: TObject);
- procedure ToolButton2Click(Sender: TObject);
- procedure ToolButton7Click(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure FormCreate(Sender: TObject);
- procedure ToolButton3Click(Sender: TObject);
- procedure ToolButton4Click(Sender: TObject);
- procedure ToolButton6Click(Sender: TObject);
- procedure RadioGroup1Click(Sender: TObject);
- procedure DBGridEh1DblClick(Sender: TObject);
- procedure ToolButton5Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- am_jygl: Tam_jygl;
- implementation
- uses dms, am_jygl_bjs, am_jygl_cxs, am_jygl_ps;
- {$R *.dfm}
- procedure Tam_jygl.ToolButton1Click(Sender: TObject);
- begin
- dm.am_jygl.Close;
- dm.am_jygl.CommandText:='select * from am_jygl where dz_dm='+''''+''''+'';
- dm.am_jygl.Open;
- //dm.am_jygl.Append;
- dm.am_jygl.edit;
- am_jygl_bj:=Tam_jygl_bj.create(application);
- am_jygl_bj.showmodal;
- end;
- procedure Tam_jygl.ToolButton2Click(Sender: TObject);
- var s:string;
- begin
- s:=Clientdataset1.fieldbyname('dz_dm').AsString;
- dm.am_jygl.Close;
- dm.am_jygl.CommandText:='select * from am_jygl where dz_dm='+''''+s+''''+'';
- dm.am_jygl.Open;
- am_jygl_bj:=Tam_jygl_bj.Create(application);
- {am_jygl_bj.DBEditEh2.Text:=dm.Am_jygl.FieldByName('dz_dm').AsString;
- am_jygl_bj.DbDateTimeEditEh1.Value:=dm.am_jygl.FieldByName('jy_jyrq').AsDateTime;
- am_jygl_bj.dbediteh1.Text:=dm.am_jygl.FieldByName('jy_yhrq').AsString;}
- am_jygl_bj.ShowModal;
- end;
- procedure Tam_jygl.ToolButton7Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tam_jygl.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- action:=cafree;
- am_jygl:=nil;
- end;
- procedure Tam_jygl.FormCreate(Sender: TObject);
- begin
- dm.am_jygl.Active:=true;//借阅管理
- Clientdataset1.Active:=true;//借阅视图
- dm.sz_jyfs.Active:=true;//借阅方式
- dm.sz_jymd.Active:=true;//借阅目的
- Dm.am_dz.Active:=true;//读者表
- dm.am_jygz.Active:=true;//借阅规则
- DM.sz_zjlb.Active:=true;//证件类别
- end;
- procedure Tam_jygl.ToolButton3Click(Sender: TObject);
- var s:string;
- begin
- dm.am_jygl.Close;
- Dm.am_jygl.CommandText:='select * from am_jygl';
- dm.am_jygl.Open;
- s:=Clientdataset1.fieldbyname('jy_xh').AsString;
- if Dm.am_jygl.RecordCount=0 then
- begin
- application.MessageBox('表中没有数据不能删除!','提示',mb_iconinformation+mb_defbutton1);
- Abort;
- end
- else
- if application.MessageBox('你确定删除吗?','警告',mb_okcancel+mb_iconinformation)=idok then
- begin
- dm.am_jygl.Close;
- dm.am_jygl.CommandText:='delete am_jygl where jy_xh='+''''+s+''''+'';
- dm.am_jygl.Execute;
- dm.am_jygl.close;
- dm.am_jygl.commandtext:='select * from am_jygl';
- dm.am_jygl.open;//删除表中数据
- toolbutton4.Click;
- end;
- end;
- procedure Tam_jygl.ToolButton4Click(Sender: TObject);
- begin
- Clientdataset1.Close;
- Clientdataset1.CommandText:='select * from v_jy';
- Clientdataset1.Open;
- end;
- procedure Tam_jygl.ToolButton6Click(Sender: TObject);
- begin
- //PrintDBGridEh1.Preview;
- am_jygl_P:=Tam_jygl_P.create(self);
- am_JYgl_P.QuickRep1.Preview;
- end;
- procedure Tam_jygl.RadioGroup1Click(Sender: TObject);
- begin
- if radioGroup1.ItemIndex=0 then
- begin
- Clientdataset1.Close;
- Clientdataset1.CommandText:='select * from v_Jy where jy_jyrq=getdate()';
- Clientdataset1.Open;
- end
- else
- begin
- Clientdataset1.Close;
- Clientdataset1.CommandText:='select * from v_Jy where jy_jyrq<>getdate()';
- Clientdataset1.Open;
- end;
- end;
- procedure Tam_jygl.DBGridEh1DblClick(Sender: TObject);
- begin
- Toolbutton2.Click;
- end;
- procedure Tam_jygl.ToolButton5Click(Sender: TObject);
- begin
- if am_jygl_cx= nil then
- begin
- am_jygl_cx:=Tam_jygl_cx.create(self);
- am_jygl_cx.showmodal;
- end;
- end;
- end.