void CSearchView::ResetResultIndex()
{
	m_PageCont=0;
	m_CurPageIndex=0;
	m_RecordsCount=0;
	m_PageRowIndex=1;
	SetPageState();
	m_CurPageIndex=1;
}
BOOL CSearchView::QueryShowRecords()
{
	HWND hWnd=this->GetSafeHwnd();
	if(m_CurPageIndex>m_PageCont)m_CurPageIndex=1;
	int start_index=(m_CurPageIndex-1)*MAX_RECORDS_NUM;

	wstring szLimit;
	wchar_t szPos[255];
	swprintf(szPos,255,L"%d",start_index);
	szLimit=szPos;
	swprintf(szPos,255,L"%d",MAX_RECORDS_NUM);
	szLimit =szLimit+L","+szPos;

	DeleteContentRow();

	int colNum=(int)CGlobal::GetDBTableMap(m_Table).size();
	if(m_pSQLDriver->ReadTableSegmentWithCondition(m_Table,
		m_Condition.c_str(),szLimit.c_str(),colNum,&m_vGridContent))
	{
		int colindex=0;
		int rowindex=0;
		while(rowindex<(int)m_vGridContent.size())
		{
			SET_PB_POS(hWnd,rowindex);
			InsertBlanRow();
			for(colindex=0;colindex<colNum;colindex++)
			{
				if(colindex==0)
				{
					int rownum=m_RecordsCount-(m_CurPageIndex-1)*MAX_RECORDS_NUM-rowindex;
					TCHAR szIndex[255];
					_itow_s(rownum,szIndex,10);
					wstring szNum=szIndex;
					m_GridCtrl.SetItemText(m_PageRowIndex,0,szNum.c_str());			
				}else{
					LPCTSTR str=m_vGridContent[rowindex][colindex].c_str();
					m_GridCtrl.SetItemText(m_PageRowIndex,colindex,str);					
				}
			}		
			rowindex++;	
		}
		SET_PB_POS(hWnd,MAX_RECORDS_NUM);
		m_vGridContent.clear();
		Sleep(1000);
		UpdateDlgGridData();
		SetPageState();

		return TRUE;
	}

	return FALSE;

}
Ejemplo n.º 3
0
void ShopCityMsgMgr::Receive_PageOpen(CMessage *pMsg)
{
	if(GetGame()->GetMainPlayer() && GetGame()->GetGameControl())
	{
		GetGame()->GetGameControl()->AutoAttactStop();//停止自动攻击
		GetGame()->GetGameControl()->AutoMoveStop();//停止自动移动
		GetGame()->GetGameControl()->StopMove();//停止移动
	}
	BYTE bFlag = pMsg->GetByte();//服务器返回是否打开成功
	if(bFlag == 1)
	{
		IsPageOpen = true;
		if(dt)//不为空,进行数据解码
			dt->DecodeFromDataBlock(pMsg);
		//解码完成通知打开界面
		FireUIEvent(SHOPCITY_PAGE_NAME,EVENT_OPEN);
		SetPageState(true);
	}
	else
	{
		FireUIEvent(SHOPCITY_PAGE_NAME,EVENT_OPEN);
		SetPageState(true);
	}
}
Ejemplo n.º 4
0
void ShopCityMsgMgr::Receive_PageClose(CMessage* pMsg)
{
	FireUIEvent(SHOPCITY_PAGE_NAME,EVENT_CLOSE);
	SetPageState(false);
}