for (UINT wCount = 0; wCount < pMan->aAccounts.wNumItems; wCount++)
{
CUserAccount *pAccount = (CUserAccount *)pMan->aAccounts.aItems.GetAt(wCount);
if (pAccount->csProfileName.Compare(pGroup->csProfileName) == 0 || pAccount->csSingleActive.Compare(pGroup->csName) == 0)
{
if (pAccount->_csUserGroup.CompareNoCase(_T("GrpAdmin")) != 0 && pAccount->_csUserGroup.CompareNoCase(_T("GrpOffice")) != 0)
{
pAccount->pFuncRestrictions->SetRestriction(Area1, Activity1);
pAccount->pFuncRestrictions->SetRestriction(Area2, Activity2);
pAccount->pFuncRestrictions->SetRestriction(Area3, Activity3);
pAccount->CreateInDatabase(pConnec);
}
}
}
Here, my code is calling CreateInDatabase twice for any user belonging to any group say ABC and DEF. So, if I have profile GHK and both of this groups use same profile then it is creating in database two entries. How to solve this issue. Any suggestions??