Example #1
0
//界面排序完毕
void CTuopList::SortOk()
{
	string strUserID = GetWebUserID();

	HitLog LogItem;
	LogItem.sUserName = strUserID;
	LogItem.sHitPro = "TuopList";
	LogItem.sHitFunc = "SortOk";
	LogItem.sDesc = strSaveSort;

	DWORD dcalBegin=GetTickCount();
	InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0);

	//数据有效性判断  如果编辑过程中 输入无效的序号 怎么处理?---》小于等于零  有重复数字 不连续 等?---》不容易完全判定清楚, 暂时不判定。
	
	//是数字吗?
	//if(!pAlertStop->text().empty())
	//{
	//	nRet = sscanf(pAlertStop->text().c_str(), "%d", &nTmp);
	//	if(nRet == EOF || nRet == 0 || nTmp < 0)
	//	{
	//		errorMsgList.push_back(strAlertStopError);
	//		bError = true;
	//	}
	//	else
	//	{				
	//		sprintf(chItem, "%d", nTmp);
	//		pAlertStop->setText(chItem);
	//	}
	//}

	//写拓扑图的顺序数据到ini
    for(row it = m_svSortList.begin(); it != m_svSortList.end(); it++)
    {
        SVTableCell * pcell = it->second.Cell(1);
        if(pcell)
        {
            // 修改每一项的选择状态
			if (pcell->Type() == adLineEdit)
            {
				//
				int nSort = 0;
				string strSortId = ((WLineEdit*)pcell->Value())->text();
				sscanf(strSortId.c_str(), "%d", &nSort);
				//OutputDebugString(pcell->Row());
				//OutputDebugString(strSortId.c_str());

				//
			#ifdef	 Tuopu
				WriteIniFileInt("sort", pcell->Row(), nSort, "tuopfile.ini");
			#else
				WriteIniFileInt("sort", pcell->Row(), nSort, "maintainfile.ini");
			#endif
            }
        }
    }

	
	//更新拓扑列表的数据
	//RecordList需要重新构造---》刷新函数能解决此问题吗?---》应该能解决
	refresh();

	//界面隐现
	pSortTable->hide();
	m_pTopologyListTable->show();

	DWORD dcalEnd1=GetTickCount();
	InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin);
}