📄 winmain.~pas
字号:
Self.ImageList1.TransparentColor := System.Drawing.Color.Transparent;
//
// StatusBar1
//
Self.StatusBar1.Location := System.Drawing.Point.Create(0, 276);
Self.StatusBar1.Name := 'StatusBar1';
Self.StatusBar1.Panels.AddRange(TSystem_Windows_Forms_StatusBarPanelArray.Create(Self.sbpinfo,
Self.sbpuser, Self.sbptime));
Self.StatusBar1.ShowPanels := True;
Self.StatusBar1.Size := System.Drawing.Size.Create(528, 22);
Self.StatusBar1.TabIndex := 2;
Self.StatusBar1.Text := 'StatusBar1';
Include(Self.StatusBar1.PanelClick, Self.StatusBar1_PanelClick);
//
// sbpinfo
//
Self.sbpinfo.AutoSize := System.Windows.Forms.StatusBarPanelAutoSize.Spring;
Self.sbpinfo.Icon := (System.Drawing.Icon(resources.GetObject('sbpinfo.Icon')));
Self.sbpinfo.Text := '请选择功能菜单';
Self.sbpinfo.Width := 392;
//
// sbpuser
//
Self.sbpuser.AutoSize := System.Windows.Forms.StatusBarPanelAutoSize.Contents;
Self.sbpuser.Icon := (System.Drawing.Icon(resources.GetObject('sbpuser.Icon')));
Self.sbpuser.Text := '操作员:';
Self.sbpuser.Width := 85;
//
// sbptime
//
Self.sbptime.AutoSize := System.Windows.Forms.StatusBarPanelAutoSize.Contents;
Self.sbptime.Icon := (System.Drawing.Icon(resources.GetObject('sbptime.Icon')));
Self.sbptime.Text := ' ';
Self.sbptime.Width := 35;
//
// Timer1
//
Self.Timer1.Interval := 1000;
Include(Self.Timer1.Tick, Self.Timer1_Tick);
//
// TWinmain
//
Self.AutoScaleBaseSize := System.Drawing.Size.Create(6, 14);
Self.ClientSize := System.Drawing.Size.Create(528, 298);
Self.Controls.Add(Self.StatusBar1);
Self.Controls.Add(Self.ToolBar1);
Self.Icon := (System.Drawing.Icon(resources.GetObject('$this.Icon')));
Self.IsMdiContainer := True;
Self.Menu := Self.MainMenu1;
Self.Name := 'TWinmain';
Self.Text := '考勤管理系统';
Include(Self.Closing, Self.TWinmain_Closing);
Include(Self.Load, Self.TWinmain_Load);
Include(Self.Closed, Self.TWinmain_Closed);
(System.ComponentModel.ISupportInitialize(Self.sbpinfo)).EndInit;
(System.ComponentModel.ISupportInitialize(Self.sbpuser)).EndInit;
(System.ComponentModel.ISupportInitialize(Self.sbptime)).EndInit;
Self.ResumeLayout(False);
end;
{$ENDREGION}
procedure TWinmain.Dispose(Disposing: Boolean);
begin
if Disposing then
begin
if Components <> nil then
Components.Dispose();
end;
inherited Dispose(Disposing);
end;
constructor TWinmain.Create;
begin
inherited Create;
//
// Required for Windows Form Designer support
//
InitializeComponent;
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
procedure TWinmain.StatusBar1_PanelClick(sender: System.Object; e: System.Windows.Forms.StatusBarPanelClickEventArgs);
begin
end;
//****************************************************************
//* 窗体加载 [Load]
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinmain.TWinmain_Load(sender: System.Object; e: System.EventArgs);
var
flash:twinflash;
login:twinlogin;
begin
try
times:=0;
flash:=twinflash.create;
flash.showdialog;
login:=twinlogin.create;
login.showdialog;
sbpinfo.Text:='考勤管理系统';
sbpUser.Text:= '操作员:'+clsMain.UserName;
sbptime.text:=system.datetime.now.tostring();
quanxian_set();
//self.WindowState:=system.windows.forms.formwindowstate.maximized;
except
on ex:exception do
begin
messagebox.Show('TWinmain.TWinmain_load:('+ex.message+')','考勤管理系统');
end;
end;
end;
//****************************************************************
//* TWinmain_Closing
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinmain.TWinmain_Closing(sender: System.Object; e: System.ComponentModel.CancelEventArgs);
begin
try
if messagebox.Show('确实要退出考勤管理系统吗?','提示信息',messageboxbuttons.okcancel,messageboxicon.information)=system.windows.forms.DialogResult.ok then
begin
application.exit;
end
else
begin
e.Cancel:=true;
end;
except
on ex:exception do
begin
messagebox.Show('TWinmain.twinmain_closeing:('+ex.message+')','考勤管理系统');
end;
end;
end;
procedure TWinmain.TWinmain_Closed(sender: System.Object; e: System.EventArgs);
begin
end;
procedure twinmain.reload_close_set();
begin
try
// 关于窗体的显示标记
if WinAboutShowFla=true then
begin
Mtwinabout.dispose; //关闭关于窗体
winaboutshowfla:=false; //显示标记设为关闭状态
end;
//用户管理窗体
if winusershowfla=true then
begin
mtwinuser.dispose;
winusershowfla:=false;
end;
//部门 管理窗体
if windepartshowfla=true then
begin
mtwindepart.Dispose;
windepartshowfla:=false;
end;
//学历管理窗体
if windiplomashowfla=true then
begin
Mtwindiploma.Dispose;
windiplomashowfla:=false;
end;
//密码修改窗体显示标记
if winpassshowfla=true then
begin
Mtwinpass.dispose;
winpassshowfla:=false;
end;
//职务管理窗体
if winpostshowfla=true then
begin
Mtwinpost.Dispose;
winpostshowfla:=false;
end;
//工作时间管理窗体
if winworktimeshowfla=true then
begin
Mtwinworktime.Close;
Mtwinworktime.Free;
winworktimeshowfla:=false;
end;
//员工基本信息窗体
if WinYuanGongshowfla=true then
begin
Mtwinyuangong.Dispose;
winyuangongshowfla:=false;
end;
//删除窗体
if WinDelshowfla=true then
begin
Mtwindel.Dispose;
WinDelshowfla:=false;
end;
//出勤管理系统
if Winchuqinshowfla=true then
begin
Mtwinchuqin.Dispose;
Winchuqinshowfla:=false;
end;
except
on ex:exception do
begin
messagebox.Show('TWinmain.reload_close_set:('+ex.message+')','考勤管理系统');
end;
end;
end;
//****************************************************************
//* Timer1_Tick
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinmain.Timer1_Tick(sender: System.Object; e: System.EventArgs);
begin
try
sbptime.text:=system.DateTime.Now.tostring();
except
on ex:exception do
begin
messagebox.Show('TWinmain.Timer1_Tick:('+ex.message+')','考勤管理系统');
end;
end;
end;
//****************************************************************
//* ToolBar1_ButtonClick
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinmain.ToolBar1_ButtonClick(sender: System.Object; e: System.Windows.Forms.ToolBarButtonClickEventArgs);
begin
try
case strtoint(e.Button.Tag.ToString) of
1:MenYuanGong_Click(sender,e);
2:Menuchuqin_Click(sender,e);
3:Menworktime_Click(sender,e);
4:Menupost_Click(sender,e);
5:menpass_click(sender,e);
6:Menexit_click(sender,e);
end;
except
on ex:exception do
begin
messagebox.Show('TWinmain.ToolBar1_ButtonClick:('+ex.message+')','考勤管理系统');
end;
end;
end;
//****************************************************************
//* quanxian_set
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinmain.quanxian_set;
begin
try
if clsmain.quanxian<>'' then
begin
case strtoint(clsmain.quanxian) of
1:
begin
menabout.Enabled:=true;
menuser.Enabled:=true;
menpass.Enabled:=true;
Mendelete.Enabled:=true;
menworktime.Enabled:=true;
toolbar1.Buttons[0].Enabled:=true;
toolbar1.Buttons[1].Enabled:=true;
toolbar1.Buttons[2].Enabled:=true;
toolbar1.Buttons[3].Enabled:=true;
toolbar1.Buttons[4].Enabled:=true;
toolbar1.Buttons[5].Enabled:=true;
end;
0:
begin
menreload.Enabled:=false;
menuser.Enabled:=false;
menpass.Enabled:=false;
Mendelete.Enabled:=false;
menworktime.Enabled:=false;
toolbar1.Buttons[0].Enabled:=true;
toolbar1.Buttons[1].Enabled:=false;
toolbar1.Buttons[2].Enabled:=false;
toolbar1.Buttons[3].Enabled:=false;
toolbar1.Buttons[4].Enabled:=true;
toolbar1.Buttons[5].Enabled:=true;
end;
end;
end;
except
on ex:exception do
begin
messagebox.Show('TWinlogin.data_get:('+ex.message+')','考勤管理系统');
end;
end;
end;
//****************************************************************
//* Menuser_Click
//*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -