changesuspandinfodlg.cpp

来自「很好的系统,vc++ + ASSSE 系统」· C++ 代码 · 共 99 行

CPP
99
字号
// ChangeSuspandInfoDlg.cpp : implementation file
//

#include "stdafx.h"
#include "school.h"
#include "ChangeSuspandInfoDlg.h"
#include "classset.h"

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

/////////////////////////////////////////////////////////////////////////////
// CChangeSuspandInfoDlg dialog


CChangeSuspandInfoDlg::CChangeSuspandInfoDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CChangeSuspandInfoDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CChangeSuspandInfoDlg)
	m_strClass = _T("");
	m_strCode = _T("");
	m_strBrief = _T("");
	m_strName = _T("");
	m_strDate = _T("");
	m_strLong = _T("");
	//}}AFX_DATA_INIT
}


void CChangeSuspandInfoDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CChangeSuspandInfoDlg)
	DDX_Control(pDX, IDC_COMBO3_CLASS, m_ctrClass);
	DDX_CBString(pDX, IDC_COMBO3_CLASS, m_strClass);
	DDX_Text(pDX, IDC_EDIT1_CODE, m_strCode);
	DDX_Text(pDX, IDC_EDIT2_BRIEF, m_strBrief);
	DDX_Text(pDX, IDC_EDIT4_NAME, m_strName);
	DDX_Text(pDX, IDC_EDIT5_DATE, m_strDate);
	DDX_Text(pDX, IDC_EDIT5_LONG, m_strLong);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CChangeSuspandInfoDlg message handlers

BOOL CChangeSuspandInfoDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CClassSet recordset ;
	if(!recordset.Open(AFX_DB_USE_DEFAULT_TYPE,"select * from class"))
	{
		MessageBox("打开数据库失败!","数据库错误",MB_OK);
		return FALSE;
	}	
	while(!recordset.IsEOF())
	{
		m_ctrClass.AddString(recordset.m_code);
		recordset.MoveNext();
	}
	recordset.Close();		
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CChangeSuspandInfoDlg::OnOK() 
{
	UpdateData();
	if(m_strCode.IsEmpty())
	{
		AfxMessageBox("请输入编号!");
		return;
	}
	if(m_strClass.IsEmpty())
	{
		AfxMessageBox("请输入班级!");
		return;
	}

	if(m_strName.IsEmpty())
	{
		AfxMessageBox("请输入休学人姓名!");
		return;
	}
	
	CDialog::OnOK();
}

⌨️ 快捷键说明

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