【求助】这段代码不理解,大家帮忙看看!
void CPaymentImpl::AddPayment(unsigned char nPSID, double fPayCount, double fPayAmt, const char *szPayNum){
CPosClientDB* pDB = CDataBaseManager::getConnection();
//一种支付方式只能使用一次
PayInfo *pInfo = GetPayInfo(nPSID);
if ( NULL != pInfo ) {
pInfo->fPayCount += fPayCount;
pInfo->fPayAmt += fPayAmt;
pInfo->fPayActualCount += fPayCount;
pInfo->fPayActualAmt += fPayAmt;
if ( strlen(pInfo->szPayNum) > 0 ) {
if(strstr(pInfo->szPayNum, szPayNum) == NULL
&& strlen(pInfo->szPayNum) + strlen(szPayNum) < sizeof(pInfo->szPayNum))
{//重复的Num就不加了
strcat(pInfo->szPayNum, ",");
strcat(pInfo->szPayNum, szPayNum);
}
} else {
strcpy(pInfo->szPayNum, szPayNum);
}
this->UpdateTempPayment(pDB, nPSID);
} else {
PayInfo info;
info.nSID = m_vecPay.size();
info.fPayCount = fPayCount;
info.fPayAmt = fPayAmt;
info.fPayActualCount = fPayCount;
info.fPayActualAmt = fPayAmt;
info.nPSID = nPSID;
if ( szPayNum != NULL ) {
strcpy(info.szPayNum, szPayNum);
}
m_vecPay.push_back(info);
pInfo = &m_vecPay[info.nSID];
this->SaveTempPayment(pDB, nPSID);
}
ReducePrecision(pInfo->fPayCount);
ReducePrecision(pInfo->fPayAmt);
ReducePrecision(pInfo->fPayActualCount);
ReducePrecision(pInfo->fPayActualAmt);
CDataBaseManager::closeConnection(pDB);
}
这段代码中就像注解的那样,有一些代码实现了“一种支付方式只能使用一次”的功能,现在实在找不到在哪里实现的,大哥大姐大爷大妈们请帮忙看看吧,我要取消这项限制,但是不知道这功能是在哪里实现的。。。谢谢各位了!