HomeFinanceManagerDoc.cpp
上传用户:xiaoke98
上传日期:2014-06-29
资源大小:5718k
文件大小:3k
源码类别:
家庭/个人应用
开发平台:
Visual C++
- // HomeFinanceManagerDoc.cpp : implementation of the CHomeFinanceManagerDoc class
- //
- #include "stdafx.h"
- #include "HomeFinanceManager.h"
- #include "HomeFinanceManagerDoc.h"
- #include "CMD.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CHomeFinanceManagerDoc
- IMPLEMENT_DYNCREATE(CHomeFinanceManagerDoc, CDocument)
- BEGIN_MESSAGE_MAP(CHomeFinanceManagerDoc, CDocument)
- //{{AFX_MSG_MAP(CHomeFinanceManagerDoc)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CHomeFinanceManagerDoc construction/destruction
- CHomeFinanceManagerDoc::CHomeFinanceManagerDoc()
- {
- // TODO: add one-time construction code here
- m_bHasLogin = false;
- }
- CHomeFinanceManagerDoc::~CHomeFinanceManagerDoc()
- {
- }
- BOOL CHomeFinanceManagerDoc::OnNewDocument()
- {
- if (!CDocument::OnNewDocument())
- return FALSE;
- // TODO: add reinitialization code here
- // (SDI documents will reuse this document)
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CHomeFinanceManagerDoc serialization
- void CHomeFinanceManagerDoc::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- // TODO: add storing code here
- }
- else
- {
- // TODO: add loading code here
- }
- }
- /////////////////////////////////////////////////////////////////////////////
- // CHomeFinanceManagerDoc diagnostics
- #ifdef _DEBUG
- void CHomeFinanceManagerDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
- void CHomeFinanceManagerDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CHomeFinanceManagerDoc commands
- void CHomeFinanceManagerDoc::Login(CView* pSender)
- {
- CCMD cmdLogin("Login");
- cmdLogin.setType(CMD_LOGIN);
- UpdateAllViews(pSender, 0, &cmdLogin);
- }
- void CHomeFinanceManagerDoc::VerifyUser(CView* pSender)
- {
- CCMD cmdLogin("VerifyUser");
- cmdLogin.setType(CMD_VERIFY_OK);
- UpdateAllViews(pSender, 0, &cmdLogin);
- }
- //---------------------------------------------------------------------------
- //收支平衡表相关
- void CHomeFinanceManagerDoc::Balance(CView* pSender)
- {
- /* if(false == m_bHasLogin)
- {
- AfxMessageBox("用户尚未登录,无法查看收入状况!");
- return;
- }*/
- CCMD cmdBalance("Balance");
- cmdBalance.setType(CMD_BALANCE);
- UpdateAllViews(pSender, 0, &cmdBalance);
- }
- //---------------------------------------------------------------------------
- //处理收入窗口显示
- void CHomeFinanceManagerDoc::FinanceIn(CView* pSender)
- {
- CCMD cmdLogin("FinanceIn");
- cmdLogin.setType(CMD_FINANCE_IN);
- UpdateAllViews(pSender, 0, &cmdLogin);
- }
- //---------------------------------------------------------------------------
- void CHomeFinanceManagerDoc::FinanceOut(CView* pSender)
- {
- CCMD cmdLogin("FinanceIn");
- cmdLogin.setType(CMD_FINANCE_OUT);
- UpdateAllViews(pSender, 0, &cmdLogin);
- }