📄 form1.h
字号:
#pragma once
#include "LinkDataBase.h"
#include "FormLogin.h"
#include "SetOrgInfo.h"
#include "GetOrgInfo.h"
#include "AmendStafferInfo.h"
#include "LookupStafferInfo.h"
#include "IncomeTax.h"
#include "SalaryManage.h"
#include "PayoffHistory.h"
#include "HortationManage.h"
#include "PunishmentManage.h"
namespace My
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Form1 摘要
///
/// 警告: 如果您更改该类的名称,则需要更改
/// 与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的
/// “资源文件名”属性。 否则,
/// 设计器将不能与此窗体关联的
/// 本地化资源正确交互。
/// </summary>
public __gc class Form1 : public System::Windows::Forms::Form
{
//--------------------成员声明------------------------
private:
LinkDataBase* MyDataBase; //数据库连接类
private: System::Windows::Forms::MenuItem * menuItem7;
private: System::Windows::Forms::MenuItem * menuItem8;
private: System::Windows::Forms::MenuItem * menuItem9;
private: System::Windows::Forms::MenuItem * menuItem10;
private: System::Windows::Forms::MenuItem * menuItem11;
private: System::Windows::Forms::MenuItem * menuItem12;
private: System::Windows::Forms::MenuItem * menuItem13;
DataSet* ds;
//-------------------成员声明结束-----------------------
public:
Form1(void)
{
InitializeComponent();
//生成数据库连接类
MyDataBase = new LinkDataBase();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::MainMenu * mainMenu1;
private: System::Windows::Forms::MenuItem * menuItem1;
private: System::Windows::Forms::MenuItem * menuItem2;
private: System::Windows::Forms::MenuItem * menuItem3;
private: System::Windows::Forms::MenuItem * menuItem4;
private: System::Windows::Forms::StatusBar * statusBar1;
private: System::Windows::Forms::StatusBarPanel * statusBarPanel1;
private: System::Windows::Forms::StatusBarPanel * statusBarPanel2;
private: System::Windows::Forms::MenuItem * menuItem5;
private: System::Windows::Forms::MenuItem * menuItem6;
private:
/// <summary>
/// 必需的设计器变量。
/// </summary>
System::ComponentModel::Container * components;
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
void InitializeComponent(void)
{
this->mainMenu1 = new System::Windows::Forms::MainMenu();
this->menuItem1 = new System::Windows::Forms::MenuItem();
this->menuItem5 = new System::Windows::Forms::MenuItem();
this->menuItem6 = new System::Windows::Forms::MenuItem();
this->menuItem2 = new System::Windows::Forms::MenuItem();
this->menuItem7 = new System::Windows::Forms::MenuItem();
this->menuItem8 = new System::Windows::Forms::MenuItem();
this->menuItem3 = new System::Windows::Forms::MenuItem();
this->menuItem9 = new System::Windows::Forms::MenuItem();
this->menuItem10 = new System::Windows::Forms::MenuItem();
this->menuItem11 = new System::Windows::Forms::MenuItem();
this->menuItem12 = new System::Windows::Forms::MenuItem();
this->menuItem13 = new System::Windows::Forms::MenuItem();
this->menuItem4 = new System::Windows::Forms::MenuItem();
this->statusBar1 = new System::Windows::Forms::StatusBar();
this->statusBarPanel1 = new System::Windows::Forms::StatusBarPanel();
this->statusBarPanel2 = new System::Windows::Forms::StatusBarPanel();
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->statusBarPanel1))->BeginInit();
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->statusBarPanel2))->BeginInit();
this->SuspendLayout();
//
// mainMenu1
//
System::Windows::Forms::MenuItem* __mcTemp__1[] = new System::Windows::Forms::MenuItem*[4];
__mcTemp__1[0] = this->menuItem1;
__mcTemp__1[1] = this->menuItem2;
__mcTemp__1[2] = this->menuItem3;
__mcTemp__1[3] = this->menuItem4;
this->mainMenu1->MenuItems->AddRange(__mcTemp__1);
//
// menuItem1
//
this->menuItem1->Index = 0;
System::Windows::Forms::MenuItem* __mcTemp__2[] = new System::Windows::Forms::MenuItem*[2];
__mcTemp__2[0] = this->menuItem5;
__mcTemp__2[1] = this->menuItem6;
this->menuItem1->MenuItems->AddRange(__mcTemp__2);
this->menuItem1->Text = S"机构编制管理";
//
// menuItem5
//
this->menuItem5->Index = 0;
this->menuItem5->Text = S"机构设置";
this->menuItem5->Click += new System::EventHandler(this, menuItem5_Click);
//
// menuItem6
//
this->menuItem6->Index = 1;
this->menuItem6->Text = S"机构信息";
this->menuItem6->Click += new System::EventHandler(this, menuItem6_Click);
//
// menuItem2
//
this->menuItem2->Index = 1;
System::Windows::Forms::MenuItem* __mcTemp__3[] = new System::Windows::Forms::MenuItem*[2];
__mcTemp__3[0] = this->menuItem7;
__mcTemp__3[1] = this->menuItem8;
this->menuItem2->MenuItems->AddRange(__mcTemp__3);
this->menuItem2->Text = S"职员信息管理";
//
// menuItem7
//
this->menuItem7->Index = 0;
this->menuItem7->Text = S"职员信息维护";
this->menuItem7->Click += new System::EventHandler(this, menuItem7_Click);
//
// menuItem8
//
this->menuItem8->Index = 1;
this->menuItem8->Text = S"职员信息查询";
this->menuItem8->Click += new System::EventHandler(this, menuItem8_Click);
//
// menuItem3
//
this->menuItem3->Index = 2;
System::Windows::Forms::MenuItem* __mcTemp__4[] = new System::Windows::Forms::MenuItem*[5];
__mcTemp__4[0] = this->menuItem9;
__mcTemp__4[1] = this->menuItem10;
__mcTemp__4[2] = this->menuItem11;
__mcTemp__4[3] = this->menuItem12;
__mcTemp__4[4] = this->menuItem13;
this->menuItem3->MenuItems->AddRange(__mcTemp__4);
this->menuItem3->Text = S"薪资福利管理";
//
// menuItem9
//
this->menuItem9->Index = 0;
this->menuItem9->Text = S"个人所得税管理";
this->menuItem9->Click += new System::EventHandler(this, menuItem9_Click);
//
// menuItem10
//
this->menuItem10->Index = 1;
this->menuItem10->Text = S"当月工资管理";
this->menuItem10->Click += new System::EventHandler(this, menuItem10_Click);
//
// menuItem11
//
this->menuItem11->Index = 2;
this->menuItem11->Text = S"工资发放历史管理";
this->menuItem11->Click += new System::EventHandler(this, menuItem11_Click);
//
// menuItem12
//
this->menuItem12->Index = 3;
this->menuItem12->Text = S"职员奖励管理";
this->menuItem12->Click += new System::EventHandler(this, menuItem12_Click);
//
// menuItem13
//
this->menuItem13->Index = 4;
this->menuItem13->Text = S"职员惩罚管理";
this->menuItem13->Click += new System::EventHandler(this, menuItem13_Click);
//
// menuItem4
//
this->menuItem4->Index = 3;
this->menuItem4->Text = S"退出系统";
this->menuItem4->Click += new System::EventHandler(this, menuItem4_Click);
//
// statusBar1
//
this->statusBar1->Location = System::Drawing::Point(0, 369);
this->statusBar1->Name = S"statusBar1";
System::Windows::Forms::StatusBarPanel* __mcTemp__5[] = new System::Windows::Forms::StatusBarPanel*[2];
__mcTemp__5[0] = this->statusBarPanel1;
__mcTemp__5[1] = this->statusBarPanel2;
this->statusBar1->Panels->AddRange(__mcTemp__5);
this->statusBar1->ShowPanels = true;
this->statusBar1->Size = System::Drawing::Size(632, 24);
this->statusBar1->TabIndex = 0;
//
// statusBarPanel1
//
this->statusBarPanel1->Alignment = System::Windows::Forms::HorizontalAlignment::Center;
this->statusBarPanel1->AutoSize = System::Windows::Forms::StatusBarPanelAutoSize::Contents;
this->statusBarPanel1->Text = S"数据库开发经典实例解析";
this->statusBarPanel1->Width = 150;
//
// statusBarPanel2
//
this->statusBarPanel2->Alignment = System::Windows::Forms::HorizontalAlignment::Center;
this->statusBarPanel2->AutoSize = System::Windows::Forms::StatusBarPanelAutoSize::Spring;
this->statusBarPanel2->Text = S"用户登陆功能和权限管理功能参考进销存实例";
this->statusBarPanel2->Width = 466;
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
this->ClientSize = System::Drawing::Size(632, 393);
this->Controls->Add(this->statusBar1);
this->IsMdiContainer = true;
this->Menu = this->mainMenu1;
this->Name = S"Form1";
this->Text = S"人力资源管理系统";
this->WindowState = System::Windows::Forms::FormWindowState::Maximized;
this->Load += new System::EventHandler(this, Form1_Load);
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->statusBarPanel1))->EndInit();
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->statusBarPanel2))->EndInit();
this->ResumeLayout(false);
}
private:
System::Void Form1_Load(System::Object * sender, System::EventArgs * e)
{
//显示登录窗口
/*FormLogin* Login = new FormLogin();
System::Windows::Forms::DialogResult Result = Login->ShowDialog(this);
//如果用户选择登录且验证通过
if(Result == DialogResult::OK)
{
//在状态栏显示相关信息
String* tempString = String::Format("当前用户: {0} 所属部门: {1}",Login->strUser->Trim(),Login->strDepartment->Trim());
this->statusBarPanel2->Text = tempString;
}
//如果用户选择退出则退出程序
else if(Result == DialogResult::Cancel)
{
Application::Exit();
}
*/
}
//------------------------查询一个子窗口是否存在--------------------------------
private:
bool CheckChildFrmExist(String* ChildFrmName)
{
Form* tempChild;
//逐个查找子窗口,如果存在则将其激活
for(int i = 0;i < this->MdiChildren->Length;i++)
{
tempChild = dynamic_cast<Form*>(this->MdiChildren[i]);
if(String::Compare(tempChild->Name,ChildFrmName) == 0)
{
if(tempChild->WindowState == FormWindowState::Minimized)
{
tempChild->WindowState = FormWindowState::Maximized;
}
tempChild->Activate();
return true;
}
return false;
}
return false;
}
private: System::Void menuItem4_Click(System::Object * sender, System::EventArgs * e)
{
if(MessageBox::Show(S"确实要退出系统?",S"询问",MessageBoxButtons::YesNo) == DialogResult::Yes)
this->Close();
}
private: System::Void menuItem5_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("SetOrgInfo"))
{
return;
}
else
{
SetOrgInfo* newFrm = new SetOrgInfo();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Show();
}
}
private: System::Void menuItem6_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("GetOrgInfo"))
{
return;
}
else
{
GetOrgInfo* newFrm = new GetOrgInfo();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Activate();
newFrm->Show();
}
}
private: System::Void menuItem7_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("AmendStafferInfo"))
{
return;
}
else
{
AmendStafferInfo* newFrm = new AmendStafferInfo();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Activate();
newFrm->Show();
}
}
private: System::Void menuItem8_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("LookupStafferInfo"))
{
return;
}
else
{
LookupStafferInfo* newFrm = new LookupStafferInfo();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Activate();
newFrm->Show();
}
}
private: System::Void menuItem9_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("IncomeTax"))
{
return;
}
else
{
IncomeTax* newFrm = new IncomeTax();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Activate();
newFrm->Show();
}
}
private: System::Void menuItem10_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("SalaryManage"))
{
return;
}
else
{
SalaryManage* newFrm = new SalaryManage();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Activate();
newFrm->Show();
}
}
private: System::Void menuItem11_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("PayoffHistory"))
{
return;
}
else
{
PayoffHistory* newFrm = new PayoffHistory();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Activate();
newFrm->Show();
}
}
private: System::Void menuItem12_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("HortationManage"))
{
return;
}
else
{
HortationManage* newFrm = new HortationManage();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Activate();
newFrm->Show();
}
}
private: System::Void menuItem13_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("PunishmentManage"))
{
return;
}
else
{
PunishmentManage* newFrm = new PunishmentManage();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Activate();
newFrm->Show();
}
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -