Accounting Software
Small Business Software Estimating Software
Unit Cost SoftwareConstruction Estimating SoftwareProject Estimating SoftwareCost Estimation SoftwareCost Estimating SoftwareConstruction Management SoftwareBusiness Management Software

Category Classes (Source Code)

Link to: header | unit cost directory

Copyright Turtle Creek Software 1996-2006. All Rights Reserved.

Comments

CCategoryClass

This class manages cost category classes in the Goldenseal accounting software,
estimating software, unit cost software, job costing software and construction accounting software.

Each item is a list of larger divisions for cost categories. These are set up in a
category system (so a given job cost category could actually belong to different
category classes in different systems).

SUPERCLASS = DB_DescribedPersistent

Constructor

/*********************************************************************************
default constructor
*********************************************************************************/
CCategoryClass::CCategoryClass()
{
mIncomeTaxField = 0;
mPadding = 0;
mPadding2 = 0;

mEndSafetyTag = tag_endsafetytag; // TCS 9/8/02sw
}

Source Code

/*********************************************************************************

CopyFrom

copy the data members from the passed object. This is used to implement
duplicate. source should be an object of the same class as this object

*********************************************************************************/
void CCategoryClass::CopyFrom(DB_PersistentObject *source, const UInt8 copyFlags)
{
THE_SUPERCLASS::CopyFrom(source, copyFlags);

CCategoryClass *src = TCS_SAFE_CAST(source, CCategoryClass);
TCS_FailNILMsg(src, TCS_GetErrString(errID_BadRecord));

TCS_BlockMove(&src->mIncomeTaxField, &mIncomeTaxField, cCopyFileLength);
}/*********************************************************************************

GetMemberValue

return the value of the member with the given tag

*********************************************************************************/
Boolean CCategoryClass::GetMemberValue(const NeoTag aTag, const NeoTag aType,
void *aValue) const
{
switch (aTag)
{
/*case tag_incometaxfield:
return ConvertObjectIDMember(mIncomeTaxField, id_IncomeTaxField,
aValue, aType);
break;*/

default:
return THE_SUPERCLASS::GetMemberValue(aTag, aType, aValue);
break;
}
}/*********************************************************************************

SetMemberValue

set the value of the member with the given tag

*********************************************************************************/
Boolean CCategoryClass::SetMemberValue(const NeoTag aTag, const NeoTag aType,
const void *aValue)
{
switch (aTag)
{
/*case tag_incometaxfield:
return ConvertDataToObjectID(aValue, aType,
&mIncomeTaxField, id_IncomeTaxField);
break;*/

default:
return THE_SUPERCLASS::SetMemberValue(aTag, aType, aValue);
break;
}
}/*********************************************************************************

ReadObject

read the persistent object's data in from a stream
*********************************************************************************/
void CCategoryClass::ReadObject(CNeoStream *aStream, const NeoTag aTag)
{
TCS_FailNILMsg(aStream, TCS_GetErrString(errID_BadStream));

CNeoDebugImport checker(aStream, this, cCheckTooSmall); // TCS 2/24/00

THE_SUPERCLASS::ReadObject(aStream, aTag);

if (!IsIOValid()) // TCS 2/5/02
return;

/// aStream->ReadChunk(&mIncomeTaxField, cFileLength);

mIncomeTaxField = aStream->ReadID(); // mfs_sa rev 20feb2k3

mPadding = aStream->ReadChar();
mPadding2 = aStream->ReadChar();

mEndSafetyTag = aStream->ReadEndSafetyTag(this);

if (!IsValidEndTag(mEndSafetyTag)) // TCS 9/8/02
ReportDamagedObject(GetDBClassID(), GetDBID());
}/*********************************************************************************

WriteObject

write the persistent object's data to a stream
*********************************************************************************/
void CCategoryClass::WriteObject(CNeoStream *aStream, const NeoTag aTag)
{
TCS_FailNILMsg(aStream, TCS_GetErrString(errID_BadStream));

// make sure we have valid data to write TCS 9/8/02
if (!IsValidEndTag(mEndSafetyTag))
{
ReportDamagedObject(GetDBClassID(), GetDBID());
mEndSafetyTag = tag_endsafetytag; // TCS 11/26/02
}

CNeoDebugExport checker(aStream, this, cCheckTooSmall);
THE_SUPERCLASS::WriteObject(aStream, aTag);


/// aStream->WriteChunk(&mIncomeTaxField, cFileLength);

aStream->WriteID(mIncomeTaxField); // mfs_sa rev 20feb2k3

aStream->WriteChar(mPadding);
aStream->WriteChar(mPadding2);

aStream->WriteEndSafetyTag(mEndSafetyTag, this);

}
#if CAN_USE_MARK
#pragma mark -
#endif
/*********************************************************************************

FillDataReport TCS 9/7/02

fill in a diagnostic table that shows data field values.

*********************************************************************************/
void CCategoryClass::FillDataReport(CTCS_Table *table, CNeoStream *stream) const
{
TCS_FailNILMsg(table, TCS_GetErrString(errID_BadTable));
TCS_FailNILMsg(stream, TCS_GetErrString(errID_BadStream));

THE_SUPERCLASS::FillDataReport(table, stream);

FillFieldStockRow(table, stream, stockID_Expansion, cLongSize, mIncomeTaxField);

FillFieldStockRow(table, stream, stockID_Padding, cCharSize, SInt32(mPadding));
FillFieldStockRow(table, stream, stockID_Padding, cCharSize, SInt32(mPadding2));

FillEndSafetyTag(table, stream, mEndSafetyTag);
}