📄 userbaseinfodlg.cpp
字号:
// UserBaseInfoDlg.cpp : implementation file
//
#include "stdafx.h"
#include "CisoCA.h"
#include "UserBaseInfoDlg.h"
#include "UserMakeCertSheet.h"
#include "CisoCADoc.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CInfoReport InfoReport;
extern DWORD dwMoudleID;
/////////////////////////////////////////////////////////////////////////////
// CUserBaseInfoDlg dialog
IMPLEMENT_DYNCREATE(CUserBaseInfoDlg, CPropertyPage)
CUserBaseInfoDlg::CUserBaseInfoDlg(CWnd* pParent /*=NULL*/)
: CPropertyPage(CUserBaseInfoDlg::IDD)
{
//{{AFX_DATA_INIT(CUserBaseInfoDlg)
m_city = _T("");
m_country = _T("");
m_dept = _T("");
m_name = _T("");
m_org = _T("");
m_prov = _T("");
//}}AFX_DATA_INIT
pSheet = (CPropertySheet*)pParent;
}
void CUserBaseInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CUserBaseInfoDlg)
DDX_Text(pDX, IDC_USER_CITY, m_city);
DDX_Text(pDX, IDC_USER_CN, m_country);
DDX_Text(pDX, IDC_USER_DEPT, m_dept);
DDX_Text(pDX, IDC_USER_NAME, m_name);
DDX_Text(pDX, IDC_USER_ORG, m_org);
DDX_Text(pDX, IDC_USER_PROV, m_prov);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CUserBaseInfoDlg, CPropertyPage)
//{{AFX_MSG_MAP(CUserBaseInfoDlg)
ON_WM_SHOWWINDOW()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CUserBaseInfoDlg message handlers
LRESULT CUserBaseInfoDlg::OnWizardNext()
{
(GetDlgItem(IDC_USER_NAME))->GetWindowText(m_name);
if(m_name=="")
{
::MessageBox(NULL,"名字不能为空!","系统提示",
MB_OK|MB_ICONEXCLAMATION);
(GetDlgItem(IDC_USER_NAME))->SetFocus();
return -1L;
}
(GetDlgItem(IDC_USER_DEPT))->GetWindowText(m_dept);
if(m_dept.GetLength()<=0)
{
::MessageBox(NULL,"部门不能为空!","系统提示",
MB_OK|MB_ICONEXCLAMATION);
(GetDlgItem(IDC_USER_DEPT))->SetFocus();
return -1L;
}
(GetDlgItem(IDC_USER_ORG))->GetWindowText(m_org);
if(m_org.GetLength()<=0)
{
::MessageBox(NULL,"单位不能为空!","系统提示",
MB_OK|MB_ICONEXCLAMATION);
(GetDlgItem(IDC_USER_ORG))->SetFocus();
return -1L;
}
(GetDlgItem(IDC_USER_CITY))->GetWindowText(m_city);
if(m_city.GetLength()<=0)
{
::MessageBox(NULL,"所在城市不能为空!","系统提示",
MB_OK|MB_ICONEXCLAMATION);
(GetDlgItem(IDC_USER_CITY))->SetFocus();
return -1L;
}
(GetDlgItem(IDC_USER_PROV))->GetWindowText(m_prov);
if(m_prov.GetLength()<=0)
{
::MessageBox(NULL,"省份不能为空!","系统提示",
MB_OK|MB_ICONEXCLAMATION);
(GetDlgItem(IDC_USER_PROV))->SetFocus();
return -1L;
}
(GetDlgItem(IDC_USER_CN))->GetWindowText(m_country);
if(m_country.GetLength()<=0)
{
::MessageBox(NULL,"国家名字不能为空!","系统提示",
MB_OK|MB_ICONEXCLAMATION);
(GetDlgItem(IDC_USER_CN))->SetFocus();
return -1L;
}
return CPropertyPage::OnWizardNext();
}
BOOL CUserBaseInfoDlg::OnSetActive()
{
((CUserMakeCertSheet*)pSheet)->SetWizardButtons(PSWIZB_NEXT);
return CPropertyPage::OnSetActive();
}
void CUserBaseInfoDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CPropertyPage::OnShowWindow(bShow, nStatus);
// TODO: Add your message handler code here
char buf[MAX_CONF_LINE]={0};
CString str="";
CCisoCADoc* pDoc = (CCisoCADoc*)GetDocument();
// 单位
pDoc->m_pConF->GetValue("Org",buf);
str.Format("%s",buf);
(GetDlgItem(IDC_USER_ORG))->SetWindowText(str);
// 城市
pDoc->m_pConF->GetValue("City",buf);
str.Format("%s",buf);
(GetDlgItem(IDC_USER_CITY))->SetWindowText(str);
// 省份
pDoc->m_pConF->GetValue("Province",buf);
str.Format("%s",buf);
(GetDlgItem(IDC_USER_PROV))->SetWindowText(str);
// 国家
pDoc->m_pConF->GetValue("Country",buf);
str.Format("%s",buf);
(GetDlgItem(IDC_USER_CN))->SetWindowText(str);
}
CDocument* CUserBaseInfoDlg::GetDocument()
{
CMainFrame *pFrm =(CMainFrame*)((CCisoCAApp*)AfxGetApp())->m_pMainWnd;
return (CDocument*)pFrm->GetActiveDocument();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -