CString CTableBase::GetValueList(BOOL bUseNULL, BOOL bExport) { CString s = _T(""); // Recuperar a lista de campos pela ordenacao de // importacao/Exportacao POSITION p = m_fieldOrdered.GetHeadPosition(); CField *pField = NULL; int counter = 0; while(p != NULL) { CString sKey = m_fieldOrdered.GetNext(p); VERIFY(m_mapFields.Lookup(sKey, pField)); if(counter++ > 0) s += _T(","); if(!pField->IsNull()) s += pField->GetQueryFormatValue(); else { // Se puder usar NULL ... if(bUseNULL) s += _T("NULL"); else { if(bExport) { if(pField->GetType() == CField::FIELD_TYPE_CURRENCY) s += _T(""); else if(pField->GetType() == CField::FIELD_TYPE_NUMBER) s += _T(""); else s += _T("\"\""); } else { // Caso contrario, mandamos Zero para os numericos ... if(pField->GetType() == CField::FIELD_TYPE_CURRENCY || pField->GetType() == CField::FIELD_TYPE_NUMBER) { s += _T(""); } else // e vazio para os outros ... s += _T(""); } } } } s += _T("\r\n"); return s; }
long CTableBase::GetLongValue(LPCTSTR _szLabel) { CField *pField; if(m_mapFields.Lookup(_szLabel, pField)) { ASSERT(pField->GetType() == CField::FIELD_TYPE_NUMBER); return pField->GetLongValue(); } ASSERT(FALSE); // NAo encontrou o campo ! return 0L; }