jizhang.cpp

来自「1、 设计内容 设计一个个人日常记账系统:含编号、科目分类(费用分类)、摘要、」· C++ 代码 · 共 102 行

CPP
102
字号
// Jizhang.cpp : implementation file
//

#include "stdafx.h"
#include "zhouyong.h"
#include "Jizhang.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CJizhang dialog


CJizhang::CJizhang(CWnd* pParent /*=NULL*/)
	: CDialog(CJizhang::IDD, pParent)
{
	//{{AFX_DATA_INIT(CJizhang)
	m_strbianhao = _T("");
	m_strfenlei = _T("");
	m_strzhaiyao = _T("");
	m_strjine = _T("");
	m_strbeizhu = _T("");
	m_strzhishou = _T("");
	m_triqi = 0;
	//}}AFX_DATA_INIT
}


void CJizhang::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CJizhang)
	DDX_Control(pDX, IDC_COMBO2, m_combozhishou);
	DDX_Control(pDX, IDC_COMBO1, m_combofenlei);
	DDX_Text(pDX, IDC_EDIT2, m_strbianhao);
	DDX_CBString(pDX, IDC_COMBO1, m_strfenlei);
	DDX_Text(pDX, IDC_EDIT3, m_strzhaiyao);
	DDX_Text(pDX, IDC_EDIT4, m_strjine);
	DDX_Text(pDX, IDC_EDIT5, m_strbeizhu);
	DDX_CBString(pDX, IDC_COMBO2, m_strzhishou);
	DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_triqi);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CJizhang, CDialog)
	//{{AFX_MSG_MAP(CJizhang)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CJizhang message handlers

BOOL CJizhang::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	
		m_combofenlei.AddString("买菜");
		m_combofenlei.AddString("工资");
		m_combofenlei.AddString("当家教");
		m_combofenlei.AddString("买书");
		m_combozhishou.AddString("支出");
		m_combozhishou.AddString("收入");
        m_triqi=CTime(2007,5,20,0,0,0);
		UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CJizhang::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData();
if(m_strbianhao.IsEmpty())
{
	MessageBox("编号不能为空!");
	
}
if(m_strfenlei.IsEmpty())
{
	MessageBox("分类不能为空!");
	
}if(m_strjine.IsEmpty())
{
	MessageBox("金额不能为空!");

}	
if(m_strzhishou.IsEmpty())
{
	MessageBox("收支不能为空!");
	
}
else	
	CDialog::OnOK();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?