Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
editpassdlg.cpp
Package: 火车票预定.rar [view]
Upload User: syx6615
Upload Date: 2007-06-17
Package Size: 99k
Code Size: 2k
Category:
transportation applications
Development Platform:
Visual C++
- // editpassdlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ticketbook.h"
- #include "editpassdlg.h"
- #include "usenameset.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // editpassdlg dialog
- editpassdlg::editpassdlg(CWnd* pParent /*=NULL*/)
- : CDialog(editpassdlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(editpassdlg)
- m_name = _T("");
- m_pass1 = _T("");
- m_pass2 = _T("");
- m_pass3 = _T("");
- //}}AFX_DATA_INIT
- }
- void editpassdlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(editpassdlg)
- DDX_Text(pDX, IDC_name, m_name);
- DDX_Text(pDX, IDC_pass1, m_pass1);
- DDX_Text(pDX, IDC_pass2, m_pass2);
- DDX_Text(pDX, IDC_pass3, m_pass3);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(editpassdlg, CDialog)
- //{{AFX_MSG_MAP(editpassdlg)
- ON_BN_CLICKED(ID_editpass, Oneditpass)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // editpassdlg message handlers
- void editpassdlg::Oneditpass()
- {this->UpdateData(true);
- usenameset set;
- if(m_name=="")
- ::MessageBox(NULL,"用户名不能为空!","错误",MB_ICONINFORMATION);
- else{set.Open(CRecordset::dynaset,_T("select * from usename where use='"+m_name+"'"));
- if(set.MyGetRecordCount()<=0)
- {::MessageBox(NULL,"没有该用户!","错误",MB_ICONINFORMATION);
- return;}
- else{if(m_pass1==""||m_pass2==""||m_pass3=="")
- ::MessageBox(NULL,"请输入密码!","错误",MB_ICONINFORMATION);
- else{if(m_pass1!=set.m_passage)
- ::MessageBox(NULL,"旧密码不正确!","错误",MB_ICONINFORMATION);
- else{
- if(m_pass2!=m_pass3)
- ::MessageBox(NULL,"确认密码不正确!","错误",MB_ICONINFORMATION);
- else{
- set.Close();
- set.Open(CRecordset::dynaset,_T("select * from usename where use='"+m_name+"'"));
- set.Edit();
- set.m_passage=m_pass2;
- set.Update();
- ::MessageBox(NULL,"密码修改成功!","信息",MB_ICONINFORMATION);
- }}}}}}