宾馆管理系统 数据库课程设计报告
)\ theApp.ADOExecute(theApp.m_pADOSet, strQuery); int iCount = theApp.m_pADOSet->GetRecordCount(); theApp.m_pADOSet->MoveFirst(); for (int i=0; i
Holder = theApp.m_pADOSet->GetCollect(\ m_sID = Holder.vt==VT_NULL?\ // Get InDate
COleDateTime time; Holder = theApp.m_pADOSet->GetCollect(\ time = Holder; m_sInDate = time.Format(\ // Get ID
Holder = theApp.m_pADOSet->GetCollect(\ m_sDiscount.Format(\ // Get Memo Holder = theApp.m_pADOSet->GetCollect(\
36
宾馆管理系统 数据库课程设计报告
m_sMemo = Holder.vt==VT_NULL?\ } else// Alter CheckOut { ((CComboBox*)GetDlgItem(IDD_CHECKOUT_ROOMNO))->InsertString(0, m_sRoomNo); // Get Room Info strQuery = \ theApp.ADOExecute(theApp.m_pADOSet, strQuery); int iCount = theApp.m_pADOSet->GetRecordCount(); theApp.m_pADOSet->MoveFirst(); // Get RoomType Holder = theApp.m_pADOSet->GetCollect(\ m_sType = Holder.vt==VT_NULL?\ // Get roomposition Holder = theApp.m_pADOSet->GetCollect(\ m_sPosition = Holder.vt==VT_NULL?\ // Get roomprice Holder = theApp.m_pADOSet->GetCollect(\ m_sPrice.Format(\ ((CComboBox*)GetDlgItem(IDD_BOOKIN_ROOMNO))->SetCurSel(0); } UpdateData(false); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CCheckOutDLG::OnCheckoutRoomNoSelChange() { // TODO: Add your control notification handler code here UpdateData(true); _variant_t strQuery, Holder; // Update room info strQuery = \ theApp.ADOExecute(theApp.m_pADOSet, strQuery); // Get RoomType Holder = theApp.m_pADOSet->GetCollect(\ m_sType = Holder.vt==VT_NULL?\ // Get roomposition Holder = theApp.m_pADOSet->GetCollect(\ m_sPosition = Holder.vt==VT_NULL?\ // Get roomprice Holder = theApp.m_pADOSet->GetCollect(\ m_sPrice.Format(\ // Update customer info
strQuery = \
37
宾馆管理系统 数据库课程设计报告
theApp.ADOExecute(theApp.m_pADOSet, strQuery); // Get name Holder = theApp.m_pADOSet->GetCollect(\ m_sName = Holder.vt==VT_NULL?\ // Get ID
Holder = theApp.m_pADOSet->GetCollect(\ m_sID = Holder.vt==VT_NULL?\ // Get InDate COleDateTime time; Holder = theApp.m_pADOSet->GetCollect(\ time = Holder; m_sInDate = time.Format(\ // Get ID
Holder = theApp.m_pADOSet->GetCollect(\ m_sDiscount.Format(\ // Get Memo Holder = theApp.m_pADOSet->GetCollect(\ m_sMemo = Holder.vt==VT_NULL?\ UpdateData(false); }
void CCheckOutDLG::OnOK() { // TODO: Add extra validation here UpdateData(true); // Get InDate _variant_t strQuery, Holder; COleDateTime tInDate; strQuery = \ theApp.ADOExecute(theApp.m_pADOSet, strQuery); Holder = theApp.m_pADOSet->GetCollect(\ tInDate = Holder; if ( tInDate>m_tOutDate ) { AfxMessageBox(_T(\结帐日期小于入住日期,请重新输入结帐日期!MB_ICONEXCLAMATION); return; } // Caculate Bill COleDateTimeSpan timeSpan; timeSpan = m_tOutDate - tInDate; int iDays = timeSpan.GetDays()+1; float fPrice = atof(m_sPrice); float fDiscount = atof(m_sDiscount); float fAmmount = fPrice*iDays*fDiscount/100;
\38
宾馆管理系统 数据库课程设计报告
CString sAmmount; sAmmount.Format(\ CString sTip = _T(\金额为:\
sTip += sAmmount;
sTip += _T(\ 结算完毕!!\
AfxMessageBox(sTip, MB_ICONINFORMATION); // Update DataBase CString sOutDate; sOutDate = m_tOutDate.Format(\ strQuery = \
where roomno='\
theApp.ADOExecute(theApp.m_pADOSet, strQuery); // Refresh CheckOut List strQuery = \ CHotel_MISView*p=(CHotel_MISView*)(((CMainFrame*)
AfxGetMainWnd())->GetActiveView());
p->RefreshCheckOut(strQuery); CDialog::OnOK(); }
2. 测试和运行
2.1用户登录界面
管理员登陆,设置用户名为“Administrator”,密码为空
2.2 客房标准 初始化界面如下:
39
宾馆管理系统 数据库课程设计报告
2.1.1 添加客房标准 若标准编号重复,显示已存在记录
2.2 .2修改客房标准
40