Am_Ajxhs.~pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:5k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit Am_Ajxhs;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ComCtrls, ToolWin, Buttons, ExtCtrls, ImgList, Grids, DBGridEh,
- DB, ActnList, XPBarMenu, PrnDbgeh, Menus;
- type
- TAm_Ajxh = class(TForm)
- ImageList1: TImageList;
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- TabSheet2: TTabSheet;
- DataSource1: TDataSource;
- DBGridEh1: TDBGridEh;
- XPBarMenu1: TXPBarMenu;
- CoolBar1: TCoolBar;
- ToolBar1: TToolBar;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- ToolButton6: TToolButton;
- ToolButton7: TToolButton;
- PrintDBGridEh1: TPrintDBGridEh;
- DBGridEh2: TDBGridEh;
- DataSource2: TDataSource;
- PopupMenu1: TPopupMenu;
- N1: TMenuItem;
- N2: TMenuItem;
- PrintDBGridEh2: TPrintDBGridEh;
- procedure FormCreate(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure ToolButton1Click(Sender: TObject);
- procedure ToolButton7Click(Sender: TObject);
- procedure ToolButton2Click(Sender: TObject);
- procedure ToolButton3Click(Sender: TObject);
- procedure PageControl1Change(Sender: TObject);
- procedure ToolButton6Click(Sender: TObject);
- procedure N1Click(Sender: TObject);
- procedure DBGridEh1CellClick(Column: TColumnEh);
- procedure N2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Am_Ajxh: TAm_Ajxh;
- implementation
- uses dms,u_public, Am_AJJDs, am_ajxh_xhs, am_ajxh_dxh_ps, Am_Ajxh_yxh_Ps;
- {$R *.dfm}
- {待销毁案卷:系统自动列出类保管期限过期的;
- 已销毁案卷:已经鉴定并且销毁的}
- procedure TAm_Ajxh.FormCreate(Sender: TObject);
- var Snow:Tdatetime;
- begin
- Snow:=strToDatetime(formatdatetime('yyyy-mm-dd',now));
- dm.V_ajgl_gd.Close;
- dm.v_ajgl_gd.CommandText:='P_am_ajxh';
- dm.v_ajgl_gd.Execute;
- //dm.V_ajgl_gd.Close;
- //dm.v_ajgl_gd.CommandText:='P_Ajgl_dxh';
- //dm.v_ajgl_gd.Open;//加载待销毁案卷
- dm.V_ajgl_Dxh.Active:=true;//待销毁案卷
- dm.am_ajxh.Active:=true;//案卷销毁表
- dm.V_ajgl_yxh.Active:=true;//已销毁
- dm.Am_ajgl.Active:=true;
- end;
- procedure TAm_Ajxh.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- dm.am_ajxh.Active:=false;
- action:=cafree;
- am_ajxh:=nil;
- end;
- procedure TAm_Ajxh.ToolButton1Click(Sender: TObject);
- begin
- if Am_AJJD=nil then
- begin
- am_ajjd:=Tam_ajjd.create(self);
- dm.am_ajxh.Close;
- dm.am_ajxh.CommandText:='select * from am_ajxh where aj_ajxh='+''''+''''+'';
- dm.am_ajxh.Open;
- am_ajjd.showmodal;
- end;
- end;
- procedure TAm_Ajxh.ToolButton7Click(Sender: TObject);
- begin
- close;
- end;
- procedure TAm_Ajxh.ToolButton2Click(Sender: TObject);
- begin
- if dm.am_ajxh.FieldByName('aj_xh').AsString<>'' then
- begin
- if am_ajxh_xh=nil then
- begin
- am_ajxh_xh:=Tam_ajxh_xh.create(self);
- dm.am_ajxh.Edit;//案卷销毁
- am_ajxh_xh.showmodal;
- end;
- end;
- end;
- procedure TAm_Ajxh.ToolButton3Click(Sender: TObject);
- var s:string;
- begin
- s:=dm.V_ajgl_yxh.fieldbyname('aj_xh').AsString;
- dm.V_ajgl_gd.Close;
- dm.V_ajgl_gd.CommandText:='update v_ajgl_gd set ajzt_mc=''待销毁案卷'' where aj_xh='+''''+s+''''+'';
- dm.V_ajgl_gd.Execute;
- //dm.V_ajgl_gd.Close;
- //dm.V_ajgl_gd.CommandText:='P_ajgl_dxh';//查找待销毁案卷
- //dm.V_ajgl_gd.Open;
- dm.V_ajgl_yxh.Close;
- dm.V_ajgl_yxh.CommandText:='P_ajgl_yxh';//查找已销毁案卷
- dm.V_ajgl_yxh.Open;
- dm.V_ajgl_dxh.Close;
- dm.V_ajgl_dxh.CommandText:='P_ajgl_dxh';//查找待销毁案卷
- dm.V_ajgl_dxh.Open;
- end;
- procedure TAm_Ajxh.PageControl1Change(Sender: TObject);
- begin
- if pageControl1.ActivePageIndex=0 then
- begin
- if dm.V_ajgl_Dxh.RecordCount=0 then
- begin
- application.MessageBox('没有待销毁案卷','提示',mb_ok+mb_iconinformation);
- toolbutton3.Enabled:=false;
- toolbutton1.Enabled:=false;
- toolbutton2.Enabled:=false;
- end
- else
- begin
- toolbutton3.Enabled:=false;
- end;
- end
- else
- begin
- if dm.V_ajgl_yxh.RecordCount<>0 then
- toolbutton3.Enabled:=true
- else
- toolbutton3.Enabled:=false;
- end;
- end;
- procedure TAm_Ajxh.ToolButton6Click(Sender: TObject);
- begin
- dm.V_ajgl_yxh.Close;
- dm.V_ajgl_yxh.CommandText:='P_ajgl_yxh';//查找已销毁案卷
- dm.V_ajgl_yxh.Open;
- dm.V_ajgl_dxh.Close;
- dm.V_ajgl_dxh.CommandText:='P_ajgl_dxh';//查找待销毁案卷
- dm.V_ajgl_dxh.Open;
- end;
- procedure TAm_Ajxh.N1Click(Sender: TObject);
- begin
- //printdbgrideh1.Preview;
- am_ajxh_dxh_P:=tam_ajxh_dxh_P.create(application);
- am_ajxh_dxh_p.quickrep1.preview;
- end;
- procedure TAm_Ajxh.DBGridEh1CellClick(Column: TColumnEh);
- var s:string;
- begin
- s:=dm.V_ajgl_dxh.fieldbyname('aj_xh').AsString;//是否已鉴定
- dm.am_ajxh.Close;
- dm.am_ajxh.CommandText:='select * from am_ajxh where aj_xh='+''''+s+''''+'';
- dm.am_ajxh.Open;
- if dm.am_ajxh.FieldByName('ajxh_JDR').AsString<>'' then
- begin
- ToolButton2.Enabled:=true;
- toolbutton1.Enabled:=false;
- end//已经鉴定则使之处于销毁状态
- else
- begin
- ToolButton2.Enabled:=false;
- toolbutton1.Enabled:=True;
- end;
- end;
- procedure TAm_Ajxh.N2Click(Sender: TObject);
- begin
- //PrintDbGrideh2.Preview;
- am_ajxh_yxh_P:=Tam_ajxh_yxh_P.create(application);
- am_ajxh_yxh_p.quickrep1.preview;
- end;
- end.