📄 addnew.cpp
字号:
// AddNew.cpp : implementation file
//
#include "stdafx.h"
#include "system.h"
#include "AddNew.h"
#include "HELP.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAddNew dialog
CAddNew::CAddNew(CWnd* pParent /*=NULL*/)
: CDialog(CAddNew::IDD, pParent)
{
//{{AFX_DATA_INIT(CAddNew)
m_name = _T("");
m_month = _T("");
m_minzu = _T("");
m_lianxihaoma = _T("");
m_jiguan = _T("");
m_id = _T("");
m_department = _T("");
m_day = _T("");
m_beizhu = _T("");
m_college = _T("");
m_address = _T("");
m_waiyu = _T("");
m_waiyudengji = _T("");
m_xinshui = _T("");
m_year = -1;
m_zhiwei = _T("");
m_zhuanye = _T("");
m_xuewei = _T("");
//}}AFX_DATA_INIT
////////////////////////////////检测是否填写的BOOl量,初始化为FALSE/////////////////////////
changeaddress=changecollege=changeid=changejiguan= \
changelianxihaoma=changename=changewaiyu= \
changewaiyudengji=changezhuanye=changexinshui= \
changeyear=changemonth=changeday=changeminzu= \
changedepartment=changezhiwei=changexuewei= \
changenan=changenv=changedate=false;
/////////////////////////////////////////////////////////
}
void CAddNew::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAddNew)
DDX_Text(pDX, IDC_NAME, m_name);
DDX_CBString(pDX, IDC_MONTH, m_month);
DDX_CBString(pDX, IDC_MINZU, m_minzu);
DDX_Text(pDX, IDC_LIANXIHAOMA, m_lianxihaoma);
DDX_Text(pDX, IDC_JIGUAN, m_jiguan);
DDX_Text(pDX, IDC_ID, m_id);
DDX_CBString(pDX, IDC_DEPARTMENT, m_department);
DDX_CBString(pDX, IDC_DAY, m_day);
DDX_Text(pDX, IDC_BEIZHU, m_beizhu);
DDX_Text(pDX, IDC_COLLEGE, m_college);
DDX_Text(pDX, IDC_ADDRESS, m_address);
DDX_Text(pDX, IDC_WAIYU, m_waiyu);
DDX_Text(pDX, IDC_WAIYUDENGJI, m_waiyudengji);
DDX_Text(pDX, IDC_XINSHUI, m_xinshui);
DDX_CBIndex(pDX, IDC_YEAR, m_year);
DDX_CBString(pDX, IDC_ZHIWEI, m_zhiwei);
DDX_Text(pDX, IDC_ZHUANYE, m_zhuanye);
DDX_CBString(pDX, IDC_COMBO1, m_xuewei);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAddNew, CDialog)
//{{AFX_MSG_MAP(CAddNew)
ON_EN_CHANGE(IDC_ID, OnChangeId)
ON_EN_CHANGE(IDC_ADDRESS, OnChangeAddress)
ON_EN_CHANGE(IDC_COLLEGE, OnChangeCollege)
ON_EN_CHANGE(IDC_JIGUAN, OnChangeJiguan)
ON_EN_CHANGE(IDC_WAIYU, OnChangeWaiyu)
ON_EN_CHANGE(IDC_WAIYUDENGJI, OnChangeWaiyudengji)
ON_EN_CHANGE(IDC_ZHUANYE, OnChangeZhuanye)
ON_EN_CHANGE(IDC_LIANXIHAOMA, OnChangeLianxihaoma)
ON_EN_CHANGE(IDC_NAME, OnChangeName)
ON_EN_CHANGE(IDC_XINSHUI, OnChangeXinshui)
ON_CBN_SETFOCUS(IDC_COMBO1, Onchangexuewei)
ON_BN_CLICKED(IDC_NAN, OnNan)
ON_BN_CLICKED(IDC_NV, OnNv)
ON_CBN_SELENDOK(IDC_MINZU, OnSelendokMinzu)
ON_CBN_SELENDOK(IDC_YEAR, OnSelendokYear)
ON_CBN_SELENDOK(IDC_MONTH, OnSelendokMonth)
ON_CBN_SELENDOK(IDC_DAY, OnSelendokDay)
ON_CBN_SELENDOK(IDC_DEPARTMENT, OnSelendokDepartment)
ON_CBN_SELENDOK(IDC_ZHIWEI, OnSelendokZhiwei)
ON_BN_CLICKED(IDOK2, OnXinXi)
ON_NOTIFY(DTN_DATETIMECHANGE, IDC_TIME, OnDatetimechangeTime)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAddNew message handlers
void CAddNew::OnOK()
{
// TODO: Add extra validation here
if(!changename) MessageBox("请正确填写姓名",NULL,MB_ICONASTERISK);
else if(!changenan && !changenv) MessageBox("请选择性别",0,MB_ICONASTERISK);
else if(!changeminzu) MessageBox("请正确填写民族",0,MB_ICONASTERISK);
else if(!changeyear) MessageBox("请正确填写出生年份",0,MB_ICONASTERISK);
else if(!changemonth) MessageBox("请正确填写出生月份",0,MB_ICONASTERISK);
else if(!changeday) MessageBox("请正确填写出生日期",0,MB_ICONASTERISK);
else if(!changeid) MessageBox("请正确填写身份证号码",0,MB_ICONASTERISK);
else if(!changejiguan) MessageBox("请正确填写籍贯",0,MB_ICONASTERISK);
else if(!changeaddress) MessageBox("请正确填写家庭住址",0,MB_ICONASTERISK);
else if(!changecollege) MessageBox("请正确填写毕业院校",0,MB_ICONASTERISK);
else if(!changezhuanye) MessageBox("请正确填写专业",0,MB_ICONASTERISK);
else if(!changexuewei) MessageBox("请正确填写学位",0,MB_ICONASTERISK);
else if(!changewaiyu) MessageBox("请正确填写外语语种",0,MB_ICONASTERISK);
else if(!changewaiyudengji) MessageBox("请正确填写外语等级",0,MB_ICONASTERISK);
else if(!changexinshui) MessageBox("请正确填写薪水",0,MB_ICONASTERISK);
else if(!changelianxihaoma) MessageBox("请正确填写联系号码",0,MB_ICONASTERISK);
else if(!changedepartment) MessageBox("请正确填写所在部门",0,MB_ICONASTERISK);
else if(!changezhiwei) MessageBox("请正确填写职位",0,MB_ICONASTERISK);
else if(!changedate) MessageBox("请选择进入时间!",0,MB_ICONASTERISK);
//else if() MessageBox("");
else
{
GetDlgItem(IDC_TIME)->GetWindowText(m_time);
CDialog::OnOK();
}
}
void CAddNew::OnChangeId()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changeid=true;
// TODO: Add your control notification handler code here
}
void CAddNew::OnChangeAddress()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changeaddress=true;
// TODO: Add your control notification handler code here
}
void CAddNew::OnChangeCollege()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changecollege=true;
// TODO: Add your control notification handler code here
}
void CAddNew::OnChangeJiguan()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changejiguan=true;
// TODO: Add your control notification handler code here
}
void CAddNew::OnChangeWaiyu()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changewaiyu=true;
// TODO: Add your control notification handler code here
}
void CAddNew::OnChangeWaiyudengji()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changewaiyudengji=true;
// TODO: Add your control notification handler code here
}
void CAddNew::OnChangeZhuanye()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changezhuanye=true;
// TODO: Add your control notification handler code here
}
void CAddNew::OnChangeLianxihaoma()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changelianxihaoma=true;
// TODO: Add your control notification handler code here
}
void CAddNew::OnChangeName()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changename=true;
// TODO: Add your control notification handler code here
}
void CAddNew::OnChangeXinshui()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
changexinshui=true;
// TODO: Add your control notification handler code here
}
BOOL CAddNew::OnInitDialog()
{
CDialog::OnInitDialog();
//AfxRegisterWndClass(0,0,(HBRUSH)GetStockObject(GRAY_BRUSH),LoadIcon(NULL,IDI_QUESTION));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -