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

📄 sturoom.cpp

📁 学生住宿管理系统 本程序用于交流方面,仅共学习交流,用于其他方面 功能欠缺
💻 CPP
字号:
// StuRoom.cpp: implementation of the CStuRoom class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Dormitory.h"
#include "StuRoom.h"
#include "student.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

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

CStuRoom::CStuRoom(Croom*rm,Cstudent*stu)
{
 room=rm;
 student=stu;
}

CStuRoom::CStuRoom()
{

}

IMPLEMENT_SERIAL(CStuRoom,CObject,1)

void CStuRoom::Serialize(CArchive &ar){
	
	CObject::Serialize( ar );

	if(ar.IsStoring())
		
	{
		room->Serialize(ar);
		student->Serialize(ar);
	}
	
	else
		
	{   room=new Croom();
	    student=new Cstudent();
		room->Serialize(ar);
		student->Serialize(ar);
	}

//问题		

}//序列化的实
CStuRoom * CStuRoom::SearchRecord(Cstudent*stud)
{ //查找该生stud是否已经分配,若分配返回分配记录,否则为空
     CStuRoom *p=(CStuRoom *)getFirstRecord();
	 
	 while(p&&(p->getstudent()->getField("no")!=stud->getField("no")))
		 p=(CStuRoom *)getNext();
	 if(!p)
		 return NULL;//未分配
	 else 
		 return p;//已经分配
    
}

⌨️ 快捷键说明

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