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

📄 orderdishssysdoc.cpp

📁 酒店用的嵌入式无线点餐系统
💻 CPP
字号:
// OrderDishsSysDoc.cpp : implementation of the COrderDishsSysDoc class
//

#include "stdafx.h"
#include "OrderDishsSys.h"

#include "OrderDishsSysDoc.h"
//
#include"afxtempl.h"
#include"Dish.h"
//
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COrderDishsSysDoc

IMPLEMENT_DYNCREATE(COrderDishsSysDoc, CDocument)

BEGIN_MESSAGE_MAP(COrderDishsSysDoc, CDocument)
	//{{AFX_MSG_MAP(COrderDishsSysDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COrderDishsSysDoc construction/destruction
//
extern CList<Dish,Dish&> MList;
extern Dish d;

COrderDishsSysDoc::COrderDishsSysDoc()
{
	// TODO: add one-time construction code here

}

COrderDishsSysDoc::~COrderDishsSysDoc()
{
}

BOOL COrderDishsSysDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// COrderDishsSysDoc serialization

void COrderDishsSysDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
		POSITION pos = MList.GetHeadPosition();
		ar<<MList.GetCount();
		for(int i=0;i<MList.GetCount();i++)
		{
			ar<<(MList.GetAt(pos)).GetName();
			ar<<(MList.GetAt(pos)).GetPrice();
			ar<<(MList.GetAt(pos)).GetQuantity();
			MList.GetNext(pos);
		}
	}
	else
	{
		// TODO: add loading code here
		int s1,shu1;
		CString name1;
		int price1;
		ar>>s1;
		for(int i1=0;i1<s1;i1++)
		{
			ar>>name1;
			ar>>price1;
			ar>>shu1;
			d.SetName(name1);
			d.SetPrice(price1);
			d.SetQuantity(shu1);
			MList.AddHead(d);
		}
	}
}

/////////////////////////////////////////////////////////////////////////////
// COrderDishsSysDoc diagnostics

#ifdef _DEBUG
void COrderDishsSysDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void COrderDishsSysDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// COrderDishsSysDoc commands

⌨️ 快捷键说明

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