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

📄 course.cpp

📁 陕西理工学院计算机系教师信息管理系统的设计与实现
💻 CPP
字号:
// Course.cpp: implementation of the CCourse class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "TeacherMIS.h"
#include "Course.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CCourse::CCourse()
{
	m_CourseID="";
	m_Name="";
	m_Period="";
	m_Mark="";
	m_Classroom="";
}

CCourse::~CCourse()
{

}
//添加课程
void CCourse::AddRecord()
{
	CADORecordset* pRs=new CADORecordset(((CTeacherMISApp*)AfxGetApp())->pDB);
	CString strSQL;
	strSQL.Format("select * from tbCourse");
	pRs->Open(strSQL,CADORecordset::openQuery);
	pRs->AddNew();
	pRs->SetFieldValue("CourseID",m_CourseID);
	pRs->SetFieldValue("Name",m_Name);
	pRs->SetFieldValue("Period",m_Period);
	pRs->SetFieldValue("Mark",m_Mark);
	pRs->SetFieldValue("Classroom",m_Classroom);

	pRs->Update();
}

int CCourse::HaveName(CString cCourseName)
{
	CADORecordset* pRs=new CADORecordset(((CTeacherMISApp*)AfxGetApp())->pDB);
	CString strSQL;
	int m;
	strSQL.Format("select * from tbCourse where Name='%s'",cCourseName);
	pRs->Open(strSQL,CADORecordset::openQuery);
	if(pRs->GetRecordCount()==1)
		m=1;
	else m=-1;

	pRs->Close();
	delete pRs;
	return m;
}

int CCourse::HaveID(CString cID)
{
	CADORecordset* pRs=new CADORecordset(((CTeacherMISApp*)AfxGetApp())->pDB);
	CString strSQL;
	int m;
	strSQL.Format("select * from tbCourse where CourseID='%s'",cID);
	pRs->Open(strSQL,CADORecordset::openQuery);
	if(pRs->GetRecordCount()==1)
		m=1;
	else m=-1;

	pRs->Close();
	delete pRs;
	return m;
}

⌨️ 快捷键说明

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