XIUGMMDLG.CPP
资源名称:gongzi.rar [点击查看]
上传用户:ghostdhl
上传日期:2018-06-14
资源大小:9728k
文件大小:2k
源码类别:
数据库编程
开发平台:
Visual C++
- // Xiugmmdlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "GZGLXT.h"
- #include "Xiugmmdlg.h"
- #include "Czyxxb.h"
- #include "Login.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- extern CCzyxxb ffxxb;
- /////////////////////////////////////////////////////////////////////////////
- // CXiugmmdlg dialog
- CXiugmmdlg::CXiugmmdlg(CWnd* pParent /*=NULL*/)
- : CDialog(CXiugmmdlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CXiugmmdlg)
- m_opwd = _T("");
- m_npwd2 = _T("");
- m_npwd1 = _T("");
- //}}AFX_DATA_INIT
- m_hIcon = AfxGetApp()->LoadIcon(IDI_XIUGMMICON);
- }
- void CXiugmmdlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CXiugmmdlg)
- DDX_Control(pDX, IDC_NAME, m_name);
- DDX_Text(pDX, IDC_EDIT1, m_opwd);
- DDX_Text(pDX, IDC_EDIT3, m_npwd2);
- DDX_Text(pDX, IDC_EDIT2, m_npwd1);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CXiugmmdlg, CDialog)
- //{{AFX_MSG_MAP(CXiugmmdlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CXiugmmdlg message handlers
- void CXiugmmdlg::OnOK()
- {
- // TODO: Add extra validation here
- UpdateData(true);
- CString name;
- m_name.GetWindowText(name);
- if(m_opwd=="")
- {
- MessageBox("请输入旧密码","工资管理系统");
- return;
- }
- if(m_npwd1=="")
- {
- MessageBox("请输入新密码","工资管理系统");
- return;
- }
- if(m_npwd2=="")
- {
- MessageBox("请确认新密码","工资管理系统");
- return;
- }
- if(m_npwd1!=m_npwd2)
- {
- MessageBox("两次输入密码不同","工资管理系统");
- return;
- }
- CCzyxxb xxb;
- if(xxb.HaveCzy(name,m_opwd)!=1)
- {
- MessageBox("用户或密码错误","工资管理系统");
- return;
- }
- else
- {
- xxb.SetPwd(m_npwd1);
- xxb.sql_updatepwd(name);
- MessageBox("密码修改成功,下次登录请用新密码","工资管理系统");
- }
- UpdateData(false);
- CDialog::OnOK();
- }
- BOOL CXiugmmdlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- SetIcon(m_hIcon, TRUE);
- m_name.SetWindowText(ffxxb.GetCzyName());
- UpdateData(false);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- BOOL CXiugmmdlg::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- if(pMsg->message==WM_KEYDOWN && pMsg->wParam==13)
- pMsg->wParam=9;
- return CDialog::PreTranslateMessage(pMsg);
- }