Esempio n. 1
0
void CVisitor::AddToBlackList(TNotifyUI& msg)
{
	CListContainerElementUI* pContainer = (CListContainerElementUI*)msg.pSender->GetTag();
	CLabelUI* pID = static_cast<CLabelUI*>(m_pManager->FindSubControlByName(pContainer,_T("VisitorIdentity")));
	std::string	strID = pID->GetText().GetStringA();
	CLabelUI* pName = static_cast<CLabelUI*>(m_pManager->FindSubControlByName(pContainer,_T("Visitorname")));
	std::string	strName = pName->GetText().GetStringA();
	CLabelUI* pAddr = static_cast<CLabelUI*>(m_pManager->FindSubControlByName(pContainer,_T("VisitorAddr")));
	std::string strAddr = pAddr->GetText().GetStringA();
	CLabelUI* pPhone = static_cast<CLabelUI*>(m_pManager->FindSubControlByName(pContainer,_T("VisitorMobile")));
	std::string strPhone = pPhone->GetText().GetStringA();
	CLabelUI* pGender = static_cast<CLabelUI*>(m_pManager->FindSubControlByName(pContainer,_T("VisitorGender")));
	std::string strGender = pGender->GetText().GetStringA();
	if (strGender == "男")
	{
		strGender = "1";
	}
	else
	{
		strGender = "2";
	}
	std::string y = "'";
	std::string d = ",";
	std::string strsql = "insert into blacklist(name,identity_num,gender,address,phone) values("+y+strName+y+d+y+strID+y+d+y+strGender+y+d+y+strAddr+y+d+y+strPhone+y+")";
	CLoginWnd::m_mySql.Execute(strsql);
	std::string sqlstr = "delete from visitor where identity_num="+y+strID+y;
	CLoginWnd::m_mySql.Execute(sqlstr);
	Paging();
}
Esempio n. 2
0
void SessionLayout::_GetGroupNameListByShortName(IN const CString& sShortName, OUT std::vector<string>& nameList)
{
	for (int n = 0; n < m_pGroupMemberList->GetCount();++n)
	{
		CListContainerElementUI* pListElement = static_cast<CListContainerElementUI*>(m_pGroupMemberList->GetItemAt(n));
		if (pListElement)
		{
			CLabelUI* pNameLable = static_cast<CLabelUI*>(pListElement->FindSubControl(_T("nickname")));
			if (!pNameLable)
			{
				continue;;
			}
			CString Name = pNameLable->GetText();
			std::string sid = util::cStringToString(CString(pListElement->GetUserData()));

			if (util::isIncludeChinese(util::cStringToString(sShortName, CP_ACP)))//检索中文
			{
				if (Name.Find(sShortName) != -1)
				{
					nameList.push_back(sid);
				}
			}
			else//检索字母
			{
				CString firstPY = util::HZ2FirstPY(util::cStringToString(Name, CP_ACP));
				if (firstPY.Find(sShortName) != -1)//先检索简拼
				{
					nameList.push_back(sid);
				}
				else
				{
					CString allPY = util::HZ2AllPY(Name);//再检索全拼
					if (allPY.Find(sShortName) != -1)
					{
						nameList.push_back(sid);
					}
				}
			}
		}
	}
}
Esempio n. 3
0
void MessageBoxWhd::InitWindow()
{
    CLabelUI* pLbl = NULL;
    CControlUI* pCtl = NULL;
    if (m_uType == Info)
    {
         pLbl = static_cast<CLabelUI*> (m_PaintManager.FindControl(_T("lab_msg_info")));
         pCtl =  static_cast<CLabelUI*> (m_PaintManager.FindControl(_T("ctl_msg_info")));
    }
    else if (m_uType == Warn)
    {
        pLbl = static_cast<CLabelUI*> (m_PaintManager.FindControl(_T("lab_msg_warn")));
        pCtl = static_cast<CLabelUI*> (m_PaintManager.FindControl(_T("ctl_msg_warn")));
    }
    else if (m_uType == Error)
    {
        pLbl = static_cast<CLabelUI*> (m_PaintManager.FindControl(_T("lab_msg_error")));
        pCtl =  static_cast<CLabelUI*> (m_PaintManager.FindControl(_T("ctl_msg_error")));
    }
    pLbl->SetVisible(true);
    pCtl->SetVisible(true);

    std::stringstream ss;
    ss<<"lbl_msg_"<<m_uMsgCode;
    CLabelUI* pTextUI = static_cast<CLabelUI*> (m_PaintManager.FindControl(Base::CharacterSet::ANSIToUnicode(ss.str()).c_str()));
    if (pTextUI)
    {
        pTextUI->SetVisible(true);
        if (!m_dstrExMsg.IsEmpty())
        {
            CDuiString theMsg = pTextUI->GetText();
            theMsg.Replace(_T("$"), m_dstrExMsg);
            pTextUI->SetText(theMsg);
        }
    }
}