www.pudn.com > chenjing.rar > BeginDlg.cpp


// BeginDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "Library.h" 
#include "BeginDlg.h" 
#include "MainDlg.h" 
#include "LibraryDlg.h" 
#include "PasswdDlg.h" 
#include "BorrowDlg.h" 
#include "CheckBorrowDlg.h" 
#include "NewBooksDlg.h" 
#include "CheckBooksDlg.h" 
#include "BookLostDlg.h" 
#include "AboutDlg.h" 
#include "NewProofDlg.h" 
#include "CheckProofDlg.h" 
#include "ProofLostDlg.h" 
 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CBeginDlg dialog 
 
 
CBeginDlg::CBeginDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CBeginDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CBeginDlg) 
	m_struser = _T(""); 
	m_strTimer = _T(""); 
	//}}AFX_DATA_INIT 
} 
 
 
void CBeginDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CBeginDlg) 
	DDX_Text(pDX, IDC_STATIC_USER, m_struser); 
	DDX_Text(pDX, IDC_STATIC_TIMER, m_strTimer); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CBeginDlg, CDialog) 
	//{{AFX_MSG_MAP(CBeginDlg) 
	ON_WM_TIMER() 
	ON_BN_CLICKED(IDC_BUTTON_BACKTOMAIN, OnButtonBacktomain) 
	ON_BN_CLICKED(IDC_BUTTON_LOGOUT, OnButtonLogout) 
	ON_BN_CLICKED(IDC_BUTTON_PASSWD, OnButtonPasswd) 
	ON_BN_CLICKED(IDC_BUTTON_EXIT, OnButtonExit) 
	ON_BN_CLICKED(IDC_BUTTON_ABOUT, OnButtonAbout) 
	ON_BN_CLICKED(IDC_BUTTON_HOWTO, OnButtonHowto) 
	ON_BN_CLICKED(IDC_BUTTON_PROOF_LOST, OnButtonProofLost) 
	ON_BN_CLICKED(IDC_BUTTON_CHECK_PROOF, OnButtonCheckProof) 
	ON_BN_CLICKED(IDC_BUTTON_MAKE_PROOF, OnButtonMakeProof) 
	ON_BN_CLICKED(IDC_BUTTON_CHECK_BORROW, OnButtonCheckBorrow) 
	ON_BN_CLICKED(IDC_BUTTON_CHECK_BOOKS, OnButtonCheckBooks) 
	ON_BN_CLICKED(IDC_BUTTON_NEW_BOOK, OnButtonNewBook) 
	ON_BN_CLICKED(IDC_BUTTON_BORROW, OnButtonBorrow) 
	ON_BN_CLICKED(IDC_BUTTON_BOOK_LOST, OnButtonBookLost) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CBeginDlg message handlers 
 
BOOL CBeginDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
	SetTimer(BEGINTIMER,1000,NULL); 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void CBeginDlg::OnTimer(UINT nIDEvent)  
{ 
	CTime curTime=CTime::GetCurrentTime(); 
	m_strTimer=curTime.Format("%y-%m-%d %H:%M:%S"); 
	UpdateData(FALSE); 
	CDialog::OnTimer(nIDEvent); 
} 
 
void CBeginDlg::OnButtonBacktomain()  
{ 
	CMainDlg m_dlg; 
	m_dlg.m_user=m_struser; 
	OnOK(); 
	m_dlg.DoModal(); 
} 
 
void CBeginDlg::OnButtonLogout()  
{ 
	int iResult=MessageBox("Really logout?","图书管理系统",MB_OKCANCEL|MB_ICONQUESTION); 
	if(iResult==IDOK) 
	{ 
		CLibraryDlg LoginDlg; 
		OnOK(); 
		LoginDlg.DoModal(); 
	} 
} 
 
void CBeginDlg::OnButtonPasswd()  
{ 
	CPasswdDlg m_PassDlg; 
	m_PassDlg.m_user=m_struser; 
	m_PassDlg.DoModal(); 
} 
 
void CBeginDlg::OnButtonExit()  
{ 
	int iResult=MessageBox("Will you really quit?","图书管理系统",MB_YESNO|MB_ICONQUESTION); 
	if(iResult==IDYES) 
		OnOK();	 
} 
 
void CBeginDlg::OnButtonAbout()  
{ 
	CAboutDlg m_dlg; 
	m_dlg.DoModal();		 
} 
 
void CBeginDlg::OnButtonHowto()  
{ 
	WinExec("hh.exe help\\help.chm",SW_SHOW);	 
} 
 
void CBeginDlg::OnButtonProofLost()  
{ 
	CProofLostDlg m_dlg; 
	m_dlg.DoModal(); 
} 
 
void CBeginDlg::OnButtonCheckProof()  
{ 
	CCheckProofDlg m_dlg; 
	m_dlg.DoModal(); 
} 
 
void CBeginDlg::OnButtonMakeProof()  
{ 
	CNewProofDlg m_dlg; 
	m_dlg.DoModal(); 
} 
 
void CBeginDlg::OnButtonCheckBorrow()  
{ 
	CCheckBorrowDlg dlg; 
	dlg.DoModal();	 
} 
 
void CBeginDlg::OnButtonCheckBooks()  
{ 
	CCheckBooksDlg dlg; 
	dlg.DoModal();	 
} 
 
void CBeginDlg::OnButtonNewBook()  
{ 
	CNewBooksDlg NewDlg; 
	NewDlg.DoModal(); 
} 
 
void CBeginDlg::OnButtonBorrow()  
{ 
	CBorrowDlg dlg; 
	dlg.DoModal(); 
} 
 
void CBeginDlg::OnButtonBookLost()  
{ 
	CBookLostDlg m_dlg; 
	m_dlg.DoModal(); 
}