📄 main.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Main.h"
#include "About.h"
#include "MainHead.h"
#include "DataModule.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TMainMenuForm *MainMenuForm;
//---------------------------------------------------------------------------
__fastcall TMainMenuForm::TMainMenuForm(TComponent *Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::HelpAbout1Execute(TObject *Sender)
{
bool haveform=false;
//try
{
for(int i = MainMenuForm->MDIChildCount-1; i>= 0; i--)
{
if(MainMenuForm->MDIChildren[i]->Name=="AboutBox")
{
haveform=true;
break;
}
}
if(haveform==true)
{
AboutBox->Show();
}
else
{
Screen->Cursor = crHourGlass;
AboutBox=new TAboutBox(this);
Screen->Cursor = crDefault;
AboutBox->Show();
}
}
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::FileExit1Execute(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::MIDesignerClick(TObject *Sender)
{
// MIDesignerForm->ShowModal();
bool haveform=false;
if(!MastData->Database->InTransaction)
{
MastData->Database->StartTransaction();
}
try
{
for(int i = MainMenuForm->MDIChildCount-1; i>= 0; i--)
{
if(MainMenuForm->MDIChildren[i]->Name=="MIDesignerForm")
{
haveform=true;
break;
}
}
if(haveform==true)
{
MIDesignerForm->Show();
}
else
{
Screen->Cursor = crHourGlass;
MIDesignerForm=new TMIDesignerForm(Application);
Screen->Cursor = crDefault;
MIDesignerForm->Show();
}
}
catch(...)
{
ShowMessage("您的权限不够...");
}
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::CustomerClick(TObject *Sender)
{
if(!MastData->Database->InTransaction)
{
MastData->Database->StartTransaction();
}
CustomerForm->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::BaseBoardClick(TObject *Sender)
{
BaseBoardForm->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::PrepregClick(TObject *Sender)
{
PrepregForm->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::BaseRouteClick(TObject *Sender)
{
if(!MastData->Database->InTransaction)
{
MastData->Database->StartTransaction();
}
StandardRouteForm->ShowModal();
/* bool haveform=false;
if(!MastData->Database->InTransaction)
{
MastData->Database->StartTransaction();
}
try
{
for(int i = MainMenuForm->MDIChildCount-1; i>= 0; i--)
{
if(MainMenuForm->MDIChildren[i]->Name=="StandardRouteForm")
{
haveform=true;
break;
}
}
if(haveform==true)
{
StandardRouteForm->Show();
}
else
{
Screen->Cursor = crHourGlass;
StandardRouteForm=new TStandardRouteForm(Application);
Screen->Cursor = crDefault;
StandardRouteForm->Show();
}
}
catch(...)
{
ShowMessage("您的权限不够...");
}
*/
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::AddUserClick(TObject *Sender)
{
UserAddForm->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::DeleteUserClick(TObject *Sender)
{
UserDeleteForm->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::UserPasswdClick(TObject *Sender)
{
UserPasswdForm->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::SampleRouteClick(TObject *Sender)
{
MastData->SampleRoute->CachedUpdates=true;
MastData->SampleRouteDetail->CachedUpdates=true;
if(!MastData->Database->InTransaction)
{
MastData->Database->StartTransaction();
}
SampleRouteForm->ShowModal();
/* bool haveform=false;
if(!MastData->Database->InTransaction)
{
MastData->Database->StartTransaction();
}
try
{
for(int i = MainMenuForm->MDIChildCount-1; i>= 0; i--)
{
if(MainMenuForm->MDIChildren[i]->Name=="SampleRouteForm")
{
haveform=true;
break;
}
}
if(haveform==true)
{
SampleRouteForm->Show();
}
else
{
Screen->Cursor = crHourGlass;
SampleRouteForm=new TSampleRouteForm(Application);
Screen->Cursor = crDefault;
SampleRouteForm->Show();
}
}
catch(...)
{
ShowMessage("您的权限不够...");
} */
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::MIAppClick(TObject *Sender)
{
// MIAppForm->ShowModal();
bool haveform=false;
if(!MastData->Database->InTransaction)
{
MastData->Database->StartTransaction();
}
try
{
for(int i = MainMenuForm->MDIChildCount-1; i>= 0; i--)
{
if(MainMenuForm->MDIChildren[i]->Name=="MIAppForm")
{
haveform=true;
break;
}
}
if(haveform==true)
{
MIAppForm->Show();
}
else
{
Screen->Cursor = crHourGlass;
MIAppForm=new TMIAppForm(Application);
Screen->Cursor = crDefault;
MIAppForm->Show();
}
}
catch(...)
{
MessageBox(NULL,"您没有增加修改或删除记录的权限..","提示",MB_OK);
}
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::MIQACheckClick(TObject *Sender)
{
// MIQACheckForm->ShowModal();
bool haveform=false;
if(!MastData->Database->InTransaction)
{
MastData->Database->StartTransaction();
}
try
{
for(int i = MainMenuForm->MDIChildCount-1; i>= 0; i--)
{
if(MainMenuForm->MDIChildren[i]->Name=="MIQACheckForm")
{
haveform=true;
break;
}
}
if(haveform==true)
{
MIQACheckForm->Show();
}
else
{
Screen->Cursor = crHourGlass;
MIQACheckForm=new TMIQACheckForm(Application);
Screen->Cursor = crDefault;
MIQACheckForm->Show();
}
}
catch(...)
{
ShowMessage("您的权限不够...");
}
}
//---------------------------------------------------------------------------
void __fastcall TMainMenuForm::MIQAAppClick(TObject *Sender)
{
// MIQAAppForm->ShowModal();
bool haveform=false;
if(!MastData->Database->InTransaction)
{
MastData->Database->StartTransaction();
}
try
{
for(int i = MainMenuForm->MDIChildCount-1; i>= 0; i--)
{
if(MainMenuForm->MDIChildren[i]->Name=="MIQAAppForm")
{
haveform=true;
break;
}
}
if(haveform==true)
{
MIQAAppForm->Show();
}
else
{
Screen->Cursor = crHourGlass;
MIQAAppForm=new TMIQAAppForm(Application);
Screen->Cursor = crDefault;
MIQAAppForm->Show();
}
}
catch(...)
{
ShowMessage("您的权限不够...");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -