ClearMgrDlg.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // learMgrDlg.cpp : 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "lyfzAttendance.h"
  5. #include "ClearMgrDlg.h"
  6. // ClearMgrDlg 对话框
  7. IMPLEMENT_DYNAMIC(CClearMgrDlg, CDialog)
  8. CClearMgrDlg::CClearMgrDlg(CWnd* pParent /*=NULL*/)
  9. : CDialog(CClearMgrDlg::IDD, pParent)
  10. , m_strAccount(_T(""))
  11. , m_strPSD(_T(""))
  12. {
  13. }
  14. CClearMgrDlg::~CClearMgrDlg()
  15. {
  16. }
  17. void CClearMgrDlg::DoDataExchange(CDataExchange* pDX)
  18. {
  19. CDialog::DoDataExchange(pDX);
  20. }
  21. BEGIN_MESSAGE_MAP(CClearMgrDlg, CDialog)
  22. ON_BN_CLICKED(IDCANCEL, &CClearMgrDlg::OnBnClickedCancel)
  23. ON_BN_CLICKED(IDOK, &CClearMgrDlg::OnBnClickedOk)
  24. END_MESSAGE_MAP()
  25. BOOL CClearMgrDlg::OnInitDialog()
  26. {
  27. CDialog::OnInitDialog();
  28. m_strAccount = _T("admin");
  29. ((CEdit*)GetDlgItem(IDC_account_EDIT))->SetWindowText(m_strAccount);
  30. return TRUE;
  31. }
  32. // ClearMgrDlg 消息处理程序
  33. //取消
  34. void CClearMgrDlg::OnBnClickedCancel()
  35. {
  36. // TODO: 在此添加控件通知处理程序代码
  37. OnCancel();
  38. }
  39. //确定
  40. void CClearMgrDlg::OnBnClickedOk()
  41. {
  42. // TODO: 在此添加控件通知处理程序代码
  43. if(MessageBox(_T("确定要清除所有管理员"), _T("提示"), MB_YESNO|MB_ICONQUESTION) == IDNO) //IDNO
  44. return;
  45. ((CEdit*)GetDlgItem(IDC_account_EDIT))->GetWindowText(m_strAccount);
  46. ((CEdit*)GetDlgItem(IDC_PSD_EDIT))->GetWindowText(m_strPSD);
  47. if(m_strPSD.GetLength() > 16)
  48. {
  49. MessageBox(_T("密码不能超过16位"));
  50. return;
  51. }
  52. OnOK();
  53. }