📄 form1.h
字号:
// statusBar1
//
this->statusBar1->Location = System::Drawing::Point(0, 357);
this->statusBar1->Name = S"statusBar1";
System::Windows::Forms::StatusBarPanel* __mcTemp__7[] = new System::Windows::Forms::StatusBarPanel*[2];
__mcTemp__7[0] = this->statusBarPanel2;
__mcTemp__7[1] = this->statusBarPanel3;
this->statusBar1->Panels->AddRange(__mcTemp__7);
this->statusBar1->ShowPanels = true;
this->statusBar1->Size = System::Drawing::Size(768, 24);
this->statusBar1->TabIndex = 8;
this->statusBar1->Text = S"statusBar1";
//
// statusBarPanel2
//
this->statusBarPanel2->AutoSize = System::Windows::Forms::StatusBarPanelAutoSize::Contents;
this->statusBarPanel2->Text = S"《数据库开发经典案例解析》 清华大学出版社";
this->statusBarPanel2->Width = 311;
//
// statusBarPanel3
//
this->statusBarPanel3->AutoSize = System::Windows::Forms::StatusBarPanelAutoSize::Spring;
this->statusBarPanel3->Width = 441;
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
this->ClientSize = System::Drawing::Size(768, 381);
this->Controls->Add(this->statusBar1);
this->IsMdiContainer = true;
this->Menu = this->mainMenu1;
this->Name = S"Form1";
this->Text = S"财务管理系统";
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->statusBarPanel2))->EndInit();
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->statusBarPanel3))->EndInit();
this->ResumeLayout(false);
}
//------------------------查询一个子窗口是否存在--------------------------------
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;
}
else
{
tempChild->WindowState = FormWindowState::Minimized;
}
return false;
}
return false;
}
private: System::Void menuItem1_Click(System::Object * sender, System::EventArgs * e)
{
}
private: System::Void menuItem2_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("SubjectSetting"))
{
return;
}
else
{
SubjectSetting* newFrm = new SubjectSetting();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Show();
}
}
private: System::Void menuItem3_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("AccountSetting"))
{
return;
}
else
{
AccountSetting* newFrm = new AccountSetting();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Show();
}
}
private: System::Void menuItem5_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("WarrentInput"))
{
return;
}
else
{
WarrentInput* newFrm = new WarrentInput();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Show();
}
}
private: System::Void menuItem6_Click(System::Object * sender, System::EventArgs * e)
{
if(MessageBox::Show(S"凭证过帐后即不可再修改,是否过帐?",S"确认",MessageBoxButtons::OKCancel) == DialogResult::OK)
{
String* warrentcount;
String* debit;
String* loan;
String* tempSQL = S"Select Count(distinct 凭证编号) 凭证数,sum(借方) 借方金额,sum(贷方) 贷方金额 from 分录表";
SqlDataReader* reader = this->MyDataBase->SQLRead(tempSQL);
if(reader->Read())
{
warrentcount = reader->Item[S"凭证数"]->ToString();
debit = reader->Item[S"借方金额"]->ToString();
loan = reader->Item[S"贷方金额"]->ToString();
}
reader->Close();
String* tempMsg = String::Format(S"过帐成功!\n过帐凭证总数:{0}\n借方金额合计:{1}\n贷方金额合计:{2}",warrentcount,debit,loan);
//过帐
tempSQL = S"exec sf_凭证过帐";
this->MyDataBase->SQLOperate(tempSQL);
MessageBox::Show(tempMsg,S"凭证过帐成功");
//删除已过帐数据
this->MyDataBase->SQLOperate(S"Delete from 分录表");
this->MyDataBase->SQLOperate(S"Delete from 凭证表");
}
}
private: System::Void menuItem9_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("LedgerQuery"))
{
return;
}
else
{
LedgerQuery* newFrm = new LedgerQuery();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Show();
}
}
private: System::Void menuItem10_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("DetailQuery"))
{
return;
}
else
{
DetailQuery* newFrm = new DetailQuery();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Show();
}
}
private: System::Void menuItem12_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("TrialBalance"))
{
return;
}
else
{
TrialBalance* newFrm = new TrialBalance(true);
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Show();
}
}
private: System::Void menuItem13_Click(System::Object * sender, System::EventArgs * e)
{
if(MessageBox::Show(S"结帐后将进入下一会计期,是否结帐?",S"确认",MessageBoxButtons::OKCancel) == DialogResult::OK)
{
//过帐
String* tempSQL = S"exec sf_期末结帐";
this->MyDataBase->SQLOperate(tempSQL);
MessageBox::Show(S"期末结帐成功",S"结帐成功");
}
}
private: System::Void menuItem14_Click(System::Object * sender, System::EventArgs * e)
{
if(this->CheckChildFrmExist("FinancialReport"))
{
return;
}
else
{
FinancialReport* newFrm = new FinancialReport();
newFrm->MdiParent = this;
newFrm->WindowState = FormWindowState::Maximized;
newFrm->Show();
}
}
private: System::Void menuItem15_Click(System::Object * sender, System::EventArgs * e)
{
if(MessageBox::Show(S"确实要退出系统?",S"询问",MessageBoxButtons::YesNo) == DialogResult::Yes)
this->Close();
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -