// gkjz.cpp : implementation file//
#include "stdafx.h"#include "hotel.h"#include "gkjz.h"
#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif
/////////////////////////////////////////////////////////////////////////////// gkjz dialog
gkjz::gkjz(CWnd* pParent /*=NULL*/): CDialog(gkjz::IDD, pParent){//{{AFX_DATA_INIT(gkjz)m_fh = _T("");m_ts = 0;m_jg = 0.0f;//}}AFX_DATA_INIT}
void gkjz::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(gkjz)DDX_Control(pDX, IDC_EDIT3, m_p);DDX_Control(pDX, IDC_EDIT2, m_d);DDX_Text(pDX, IDC_EDIT1, m_fh);DDV_MaxChars(pDX, m_fh, 4);DDX_Text(pDX, IDC_EDIT2, m_ts);DDX_Text(pDX, IDC_EDIT3, m_jg);//}}AFX_DATA_MAP}
BEGIN_MESSAGE_MAP(gkjz, CDialog)//{{AFX_MSG_MAP(gkjz)ON_EN_KILLFOCUS(IDC_EDIT1, OnKillfocusEdit1)//}}AFX_MSG_MAPEND_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////// gkjz message handlers
void gkjz::setList(guest &x){List=&x;}
void gkjz::OnOK() {// TODO: Add extra validation hereguest *t;t=List;if(p){while(t->next!=p){t=t->next;}t->next=p->next;delete p;}CDialog::OnOK();//显示的对话框基类}
void gkjz::OnKillfocusEdit1() {// TODO: Add your control notification handler code herep=List->next;UpdateData(TRUE);//刷新while(p){if(strcmp(p->getNum(),this->m_fh)==0){break;}p=p->next;}if(p==NULL){MessageBox("该客房未被预订","wrong",MB_ICONWARNING);}else{char temp[3];int d;for(int i=0;i<2;i++){temp[i]=*(p->getDate()+8+i);}SYSTEMTIME st = {0};GetLocalTime(&st);//获取日期时间d=st.wDay-atoi(temp);m_ts=d;m_jg=(float)(d*50);UpdateData(FALSE);//取消原数据}}
这个结账功能是咋实现的呢...
#include "stdafx.h"#include "hotel.h"#include "gkjz.h"
#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif
/////////////////////////////////////////////////////////////////////////////// gkjz dialog
gkjz::gkjz(CWnd* pParent /*=NULL*/): CDialog(gkjz::IDD, pParent){//{{AFX_DATA_INIT(gkjz)m_fh = _T("");m_ts = 0;m_jg = 0.0f;//}}AFX_DATA_INIT}
void gkjz::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(gkjz)DDX_Control(pDX, IDC_EDIT3, m_p);DDX_Control(pDX, IDC_EDIT2, m_d);DDX_Text(pDX, IDC_EDIT1, m_fh);DDV_MaxChars(pDX, m_fh, 4);DDX_Text(pDX, IDC_EDIT2, m_ts);DDX_Text(pDX, IDC_EDIT3, m_jg);//}}AFX_DATA_MAP}
BEGIN_MESSAGE_MAP(gkjz, CDialog)//{{AFX_MSG_MAP(gkjz)ON_EN_KILLFOCUS(IDC_EDIT1, OnKillfocusEdit1)//}}AFX_MSG_MAPEND_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////// gkjz message handlers
void gkjz::setList(guest &x){List=&x;}
void gkjz::OnOK() {// TODO: Add extra validation hereguest *t;t=List;if(p){while(t->next!=p){t=t->next;}t->next=p->next;delete p;}CDialog::OnOK();//显示的对话框基类}
void gkjz::OnKillfocusEdit1() {// TODO: Add your control notification handler code herep=List->next;UpdateData(TRUE);//刷新while(p){if(strcmp(p->getNum(),this->m_fh)==0){break;}p=p->next;}if(p==NULL){MessageBox("该客房未被预订","wrong",MB_ICONWARNING);}else{char temp[3];int d;for(int i=0;i<2;i++){temp[i]=*(p->getDate()+8+i);}SYSTEMTIME st = {0};GetLocalTime(&st);//获取日期时间d=st.wDay-atoi(temp);m_ts=d;m_jg=(float)(d*50);UpdateData(FALSE);//取消原数据}}
这个结账功能是咋实现的呢...