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

📄 mainfrm.cpp

📁 学生管理系统 学生管理系统
💻 CPP
字号:
// MainFrm.cpp : implementation of the CMainFrame class
//

#include "stdafx.h"
#include "学生成绩管理系统.h"

#include "Public.h"
#include "BookEnterOneDlg.h"//1这是手工添加的
#include "EditScoreDlg.h"//2这是手工添加的
#include "DeleteSbScoreDlg.h"//3这是手工添加的
#include "DeleteSbAllScoresDlg.h"//4这是手工添加的
#include "DeleteSubjectScoresDlg.h"//5这是手工添加的
#include "DeleteCategoryScoresDlg.h"//6这是手工添加的
#include "ScoresEnterMassDlg.h"//7这是手工添加的
#include "EditStudentCodeDlg.h"//8这是手工添加的
#include "AddStudentSingleDlg.h"//9这是手工添加的
#include "AddStudentMassDlg.h"//10这是手工添加的
#include "StudentQuerySubjectDlg.h"//11这是手工添加的
#include "StudentQueryAllDlg.h"//12这是手工添加的
#include "AdminQueryStudentScoreDlg.h"//13这是手工添加的
#include "AdminQueryStudentInfDlg.h"//14这是手工添加的
#include "MainFrm.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMainFrame

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
	//{{AFX_MSG_MAP(CMainFrame)
	ON_WM_CREATE()
	ON_COMMAND(ID_SCORE_ENTER_ONE, OnScoreEnterOne)
	ON_COMMAND(ID_SCORE_EDIT, OnScoreEdit)
	ON_COMMAND(ID_DELETE_SB_SUBJECT, OnDeleteSbSubject)
	ON_COMMAND(ID_DELETE_SB_ALL_SOCRES, OnDeleteSbAllSocres)
	ON_COMMAND(ID_DELETE_SUBJECT_ALL_SCORES, OnDeleteSubjectAllScores)
	ON_COMMAND(ID_DELETE_CATEGORY_ALL_SCORES, OnDeleteCategoryAllScores)
	ON_COMMAND(ID_SCORE_ENTER_MASS, OnScoreEnterMass)
	ON_COMMAND(ID_EDIT_STUDENT_CODE, OnEditStudentCode)
	ON_COMMAND(ID_ADD_STUDENT_SINGLE, OnAddStudentSingle)
	ON_COMMAND(ID_ADD_STUDENT_MASS, OnAddStudentMass)
	ON_COMMAND(ID_QUERY_STUDENT_SUBJECT, OnQueryStudentSubject)
	ON_COMMAND(ID_QUERY_STUDENT_ALL, OnQueryStudentAll)
	ON_UPDATE_COMMAND_UI(ID_ADD_STUDENT_SINGLE, OnUpdateAddStudentSingle)
	ON_UPDATE_COMMAND_UI(ID_ADD_STUDENT_MASS, OnUpdateAddStudentMass)
	ON_COMMAND(ID_ADMIN_QUERY_STUDENT_SCORES, OnAdminQueryStudentScores)
	ON_COMMAND(ID_ADMIN_QUERY_STUDENT_INF, OnAdminQueryStudentInf)
	ON_UPDATE_COMMAND_UI(ID_ADMIN_QUERY_STUDENT_INF, OnUpdateAdminQueryStudentInf)
	ON_UPDATE_COMMAND_UI(ID_ADMIN_QUERY_STUDENT_SCORES, OnUpdateAdminQueryStudentScores)
	ON_UPDATE_COMMAND_UI(ID_DELETE_CATEGORY_ALL_SCORES, OnUpdateDeleteCategoryAllScores)
	ON_UPDATE_COMMAND_UI(ID_DELETE_SB_ALL_SOCRES, OnUpdateDeleteSbAllSocres)
	ON_UPDATE_COMMAND_UI(ID_DELETE_SB_SUBJECT, OnUpdateDeleteSbSubject)
	ON_UPDATE_COMMAND_UI(ID_DELETE_SUBJECT_ALL_SCORES, OnUpdateDeleteSubjectAllScores)
	ON_UPDATE_COMMAND_UI(ID_SCORE_EDIT, OnUpdateScoreEdit)
	ON_UPDATE_COMMAND_UI(ID_SCORE_ENTER_MASS, OnUpdateScoreEnterMass)
	ON_UPDATE_COMMAND_UI(ID_SCORE_ENTER_ONE, OnUpdateScoreEnterOne)
	ON_UPDATE_COMMAND_UI(ID_QUERY_STUDENT_ALL, OnUpdateQueryStudentAll)
	ON_UPDATE_COMMAND_UI(ID_QUERY_STUDENT_SUBJECT, OnUpdateQueryStudentSubject)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

static UINT indicators[] =
{
	ID_SEPARATOR,           // status line indicator
	ID_INDICATOR_CAPS,
	ID_INDICATOR_NUM,
	ID_INDICATOR_SCRL,
};

/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction

CMainFrame::CMainFrame()
{
	// TODO: add member initialization code here
	
}

CMainFrame::~CMainFrame()
{
}

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	// TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

	return 0;
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics

#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
	CFrameWnd::AssertValid();
}

void CMainFrame::Dump(CDumpContext& dc) const
{
	CFrameWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers


void CMainFrame::OnScoreEnterOne() 
{
	// TODO: Add your command handler code here
	CBookEnterOneDlg scoreEnterOnedlg;
	scoreEnterOnedlg.DoModal();
}

void CMainFrame::OnScoreEdit() 
{
	// TODO: Add your command handler code here
	CEditScoreDlg editScoreDlg;
	editScoreDlg.DoModal();
}

void CMainFrame::OnDeleteSbSubject() 
{
	// TODO: Add your command handler code here
	CDeleteSbScoreDlg deleteSbScoreDlg;
	deleteSbScoreDlg.DoModal();
}

void CMainFrame::OnDeleteSbAllSocres() 
{
	CDeleteSbAllScoresDlg deleteSbAllScoresDlg;
	deleteSbAllScoresDlg.DoModal();
}

void CMainFrame::OnDeleteSubjectAllScores() 
{
	// TODO: Add your command handler code here
	CDeleteSubjectScoresDlg deleteSubjectScoresDlg;
	deleteSubjectScoresDlg.DoModal();
}

void CMainFrame::OnDeleteCategoryAllScores() 
{
	// TODO: Add your command handler code here
	CDeleteCategoryScoresDlg deleteCategoryScoresDlg;
	deleteCategoryScoresDlg.DoModal();
}

void CMainFrame::OnScoreEnterMass() 
{
	// TODO: Add your command handler code here
	CScoresEnterMassDlg scoresEnterMassDlg;
	scoresEnterMassDlg.DoModal();
}

void CMainFrame::OnEditStudentCode() 
{
	// TODO: Add your command handler code here
	CEditStudentCodeDlg editStudentCodeDlg;
	editStudentCodeDlg.DoModal();
}

void CMainFrame::OnAddStudentSingle() 
{
	// TODO: Add your command handler code here
	CAddStudentSingleDlg addStudentSingleDlg;
	addStudentSingleDlg.DoModal();
}

void CMainFrame::OnAddStudentMass() 
{
	// TODO: Add your command handler code here
	CAddStudentMassDlg addStudentMassDlg;
	addStudentMassDlg.DoModal();
}

void CMainFrame::OnQueryStudentSubject() 
{
	// TODO: Add your command handler code here
	CStudentQuerySubjectDlg studentQuerySubject;
	studentQuerySubject.DoModal();
}

void CMainFrame::OnQueryStudentAll() 
{
	// TODO: Add your command handler code here
	CStudentQueryAllDlg studentQueryAllDlg;
	studentQueryAllDlg.DoModal();
}

void CMainFrame::OnAdminQueryStudentScores() 
{
	// TODO: Add your command handler code here
	CAdminQueryStudentScoreDlg adminQueryStudentScoreDlg;
	adminQueryStudentScoreDlg.DoModal();
}

void CMainFrame::OnAdminQueryStudentInf() 
{
	// TODO: Add your command handler code here
	CAdminQueryStudentInfDlg adminQueryStudentInfDlg;
	adminQueryStudentInfDlg.DoModal();
}

void CMainFrame::OnUpdateAddStudentSingle(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateAddStudentMass(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateAdminQueryStudentInf(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateAdminQueryStudentScores(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateDeleteCategoryAllScores(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateDeleteSbAllSocres(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateDeleteSbSubject(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateDeleteSubjectAllScores(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateScoreEdit(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateScoreEnterMass(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateScoreEnterOne(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(CPublic::flag);
}

void CMainFrame::OnUpdateQueryStudentAll(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(!CPublic::flag);
}

void CMainFrame::OnUpdateQueryStudentSubject(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(!CPublic::flag);
}

⌨️ 快捷键说明

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