資源簡介
應(yīng)用MFC編譯的酒店客房管理系統(tǒng),實現(xiàn)了查詢刪除等各項功能。

代碼片段和文件信息
//?chaxun.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“酒店客房管理系統(tǒng).h“
#include?“chaxun.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
typedef?struct?Cxin//創(chuàng)建一個Cxin結(jié)構(gòu)體用于保存訂單中的所有信息
{
CString?number;
CString?price;?
CString?kind;
CString?name;?
CString?time;
CString?TL;
};
Cxin?*p1;
typedef?struct?Cpiao//創(chuàng)建一個Cpiao結(jié)構(gòu)體用于儲存房間的所有屬性
{
CString?number;
CString?price;
CString?kind;
};
Cpiao?*p2;
/////////////////////////////////////////////////////////////////////////////
//?Ctest?dialog
/////////////////////////////////////////////////////////////////////////////
//?Cchaxun?dialog
Cchaxun::Cchaxun(CWnd*?pParent?/*=NULL*/)
:?CDialog(Cchaxun::IDD?pParent)
{
Cpiao?*p2=new?Cpiao;
bool?flg=1;
CStdioFile?file(“data.txt“CFile::modeRead);//讀取data.txt中的數(shù)據(jù)
????flg=file.ReadString(p2->number);
while(flg)
{
flg=file.ReadString(p2->price);
flg=file.ReadString(p2->kind);
m_ren.AddTail(p2);
p2=new?Cpiao;
flg=file.ReadString(p2->number);
}
file.Close();
//{{AFX_DATA_INIT(Cchaxun)
m_edit1?=?_T(““);
m_edit2?=?_T(““);
m_edit3?=?_T(““);
m_edit4?=?_T(““);
m_edit5?=?_T(““);
m_edit7?=?_T(““);
m_edit8?=?_T(““);
//}}AFX_DATA_INIT
}
void?Cchaxun::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Cchaxun)
DDX_Text(pDX?IDC_EDIT1?m_edit1);
DDX_Text(pDX?IDC_EDIT2?m_edit2);
DDX_Text(pDX?IDC_EDIT3?m_edit3);
DDX_Text(pDX?IDC_EDIT4?m_edit4);
DDX_Text(pDX?IDC_EDIT5?m_edit5);
DDX_Text(pDX?IDC_EDIT7?m_edit7);
DDX_Text(pDX?IDC_EDIT8?m_edit8);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Cchaxun?CDialog)
//{{AFX_MSG_MAP(Cchaxun)
ON_BN_CLICKED(IDC_BUTTON1?OnButton1)
ON_BN_CLICKED(IDC_BUTTON2?OnButton2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?Cchaxun?message?handlers
void?Cchaxun::OnButton1()?
{
//?TODO:?Add?your?control?notification?handler?code?here
UpdateData();
????POSITION?pos;
bool?flg=0;
pos=m_ren.GetHeadPosition();
while(pos!=NULL)//信息的檢索,將輸入信息和data.txt中的數(shù)據(jù)進行對比,將符合信息輸出
{
p2=(Cpiao*)m_ren.GetNext(pos);
if(m_edit1==p2->number)
{
m_edit2=p2->number;
m_edit3=p2->price;
m_edit4=p2->kind;
UpdateData(0);
flg=1;
break;
}
}
//m_line.GetPrev(pos);
if(!flg)
{
m_edit2=““;
m_edit3=““;
m_edit4=““;
UpdateData(0);
MessageBox(“沒有此房間“);
}
}
void?Cchaxun::OnButton2()?
{
//?TODO:?Add?your?control?notification?handler?code?here
UpdateData();
p1=new?Cxin;
p1->name=m_edit5;
p1->number=m_edit2;
p1->price=m_edit3;
p1->kind=m_edit4;
p1->time=m_edit7;
p1->TL=m_edit8;
m_renren.AddTail(p1);//將窗口編輯中的內(nèi)容賦值給Cxin寫入鏈表尾部
MessageBox(“以保存當(dāng)前訂房“);
}
void?Cchaxun::OnOK()?//對“確定“按鈕進行定義
{
//?TODO:?Add?extra?validation?here
CStdioFile?file(“data2.txt“CFile::mode
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3558??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\chaxun.cpp
?????文件???????1357??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\chaxun.h
?????文件???????2513??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\check.cpp
?????文件???????1275??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\check.h
?????文件?????????50??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\data.txt
?????文件?????????47??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\data2.txt
?????文件??????29634??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\chaxun.obj
?????文件??????22215??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\check.obj
?????文件??????16616??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\face.obj
?????文件??????14958??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\jiemian.obj
?????文件??????22509??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\MainFrm.obj
?????文件?????106077??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\StdAfx.obj
?????文件?????336896??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\vc60.idb
?????文件?????372736??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\vc60.pdb
?????文件?????135315??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\酒店客房管理系統(tǒng).exe
?????文件?????338588??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\酒店客房管理系統(tǒng).ilk
?????文件??????23290??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\酒店客房管理系統(tǒng).obj
?????文件????5615700??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\酒店客房管理系統(tǒng).pch
?????文件?????451584??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\酒店客房管理系統(tǒng).pdb
?????文件???????9268??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\酒店客房管理系統(tǒng).res
?????文件??????15096??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\酒店客房管理系統(tǒng)Doc.obj
?????文件??????19957??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\Debug\酒店客房管理系統(tǒng)View.obj
?????文件???????1310??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\face.cpp
?????文件???????1196??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\face.h
?????文件???????1083??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\jiemian.cpp
?????文件???????1193??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\jiemian.h
?????文件???????2559??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\MainFrm.cpp
?????文件???????1474??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\MainFrm.h
?????文件???????4453??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\ReadMe.txt
?????文件???????1078??2012-06-29?17:01??電子081??0808140626??任立兢?17??酒店客房管理系統(tǒng)?-?副本\酒店客房管理系統(tǒng)\res\Toolbar.bmp
............此處省略27個文件信息
- 上一篇:雷霆戰(zhàn)機 c++源碼
- 下一篇:銀行賬戶管理系統(tǒng)C++
評論
共有 條評論