Click here to Skip to main content
15,881,172 members
Articles / Programming Languages / C

BasicAdmin - Personal Organizer

Rate me:
Please Sign up or sign in to vote.
4.94/5 (14 votes)
1 Aug 2009CPOL6 min read 50.6K   5.6K   60  
Finance, contacts, notes organizer
#include "stdafx.h"
#include "Account.h"

int CAccount::TreeImage(BOOL HasChildren, CppSQLite3Query* q)
{
	CBasicTables::eAccountType acctype = (CBasicTables::eAccountType)q->getIntField("ACCTYPE");
	if (HasChildren)
		return 10;
	else
	{
		switch(acctype)
		{
			case CBasicTables::TaccCash: return 30;
			case CBasicTables::TaccSalary: return 28;
			case CBasicTables::TaccBankAccount: return 26;
			case CBasicTables::TaccExpense: return 25;
			case CBasicTables::TaccStockAccount: return 38;
		}
	}
}
int CAccount::TreeImage(BOOL HasChildren, int acctype)
{
	if (HasChildren)
		return 10;
	else
	{
		switch(acctype)
		{
			case CBasicTables::TaccCash: return 30;
			case CBasicTables::TaccSalary: return 28;
			case CBasicTables::TaccBankAccount: return 26;
			case CBasicTables::TaccExpense: return 25;
			case CBasicTables::TaccStockAccount: return 38;
		}
	}
	return -1;
}
void CAccount::GetAccount(int ID,CUtils* ut, CppSQLite3Query* q1)
{
	CppSQLite3Query q;
	CString strid;
	strid.Format("%d", ID);
	if (q1 == 0)
	{
		q = dbAdmin.execQuery("SELECT * FROM ACCOUNTS WHERE ID = " + strid);
		q1 = &q;
	}
	this->ID = q1->getIntField("ID");
	AccountType = (CBasicTables::eAccountType)q1->getIntField("ACCTYPE");
	Description = q1->getStringField("DESCRIPTION");
	IdCurrency = q1->getIntField("ID_CUR");
	Observations = q1->getStringField("OBSERVATIONS");
	Parent = q1->getIntField("PARENT");
	Shortcut1 = q1->getIntField("SHORTCUT1");
	Shortcut2 = q1->getIntField("SHORTCUT2");
	this->Path = ut->AccGetArrDescription(this->ID,0);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Argentina Argentina
System developer from Argentina.

Programmed in VB 5,6,.NET, C#, Java, PL-SQL, Transac-SQL, C, C++ and even some "calculator" language.

Love to build small, useful applications.
Usually building big and complicated apps based on solid, reliable components.

Hobbies: reading, photography, chess, paddle, running.

Comments and Discussions