// Psw.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "Psw.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // Psw dialog Psw::Psw(CWnd* pParent /*=NULL*/) : CDialog(Psw::IDD, pParent) { //{{AFX_DATA_INIT(Psw) m_account = _T(""); m_psw = _T(""); m_psw2 = _T(""); m_psw3 = _T(""); //}}AFX_DATA_INIT } void Psw::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(Psw) DDX_Text(pDX, IDC_EDITaccount, m_account); DDX_Text(pDX, IDC_EDITpsw, m_psw); DDX_Text(pDX, IDC_EDITpsw2, m_psw2); DDX_Text(pDX, IDC_EDITpsw3, m_psw3); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(Psw, CDialog) //{{AFX_MSG_MAP(Psw) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Psw message handlers void Psw::OnOK() { // TODO: Add extra validation here UpdateData(); if(m_psw!=m_List1array.ElementAt (0).ElementAt (2)) { AfxMessageBox("¾ÉÃÜÂë´íÎó!", MB_ICONINFORMATION); return; } if(m_psw3!=m_psw2) { AfxMessageBox("ÐÂÃÜÂë²»Ò»ÖÁ!", MB_ICONINFORMATION); return; } CString sql; sql="update [user] set [psw]='"+m_psw3+"' where [account]='"+m_account+"'"; g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; CDialog::OnOK(); } BOOL Psw::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here g_sendhead.bsql=0; g_sendhead.code[0]=23; g_sendhead.tabcount=1; CString sql; sql="name='"+g_user.name+"'"; g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return 1; DataToArray(&m_List1array); if(m_List1array.GetSize ()==0) { CDialog::OnCancel (); return true; } m_account=m_List1array.ElementAt (0).ElementAt (0); UpdateData(false); this->CenterWindow (g_pMainWnd); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }