www.pudn.com > 111.rar > DialogSelectRecord.cpp


// 
/****************************************/ 
/*		SchoolManageSystem			    */ 
/*设计者:全佳营						*/ 
/*时间:2004.5.9-2004-5.18				*/ 
/*Email:ghostman@tzc.edu.cn				*/ 
/****************************************/ 
// DialogSelectRecord.cpp : 实现文件 
// 
 
#include "stdafx.h" 
#include "SchoolManageSys_2.h" 
#include "DialogSelectRecord.h" 
#include ".\dialogselectrecord.h" 
#include "AdoConnection.h" 
#include "DataGridShow.h" 
// CDialogSelectRecord 对话框 
 
IMPLEMENT_DYNAMIC(CDialogSelectRecord, CDialog) 
CDialogSelectRecord::CDialogSelectRecord(CWnd* pParent /*=NULL*/) 
	: CDialog(CDialogSelectRecord::IDD, pParent) 
{ 
} 
 
CDialogSelectRecord::~CDialogSelectRecord() 
{ 
} 
 
void CDialogSelectRecord::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	DDX_Control(pDX, IDC_COMBO1, m_sRecord); 
} 
 
 
BEGIN_MESSAGE_MAP(CDialogSelectRecord, CDialog) 
	ON_CBN_SELCHANGE(IDC_COMBO1, OnCbnSelchangeCombo1) 
	ON_BN_CLICKED(IDOK, OnBnClickedOk) 
END_MESSAGE_MAP() 
 
 
// CDialogSelectRecord 消息处理程序 
BOOL CDialogSelectRecord::OnInitDialog(){ 
	CDialog::OnInitDialog(); 
	theApp.m_pSkin->ApplySkin((long)m_hWnd); 
	m_sRecord.AddString("学院记录集"); 
	m_sRecord.AddString("系别记录集"); 
	m_sRecord.AddString("班级记录集"); 
	m_sRecord.AddString("课程记录集"); 
	m_sRecord.AddString("借书记录集"); 
	m_sRecord.AddString("教师记录集"); 
	m_sRecord.AddString("课程记录集"); 
	m_sRecord.AddString("社团记录集"); 
	m_sRecord.AddString("学生记录集"); 
	m_sRecord.AddString("schooldata数据库操作用户"); 
	m_sRecord.SetCurSel(0); 
	return TRUE; 
} 
 
void CDialogSelectRecord::OnCbnSelchangeCombo1() 
{ 
	// TODO: 在此添加控件通知处理程序代码 
	UpdateData(); 
	CWnd *pWnd=CWnd::FindWindow(NULL,"网格显示数据"); 
	 
	m_sRecord.GetLBText(m_sRecord.GetCurSel(),m_nRecord); 
	if(m_nRecord=="选择记录"){ 
		AfxMessageBox("请选一个选项"); 
		return; 
	} 
	((CDataGridShow*) pWnd)->m_nRecord=m_nRecord; 
} 
 
void CDialogSelectRecord::OnBnClickedOk() 
{ 
	// TODO: 在此添加控件通知处理程序代码 
	UpdateData(); 
	if(m_sRecord.GetCurSel()==0){ 
		AfxMessageBox("请选一个选项"); 
		return; 
	} 
	OnOK(); 
}