ComUserDlg.cpp
上传用户:yffx2008
上传日期:2014-10-12
资源大小:12414k
文件大小:2k
- // ComUserDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "GpsSC.h"
- #include "ComUserDlg.h"
- #include "ClientinfoSet.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CComUserDlg dialog
- CComUserDlg::CComUserDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CComUserDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CComUserDlg)
- m_strCommUserPassWord = _T("");
- m_strVehicleTelno = _T("");
- m_strPassWordOriginal = _T("");
- //}}AFX_DATA_INIT
- }
- void CComUserDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CComUserDlg)
- DDX_Control(pDX, IDC_VEHICLETELNO, m_ctrlVehicleTelNo);
- DDX_Text(pDX, IDC_COMMUSERPASSWORD, m_strCommUserPassWord);
- DDV_MaxChars(pDX, m_strCommUserPassWord, 6);
- DDX_CBString(pDX, IDC_VEHICLETELNO, m_strVehicleTelno);
- DDX_Text(pDX, IDC_PASSWORDORIGINAL, m_strPassWordOriginal);
- DDV_MaxChars(pDX, m_strPassWordOriginal, 6);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CComUserDlg, CDialog)
- //{{AFX_MSG_MAP(CComUserDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CComUserDlg message handlers
- BOOL CComUserDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- CString strVehicleNo;
- CClientinfoSet clientinfoset;
- BOOL HasGetTreeItemText=false;
- try
- {
- if(!clientinfoset.IsOpen())
- clientinfoset.Open();
- while(!clientinfoset.IsEOF())
- {
- strVehicleNo='('+clientinfoset.m_CarNumber+')'+clientinfoset.m_CarPhone;
- m_ctrlVehicleTelNo.AddString(strVehicleNo);
- if((str_GetTreeItemText==clientinfoset.m_CarNumber)||(str_GetTreeItemText==clientinfoset.m_ClientName))
- {
- str_GetTreeItemText=strVehicleNo;
- HasGetTreeItemText=true;
- }
- clientinfoset.MoveNext();
- }
- clientinfoset.Close();
- }
- catch(CDBException *Exp)
- {
- AfxMessageBox(Exp->ReportError());
- clientinfoset.Close();
- }
- //设置在树形控件所选子项
- if(HasGetTreeItemText)
- (m_ctrlVehicleTelNo.FindStringExact(0, str_GetTreeItemText )==CB_ERR ) ?
- m_ctrlVehicleTelNo.SetCurSel (-1):
- m_ctrlVehicleTelNo.SetCurSel (m_ctrlVehicleTelNo.FindStringExact(0,str_GetTreeItemText));
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }