void CTestMachine::CheckViewOrderL(const CContactViewBase* aView, TBool aPrint, TBool aReverseOrder) { ASSERT(aView); const TInt numOfCont = aView->CountL(); TInt prevOrder = aReverseOrder ? 99 : -1; //used for first comparison //99 - More than items in database, -1 less than an index of first item for (TInt i=0; i < numOfCont; ++i) { const CViewContact& theContact = aView->ContactAtL(i); const TPtrC& theNum = theContact.Field(2); const TPtrC& theFamilyName = theContact.Field(0); if (aPrint) { //Print only if we asked to const TPtrC& theGivenName = theContact.Field(1); test.Printf(_L("%S %S, %S\n"), &theNum, &theFamilyName, &theGivenName); } //Order checking //The number of contact in alphabetically sorted list is given in MiddleName field TLex16 strOrder(theNum); TInt currOrder; TESTNOERRL(strOrder.Val(currOrder)) //Convert string to integer if (aReverseOrder) TESTTRUE(prevOrder > currOrder) //Descending order for reverse sorting else TESTTRUE(prevOrder < currOrder) //Ascending order for forward sorting prevOrder = currOrder; } }
void CIpoDlg::OnShowListCtrol(CString addr) { return; string strCommand,strShowData =""; strCommand = strprintf("%s %s %s","getappaccinfo" , theApp.m_ipoScritptid ,addr); Json::Value root; if(!CSoyPayHelp::getInstance()->SendRpc(strCommand,root)) { TRACE("UpdateAddressData rpccmd listaddr error"); return; } strShowData = root.toStyledString(); m_listCtrl.DeleteAllItems(); int pos = strShowData.find("FreeValues"); INT64 nMoney = 0; if (pos >0) { nMoney = root["FreeValues"].asInt64() ; } double money = (nMoney*1.0/COIN); strShowData = strprintf("可提现金额:%.8f",money); ((CStatic*)GetDlgItem(IDC_STATIC_AMOUNT))->SetWindowText(strShowData.c_str()); Invalidate(); Json::Value valuearray = root["vFreezedFund"]; int coulum = 0; for(unsigned int i =0;i<valuearray.size();i++) { int nSubIdx = 0; CString strOrder(""); strOrder.Format(_T("%d"), i+1); m_listCtrl.InsertItem(coulum,strOrder); nMoney = valuearray[i]["value"].asInt64() ; money = (nMoney*1.0/COIN); strShowData = strprintf("%.8f",money); m_listCtrl.SetItemText( coulum , ++nSubIdx, strShowData.c_str()) ; strShowData = strprintf("%d" , valuearray[i]["nHeight"].asInt()) ; m_listCtrl.SetItemText(coulum , ++nSubIdx , strShowData.c_str() ) ; coulum++; } }