bool CWizDatabase::updateBizUsers(const CWizBizUserDataArray& arrayUser)
{
    // TODO: delete users not exist on remote
    if (arrayUser.empty())
        return false;

    bool bHasError = false;
    CWizBizUserDataArray::const_iterator it;
    for (it = arrayUser.begin(); it != arrayUser.end(); it++)
    {
        const WIZBIZUSER& user = *it;
        if (!updateBizUser(user)) {
            bHasError = true;
        }
    }

    return !bHasError;
}
Beispiel #2
0
bool CWizIndexBase::userFromGUID(const QString& strUserGUID,
                                 CWizBizUserDataArray& arrayUser)
{
    CString strWhere;
    strWhere.Format("USER_GUID=%s", STR2SQL(strUserGUID).utf16());

    CString strSQL = FormatQuerySQL(TABLE_NAME_WIZ_USER,
                                    FIELD_LIST_WIZ_USER,
                                    strWhere);

    if (!SQLToBizUserDataArray(strSQL, arrayUser)) {
        TOLOG("[userFromGUID] failed to get user by user guid");
        return false;
    }

    if (arrayUser.empty())
        return false;

    return true;
}
Beispiel #3
0
bool CWizIndexBase::userFromGUID(const QString& bizGUID,
                                 const QString& userGUID,
                                 WIZBIZUSER& user)
{
    CString strWhere = "BIZ_GUID=%1 AND USER_GUID=%2";
    strWhere = strWhere.arg(STR2SQL(bizGUID)).arg(STR2SQL(userGUID));

    CString strSQL = FormatQuerySQL(TABLE_NAME_WIZ_USER,
                                    FIELD_LIST_WIZ_USER,
                                    strWhere);

    CWizBizUserDataArray arrayUser;
    if (!SQLToBizUserDataArray(strSQL, arrayUser)) {
        TOLOG("[userFromGUID] failed to get user by user guid");
        return false;
    }

    if (arrayUser.empty())
        return false;

    user = arrayUser[0];
    return true;
}