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

Work Crew Tables (Source Code)

Link to: header | tables directory

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

Comments

CWorkCrewMemberTable

This class manages project work crew tables for the Goldenseal accounting software,
small business management software, construction project management software and
construction accounting software.

It's a member table showing work crews

SUPERCLASS = CFlexibleCVTable

Constructor

/*********************************************************************************
constructor TCS 5/28/02
*********************************************************************************/
CWorkCrewMemberTable::CWorkCrewMemberTable(const SPaneInfo &inPaneInfo,
const SViewInfo &inViewInfo)
: CFlexibleCVTable(inPaneInfo, inViewInfo)
{
}

Source Code

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

GetCellCVClassID TCS 5/28/02

return the cv class id for a cell

*********************************************************************************/
DBid CWorkCrewMemberTable::GetCellCVClassID(const TableCellT &inCell) const
{
if (COL(inCell) == CWorkCrew::col_member)
{
return GetCellValue(ROW(inCell), CWorkCrew::col_type);

}
else
return THE_SUPERCLASS::GetCellCVClassID(inCell);
}
/*********************************************************************************

FillNewRowCells TCS 5/28/02

fill in default values

*********************************************************************************/
void CWorkCrewMemberTable::FillNewRowCells(const TableIndexT row)
{
THE_SUPERCLASS::FillNewRowCells(row);

SetCVCellValue(row, CWorkCrew::col_type, id_EmployeeAccount);
SetCellText(row, CWorkCrew::col_percent, CMoney::GetHundredPercentString());
}
/*********************************************************************************

HandleCellTextChanged TCS 5/28/02

text has changed in the table. We want to restrict % values to between 0 & 100

*********************************************************************************/
void CWorkCrewMemberTable::HandleCellTextChanged(const TableIndexT row,
const TableIndexT col,
const Boolean sendMessage)
{
if (col == CWorkCrew::col_percent)
{
CMoney value = GetCellMoneyValue(row, col);


if (value.GetDollars() > 100)
{
TCS_ErrorAlert(TCS_GetErrString(errID_OverMaxValue));
SetCellText(row, col, CMoney::GetHundredPercentString());
}
else if (value.GetDollars() <= 0)
{
TCS_ErrorAlert(TCS_GetErrString(errID_UnderMinValue));
SetCellText(row, col, CMoney::GetZeroPercentString());
}
}

THE_SUPERCLASS::HandleCellTextChanged(row, col, sendMessage);
}