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

📄 haxun.cpp

📁 成绩管理系统,用VC和SQL 2000开发
💻 CPP
字号:
// HAXUN.cpp : implementation file
//

#include "stdafx.h"
#include "成绩管理系统.h"
#include "成绩管理系统Dlg.h"
#include "HAXUN.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
	CString cxlb,zl,tj,gjz;//
	CString CXSQL;
	bool k;
/////////////////////////////////////////////////////////////////////////////
// CHAXUN dialog


CHAXUN::CHAXUN(CWnd* pParent /*=NULL*/)
	: CDialog(CHAXUN::IDD, pParent)
{
	//{{AFX_DATA_INIT(CHAXUN)
	//}}AFX_DATA_INIT
}


void CHAXUN::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CHAXUN)
	DDX_Control(pDX, IDOK, m_ok);
	DDX_Control(pDX, IDC_CXSTU_ZL, m_CXSTU_ZL);
	DDX_Control(pDX, IDC_CXSTU_TJ, m_CXSTU_TJ);
	DDX_Control(pDX, IDC_CXSTU_GJZ, m_CXSTU_GJZ);
	DDX_Control(pDX, IDC_CXSC_ZL, m_CXSC_ZL);
	DDX_Control(pDX, IDC_CXSC_TJ, m_CXSC_TJ);
	DDX_Control(pDX, IDC_CXSC_GJZ, m_CXSC_GJZ);
	DDX_Control(pDX, IDC_CXKC_ZL, m_CXKC_ZL);
	DDX_Control(pDX, IDC_CXKC_TJ, m_CXKC_TJ);
	DDX_Control(pDX, IDC_CXKC_GJZ, m_CXKC_GJZ);
	DDX_Control(pDX, IDC_CX_LB, m_CX_LB);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CHAXUN, CDialog)
	//{{AFX_MSG_MAP(CHAXUN)
	ON_WM_CANCELMODE()
	ON_CBN_SELCHANGE(IDC_CX_LB, OnSelchangeCxLb)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHAXUN message handlers

void CHAXUN::OnOK() 
{
	// TODO: Add extra validation here
	m_CX_LB.GetLBText(m_CX_LB.GetCurSel(),cxlb);
//	CString zl,tj,gjz;
	if(cxlb=="学生资料")
	{
       m_CXSTU_ZL.GetWindowText(zl);
	   m_CXSTU_TJ.GetWindowText(tj);
	   m_CXSTU_GJZ.GetWindowText(gjz);
       CXSQL.Format("select * from v_student where %s %s '%s' ORDER BY 学号 DESC",zl,tj,gjz);
	}
	if(cxlb=="课程表")
	{
       m_CXKC_ZL.GetWindowText(zl);
	   m_CXKC_TJ.GetWindowText(tj);
	   m_CXKC_GJZ.GetWindowText(gjz);
       CXSQL.Format("select * from v_course where %s %s '%s' ORDER BY 课程号 DESC",zl,tj,gjz);
	}
	if(cxlb=="选修课成绩表")
	{
	   m_CXSC_ZL.GetWindowText(zl);
	   m_CXSC_TJ.GetWindowText(tj);
	   m_CXSC_GJZ.GetWindowText(gjz);
       CXSQL.Format("select * from v_sc where %s %s '%s' ORDER BY 学号 DESC",zl,tj,gjz);
	}
	k=true;
	CDialog::OnOK();
}

BOOL CHAXUN::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_ok.EnableWindow(false);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CHAXUN::OnCancelMode() 
{
	CDialog::OnCancelMode();
	
	// TODO: Add your message handler code here
	
}

//DEL void CHAXUN::disablestu()
//DEL {
//DEL    m_STU_XH.EnableWindow(false);
//DEL    m_STU_XM.EnableWindow(false);
//DEL    m_STU_NL.EnableWindow(false);
//DEL    m_STU_XB.EnableWindow(false);
//DEL    m_STU_SZX.EnableWindow(false);
//DEL }

//DEL void CHAXUN::disablekc()
//DEL {
//DEL   m_KC_KCH.EnableWindow(false);
//DEL   m_KC_KCM.EnableWindow(false);
//DEL   m_KC_RKLS.EnableWindow(false);
//DEL   m_KC_XF.EnableWindow(false);
//DEL }

//DEL void CHAXUN::disablecjb()
//DEL {
//DEL  m_CJ_XH.EnableWindow(false);
//DEL  m_CJ_KCH.EnableWindow(false);
//DEL  m_CJ_KSCJ.EnableWindow(false);
//DEL  m_CJ_PSCJ.EnableWindow(false);
//DEL  m_CJ_ZPCJ.EnableWindow(false);
//DEL  m_BK.EnableWindow(false);
//DEL  m_CX.EnableWindow(false);
//DEL }

void CHAXUN::OnSelchangeCxLb() 
{
	// TODO: Add your control notification handler code here
    m_ok.EnableWindow(true);	
}

⌨️ 快捷键说明

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