📄 main.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "main.h"
#include "AoutNew.h"
#include "Banci2.h"
#include "Gudingban.h"
#include "Pb1.h"
#include "Jiari.h"
#include "Qinjia.h"
#include "DM1.h"
#include "Pb1.h"
#include "PbAll.h"
#include "SelectBC.h"
#include "PbChaXun.h"
#include "Kqgz.h"
#include "Sgsk.h"
#include "Tongji.h"
#include "JiaBan.h"
#include "TiaoBan1.h"
#include "BaoBiao.h"
#include "KqjTx.h"
#include "KqjWh.h"
#include "BmWh.h"
#include "BzWh.h"
#include "PrintSet.h"
#include "RenShi.h"
#include "RenShiZiLiao.h"
#include "RenShiPrint.h"
#include "YongHu.h"
#include "PassWord.h"
#include "Card.h"
#include "SkChaXun.h"
#include "YiChang.h"
#include "JbChaXun.h"
#include "LoginQuery.h"
#include "RiTj.h"
#include "QjZl.h"
#include "WaiChu.h"
#include "RiBaoBiao.h"
//#include "FaKa.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMainForm *MainForm;
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N3Click(TObject *Sender)
{
TAboutNew * AboutNew = new TAboutNew(this);
AboutNew->ShowModal();
delete AboutNew;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_quitClick(TObject *Sender)
{
MainForm->Close();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_bcClick(TObject *Sender)
{
TFormBanci2 * FormBanci2 = new TFormBanci2(this);
FormBanci2->ShowModal();
delete FormBanci2;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_glpbClick(TObject *Sender)
{
TFormGudingban * FormGudingban = new TFormGudingban(this);
FormGudingban->ShowModal();
delete FormGudingban;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_paibanClick(TObject *Sender)
{
TFormPb1 * FormPb1 = new TFormPb1(this);
FormPb1->ShowModal();
delete FormPb1;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_holidayClick(TObject *Sender)
{
TFormJiari * FormJiari = new TFormJiari(this);
FormJiari->ShowModal();
delete FormJiari;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_qjClick(TObject *Sender)
{
TFormQinjia * FormQinjia = new TFormQinjia(this);
FormQinjia->ShowModal();
delete FormQinjia;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormClose(TObject *Sender, TCloseAction &Action)
{
pUser = GetQuery("Query3");
pUser->Close();
pUser->SQL->Clear();
pUser->SQL->Add("insert into kq_login(yhmc,quanxian,sj,zt) values('" + sYhmc + "','" + sQuanxian + "','" + Now().FormatString("yyyy-mm-dd hh:mm:ss") + "','离开')");
try
{
pUser->ExecSQL();
}
catch(...)
{
return;
}
pUser->Close();
pUser->SQL->Clear();
if (DataModal1->ADOConnection1->Connected == true)
DataModal1->ADOConnection1->Close();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_pbcxClick(TObject *Sender)
{
HWND nHandle;
nHandle = FindWindow(NULL,"排班表查询");
if (nHandle != NULL)
{
return;
}
TFormPbChaXun * FormPbChaXun = new TFormPbChaXun(this);
FormPbChaXun->Show();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_gzClick(TObject *Sender)
{
TFormKqgz *FormKqgz = new TFormKqgz(this);
FormKqgz->ShowModal();
delete FormKqgz;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_sgskClick(TObject *Sender)
{
TFormSgsk * FormSgsk = new TFormSgsk(this);
FormSgsk->ShowModal();
delete FormSgsk;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_ytjClick(TObject *Sender)
{
TFormTongji *FormTongji = new TFormTongji(this);
FormTongji->ShowModal();
delete FormTongji;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_sgjbClick(TObject *Sender)
{
TFormJiaBan *FormJiaBan = new TFormJiaBan(this);
FormJiaBan->ShowModal();
delete FormJiaBan;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_tiaobanClick(TObject *Sender)
{
TFormTiaoBan1 * FormTiaoBan1 = new TFormTiaoBan1(this);
FormTiaoBan1->ShowModal();
delete FormTiaoBan1;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_ybbClick(TObject *Sender)
{
TFormBaoBiao * FormBaoBiao = new TFormBaoBiao(this);
FormBaoBiao->ShowModal();
delete FormBaoBiao;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_readdataClick(TObject *Sender)
{
TFormKqjTx *FormKqjTx = new TFormKqjTx(this);
FormKqjTx->ShowModal();
delete FormKqjTx;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_kqjClick(TObject *Sender)
{
TFormKqjWh * FormKqjWh = new TFormKqjWh(this);
FormKqjWh->ShowModal();
delete FormKqjWh;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_bmClick(TObject *Sender)
{
TFormBmWh * FormBmWh = new TFormBmWh(this);
FormBmWh->ShowModal();
delete FormBmWh;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_bzClick(TObject *Sender)
{
TFormBzWh *FormBzWh = new TFormBzWh(this);
FormBzWh->ShowModal();
delete FormBzWh;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_humanClick(TObject *Sender)
{
TFormRenShi * FormRenShi = new TFormRenShi(this);
FormRenShi->ShowModal();
delete FormRenShi;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_jwClick(TObject *Sender)
{
TFormRenShiZiLiao *FormRenShiZiLiao = new TFormRenShiZiLiao(this);
FormRenShiZiLiao->EnterPro("职务类型维护","zhiwu","QZhiWu");
FormRenShiZiLiao->ShowModal();
delete FormRenShiZiLiao;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_jcClick(TObject *Sender)
{
TFormRenShiZiLiao *FormRenShiZiLiao = new TFormRenShiZiLiao(this);
FormRenShiZiLiao->EnterPro("职称类型维护","zhichen","QZhiChen");
FormRenShiZiLiao->ShowModal();
delete FormRenShiZiLiao;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_ljClick(TObject *Sender)
{
TFormRenShiZiLiao *FormRenShiZiLiao = new TFormRenShiZiLiao(this);
FormRenShiZiLiao->EnterPro("离职类型维护","lizhiyy","QLiZhiYY");
FormRenShiZiLiao->ShowModal();
delete FormRenShiZiLiao;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_systemuserClick(TObject *Sender)
{
if (sQuanxian !="系统管理员")
{
ShowMessage("对不起,该项操作只限系统管理员使用!");
return;
}
TFormYongHu *FormYongHu = new TFormYongHu(this);
FormYongHu->ShowModal();
delete FormYongHu;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormShow(TObject *Sender)
{
StatusBar1->Panels->Items[0]->Text = sYhmc;
StatusBar1->Panels->Items[1]->Text = sQuanxian;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_changepasswordClick(TObject *Sender)
{
TFormPassWord *FormPassWord = new TFormPassWord(this);
FormPassWord->sYhmc = sYhmc;
FormPassWord->ShowModal();
delete FormPassWord;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_cardClick(TObject *Sender)
{
TFormCard *FormCard = new TFormCard(this);
FormCard->ShowModal();
delete FormCard;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_dataqueryClick(TObject *Sender)
{
HWND nHandle;
nHandle = FindWindow(NULL,"刷卡数据查询");
if (nHandle != NULL)
{
return;
}
TFormSkChaXun *FormSkChaXun = new TFormSkChaXun(this);
FormSkChaXun->Show();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_ycbbClick(TObject *Sender)
{
HWND nHandle;
nHandle = FindWindow(NULL,"异常报表");
if (nHandle != NULL)
{
return;
}
TFormYiChang *FormYiChang = new TFormYiChang(this);
FormYiChang->Show();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_dnjbcxClick(TObject *Sender)
{
HWND nHandle;
nHandle = FindWindow(NULL,"电脑计算加班查询");
if (nHandle != NULL)
{
return;
}
TFormJbChaXun *FormJbChaXun = new TFormJbChaXun(this);
FormJbChaXun->Show();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N2Click(TObject *Sender)
{
TFormLoginQuery * FormLoginQuery = new TFormLoginQuery(this);
FormLoginQuery->ShowModal();
delete FormLoginQuery;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_RiBbClick(TObject *Sender)
{
HWND nHandle;
nHandle = FindWindow(NULL,"日报表");
if (nHandle != NULL)
{
return;
}
TFormRiBaoBiao *FormRiBaoBiao = new TFormRiBaoBiao(this);
FormRiBaoBiao->Show();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N5Click(TObject *Sender)
{
TFormQjZl *FormQjZl = new TFormQjZl(this);
FormQjZl->ShowModal();
delete FormQjZl;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N_waichuClick(TObject *Sender)
{
TFormWaiChu *FormWaiChu = new TFormWaiChu(this);
FormWaiChu->ShowModal();
delete FormWaiChu;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N4Click(TObject *Sender)
{
TFormRiTj *FormRiTj = new TFormRiTj(this);
FormRiTj->ShowModal();
delete FormRiTj;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -