⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yuding.cpp

📁 这是一个简单的酒店管理系统
💻 CPP
字号:
// YuDing.cpp : implementation file
//

#include "stdafx.h"
#include "shujuku.h"
#include "YuDing.h"
#include "DingDan.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CYuDing dialog


CYuDing::CYuDing(CWnd* pParent /*=NULL*/)
	: CDialog(CYuDing::IDD, pParent)
{
	//{{AFX_DATA_INIT(CYuDing)
	m_EndTime = COleDateTime::GetCurrentTime();
	m_StartTime = COleDateTime::GetCurrentTime();
	//}}AFX_DATA_INIT
}


void CYuDing::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CYuDing)
	DDX_DateTimeCtrl(pDX, IDC_EndDATETIME, m_EndTime);
	DDX_DateTimeCtrl(pDX, IDC_StartDATETIME, m_StartTime);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CYuDing, CDialog)
	//{{AFX_MSG_MAP(CYuDing)
	ON_BN_CLICKED(IDC_YuDing, OnYuDing)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CYuDing message handlers

void CYuDing::OnYuDing() 
{
	// TODO: Add your control notification handler code here
	CDingDan a;

	UpdateData(true);
    CString d1=m_StartTime.Format("%Y.%m.%d");
    CString d2=m_EndTime.Format("%Y.%m.%d");
    startdate=d1;
	enddate=d2;

    COleDateTime strFirst,strEnd;
    strFirst = COleDateTime(m_StartTime.GetYear(),m_StartTime.GetMonth(),m_StartTime.GetDay(),0,0,0);
    strEnd = COleDateTime(m_EndTime.GetYear(),m_EndTime.GetMonth(),m_EndTime.GetDay(),23,59,59);
    COleDateTimeSpan ShiJianCha= strEnd - strFirst;
    CString ZongTianShu;

	 
	int day=ShiJianCha.GetDays();
    ZongTianShu.Format("%d", day);
     

/////////////////////////////////////////////////////////////////////////////////////
    int money=day*Price;
	
    CString show,M;
	M.Format("%d",money);


	CusName.TrimRight();
	HolName.TrimRight();
	RoomName.TrimRight();
	show="尊敬的: "+CusName+" 您好!"+"\r\n"+"\r\n";
	show=show+"你将预定: "+HolName+" 的 "+RoomName+"\r\n"+"\r\n";;
	show=show+"时间从: "+d1+"至"+d2+"共"+ZongTianShu+"天"+"\r\n"+"\r\n";;
	show=show+"金额合计:¥"+M+"元";

	a.m_Show=show;
	UpdateData(false);



	a.DoModal();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -