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