示例#1
0
void CSVSortList::enumGroup(string &szGroupIndex)
{
    list<string> lsGroupID;
    list<string>::iterator lsItem;
    OBJECT objGroup;

    base_param group;

    if(IsSVSEID(szGroupIndex))
    {
        objGroup = GetSVSE(szGroupIndex, m_szIDCUser, m_szIDCPwd);
        if(objGroup != INVALID_VALUE)
        {
            GetSubGroupsIDBySE(objGroup, lsGroupID);
            CloseSVSE(objGroup);
        }
    }
    else
    {
        objGroup = GetGroup(szGroupIndex, m_szIDCUser, m_szIDCPwd);
        if(objGroup != INVALID_VALUE)
        {
            GetSubGroupsIDByGroup(objGroup, lsGroupID);
            CloseGroup(objGroup);
        }
    }

    int nIndex = 0;
    for(lsItem = lsGroupID.begin(); lsItem != lsGroupID.end(); lsItem ++)
    {
        string szID = (*lsItem).c_str();
        bool bHasRight = true;
        if(m_pSVUser)
            bHasRight = m_pSVUser->haveGroupRight(szID, Tree_DEVICE);
        if(bHasRight)
        {
            objGroup = GetGroup(szID, m_szIDCUser, m_szIDCPwd);
            if(objGroup != INVALID_VALUE)
            {
                MAPNODE node = GetGroupMainAttribNode(objGroup);
                if(node != INVALID_VALUE)
                {
                    string szName (""), szIndex ("");
                    FindNodeValue(node, "sv_name", szName);
                    FindNodeValue(node, "sv_index", szIndex);
                    if(szIndex.empty())
                        nIndex = FindIndexByID(szID);
                    else
                        nIndex = atoi(szIndex.c_str());
                    group.szIndex = szID;
                    group.szName = szName;
                    m_sortList[nIndex] = group;
                }
                CloseGroup(objGroup);
            }
        }
    }
}
示例#2
0
void CCheckBoxTreeView::PushGroup(std::string strUserGroupRight, vector<string>& pUserRightVec )
{
    //bool bFirst= true;
    std::string  strParent= strUserGroupRight;
    vector<string> ::iterator plistitem;
    while(!IsSVSEID(strParent))
    {

        plistitem= find(pUserRightVec.begin(),pUserRightVec.end(),strParent);
        if(plistitem==pUserRightVec.end())
            pUserRightVec.push_back(strParent);
        strParent= FindParentID(strParent);

    }
    plistitem= find(pUserRightVec.begin(),pUserRightVec.end(),strParent);
    if(plistitem==pUserRightVec.end())
        pUserRightVec.push_back(strParent);


}