Accounting Software
Small Business Software Estimating Software
Time Tracking SoftwareTime Management SoftwareTime Billing SoftwareContact Management SoftwareCustomer Management SoftwareProject Management SoftwareBusiness Management Software

Sales Promotion Tables (Source Code)

Link to: header | tables directory

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

Comments

CPromotionTable

This class manages sales promotion tables for the Goldenseal accounting software,
small business management software, construction project management software and
construction accounting software

It's a member table used in sales promotions. It shows cats, subcats & cost items

SUPERCLASS = CMemberTable

Constructor

/*********************************************************************************
constructor TCS 10/8/99
*********************************************************************************/
CPromotionTable::CPromotionTable(const SPaneInfo &inPaneInfo,
const SViewInfo &inViewInfo)
: CMemberTable(inPaneInfo, inViewInfo)
{
}

Source Code

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

CreateNewCellCVField TCS 10/8/99

create a cv field for the given cell
*********************************************************************************/
CTCS_CVField *CPromotionTable::CreateNewCellCVField(const TableCellT &inCell,
const SPaneInfo &inPaneInfo)
{
CTCS_CVField *result = nil;

switch (COL(inCell))
{
case (CPromotion::col_cat):
result = NEW CCategoryCV(inPaneInfo, mTextInfo, cHasPopup);
break;

case (CPromotion::col_subcat):
result = NEW CSubcatCV(inPaneInfo, mTextInfo, cHasPopup);
break;

case (CPromotion::col_item):
result = NEW CCostItemCV(inPaneInfo, mTextInfo, cHasPopup);
break;

default:
result = THE_SUPERCLASS::CreateNewCellCVField(inCell, inPaneInfo);
break;
}

return result;
}
/*********************************************************************************

HandleCellCVChanged TCS moved code here 12/13/01

handle a clairvoyant change. We handle some cv columns here

*********************************************************************************/
void CPromotionTable::HandleCellCVChanged(const TableIndexT row, const TableIndexT col,
CTCS_CVField */*cv*/)
{
switch (col)
{
case (CPromotion::col_cat):
ResetSubcategory(row);
ResetCostItem(row, 0, 0);
break;

case (CPromotion::col_subcat):
case (CPromotion::col_item):
ResetCostItem(row, 0, 0);
break;

default:
break;
}
}
/*********************************************************************************

ResetSubcategory

erase the subcategory

*********************************************************************************/
void CPromotionTable::ResetSubcategory(TableIndexT row)
{
ClearCVCell(row, CPromotion::col_subcat);
}
/*********************************************************************************

ResetCostItem

erase the cost item

*********************************************************************************/
void CPromotionTable::ResetCostItem(TableIndexT row, const SInt32 /*oldValue*/,
const SInt32 /*newValue*/)
{
ClearCVCell(row, CPromotion::col_item);
}