?? dmain.cpp
字號:
// DMain.cpp : implementation file
//
#include "stdafx.h"
#include "htglxt.h"
#include "DMain.h"
#include "DBaseQuery.h"
#include "Dbmxx.h"
#include "externdllHeader.h"
#include "DWLDW.h"
#include "Dqyqhtps.h"
#include "Dxmxx.h"
#include "Dhtqd.h"
#include "Dhtgg.h"
#include "Dblzfsx.h"
#include "Dwysp.h"
#include "BAK.h"
#include "DFormat.h"
#include "DOp.h"
#include "Dxgmm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CHtglxtApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CDMain dialog
CDMain::CDMain(CWnd* pParent /*=NULL*/)
: CDialog(CDMain::IDD, pParent)
{
//{{AFX_DATA_INIT(CDMain)
//}}AFX_DATA_INIT
}
void CDMain::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDMain)
DDX_Control(pDX, IDCANCEL, m_ButExit);
DDX_Control(pDX, IDC_BUTSYSTEM, m_ButSystem);
DDX_Control(pDX, IDC_BUTMANAGE, m_ButManage);
DDX_Control(pDX, IDC_BUTEXEC, m_ButExec);
DDX_Control(pDX, IDC_BUTLOT, m_ButLot);
DDX_Control(pDX, IDC_BUTBASE, m_ButBase);
DDX_Control(pDX, IDC_BUTDEPT, m_ButJC[0]);
DDX_Control(pDX, IDC_BUTCANDG, m_ButJC[1]);
DDX_Control(pDX, IDC_BUTITEM, m_ButJC[2]);
DDX_Control(pDX, IDC_BUTCOMMENT, m_ButQD[0]);
DDX_Control(pDX, IDC_BUTSIGN, m_ButQD[1]);
DDX_Control(pDX, IDC_BUTCHANGE, m_ButQD[2]);
DDX_Control(pDX, IDC_BUTPAYMENT, m_ButHTZX[0]);
DDX_Control(pDX, IDC_BUTPAYFOR, m_ButHTZX[1]);
DDX_Control(pDX, IDC_BUTBAK, m_ButSJ[0]);
DDX_Control(pDX, IDC_BUTRESUME, m_ButSJ[1]);
DDX_Control(pDX, IDC_BUTFORMAT, m_ButSJ[2]);
DDX_Control(pDX, IDC_BUTOP, m_ButSYS[0]);
DDX_Control(pDX, IDC_BUTPWD, m_ButSYS[1]);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDMain, CDialog)
//{{AFX_MSG_MAP(CDMain)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
ON_BN_CLICKED(IDC_BUTBASE, OnButbase)
ON_BN_CLICKED(IDCANCEL, OnButexit)
ON_BN_CLICKED(IDC_BUTLOT, OnButlot)
ON_BN_CLICKED(IDC_BUTEXEC, OnButexec)
ON_BN_CLICKED(IDC_BUTMANAGE, OnButmanage)
ON_BN_CLICKED(IDC_BUTSYSTEM, OnButsystem)
ON_BN_CLICKED(IDC_BUTDEPT, OnButDept)
ON_BN_CLICKED(IDC_BUTCANDG, OnButcAndg)
ON_BN_CLICKED(IDC_BUTITEM, OnButItem)
ON_BN_CLICKED(IDC_BUTCOMMENT, OnButComment)
ON_BN_CLICKED(IDC_BUTSIGN, OnButSign)
ON_BN_CLICKED(IDC_BUTCHANGE, OnButChange)
ON_BN_CLICKED(IDC_BUTPAYMENT, OnButPayMent)
ON_BN_CLICKED(IDC_BUTPAYFOR, OnButPayFor)
ON_BN_CLICKED(IDC_BUTBAK, OnButBak)
ON_BN_CLICKED(IDC_BUTRESUME, OnButResume)
ON_BN_CLICKED(IDC_BUTFORMAT, OnButFormat)
ON_BN_CLICKED(IDC_BUTOP, OnButOp)
ON_BN_CLICKED(IDC_BUTPWD, OnButPwd)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDMain message handlers
BOOL CDMain::OnInitDialog()
{
CDialog::OnInitDialog();
m_ButJC[0].LoadPic(IDB_BITMAP01,IDB_BITMAP02,IDB_BITMAP01);
m_ButJC[1].LoadPic(IDB_BITMAP04,IDB_BITMAP03,IDB_BITMAP04);
m_ButJC[2].LoadPic(IDB_BITMAP25,IDB_BITMAP26,IDB_BITMAP25);
m_ButQD[0].LoadPic(IDB_BITMAP05,IDB_BITMAP06,IDB_BITMAP05);
m_ButQD[1].LoadPic(IDB_BITMAP07,IDB_BITMAP08,IDB_BITMAP07);
m_ButQD[2].LoadPic(IDB_BITMAP09,IDB_BITMAP10,IDB_BITMAP09);
m_ButHTZX[0].LoadPic(IDB_BITMAP11,IDB_BITMAP12,IDB_BITMAP11);
m_ButHTZX[1].LoadPic(IDB_BITMAP13,IDB_BITMAP14,IDB_BITMAP13);
m_ButSJ[0].LoadPic(IDB_BITMAP15,IDB_BITMAP16,IDB_BITMAP15);
m_ButSJ[1].LoadPic(IDB_BITMAP17,IDB_BITMAP18,IDB_BITMAP17);
m_ButSJ[2].LoadPic(IDB_BITMAP19,IDB_BITMAP20,IDB_BITMAP19);
m_ButSYS[0].LoadPic(IDB_BITMAP21,IDB_BITMAP22,IDB_BITMAP21);
m_ButSYS[1].LoadPic(IDB_BITMAP23,IDB_BITMAP24,IDB_BITMAP23);
m_ButBase.EnableWindow(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDMain::OnOK()
{
}
void CDMain::OnPaint()
{
CPaintDC dc(this); // device context for painting
CBitmap bit;
CDC memDC;
CRect rect;
this->GetClientRect(&rect);
bit.LoadBitmap(IDB_BIT_BLACK);
memDC.CreateCompatibleDC(&dc);
memDC.SelectObject(&bit);
dc.BitBlt(0,0,rect.Width(),rect.Height(),&memDC,0,0,SRCCOPY);
memDC.DeleteDC();
::DeleteObject(&bit);
}
void CDMain::OnButbase()
{
m_ButBase.EnableWindow(false);
m_ButLot.EnableWindow(true);
m_ButExec.EnableWindow(true);
m_ButManage.EnableWindow(true);
m_ButSystem.EnableWindow(true);
m_ButExit.EnableWindow(true);
int i;
for(i=0;i<2;i++)
{
m_ButHTZX[i].ShowWindow(SW_HIDE);
m_ButSYS[i].ShowWindow(SW_HIDE);
}
for(i=0;i<3;i++)
{
m_ButJC[i].ShowWindow(SW_SHOW);
m_ButQD[i].ShowWindow(SW_HIDE);
m_ButSJ[i].ShowWindow(SW_HIDE);
}
}
void CDMain::OnButexit()
{
if(MessageBox("確定要退出系統嗎?","系統提示",MB_OKCANCEL|MB_ICONQUESTION)!=1)
return;
this->OnCancel();
try{
theApp.m_pMainWnd->DestroyWindow();
}
catch(...)
{
}
}
void CDMain::OnButlot()
{
m_ButBase.EnableWindow(true);
m_ButLot.EnableWindow(false);
m_ButExec.EnableWindow(true);
m_ButExit.EnableWindow(true);
m_ButManage.EnableWindow(true);
m_ButSystem.EnableWindow(true);
int i;
for(i=0;i<2;i++)
{
m_ButHTZX[i].ShowWindow(SW_HIDE);
m_ButSYS[i].ShowWindow(SW_HIDE);
}
for(i=0;i<3;i++)
{
m_ButJC[i].ShowWindow(SW_HIDE);
m_ButQD[i].ShowWindow(SW_SHOW);
m_ButSJ[i].ShowWindow(SW_HIDE);
}
}
void CDMain::OnButexec()
{
m_ButBase.EnableWindow(true);
m_ButLot.EnableWindow(true);
m_ButExec.EnableWindow(false);
m_ButExit.EnableWindow(true);
m_ButManage.EnableWindow(true);
m_ButSystem.EnableWindow(true);
int i;
for(i=0;i<2;i++)
{
m_ButHTZX[i].ShowWindow(SW_SHOW);
m_ButSYS[i].ShowWindow(SW_HIDE);
}
for(i=0;i<3;i++)
{
m_ButJC[i].ShowWindow(SW_HIDE);
m_ButQD[i].ShowWindow(SW_HIDE);
m_ButSJ[i].ShowWindow(SW_HIDE);
}
}
void CDMain::OnButmanage()
{
m_ButBase.EnableWindow(true);
m_ButLot.EnableWindow(true);
m_ButExec.EnableWindow(true);
m_ButExit.EnableWindow(true);
m_ButManage.EnableWindow(false);
m_ButSystem.EnableWindow(true);
int i;
for(i=0;i<2;i++)
{
m_ButHTZX[i].ShowWindow(SW_HIDE);
m_ButSYS[i].ShowWindow(SW_HIDE);
}
for(i=0;i<3;i++)
{
m_ButJC[i].ShowWindow(SW_HIDE);
m_ButQD[i].ShowWindow(SW_HIDE);
m_ButSJ[i].ShowWindow(SW_SHOW);
}
}
void CDMain::OnButsystem()
{
m_ButBase.EnableWindow(true);
m_ButLot.EnableWindow(true);
m_ButExec.EnableWindow(true);
m_ButExit.EnableWindow(true);
m_ButManage.EnableWindow(true);
m_ButSystem.EnableWindow(false);
int i;
for(i=0;i<2;i++)
{
m_ButHTZX[i].ShowWindow(SW_HIDE);
m_ButSYS[i].ShowWindow(SW_SHOW);
}
for(i=0;i<3;i++)
{
m_ButJC[i].ShowWindow(SW_HIDE);
m_ButQD[i].ShowWindow(SW_HIDE);
m_ButSJ[i].ShowWindow(SW_HIDE);
}
}
void CDMain::OnButDept()
{
RxRecordset brst;
CString sName,stime;
CTime ttime;
brst.Open("部門信息表");
sName="部門信息報表";
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.MainCaption=sName;
m_ps.DeckCaptionNumber=2;
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.DeckCaptionFontSize=180;
m_ps.MainCaptionFontSize=400;
m_ps.DeckCaptions[0]="日期:"+stime;
m_ps.DeckCaptions[1]="操作員:"+OP;
CDBaseQuery dlg;
CDbmxx nextdlg;
dlg.Show("部門信息查詢","部門信息表",&nextdlg,m_ps);
dlg.DoModal();
//部門信息管理
}
void CDMain::OnButcAndg()
{
RxRecordset brst;
CString sName,stime;
CTime ttime;
brst.Open("往來單位信息表");
sName="往來單位信息報表";
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.MainCaption=sName;
m_ps.DeckCaptionNumber=2;
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.DeckCaptionFontSize=180;
m_ps.MainCaptionFontSize=400;
m_ps.DeckCaptions[0]="日期:"+stime;
m_ps.DeckCaptions[1]="操作員:"+OP;
CDBaseQuery dlg;
CDWLDW nextdlg;
dlg.Show("往來單位信息查詢","往來單位信息表",&nextdlg,m_ps);
dlg.DoModal();
//往來單位信息管理
}
void CDMain::OnButItem()
{
RxRecordset brst;
CString sName,stime;
CTime ttime;
brst.Open("項目信息表");
sName="項目信息報表";
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.MainCaption=sName;
m_ps.DeckCaptionNumber=2;
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.DeckCaptionFontSize=180;
m_ps.MainCaptionFontSize=400;
m_ps.DeckCaptions[0]="日期:"+stime;
m_ps.DeckCaptions[1]="操作員:"+OP;
CDBaseQuery dlg;
CDxmxx nextdlg;
dlg.Show("項目信息查詢","項目信息表",&nextdlg,m_ps);
dlg.DoModal();
//項目信息管理
}
void CDMain::OnButComment()
{
CDBaseQuery dlg;
CDqyqhtps nextdlg;
dlg.Show("簽約前合同評審查詢","簽約前合同評審視圖",&nextdlg,m_ps);
dlg.CanPrint=false;
dlg.DoModal();
}
void CDMain::OnButSign()
{
CDBaseQuery dlg;
CDhtqd nextdlg;
dlg.Show("合同簽訂查詢","合同簽訂視圖",&nextdlg,m_ps);
dlg.CanPrint=false;
dlg.DoModal();
}
void CDMain::OnButChange()
{
CDBaseQuery dlg;
CDhtgg nextdlg;
dlg.Show("合同更改查詢","合同更改視圖",&nextdlg,m_ps);
dlg.CanPrint=false;
dlg.DoModal();
}
void CDMain::OnButPayMent()
{
RxRecordset brst;
CString sName,stime;
CTime ttime;
brst.Open("支付手續表");
sName="支付手續報表";
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.MainCaption=sName;
m_ps.DeckCaptionNumber=2;
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.DeckCaptionFontSize=180;
m_ps.MainCaptionFontSize=400;
m_ps.DeckCaptions[0]="日期:"+stime;
m_ps.DeckCaptions[1]="操作員:"+OP;
CDBaseQuery dlg;
CDblzfsx nextdlg;
dlg.Show("支付手續查詢","支付手續視圖",&nextdlg,m_ps);
dlg.DoModal();
//項目信息管理
}
void CDMain::OnButPayFor()
{
CDBaseQuery dlg;
CDwysp nextdlg;
dlg.Show("違約索賠查詢","違約索賠視圖",&nextdlg,m_ps);
dlg.CanPrint=false;
dlg.DoModal();
}
void CDMain::OnLButtonDown(UINT nFlags, CPoint point)
{
::SendMessage(this->GetSafeHwnd(),WM_SYSCOMMAND,SC_MOVE+HTCAPTION,0);
CDialog::OnLButtonDown(nFlags, point);
}
void CDMain::OnButBak()
{
CBAK dlg;
dlg.m_sCaption="數據備份";
dlg.DoModal();
}
void CDMain::OnButResume()
{
CBAK dlg;
dlg.m_sCaption="數據恢復";
dlg.DoModal();
}
void CDMain::OnButFormat()
{
CDFormat dlg;
dlg.DoModal();
}
void CDMain::OnButOp()
{
RxRecordset brst;
CString sName,stime;
CTime ttime;
brst.Open("用戶信息表");
sName="用戶信息報表";
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.MainCaption=sName;
m_ps.DeckCaptionNumber=2;
ttime=ttime.GetCurrentTime();
stime=CTimeToCString(ttime);
m_ps.DeckCaptionFontSize=180;
m_ps.MainCaptionFontSize=400;
m_ps.DeckCaptions[0]="日期:"+stime;
m_ps.DeckCaptions[1]="操作員:"+OP;
CDBaseQuery dlg;
CDOp nextdlg;
dlg.Show("用戶信息查詢","用戶信息表",&nextdlg,m_ps);
dlg.DoModal();
//用戶信息管理
}
void CDMain::OnButPwd()
{
CDxgmm dlg;
dlg.DoModal();
}
void CDMain::Close()
{
CHtglxtApp * app=(CHtglxtApp *)AfxGetApp();
try{
app->m_pMainWnd->DestroyWindow();
}
catch(...)
{
}
this->OnCancel();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -