f_main.pas
上传用户:lcqxtx
上传日期:2013-02-15
资源大小:530k
文件大小:5k
- unit f_main;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ToolWin, ComCtrls, ExtCtrls, Menus, ImgList;
- type userinfo = record // 定义用户信息
- id: string;
- name: string; // 用户权限
- end;
- type
- Tw_main = class(TForm)
- stb: TStatusBar;
- Timer1: TTimer;
- MainMenu1: TMainMenu;
- N1: TMenuItem;
- N2: TMenuItem;
- N3: TMenuItem;
- N4: TMenuItem;
- N5: TMenuItem;
- N22: TMenuItem;
- N9: TMenuItem;
- N10: TMenuItem;
- N11: TMenuItem;
- N12: TMenuItem;
- N13: TMenuItem;
- N14: TMenuItem;
- N15: TMenuItem;
- N16: TMenuItem;
- N17: TMenuItem;
- N18: TMenuItem;
- N19: TMenuItem;
- N20: TMenuItem;
- N21: TMenuItem;
- N23: TMenuItem;
- N24: TMenuItem;
- N25: TMenuItem;
- ImageList1: TImageList;
- ToolBar1: TToolBar;
- ToolButton4: TToolButton;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- N6: TMenuItem;
- N7: TMenuItem;
- bum1: TMenuItem;
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure Timer1Timer(Sender: TObject);
- procedure N2Click(Sender: TObject);
- procedure N4Click(Sender: TObject);
- procedure N3Click(Sender: TObject);
- procedure ToolButton4Click(Sender: TObject);
- procedure N11Click(Sender: TObject);
- procedure N9Click(Sender: TObject);
- procedure N10Click(Sender: TObject);
- procedure ToolButton2Click(Sender: TObject);
- procedure N6Click(Sender: TObject);
- procedure N23Click(Sender: TObject);
- procedure ToolButton1Click(Sender: TObject);
- procedure N13Click(Sender: TObject);
- procedure N14Click(Sender: TObject);
- procedure N19Click(Sender: TObject);
- procedure N20Click(Sender: TObject);
- procedure N7Click(Sender: TObject);
- procedure bum1Click(Sender: TObject);
- procedure N16Click(Sender: TObject);
- procedure N17Click(Sender: TObject);
- procedure ToolButton3Click(Sender: TObject);
- procedure N25Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- auser: userinfo;
- end;
- var
- w_main: Tw_main;
- implementation
- uses Unit1, f_xgmm, f_yhgl,f_DataBack, f_zpinf, f_rsxt, f_rscx, data_1,
- f_kqrl, f_kqcx, f_gzrl, f_gzcx, f_depart, f_xshuo, f_xscx, f_bz;
- {$R *.dfm}
- function whatweek:string;
- var
- i_week:integer;
- begin
- i_week:=dayofweek(now());
- case i_week of
- 1:result:='星期日';
- 2:result:='星期一';
- 3:result:='星期二';
- 4:result:='星期三';
- 5:result:='星期四';
- 6:result:='星期五';
- 7:result:='星期六';
- end;
- end;
- procedure Tw_main.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- if application.MessageBox('确认要退出程序吗?','提示',mb_okcancel)=idok then
- begin
- Action := caFree;
- application.Terminate;
- end
- else
- Action := caNone;
- end;
- procedure Tw_main.Timer1Timer(Sender: TObject);
- var
- s_date,strl,str2:string;
- begin
- strl:= formatdatetime('yyyy/mm/dd ',date());
- str2:='今天是 '+copy(strl,1,4)+ '年' +copy(strl,6,2)+ '月' +copy(strl,9,2)+ '日' ;
- s_date:=' '+str2+' '+whatweek();
- StB.Panels[4].Text:=s_date;
- stb.Panels[0].Text := ' 系统属于开发阶段.....';
- Stb.Panels[1].Text:=' 当前用户: '+' '+w_main.auser.name+' 属于 '+form1.power;
- Stb.Panels[2].Text:=' 服务器:'+form1.Edit3.Text;
- end;
- procedure Tw_main.N2Click(Sender: TObject);
- begin
- form1.Edit1.Clear;
- form1.Edit2.Clear;
- form1.Edit3.Clear;
- w_main.Hide;
- form1.Show;
- end;
- procedure Tw_main.N4Click(Sender: TObject);
- begin
- w_xgmm:=tw_xgmm.Create(self);
- w_xgmm.show;
- end;
- procedure Tw_main.N3Click(Sender: TObject);
- begin
- w_yhgl:=tw_yhgl.create(self);
- w_yhgl.ShowModal;
- end;
- procedure Tw_main.ToolButton4Click(Sender: TObject);
- begin
- DataBack:=TDataBack.create(self);
- DataBack.showmodal;
- end;
- procedure Tw_main.N11Click(Sender: TObject);
- begin
- w_zpinf:=tw_zpinf.create(self);
- w_zpinf.show;
- end;
- procedure Tw_main.N9Click(Sender: TObject);
- begin
- w_rsxt:=tw_rsxt.create(self);
- w_rsxt.show;
- end;
- procedure Tw_main.N10Click(Sender: TObject);
- begin
- w_rscx:=tw_rscx.create(self) ;
- w_rscx.show;
- end;
- procedure Tw_main.ToolButton2Click(Sender: TObject);
- begin
- data1.frReport1.ShowReport;
- end;
- procedure Tw_main.N6Click(Sender: TObject);
- begin
- data1.frReport1.ShowReport;
- end;
- procedure Tw_main.N23Click(Sender: TObject);
- begin
- //w_rscx.frReport1.ShowReport;
- end;
- procedure Tw_main.ToolButton1Click(Sender: TObject);
- begin
- //w_rscx.frReport1.ShowReport;
- end;
- procedure Tw_main.N13Click(Sender: TObject);
- begin
- w_kqrl:=tw_kqrl.create(self);
- w_kqrl.show;
- end;
- procedure Tw_main.N14Click(Sender: TObject);
- begin
- w_kqcx:=tw_kqcx.create(self);
- w_kqcx.show;
- end;
- procedure Tw_main.N19Click(Sender: TObject);
- begin
- w_gzrl:=tw_gzrl.create(self);
- w_gzrl.show;
- end;
- procedure Tw_main.N20Click(Sender: TObject);
- begin
- w_gzcx:=tw_gzcx.create(self);
- w_gzcx.show;
- end;
- procedure Tw_main.N7Click(Sender: TObject);
- begin
- data1.frReport2.ShowReport;
- end;
- procedure Tw_main.bum1Click(Sender: TObject);
- begin
- w_depart:=tw_depart.create(self);
- w_depart.show;
- end;
- procedure Tw_main.N16Click(Sender: TObject);
- begin
- w_xshuo:=tw_xshuo.create(self);
- w_xshuo.show;
- end;
- procedure Tw_main.N17Click(Sender: TObject);
- begin
- form2:=tform2.create(self);
- form2.show;
- end;
- procedure Tw_main.ToolButton3Click(Sender: TObject);
- begin
- form2.frReport1.ShowReport;
- end;
- procedure Tw_main.N25Click(Sender: TObject);
- begin
- w_bz:=tw_bz.create(self);
- w_bz.show;
- end;
- end.