1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #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::Psw(CWnd* pParent )
- : CDialog(Psw::IDD, pParent)
- {
-
- m_account = _T("");
- m_psw = _T("");
- m_psw2 = _T("");
- m_psw3 = _T("");
-
- }
- void Psw::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
-
- 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);
-
- }
- BEGIN_MESSAGE_MAP(Psw, CDialog)
-
-
- END_MESSAGE_MAP()
- void Psw::OnOK()
- {
-
- 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();
-
- 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;
-
- }
|