// GetClientInfo.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "GetClientInfo.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // GetClientInfo dialog IDC_EDITtime2 GetClientInfo::GetClientInfo(CWnd* pParent /*=NULL*/) : CDialog(GetClientInfo::IDD, pParent) { //{{AFX_DATA_INIT(GetClientInfo) m_name1 = _T(""); m_name2 = _T(""); m_id = _T(""); m_ren = _T(""); m_birthday = _T(""); m_phone = _T(""); m_qq = _T(""); m_addr = _T(""); //}}AFX_DATA_INIT } void GetClientInfo::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(GetClientInfo) DDX_Control(pDX, IDC_COMBO5, m_combobox); DDX_Text(pDX, IDC_EDITname, m_name1); DDX_Text(pDX, IDC_EDITname2, m_name2); DDX_Text(pDX, IDC_EDITid, m_id); DDX_Text(pDX, IDC_EDITOren, m_ren); DDX_Text(pDX, IDC_EDITtaoxiname, m_taoxiname); DDX_Text(pDX, IDC_EDITBirthday2, m_birthday); DDX_Text(pDX, IDC_EDITphone, m_phone); DDX_Text(pDX, IDC_EDITqq, m_qq); DDX_Text(pDX, IDC_EDITaddr, m_addr); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(GetClientInfo, CDialog) //{{AFX_MSG_MAP(GetClientInfo) ON_CBN_SELCHANGE(IDC_COMBO5, OnSelchangeCombo5) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // GetClientInfo message handlers BOOL GetClientInfo::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here #ifdef CHILD_VERSION GetDlgItem(IDC_STATIC1)->SetWindowText("家长姓名:"); GetDlgItem(IDC_STATIC2)->SetWindowText("宝宝姓名:"); // GetDlgItem(IDC_STATIC10)->SetWindowText("引导师:"); #endif m_acCombo.Init(&m_combobox); g_sendhead.bsql = 0; g_sendhead.code[0] = 30; g_sendhead.tabcount = 1; g_pMainWnd->ProcessChatMessageRequest2(21); if (g_bSendOK == 0)return 0; DataToArray(&m_List1array); m_acCombo.m_pArray = &m_List1array; m_combobox.SetFocus(); this->CenterWindow(g_pMainWnd); return false; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void GetClientInfo::OnOK() { // TODO: Add extra validation here UpdateData(); CDialog::OnOK(); } void GetClientInfo::ClientChange() { CString filter = "id='" + id + "'"; g_sendhead.code[0] = 52; g_sendhead.tabcount = 1; g_sendhead.bsql = 0; g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return; DataToArray(&g_List1array); if (g_List1array.GetSize()) { m_id = id; m_name1 = g_List1array.ElementAt(0).ElementAt(1); m_name2 = g_List1array.ElementAt(0).ElementAt(2); if (g_List1array.ElementAt(0).ElementAt(4) != "") m_phone = g_List1array.ElementAt(0).ElementAt(4); else m_phone = g_List1array.ElementAt(0).ElementAt(3); if (g_List1array.ElementAt(0).ElementAt(12) != "") m_birthday = g_List1array.ElementAt(0).ElementAt(12); else m_birthday = g_List1array.ElementAt(0).ElementAt(11); if (g_List1array.ElementAt(0).ElementAt(6) != "") m_qq = g_List1array.ElementAt(0).ElementAt(6); else m_qq = g_List1array.ElementAt(0).ElementAt(5); if (g_List1array.ElementAt(0).ElementAt(8) != "") m_addr = g_List1array.ElementAt(0).ElementAt(8); else m_addr = g_List1array.ElementAt(0).ElementAt(7); m_sex = g_List1array.ElementAt(0).ElementAt(18); UpdateData(false); } } void GetClientInfo::OnSelchangeCombo5() { // TODO: Add your control notification handler code here int pos = m_combobox.GetCurSel(); if (pos == -1)return; if (m_acCombo.m_posarray.GetSize() <= pos)return; int pos2 = m_acCombo.m_posarray.ElementAt(pos); id = m_List1array.ElementAt(pos2).ElementAt(0); m_jiage = m_List1array.ElementAt(pos2).ElementAt(11); ClientChange(); }