📄 orderview.cpp
字号:
// orderView.cpp : implementation of the COrderView class
//
#include "stdafx.h"
#include "order.h"
#include "orderDoc.h"
#include "orderView.h"
#include "OrderDialog.h"
#include "CheckDialog.h"
#include "RoomRecordset.h"
#include "OutDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
COrderDialog odlg;
IMPLEMENT_DYNCREATE(COrderView, CView)
BEGIN_MESSAGE_MAP(COrderView, CView)
//{{AFX_MSG_MAP(COrderView)
ON_COMMAND(IDO_DOORDER, OnDoorder)
ON_COMMAND(IDC_DOCHECK, OnDocheck)
ON_COMMAND(IDC_DOOUTROOM, OnDooutroom)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COrderView construction/destruction
COrderView::COrderView()
{
// TODO: add construction code here
}
COrderView::~COrderView()
{
}
BOOL COrderView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// COrderView drawing
void COrderView::OnDraw(CDC* pDC)
{
COrderDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CRoomRecordset rs;
rs.Open(CRecordset::dynaset,_T("select * from roominfo"));
CString str=" ";
pDC->TextOut(10,0,"房间"+str+" 价格"+str+" 状态"+str+" 时间"+str+" 天数"+" VIP"+str+" 姓名");
int num=1;
while(!rs.IsEOF())
{
CString outstr="";
for(int i=0;i<7;i++)
{
rs.GetFieldValue(i,str);
pDC->TextOut(10+90*i,15*num,str);
}
num++;
rs.MoveNext();
}
rs.Close();
pDC->GetTextAlign();
}
/////////////////////////////////////////////////////////////////////////////
// COrderView printing
BOOL COrderView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void COrderView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void COrderView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// COrderView diagnostics
#ifdef _DEBUG
void COrderView::AssertValid() const
{
CView::AssertValid();
}
void COrderView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
COrderDoc* COrderView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(COrderDoc)));
return (COrderDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// COrderView message handlers
void COrderView::OnDoorder()
{
// TODO: Add your command handler code here
COrderDialog odlg;
odlg.DoModal();
}
//DEL void COrderView::OnExitT()
//DEL {
//DEL // TODO: Add your control notification handler code here
//DEL MessageBox("end");
//DEL
//DEL }
void COrderView::OnDocheck()
{
// TODO: Add your command handler code here
/* CCheckDialog *pcDlg=new CCheckDialog;
pcDlg->Create(IDD_CHECK,this);
pcDlg->ShowWindow(SW_SHOW);
*/
CCheckDialog cdlg;
cdlg.DoModal();
}
void COrderView::OnDooutroom()
{
// TODO: Add your command handler code here
COutDialog odlg;
odlg.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -