⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 studentinfodlg.cpp

📁 学校社团管理系统Visual C
💻 CPP
字号:
/**
 * <p> Title: 增加,修改,查看学生信息的窗口类实现 </p>
 * <p> Description:提供显示学生信息功能 </p>
 * <p> Copyright: Copyright (c) 2005-12-17 </p>
 * <p> Company: bjut </p>
 * @author gaok
 * @version 1.0 
 * @Created on 2005-12-17
 */

#include "stdafx.h"
#include "STMis.h"
#include "StudentInfoDlg.h"
#include "AddStMsgRSet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CStudentInfoDlg dialog

/*
 * 构造函数
 */
CStudentInfoDlg::CStudentInfoDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CStudentInfoDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CStudentInfoDlg)
	m_strCode = _T("");
	m_strName = _T("");
	m_strSt = _T("");
	m_strSex = _T("");
	m_strEmail = _T("");
	m_strPhone = _T("");
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CStudentInfoDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CStudentInfoDlg)
	DDX_Control(pDX, IDC_EDIT_STUDENTCODE, m_ctrCode);
	DDX_Text(pDX, IDC_EDIT_STUDENTCODE, m_strCode);
	DDX_Text(pDX, IDC_EDIT_STUNAME, m_strName);
	DDX_Control(pDX, IDC_COMBO_SEX, m_ctrSex);
	DDX_CBString(pDX, IDC_COMBO_SEX, m_strSex);
	DDX_Text(pDX, IDC_EDIT_PHONE, m_strPhone);
	DDX_Text(pDX, IDC_EDIT_EMAIL, m_strEmail);
	DDX_Control(pDX, IDC_COMBO_ST, m_ctrSt);
	DDX_CBString(pDX, IDC_COMBO_ST, m_strSt);
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CStudentInfoDlg, CDialog)
	//{{AFX_MSG_MAP(CStudentInfoDlg)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CStudentInfoDlg message handlers
BOOL CStudentInfoDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CAddStMsgRSet m_recordset(&m_database); // 连接数据库
	CString strSQL;
	strSQL="select * from ST where ST_SCBZ=false";
	if(!m_recordset.Open(AFX_DB_USE_DEFAULT_TYPE,strSQL))
	{
		MessageBox("打开数据库失败!","数据库错误",MB_OK);

	}	
	while(!m_recordset.IsEOF())
	{
		m_ctrSt.AddString(m_recordset.m_ST_ZZMC);
		m_recordset.MoveNext();
	}
	m_database.Close();
	
	if(!m_strCode.IsEmpty())
	{ // 初始化文本框中得内容
		m_bNew = FALSE;
		m_ctrCode.EnableWindow(FALSE);
	}
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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