Exemplo n.º 1
0
int NFCRecord::FindInt(const std::string& strColTag, const NFINT64 value, NFDataList& varResult)
{
    if (strColTag.empty())
    {
        return -1;
    }

    int nCol = GetCol(strColTag);
    return FindInt(nCol, value, varResult);
}
Exemplo n.º 2
0
int NFCRecord::FindInt(const int nCol, const NFINT64 value)
{
	NFDataList xDataList;
	int nRowCount = FindInt(nCol, value, xDataList);
	if (nRowCount > 0 && xDataList.GetCount() > 0)
	{
		return (int) xDataList.Int(0);
	}

	return -1;
}
Exemplo n.º 3
0
int NFCRecord::FindInt(const std::string & strColTag, const NFINT64 value)
{
	NFDataList xDataList;
	int nRowCount = FindInt(strColTag, value, xDataList);
	if (nRowCount > 0 && xDataList.GetCount() > 0)
	{
		return (int) xDataList.Int(0);
	}

	return -1;
}
Exemplo n.º 4
0
void CIntListView::OnRemove()
{
	int nSel;
	POSITION pos;
	// Find the string in both the CList<int,int> and in the listbox.
	if (FindInt(nSel, pos) != TRUE)
		return;


	// Remove the integer from the CList<int,int>.
	GetDocument()->m_intList.RemoveAt(pos);

	// Remove the integer from the listbox.
	m_ctlList.DeleteString(nSel);
}
Exemplo n.º 5
0
void CIntListView::OnRemove()
{
	int nSel;
	// Find the string in both the CList<int,int> and in the listbox.
	if (!FindInt(nSel))
		return;

	try {
	// Remove the integer from the CList<int,int>.
	GetDocument()->m_intList->Remove;
	} catch(_com_error& e) {
		dump_com_error(e);
	}

	// Remove the integer from the listbox.
	m_ctlList.DeleteString(nSel);
}
Exemplo n.º 6
0
int NFCRecord::FindRowByColValue(const int nCol, const NFData& var, NFDataList& varResult)
{
    if (!ValidCol(nCol))
    {
        return -1;
    }

    NFDATA_TYPE eType = var.GetType();
    if (eType != mVarRecordType->Type(nCol))
    {
        return -1;
    }

    switch (eType)
    {
        case TDATA_INT:
            return FindInt(nCol, var.GetInt(), varResult);
            break;

        case TDATA_FLOAT:
            return FindFloat(nCol, var.GetFloat(), varResult);
            break;

        case TDATA_STRING:
            return FindString(nCol, var.GetString(), varResult);
            break;

        case TDATA_OBJECT:
            return FindObject(nCol, var.GetObject(), varResult);
            break;

		case TDATA_VECTOR2:
			return FindVector2(nCol, var.GetVector2(), varResult);
			break;

        case TDATA_VECTOR3:
			return FindVector3(nCol, var.GetVector3(), varResult);
			break;

        default:
            break;
    }

    return -1;
}
Exemplo n.º 7
0
void CIntListView::OnUpdateButton()
{
	if (UpdateData() != TRUE)
		return;

	int nSel;
	POSITION pos;
	// Find the integer in both the CList<int,int> and the listbox.
	if (FindInt(nSel, pos) != TRUE)
		return;

	// Replace the integer in the CList<int,int>.
	GetDocument()->m_intList.SetAt(pos, m_int);

	// Update the old integer in the listbox by removing
	// the old entry and adding a new entry.
	m_ctlList.DeleteString(nSel);
	AddIntToListBox(m_int, nSel);
}
Exemplo n.º 8
0
void CIntListView::OnInsertBefore()
{
	if (UpdateData() != TRUE)
		return;

	int nSel;
	POSITION pos;
	// Find the integer in both the CList<int,int> and the listbox.
	if (FindInt(nSel, pos) != TRUE)
		return;


	// Insert in front of the integer found in the CList<int,int>
	POSITION posTemp = 0;
	posTemp = GetDocument()->m_intList.InsertBefore(pos, m_int);

	// Insert new integer in the listbox
	AddIntToListBox(m_int, nSel);
}
Exemplo n.º 9
0
void CIntListView::OnInsertBefore()
{
	if (UpdateData() != TRUE)
		return;

	int nSel;
	// Find the integer in both the CList<int,int> and the listbox.
	if (!FindInt(nSel))
		return;


	try {
	// Insert in front of the integer found in the CList<int,int>
	GetDocument()->m_intList->InsertBefore = m_int;
	} catch(_com_error& e) {
		dump_com_error(e);
	}

	// Insert new integer in the listbox
	AddIntToListBox(m_int, nSel);
}
Exemplo n.º 10
0
void CIntListView::OnUpdate()
{
	if (UpdateData() != TRUE)
		return;

	int nSel;
	// Find the integer in both the CList<int,int> and the listbox.
	if (!FindInt(nSel))
		return;

	try {
	// Replace the integer in the CList<int,int>.
	GetDocument()->m_intList->SetAt = m_int;
	} catch(_com_error& e) {
		dump_com_error(e);
	}

	// Update the old integer in the listbox by removing
	// the old entry and adding a new entry.
	m_ctlList.DeleteString(nSel);
	AddIntToListBox(m_int, nSel);
}
Exemplo n.º 11
0
int NFCRecord::FindRowByColValue(const int nCol, const NFIDataList& var, NFIDataList& varResult)
{
    if (!ValidCol(nCol))
    {
        return -1;
    }

    TDATA_TYPE eType = var.Type(0);
    if (eType != mVarRecordType->Type(nCol))
    {
        return -1;
    }

    switch (eType)
    {
        case TDATA_INT:
            return FindInt(nCol, var.Int(nCol), varResult);
            break;

        case TDATA_FLOAT:
            return FindFloat(nCol, var.Float(nCol), varResult);
            break;

        case TDATA_STRING:
            return FindString(nCol, var.String(nCol).c_str(), varResult);
            break;

        case TDATA_OBJECT:
            return FindObject(nCol, var.Object(nCol), varResult);
            break;

        default:
            break;
    }

    return -1;
}
Exemplo n.º 12
0
/** Convenience method to return the stored Int named
 * "rc". It's the equivalent of returning the second
 * parameter of FindInt("rc", &param);
 *
 * \return the value of the "rc" named Int.
 */ 
int Message::rc()
{
	int ans;
	if ( FindInt("rc", &ans ) != 0 ) return -1;
	return ans;
}
Exemplo n.º 13
0
int32 Message::FindInt(const char *name, 
			      int *anInt) const
{
	return FindInt( name, 0, anInt );
}