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

📄 studentquerysubjectdlg.cpp

📁 学生管理系统 学生管理系统
💻 CPP
字号:
// StudentQuerySubjectDlg.cpp : implementation file
//

#include "stdafx.h"
#include "学生成绩管理系统.h"
//以下是手工添加的
#include "ScoresRS1.h"
#include "Public.h"
//以上是手工添加的
#include "StudentQuerySubjectDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CStudentQuerySubjectDlg dialog


CStudentQuerySubjectDlg::CStudentQuerySubjectDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CStudentQuerySubjectDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CStudentQuerySubjectDlg)
	m_studentQuerySubjectName = _T("");
	//}}AFX_DATA_INIT
}


void CStudentQuerySubjectDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CStudentQuerySubjectDlg)
	DDX_Control(pDX, IDC_STUDENT_QUERY_SUBRESULT, m_studentQuerySubResult);
	DDX_Text(pDX, IDC_STUDENT_QUERY_SUBJECT_NAME, m_studentQuerySubjectName);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CStudentQuerySubjectDlg message handlers

void CStudentQuerySubjectDlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData();
	if(!m_scoresSet.IsOpen())
	{
		m_scoresSet.Open();
	}
	m_scoresSet.m_strFilter.Format("ID='%s' and subject='%s'",CPublic::strName,m_studentQuerySubjectName);
	m_scoresSet.Requery();
	if (m_scoresSet.IsEOF()){
		if(m_studentQuerySubjectName=="")
			AfxMessageBox("请输入要查询的科目!");
		else
		   AfxMessageBox("没有关于您的这门的记录!");
	}
	else
	{
		m_studentQuerySubResult.ResetContent();
		CString table(";绩点:");
		CString content("成绩:");
		CString temp;
		temp.Format("%d",m_scoresSet.m_score);
		content+=temp;
		content+=table;
		content+=m_scoresSet.m_credit;
		m_studentQuerySubResult.AddString(content);
	}
//	CDialog::OnOK();
}

⌨️ 快捷键说明

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