📄 mainform.cs
字号:
this.menuItem18.Index = 11;
this.menuItem18.Text = "养老保险记录";
this.menuItem18.Click += new System.EventHandler(this.menuItem18_Click);
//
// menuItem19
//
this.menuItem19.Index = 12;
this.menuItem19.Text = "医疗保险记录";
this.menuItem19.Click += new System.EventHandler(this.menuItem19_Click);
//
// menuItem11
//
this.menuItem11.Index = 2;
this.menuItem11.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem12});
this.menuItem11.Text = "统计";
//
// menuItem12
//
this.menuItem12.Index = 0;
this.menuItem12.Text = "统计数据";
this.menuItem12.Click += new System.EventHandler(this.menuItem12_Click);
//
// menuItem25
//
this.menuItem25.Index = 3;
this.menuItem25.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem26,
this.menuItem27,
this.menuItem34,
this.menuItem37});
this.menuItem25.Text = "工具";
//
// menuItem26
//
this.menuItem26.Index = 0;
this.menuItem26.Text = "记事本";
this.menuItem26.Click += new System.EventHandler(this.menuItem26_Click);
//
// menuItem27
//
this.menuItem27.Index = 1;
this.menuItem27.Text = "计算器";
this.menuItem27.Click += new System.EventHandler(this.menuItem27_Click);
//
// menuItem34
//
this.menuItem34.Index = 2;
this.menuItem34.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem35,
this.menuItem36,
this.menuItem41,
this.menuItem43,
this.menuItem44});
this.menuItem34.Text = "更换界面皮肤";
this.menuItem34.Click += new System.EventHandler(this.menuItem34_Click);
//
// menuItem35
//
this.menuItem35.Index = 0;
this.menuItem35.Text = "GtClassic.urf";
this.menuItem35.Click += new System.EventHandler(this.menuItem35_Click);
//
// menuItem36
//
this.menuItem36.Index = 1;
this.menuItem36.Text = "sap_af.urf";
this.menuItem36.Click += new System.EventHandler(this.menuItem36_Click);
//
// menuItem41
//
this.menuItem41.Index = 2;
this.menuItem41.Text = "GtBase.urf";
this.menuItem41.Click += new System.EventHandler(this.menuItem41_Click);
//
// menuItem43
//
this.menuItem43.Index = 3;
this.menuItem43.Text = "BluePinna.urf";
this.menuItem43.Click += new System.EventHandler(this.menuItem43_Click);
//
// menuItem44
//
this.menuItem44.Index = 4;
this.menuItem44.Text = "取消皮肤";
this.menuItem44.Click += new System.EventHandler(this.menuItem44_Click);
//
// menuItem31
//
this.menuItem31.Index = 4;
this.menuItem31.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem32,
this.menuItem33});
this.menuItem31.Text = "帮助";
//
// menuItem32
//
this.menuItem32.Index = 0;
this.menuItem32.Text = "用户帮助";
//
// menuItem33
//
this.menuItem33.Index = 1;
this.menuItem33.Text = "关于...";
this.menuItem33.Click += new System.EventHandler(this.menuItem33_Click);
//
// statusBar1
//
this.statusBar1.Location = new System.Drawing.Point(0, 399);
this.statusBar1.Name = "statusBar1";
this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.statusBarPanel1,
this.statusBarPanel2,
this.statusBarPanel3,
this.statusBarPanel4});
this.statusBar1.ShowPanels = true;
this.statusBar1.Size = new System.Drawing.Size(936, 22);
this.statusBar1.TabIndex = 1;
//
// statusBarPanel1
//
this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
this.statusBarPanel1.Width = 230;
//
// statusBarPanel2
//
this.statusBarPanel2.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
this.statusBarPanel2.Width = 230;
//
// statusBarPanel3
//
this.statusBarPanel3.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
this.statusBarPanel3.Width = 230;
//
// statusBarPanel4
//
this.statusBarPanel4.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
this.statusBarPanel4.Width = 230;
//
// contextMenu1
//
this.contextMenu1.Popup += new System.EventHandler(this.contextMenu1_Popup);
//
// menuItem37
//
this.menuItem37.Index = 3;
this.menuItem37.Text = "照相";
this.menuItem37.Click += new System.EventHandler(this.menuItem37_Click);
//
// mainForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(936, 421);
this.ContextMenu = this.contextMenu1;
this.Controls.Add(this.statusBar1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.IsMdiContainer = true;
this.Menu = this.mainMenu1;
this.Name = "mainForm";
this.Text = "主界面";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Closing += new System.ComponentModel.CancelEventHandler(this.mainForm_Closing);
this.Load += new System.EventHandler(this.mainForm_Load);
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel4)).EndInit();
this.ResumeLayout(false);
}
#endregion
#region 判断一个窗体是否存在,不存在就显示,存在就不显示
public bool CheckForm(string FormName)
{
foreach(Form form in this.MdiChildren)
{
if(form.Name == FormName)
{
if(form.WindowState==FormWindowState.Minimized)
{
form.WindowState=FormWindowState.Normal;
}
form.Activate();
return true;
}
}
return false;
}
#endregion
private void mainForm_Load(object sender, System.EventArgs e)
{
this.Enabled = true;
this.statusBarPanel3.Text = "当前操作员: " + Form1.f1.Cmb;
switch(Form1.f1.power)
{
case "系统管理员":
{
this.menuItem2.Enabled = true;
this.menuItem30.Enabled = true;
break;
}
case "管理员":
{
this.menuItem2.Enabled = false;
this.menuItem30.Enabled = false;
break;
}
case "一般用户":
{
this.menuItem2.Enabled = false;
this.menuItem30.Enabled = false;
this.menuItem4.Enabled = false;
this.menuItem5.Enabled = false;
break;
}
default :
{
this.menuItem2.Enabled = false;
this.menuItem30.Enabled = false;
this.menuItem4.Enabled = false;
this.menuItem5.Enabled = false;
break;
}
}
}
#region 菜单按钮事件
//显示操作员权限设置界面
private void menuItem2_Click(object sender, System.EventArgs e)
{
if(this.CheckForm("OperationForm") == true)
{
return;
}
else
{
OperationForm of = new OperationForm();
of.MdiParent = this;
of.Show();
}
}
//显示部门设置界面
private void menuItem4_Click(object sender, System.EventArgs e)
{
if(this.CheckForm("sessionForm") == true)
{
return;
}
else
{
sessionForm sf = new sessionForm();
sf.MdiParent = this;
sf.Show();
}
}
//显示其他选项设置界面
private void menuItem5_Click(object sender, System.EventArgs e)
{
if(this.CheckForm("otherForm") == true)
{
return;
}
else
{
otherForm otf = new otherForm();
otf.MdiParent = this;
otf.Show();
}
}
//显示更改密码界面
private void menuItem7_Click(object sender, System.EventArgs e)
{
if(this.CheckForm("uppasswordForm") == true)
{
return;
}
else
{
uppasswordForm uf = new uppasswordForm();
uf.MdiParent = this;
uf.Show();
}
}
//显示登陆界面
private void menuItem8_Click(object sender, System.EventArgs e)
{
if(this.CheckForm("Form1") == true)
{
return;
}
else
{
Form1 f1 = new Form1();
f1.MdiParent = this;
f1.Show();
}
}
//退出系统
private void menuItem10_Click(object sender, System.EventArgs e)
{
DialogResult result;
result=MessageBox.Show("是否退出本系统?","提示!",MessageBoxButtons.YesNo);
if(result==DialogResult.Yes)
{
this.Close();
}
if(result==DialogResult.No)
{
this.Show();
}
}
//显示人员档案界面
private void menuItem28_Click(object sender, System.EventArgs e)
{
if(this.CheckForm("empInfoForm") == true)
{
return;
}
else
{
empInfoForm eif = new empInfoForm();
eif.MdiParent = this;
eif.Show();
}
}
//显示调动界面
private void menuItem21_Click(object sender, System.EventArgs e)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -