mainfrms.pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:22k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit mainfrms;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ImgList, Menus, ExtCtrls, ComCtrls, ToolWin,iniFiles,
- TFlatHintUnit, DB, ADODB, DBClient, MConnect, SConnect, ActnList,
- XPBarMenu, StdCtrls, DBCtrls,ShellApi, StdActns, AppEvnts;
- type
- Tmainfrm = class(TForm)
- MainMenu1: TMainMenu;
- N1: TMenuItem;
- J1: TMenuItem;
- M1: TMenuItem;
- H1: TMenuItem;
- yljgl: TMenuItem;
- N3: TMenuItem;
- N4: TMenuItem;
- gdajgl: TMenuItem;
- jdhxh: TMenuItem;
- kwzkgl: TMenuItem;
- Dzgl: TMenuItem;
- Jygzsd: TMenuItem;
- Ghgl: TMenuItem;
- N17: TMenuItem;
- yhzfp: TMenuItem;
- ImageList1: TImageList;
- bz: TMenuItem;
- StatusBar1: TStatusBar;
- Timer1: TTimer;
- CoolBar1: TCoolBar;
- tmrTime: TTimer;
- Tcxt: TMenuItem;
- Xtsz: TMenuItem;
- ToolBar1: TToolBar;
- TreeView: TImageList;
- zsg: TImageList;
- ActionList1: TActionList;
- Quit: TAction;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- PopupMenu1: TPopupMenu;
- A1: TMenuItem;
- N22: TMenuItem;
- N23: TMenuItem;
- N24: TMenuItem;
- N25: TMenuItem;
- XPBarMenu1: TXPBarMenu;
- Xtrz: TMenuItem;
- xtcs: TMenuItem;
- Yhzgl: TMenuItem;
- yhgl: TMenuItem;
- mmgg: TMenuItem;
- cdqx: TMenuItem;
- N19: TMenuItem;
- qzgl: TMenuItem;
- N32: TMenuItem;
- xtajlbgl: TMenuItem;
- ajlbgl: TMenuItem;
- N36: TMenuItem;
- ztcl: TMenuItem;
- ztck: TMenuItem;
- dmgl: TMenuItem;
- N40: TMenuItem;
- bmlr: TMenuItem;
- yglr: TMenuItem;
- kwgl: TMenuItem;
- wjlbgl: TMenuItem;
- jygl: TMenuItem;
- Image1: TImage;
- ajgl: TMenuItem;
- ajjs: TMenuItem;
- wjgl: TMenuItem;
- wjjs: TMenuItem;
- N7: TMenuItem;
- Sjbf: TMenuItem;
- Sjhf: TMenuItem;
- ClientDataSet1: TClientDataSet;
- SaveDialog1: TSaveDialog;
- ClientDataSet3: TClientDataSet;
- Socket1: TSocketConnection;
- ToolButton5: TToolButton;
- ToolButton1: TToolButton;
- WindowClose1: TWindowClose;
- WindowCascade1: TWindowCascade;
- WindowTileHorizontal1: TWindowTileHorizontal;
- WindowTileVertical1: TWindowTileVertical;
- WindowMinimizeAll1: TWindowMinimizeAll;
- WindowArrange1: TWindowArrange;
- W1: TMenuItem;
- N2: TMenuItem;
- N5: TMenuItem;
- N6: TMenuItem;
- N8: TMenuItem;
- N9: TMenuItem;
- N10: TMenuItem;
- FlatHint1: TFlatHint;
- ToolButton6: TToolButton;
- ToolButton7: TToolButton;
- ToolButton18: TToolButton;
- ToolButton8: TToolButton;
- ApplicationEvents1: TApplicationEvents;
- N11: TMenuItem;
- N12: TMenuItem;
- procedure tmrTimeTimer(Sender: TObject);
- procedure bzClick(Sender: TObject);
- procedure XtszClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure YhzglClick(Sender: TObject);
- procedure qzglClick(Sender: TObject);
- procedure DzglClick(Sender: TObject);
- procedure N12Click(Sender: TObject);
- procedure GhglClick(Sender: TObject);
- procedure JygzsdClick(Sender: TObject);
- procedure jyglClick(Sender: TObject);
- procedure xtcsClick(Sender: TObject);
- procedure dmglClick(Sender: TObject);
- procedure xtajlbglClick(Sender: TObject);
- procedure kwglClick(Sender: TObject);
- procedure bmlrClick(Sender: TObject);
- procedure yglrClick(Sender: TObject);
- procedure wjlbglClick(Sender: TObject);
- procedure kwzkglClick(Sender: TObject);
- procedure ztclClick(Sender: TObject);
- procedure ztckClick(Sender: TObject);
- procedure ajlbglClick(Sender: TObject);
- procedure yljglClick(Sender: TObject);
- procedure ajglClick(Sender: TObject);
- procedure jdhxhClick(Sender: TObject);
- procedure yhglClick(Sender: TObject);
- procedure mmggClick(Sender: TObject);
- procedure yhzfpClick(Sender: TObject);
- procedure cdqxClick(Sender: TObject);
- procedure SjbfClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure XtrzClick(Sender: TObject);
- procedure SjhfClick(Sender: TObject);
- procedure ajjsClick(Sender: TObject);
- procedure wjjsClick(Sender: TObject);
- procedure ToolButton2Click(Sender: TObject);
- procedure ToolButton3Click(Sender: TObject);
- procedure ToolButton4Click(Sender: TObject);
- procedure ToolButton5Click(Sender: TObject);
- procedure QuitExecute(Sender: TObject);
- procedure ToolButton1Click(Sender: TObject);
- procedure ToolButton6Click(Sender: TObject);
- procedure ToolButton7Click(Sender: TObject);
- procedure ApplicationEvents1Exception(Sender: TObject; E: Exception);
- procedure dfd1Click(Sender: TObject);
- procedure Action1Execute(Sender: TObject);
- procedure N11Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- flag:Boolean;
- key:char;
- dbedit:Tdbedit;
- r:Trect;
- function MdiRect:Trect;
- procedure Next(Sender: TObject; var Key: Char);
- procedure DbInputNum(dbedit:Tdbedit;var key:char);//输入整数
- end;
- var
- mainfrm: Tmainfrm;
- implementation
- uses frmAbouts, da_csszs,da_comman, ajgls,xt_yhzs,u_public, xt_yhz_ms,
- ljszs, sz_qzs, AM_dzs, am_jygzs, am_jygls, am_ghgls, xt_lbjss, sz_dmgls,
- sz_xtajlbs, sz_kws, sz_bms, sz_yggls, sz_wjlbs, Am_kwgls, sz_ztcls,
- sz_ztcks, sz_ajlbs, Am_yljs, Am_gdajs, Am_Ajgl_Yjs, Am_Ajxhs, Am_Yhgls,
- am_yhgl_mms, Xt_Qxszs,logins, uset, xt_rzs, am_ajjss, am_wjjss,
- am_yhz_xzs, Xt_Cssds, am_gdaj_cxs;
- {$R *.dfm}
- function Tmainfrm.MdiRect:Trect;
- begin
- Windows.GetClientRect(clientHandle,result);
- end;
- //取自窗体的大小*****************************
- procedure Tmainfrm.DbInputNum(dbedit:Tdbedit;var key:char);
- begin
- if not (key in ['0'..'9',#8,#13]) then
- begin
- key:=#0;
- messagebeep(1);
- application.MessageBox('请输入数字!','提示',mb_ok);
- end;
- end;//定义传值输入整数的过程
- //****************************************
- procedure Tmainfrm.Next(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- begin
- key:=#0;
- selectnext(activecontrol,true,true)
- end;
- end;
- ///-----------------定义回车换行过程
- procedure Tmainfrm.tmrTimeTimer(Sender: TObject);
- begin
- statusbar1.Panels[2].Text :=timenow();
- end;
- procedure Tmainfrm.bzClick(Sender: TObject);
- begin
- frmAbout:=TfrmAbout.create(application);
- frmAbout.Show;
- end;
- procedure Tmainfrm.XtszClick(Sender: TObject);
- begin
- if frmset=nil then
- begin
- frmset:=Tfrmset.create(application);
- frmset.showmodal;
- end;
- end;
- procedure Tmainfrm.FormCreate(Sender: TObject);
- var iFile:Tinifile;
- begin
- Sys_Time:=formatdatetime('yyyy-mm-dd hh:mm:ss',now);
- sys_Tem:='登陆系统';
- ljsz:=Tljsz.create(application);
- ljsz.showmodal;
- sPath := ExtractFilePath(Application.ExeName);
- iFile := TIniFile.Create(sPath + 'perset.ini');
- sTopic := iFile.ReadString('sTopic', 'topic', '通用档案管理系统1.0正式版');
- bgstr := iFile.ReadString('sysbg', 'bground', 'main.jpg');
- iFile.Free;
- if sTopic = '' then sTopic := '通用档案管理系统1.0正式版';
- if (bgStr = '') or (not FileExists(sPath + bgStr)) then
- bgStr := 'main.jpg';
- image1.Picture.LoadFromFile(sPath + bgStr);
- self.Caption := sTopic;
- Application.Title := sTopic;
- Application.ShowHint := true;
- Application.HintColor := clLime;
- self.WindowState:=wsMaximized;
- //=======================================================================================
- {if login.ClientDataSet2.FieldByName('xtrz').AsBoolean=false then xtrz.Visible:=false;//1
- if login.ClientDataSet2.FieldByName('xtcs').AsBoolean=false then xtcs.Visible:=false;
- if login.ClientDataSet2.FieldByName('yhzgl').AsBoolean=false then yhzgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('yhgl').AsBoolean=false then yhgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('mmgg').AsBoolean=false then mmgg.Visible:=false;
- if login.ClientDataSet2.FieldByName('yhzfp').AsBoolean=false then yhzfp.Visible:=false;
- if login.ClientDataSet2.FieldByName('cdqx').AsBoolean=false then cdqx.Visible:=false;
- if login.ClientDataSet2.FieldByName('sjbf').AsBoolean=false then sjbf.Visible:=false;
- if login.ClientDataSet2.FieldByName('sjhf').AsBoolean=false then sjhf.Visible:=false;
- if login.ClientDataSet2.FieldByName('xtsz').AsBoolean=false then xtsz.Visible:=false;
- if login.ClientDataSet2.FieldByName('tcxt').AsBoolean=false then tcxt.Visible:=false;
- if login.ClientDataSet2.FieldByName('N17').AsBoolean=false then N17.Visible:=false;
- if login.ClientDataSet2.FieldByName('N7').AsBoolean=false then N7.Visible:=false;
- //--------------------------------------------------------------------------系统管理
- if login.ClientDataSet2.FieldByName('qzgl').AsBoolean=false then qzgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('xtajlbgl').AsBoolean=false then xtajlbgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('ajlbgl').AsBoolean=false then ajlbgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('wjlbgl').AsBoolean=false then wjlbgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('ztcl').AsBoolean=false then ztcl.Visible:=false;
- if login.ClientDataSet2.FieldByName('ztck').AsBoolean=false then ztck.Visible:=false;
- if login.ClientDataSet2.FieldByName('dmgl').AsBoolean=false then dmgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('bmlr').AsBoolean=false then bmlr.Visible:=false;
- if login.ClientDataSet2.FieldByName('yglr').AsBoolean=false then yglr.Visible:=false;
- if login.ClientDataSet2.FieldByName('kwgl').AsBoolean=false then kwgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('N32').AsBoolean=false then N32.Visible:=false;
- if login.ClientDataSet2.FieldByName('N36').AsBoolean=false then N36.Visible:=false;
- if login.ClientDataSet2.FieldByName('N40').AsBoolean=false then N40.Visible:=false;
- //----------------------------------------------------------------------基础数据
- if login.ClientDataSet2.FieldByName('yljgl').AsBoolean=false then yljgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('ajgl').AsBoolean=false then ajgl.Visible:=false;
- if login.ClientDataSet2.FieldByName('ajjs').AsBoolean=false then ajjs.Visible:=false;
- if login.ClientDataSet2.FieldByName('wjgl').AsBoolean=false then tcxt.Visible:=false;
- if login.ClientDataSet2.FieldByName('wjjs').AsBoolean=false then tcxt.Visible:=false;
- if login.ClientDataSet2.FieldByName('gdajgl').AsBoolean=false then tcxt.Visible:=false;
- if login.ClientDataSet2.FieldByName('jdhxh').AsBoolean=false then tcxt.Visible:=false;
- if login.ClientDataSet2.FieldByName('kwzkgl').AsBoolean=false then tcxt.Visible:=false;
- if login.ClientDataSet2.FieldByName('N3').AsBoolean=false then N3.Visible:=false;
- if login.ClientDataSet2.FieldByName('N4').AsBoolean=false then N4.Visible:=false;
- //---------------------------------------------------------------------案卷管理
- if login.ClientDataSet2.FieldByName('dzgl').AsBoolean=false then tcxt.Visible:=false;
- if login.ClientDataSet2.FieldByName('jygl').AsBoolean=false then tcxt.Visible:=false;
- if login.ClientDataSet2.FieldByName('jygzsd').AsBoolean=false then tcxt.Visible:=false;
- if login.ClientDataSet2.FieldByName('ghgl').AsBoolean=false then tcxt.Visible:=false;
- //-----------------------------------------------------------------------------------
- if login.ClientDataSet2.FieldByName('bz').AsBoolean=false then tcxt.Visible:=false;}
- end;
- procedure Tmainfrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- begin
- if Application.messagebox('您确认要退出本系统吗?','提示',mb_okcancel+mb_iconquestion)=idok then
- begin
- ljsz.Free;
- application.terminate;
- end
- else
- Canclose:=false;
- end;
- procedure Tmainfrm.YhzglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if xt_yhz=nil then
- begin
- xt_yhz:=Txt_yhz.Create(self);
- xt_yhz.show;
- xt_yhz.boundsRect:=Rect(r.left,r.top,r.right-r.left,r.bottom-r.top);
- end;
- end;
- procedure Tmainfrm.qzglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if sz_qz=nil then
- begin
- sz_qz:=Tsz_qz.Create(self);
- sz_qz.show;
- sz_qz.boundsRect:=Rect(r.left,r.top,r.right-r.left,r.bottom-r.top);
- end;
- end;
- procedure Tmainfrm.DzglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if am_dz=nil then
- begin
- am_dz:=Tam_dz.Create(self);
- am_dz.show;
- am_dz.boundsRect:=Rect(r.left,r.top,r.right-r.left,r.bottom-r.top);
- end;
- end;
- procedure Tmainfrm.N12Click(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if am_gdaj_cx=nil then
- begin
- am_gdaj_cx:=Tam_gdaj_cx.Create(self);
- am_gdaj_cx.show;
- am_gdaj_cx.boundsRect:=Rect(r.left,r.top,r.right-r.left,r.bottom-r.top);
- end;
- end;
- procedure Tmainfrm.GhglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if am_ghgl=nil then
- begin
- am_ghgl:=Tam_ghgl.Create(self);
- am_ghgl.show;
- am_ghgl.boundsRect:=Rect(r.left,r.top,r.right-r.left,r.bottom-r.top);
- end;
- end;
- procedure Tmainfrm.JygzsdClick(Sender: TObject);
- begin
- if am_jygz=nil then
- begin
- am_jygz:=Tam_jygz.Create(application);
- am_jygz.showmodal;
- end;
- end;
- procedure Tmainfrm.jyglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if am_jygl=nil then
- begin
- am_jygl:=Tam_jygl.Create(application);
- am_jygl.Show;
- am_jygl.BoundsRect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.xtcsClick(Sender: TObject);
- begin
- {if xt_lbjs=nil then
- begin
- xt_lbjs:=Txt_lbjs.Create(application);
- xt_lbjs.showmodal;
- end;}
- if xt_cssd=Nil then
- begin
- xt_cssd:=Txt_cssd.create(self);
- xt_cssd.showmodal;
- end;
- end;
- procedure Tmainfrm.dmglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if sz_dmgl=nil then
- begin
- sz_dmgl:=Tsz_dmgl.Create(application);
- sz_dmgl.show;
- sz_dmgl.BoundsRect:=rect(r.Left+90,r.Top,r.Right-r.Left-90,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.xtajlbglClick(Sender: TObject);
- begin
- if sz_xtajlb=nil then
- begin
- sz_xtajlb:=Tsz_xtajlb.Create(application);
- sz_xtajlb.showmodal;
- end;
- end;
- procedure Tmainfrm.kwglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if sz_kw=nil then
- begin
- sz_kw:=Tsz_kw.create(application);
- sz_kw.show;
- sz_kw.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.bmlrClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if sz_bm=nil then
- begin
- sz_bm:=Tsz_bm.create(application);
- sz_bm.show;
- sz_bm.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.yglrClick(Sender: TObject);
- begin
- if sz_yggl=nil then
- begin
- sz_yggl:=Tsz_yggl.create(application);
- sz_yggl.showmodal;
- end;
- end;
- procedure Tmainfrm.wjlbglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if sz_wjlb=nil then
- begin
- sz_wjlb:=Tsz_wjlb.create(application);
- sz_wjlb.show;
- sz_wjlb.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.kwzkglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if Am_kwgl=nil then
- begin
- Am_kwgl:=Tam_kwgl.create(self);
- Am_kwgl.show;
- Am_kwgl.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.ztclClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if sz_ztcl=nil then
- begin
- sz_ztcl:=Tsz_ztcl.create(self);
- sz_ztcl.show;
- sz_ztcl.boundsrect:=rect(r.left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.ztckClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if sz_ztck2=nil then
- begin
- sz_ztck2:=Tsz_ztck2.create(application);
- sz_ztck2.show;
- sz_ztck2.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.ajlbglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if not assigned(sz_ajlb) then
- begin
- sz_ajlb:=Tsz_ajlb.create(application);
- sz_ajlb.show;
- sz_ajlb.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.yljglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if Am_ylj=Nil then
- begin
- Am_ylj:=TAm_ylj.create(application);
- Am_ylj.show;
- am_ylj.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.ajglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if am_ajgl=nil then
- begin
- am_ajgl:=Tam_ajgl.create(application);
- am_ajgl.Show;
- am_ajgl.BoundsRect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.jdhxhClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if Am_Ajxh=nil then
- begin
- Am_Ajxh:=TAm_Ajxh.create(self);
- Am_Ajxh.show;
- Am_Ajxh.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.yhglClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if Am_Yhgl=nil then
- begin
- Am_Yhgl:=TAm_Yhgl.create(self);
- Am_Yhgl.show;
- Am_Yhgl.boundsrect:=Rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.top);
- end;
- end;
- procedure Tmainfrm.mmggClick(Sender: TObject);
- begin
- if am_yhgl_mm=nil then
- begin
- am_yhgl_mm:=Tam_yhgl_mm.create(self);
- am_yhgl_mm.showmodal;
- end;
- end;
- procedure Tmainfrm.yhzfpClick(Sender: TObject);
- begin
- xt_fpyhz:=Txt_fpyhz.create(self);
- xt_fpyhz.showmodal;
- end;
- procedure Tmainfrm.cdqxClick(Sender: TObject);
- begin
- if Xt_Cdqx=nil then
- begin
- xt_cdqx:=TXt_Cdqx.create(self);
- xt_cdqx.showmodal;
- end;
- end;
- procedure Tmainfrm.SjbfClick(Sender: TObject);
- Var disk_name:string;
- begin
- with savedialog1 do
- if execute then
- begin
- disk_name:=savedialog1.FileName;
- end;
- Clientdataset1.Close;
- Clientdataset1.CommandText:='backup database ElangAm to disk ='+''''+disk_name+''''+'with init';
- Try
- Clientdataset1.execute;
- Application.messagebox('数据库备份成功','提示',mb_ok+mb_iconinformation);
- except
- clientdataset1.close;
- application.messagebox('数据库备份失败','提示',mb_ok+mb_iconquestion);
- end;
- end;//数据库备份
- procedure Tmainfrm.FormShow(Sender: TObject);
- begin
- Clientdataset3.Active:=true;
- Clientdataset3.Append;
- Clientdataset3.Edit;
- Clientdataset3.FieldByName('user_name').AsString:=user_name;
- Clientdataset3.FieldByName('rz_czsj').AsString:=Sys_Time;
- Clientdataset3.FieldByName('rz_nr').AsString:=Sys_tem;
- Clientdataset3.FieldByName('rz_computer_Ip').AsString:=Computer_IP;
- Clientdataset3.ApplyUpdates(0);
- Clientdataset3.Close;
- Clientdataset3.CommandText:='select * from xt_rz';
- Clientdataset3.Open;//日志纪录
- Clientdataset3.Active:=false;
- end;
- procedure Tmainfrm.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- Sys_tem:='退出系统';
- Clientdataset3.Active:=true;
- Clientdataset3.Append;
- Clientdataset3.Edit;
- Clientdataset3.FieldByName('user_name').AsString:=user_name;
- Clientdataset3.FieldByName('rz_czsj').AsString:=Sys_Time;
- Clientdataset3.FieldByName('rz_nr').AsString:=Sys_tem;
- Clientdataset3.FieldByName('rz_computer_Ip').AsString:=computer_Ip;
- Clientdataset3.ApplyUpdates(0);
- Clientdataset3.Close;
- Clientdataset3.CommandText:='select * from xt_rz';
- Clientdataset3.Open;//日志纪录
- end;
- procedure Tmainfrm.XtrzClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if xt_rz=nil then
- begin
- xt_rz:=Txt_rz.create(self);
- xt_rz.show;
- xt_rz.BoundsRect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.SjhfClick(Sender: TObject);
- begin
- if application.MessageBox('警告:恢复数据库必须断开所有'+#13#10+'与它的连接!现在将关闭程序,是否继续?','询问?',mb_okcancel+mb_iconquestion)=idok then
- begin
- //应写程序主窗体的name
- ShellExecute(Handle,'open','restore.exe',nil,nil,SW_SHOWNORMAL);
- ljsz.Close;
- application.Terminate;
- end;
- end;
- procedure Tmainfrm.ajjsClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if am_ajjs=nil then
- begin
- am_ajjs:=Tam_ajjs.create(self);
- am_ajjs.show;
- am_ajjs.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- procedure Tmainfrm.wjjsClick(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if am_wjjs=nil then
- begin
- am_wjjs:=Tam_wjjs.create(self);
- am_wjjs.show;
- am_wjjs.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.top);
- end;
- end;
- procedure Tmainfrm.ToolButton2Click(Sender: TObject);
- begin
- yljgl.Click;
- end;
- procedure Tmainfrm.ToolButton3Click(Sender: TObject);
- begin
- ajgl.Click;
- end;
- procedure Tmainfrm.ToolButton4Click(Sender: TObject);
- begin
- jygl.Click;
- end;
- procedure Tmainfrm.ToolButton5Click(Sender: TObject);
- begin
- bz.Click;
- end;
- procedure Tmainfrm.QuitExecute(Sender: TObject);
- begin
- close;
- end;
- procedure Tmainfrm.ToolButton1Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tmainfrm.ToolButton6Click(Sender: TObject);
- begin
- gdajgl.Click;
- end;
- procedure Tmainfrm.ToolButton7Click(Sender: TObject);
- begin
- Dzgl.Click;
- end;
- procedure Tmainfrm.ApplicationEvents1Exception(Sender: TObject;
- E: Exception);
- var str:string;
- begin
- str:=e.Message;
- if (pos('date',str)>0) then
- application.MessageBox('数据类型不符合要求!','提示',mb_iconExclaMation);
- if (pos('Time',str)>0) then
- application.MessageBox('数据类型不符合要求!','提示',mb_iconExclaMation);
- if (pos('Calendar',str)>0) then
- application.MessageBox('数据范围有误!','提示',mb_iconExclaMation);
- if (Pos('约束',str)>0) then
- application.MessageBox('此数据类型已被用,不能删除','提示',mb_iconExclaMation);
- if (pos('invalid',str)>0) then
- application.MessageBox('无效的数据类型','提示',mb_iconExclaMation);
- if (POs('无效',str)>0) then
- application.MessageBox('数据库连接有问题','提示',mb_iconExclaMation);
- end;
- procedure Tmainfrm.dfd1Click(Sender: TObject);
- begin
- tile;
- end;
- procedure Tmainfrm.Action1Execute(Sender: TObject);
- begin
- tile;
- end;
- procedure Tmainfrm.N11Click(Sender: TObject);
- begin
- inherited;
- r:=mdirect;
- if am_gdaj=nil then
- begin
- am_gdaj:=Tam_gdaj.create(self);
- am_gdaj.show;
- am_gdaj.boundsrect:=rect(r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top);
- end;
- end;
- end.