⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 count.cpp

📁 一个简单的记账软件
💻 CPP
字号:
// Count.cpp: implementation of the CCount class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Tally.h"
#include "Count.h"
#include "TallyDoc.h"
#include "Item.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CCount::CCount()
{
	/*for (int j=0; j<9; j++){	
			m_Times[i][j] += 
		}*/
	//CArray<CItem,CItem&> m_aMonth[12];
	CWnd * pMain = AfxGetApp( )->m_pMainWnd;
	CTallyDoc * pActiveDoc = (CTallyDoc*)((CMDIFrameWnd*)pMain)->MDIGetActive()->GetActiveDocument();
	for (int i=0; i<12; i++){
		for (int j=0; j<9; j++){
			m_Times[i][j] = 0;
			m_Count[i][j] = 0;
		}
	}
	for (i=0; i<12; i++){
		for (int j=0; j<pActiveDoc->m_aMonth[i].GetSize(); j++){
			m_Times[i][pActiveDoc->m_aMonth[i][j].m_tType] ++;
			m_Count[i][pActiveDoc->m_aMonth[i][j].m_tType] += pActiveDoc->m_aMonth[i][j].m_dCost;
		}		
	}
}

CCount::~CCount()
{

}
int CCount::GetYearTimes (int type)
{
	int temp = 0;
	for (int i=0; i<12; i++)
		temp += m_Times[i][type];
	return temp;
}
double CCount::GetYearCount (int type)
{
	double temp = 0;
	for (int i=0; i<12; i++)
		temp += m_Count[i][type];
	return temp;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -