酒店管理系统代码 

导读:voidCCheckDlg::OnButtonRf(){CStringsql;i,ClassDlg.cpp文件代码:#include\#include\#incl,}if(pos){intnItem=m_oChecklist.GetNextSelectedItem(pos);sdiscountsum=m_oChecklist.GetItemText(nItem,2);fdiscountsum=

酒店管理系统代码 

}

if(pos) { int nItem = m_oChecklist.GetNextSelectedItem(pos); sdiscountsum=m_oChecklist.GetItemText(nItem,2); fdiscountsum=atof(sdiscountsum); m_oCdiscount.GetWindowText(sdiscount); ldiscount=atol(sdiscount); if(ldiscount>100||ldiscount<0) { MessageBox(\请确定折扣大于0并且小于100!\ return; } if(ldiscount

float ftotal=0;

int nItemCount=m_oChecklist.GetItemCount();//表项总数 for(int i=0;i

CString stotal;

stotal.Format(\

m_oTotalm.SetWindowText(stotal);

void CCheckDlg::OnButtonRf() { CString sql; if(!theApp.VerifyPower(\ { AfxMessageBox(\没有权限RF单据!\ return; } //得到系统时间 CTime now=CTime::GetCurrentTime(); CString snowtime=now.Format(_T(\ sql=\SALEBILL set SALES='\TE='\已结帐', ACTTOTAL=0, PAYMODE=88 where ID='\ try { _variant_t RecordsAffected; theApp.m_pConnection->Execute((_bstr_t)sql,&RecordsAffected,adCmdText); } catch(_com_error e)///捕捉异常 { CString temp; temp.Format(\结帐]RF更新数据库出错:%s\ AfxMessageBox(temp); return; } //When the check button is click down,send a message(WM_CHECKOUT) to the CPosDlg. LRESULT Res=::SendMessage(theApp.pWnd, WM_CHECKOUT, 0, 0); EndDialog(1);//Close the dialog. }

void CCheckDlg::OnButtonHang() { if(!theApp.VerifyPower(\ { AfxMessageBox(\没有权限挂帐!\ return; }

CString sql; sql=\挂帐' where ID='\ try { _variant_t RecordsAffected; theApp.m_pConnection->Execute((_bstr_t)sql,&RecordsAffected,adCmdText); } catch(_com_error e)///捕捉异常 { CString temp; temp.Format(\结帐]挂帐更新数据库出错:%s\ AfxMessageBox(temp); return; } EndDialog(1);//Close the dialog. }

long CCheckDlg::VerifyDicsount() { CString sql; _RecordsetPtr m_pRecordset; long ldiscount; sql=\ try { m_pRecordset.CreateInstance(\ m_pRecordset->Open((_variant_t)sql,_variant_t((IDispatch*)theApp.m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); if(!m_pRecordset->adoEOF) ldiscount=(long)m_pRecordset->GetCollect(\ } catch(_com_error e)///捕捉异常 { CString temp; temp.Format(\读取用户权限出错:%s\ AfxMessageBox(temp); return -1; } return ldiscount; }

ClassDlg.cpp文件代码: #include \#include \#include \

#ifdef _DEBUG

#define new DEBUG_NEW #undef THIS_FILE

static char THIS_FILE[] = __FILE__; #endif

///////////////////////////////////////////////////////////////////////////// // CClassDlg dialog

extern CMyPosApp theApp;

CClassDlg::CClassDlg(CWnd* pParent /*=NULL*/) : CDialog(CClassDlg::IDD, pParent) { //{{AFX_DATA_INIT(CClassDlg) m_classname = _T(\ m_radiodiscount = -1; m_tempid = 0; //}}AFX_DATA_INIT }

void CClassDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CClassDlg) DDX_Control(pDX, IDC_RADIO1_DISCOUNT, m_oRadiodiscount); DDX_Control(pDX, IDC_EDIT_CLASSNAME, m_oClassname); DDX_Control(pDX, IDC_TREE_CLASS, m_oTreeclass); DDX_Text(pDX, IDC_EDIT_CLASSNAME, m_classname); DDX_Radio(pDX, IDC_RADIO1_DISCOUNT, m_radiodiscount); DDX_Text(pDX, IDC_TEMPID, m_tempid); //}}AFX_DATA_MAP }

BEGIN_MESSAGE_MAP(CClassDlg, CDialog) //{{AFX_MSG_MAP(CClassDlg) ON_NOTIFY(TVN_SELCHANGED, IDC_TREE_CLASS, OnSelchangedTreeClass)

ON_BN_CLICKED(IDC_BUTTON_ADDSAME, OnButtonAddsame) ON_BN_CLICKED(IDC_BUTTON_ADDSUB, OnButtonAddsub) ON_BN_CLICKED(IDC_BUTTON_DEL, OnButtonDel) ON_BN_CLICKED(IDC_BUTTON_SAVE, OnButtonSave) //}}AFX_MSG_MAP END_MESSAGE_MAP()

///////////////////////////////////////////////////////////////////////////// // CClassDlg message handlers

void CClassDlg::OnSelchangedTreeClass(NMHDR* pNMHDR, LRESULT* pResult) { NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; CString sql; CString curtext; _RecordsetPtr m_pRecordset; //Must define it in function!!! HTREEITEM hCurItem; hCurItem=m_oTreeclass.GetSelectedItem ();//Get Current item and its sub items. curtext=m_oTreeclass.GetItemText(hCurItem);//Read current item text into edit control. m_classname=curtext; sql=\TERIELCLASS where NAME='\ try { m_tempid=0; m_pRecordset.CreateInstance(\ m_pRecordset->Open((_variant_t)sql,_variant_t((IDispatch*)theApp.m_pConnection,true),adOpenDynamic,adLockOptimistic,adCmdText); if(!m_pRecordset->adoEOF) { m_tempid=(long)(m_pRecordset->GetCollect(\ Curpar=VariantToCString(m_pRecordset->GetCollect(\ if((float)(m_pRecordset->GetCollect(\ m_radiodiscount=0; if((float)(m_pRecordset->GetCollect(\ m_radiodiscount=1; } m_pRecordset->Close(); } catch(_com_error e)///捕捉异常 { CString errormessage;

博泰典藏网btdcw.com包含总结汇报、高中教育、教学研究、计划方案、高等教育、表格模板、党团工作、外语学习、经管营销以及酒店管理系统代码 等内容。

本文共7页1234567