📄 studentqueryalldlg.cpp
字号:
// StudentQueryAllDlg.cpp : implementation file
//
#include "stdafx.h"
#include "学生成绩管理系统.h"
//以下是手工添加的
#include "ScoresRS1.h"
#include "Public.h"
//以上是手工添加的
#include "StudentQueryAllDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStudentQueryAllDlg dialog
CStudentQueryAllDlg::CStudentQueryAllDlg(CWnd* pParent /*=NULL*/)
: CDialog(CStudentQueryAllDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CStudentQueryAllDlg)
//}}AFX_DATA_INIT
}
void CStudentQueryAllDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStudentQueryAllDlg)
DDX_Control(pDX, IDC_STUDENT_QUERY_ALL_RESULT, m_studentQueryAllResult);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CStudentQueryAllDlg, CDialog)
//{{AFX_MSG_MAP(CStudentQueryAllDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStudentQueryAllDlg message handlers
void CStudentQueryAllDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData();
CString table1("科目:");
CString table2(";成绩:");
CString table3(":绩点:");
CString content;
if(!m_scoresSet.IsOpen())
m_scoresSet.Open();
m_scoresSet.m_strFilter.Format("ID='%s'",CPublic::strName);
m_scoresSet.Requery();
if(m_scoresSet.IsEOF())
AfxMessageBox("很抱歉,您还没参加过考试!");
else
{
m_studentQueryAllResult.ResetContent();
while (!m_scoresSet.IsEOF())
{
content+=table1;
content+=m_scoresSet.m_subject;
content+=table2;
CString temp;
temp.Format("%d",m_scoresSet.m_score);
content+=temp;
content+=table3;
content+=m_scoresSet.m_credit;
m_studentQueryAllResult.AddString(content);
content.Empty();
m_scoresSet.MoveNext();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -