c++课程设计 小型饭店管理信息系统 C++课程设计《酒店客人管理系统》怎么写的? 要写出这个程序...
c++\u8bfe\u7a0b\u8bbe\u8ba1 \u5c0f\u578b\u996d\u5e97\u7ba1\u7406\u4fe1\u606f\u7cfb\u7edf#include "stdafx.h"
#include "FinanceBook.h"
#include "AccountDaily.h"
// CAccountDaily \u5bf9\u8bdd\u6846
IMPLEMENT_DYNAMIC(CAccountDaily, CDialog)
CAccountDaily::CAccountDaily(CWnd* pParent /*=NULL*/)
: CDialog(CAccountDaily::IDD, pParent)
{
EnableAutomation();
}
CAccountDaily::~CAccountDaily()
{
}
void CAccountDaily::OnFinalRelease()
{
// \u91ca\u653e\u4e86\u5bf9\u81ea\u52a8\u5316\u5bf9\u8c61\u7684\u6700\u540e\u4e00\u4e2a\u5f15\u7528\u540e\uff0c\u5c06\u8c03\u7528
// OnFinalRelease\u3002\u57fa\u7c7b\u5c06\u81ea\u52a8
// \u5220\u9664\u8be5\u5bf9\u8c61\u3002\u5728\u8c03\u7528\u8be5\u57fa\u7c7b\u4e4b\u524d\uff0c\u8bf7\u6dfb\u52a0\u60a8\u7684
// \u5bf9\u8c61\u6240\u9700\u7684\u9644\u52a0\u6e05\u7406\u4ee3\u7801\u3002
CDialog::OnFinalRelease();
}
void CAccountDaily::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAccountDaily, CDialog)
ON_BN_CLICKED(IDOK, &CAccountDaily::OnBnClickedOk)
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CAccountDaily, CDialog)
END_DISPATCH_MAP()
// \u6ce8\u610f: \u6211\u4eec\u6dfb\u52a0 IID_IAccountDaily \u652f\u6301
// \u4ee5\u652f\u6301\u6765\u81ea VBA \u7684\u7c7b\u578b\u5b89\u5168\u7ed1\u5b9a\u3002\u6b64 IID \u5fc5\u987b\u540c\u9644\u52a0\u5230 .IDL \u6587\u4ef6\u4e2d\u7684
// \u8c03\u5ea6\u63a5\u53e3\u7684 GUID \u5339\u914d\u3002
// {535CE23C-51E3-4FD9-96FB-DB8A8C13BE92}
static const IID IID_IAccountDaily =
{ 0x535CE23C, 0x51E3, 0x4FD9, { 0x96, 0xFB, 0xDB, 0x8A, 0x8C, 0x13, 0xBE, 0x92 } };
BEGIN_INTERFACE_MAP(CAccountDaily, CDialog)
INTERFACE_PART(CAccountDaily, IID_IAccountDaily, Dispatch)
END_INTERFACE_MAP()
// CAccountDaily \u6d88\u606f\u5904\u7406\u7a0b\u5e8f
BOOL CAccountDaily::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: \u5728\u6b64\u6dfb\u52a0\u989d\u5916\u7684\u521d\u59cb\u5316
CButton *pRadioButton = (CButton*)GetDlgItem(IDC_PAYOUT);
pRadioButton->SetCheck(true);
CButton *pCheckBox = (CButton*)GetDlgItem(IDC_FORMAT_DAILY);
pCheckBox->SetCheck(true);
return TRUE; // return TRUE unless you set the focus to a control
// \u5f02\u5e38: OCX \u5c5e\u6027\u9875\u5e94\u8fd4\u56de FALSE
}
void CAccountDaily::CheckEnter()
{
//\u8be5\u51fd\u6570\u7684\u4f5c\u7528\u662f\u68c0\u67e5\u8f93\u5165\u683c\u5f0f\uff0c\u5224\u65adRadioButton\u548cCheckBox\u7684\u72b6\u6001
CButton *pRadioButton = (CButton*)GetDlgItem(IDC_PAYOUT);
CButton *pCheckBox = (CButton*)GetDlgItem(IDC_FORMAT_DAILY);
int IsRadioButtonChecked = pRadioButton->GetCheck(),
IsCheckBox = pCheckBox->GetCheck();
GetDlgItemText(IDC_DATE_DAILY,dateTime);
GetDlgItemText(IDC_RESUME,resume);
GetDlgItemText(IDC_AMOUNT_DAILY,amount);
GetDlgItemText(IDC_REMARK_DAILY,remark);
if(!resume.GetLength())
{
MessageBox(L"\u8d39\u7528\u6458\u8981 \u4e0d\u80fd\u4e3a\u7a7a\uff01 ",L"\u91cd\u8981\u63d0\u793a",MB_ICONWARNING);
GetDlgItem(IDC_RESUME)->SetFocus();
}
else if(!amount.GetLength())
{
MessageBox(L"\u53d1\u751f\u91d1\u989d \u4e0d\u80fd\u4e3a\u7a7a\uff01 ",L"\u91cd\u8981\u63d0\u793a",MB_ICONWARNING);
GetDlgItem(IDC_AMOUNT_DAILY)->SetFocus();
}
else
{
if(IsRadioButtonChecked)
type = L"\u652f\u51fa";
else
type = L"\u6536\u5165";
int dot = 0, space = 0, ch = 0;
CString str;
for(int index = 0; index != amount.GetLength(); ++index)
{
if(amount.GetAt(index) == '.')
dot++;
if(amount.GetAt(index) == ' ')
space++;
if(amount.GetAt(index) < '0' || amount.GetAt(index) > '9')
{
str = amount.GetAt(index);
ch++;
}
}
if(ch > 0)
{
/***BUG\uff1a\u5f53\u5b57\u4e32\u4e2d\u6709\u5176\u4ed6\u5b57\u7b26\uff0c\u5f62\u5982\u201ca.6\u201d\u65f6\uff0c\u4f1a\u8ba4\u4e3a\u683c\u5f0f\u6b63\u786e\u3002***/
if(str != '.' && str != ' ' || (space > 0 || dot > 1) )
{
MessageBox(L"\u91d1\u989d\u683c\u5f0f\u6709\u8bef\uff0c\u8bf7\u60a8\u68c0\u67e5\u8f93\u5165\uff01 ",L"\u91cd\u8981\u63d0\u793a",MB_ICONWARNING);
amountIsRigth = false;
GetDlgItem(IDC_AMOUNT_DAILY)->SetFocus();
}
else
amountIsRigth = true;
}
if(IsCheckBox)
amount = L"\uffe5" + amount;
}
}
void CAccountDaily::OnBnClickedOk()
{
// TODO: \u5728\u6b64\u6dfb\u52a0\u63a7\u4ef6\u901a\u77e5\u5904\u7406\u7a0b\u5e8f\u4ee3\u7801
//OnOK();
CheckEnter();
if(resume.GetLength() && amount.GetLength() && amountIsRigth)
MessageBox(dateTime + L"\
\
" + resume + L"\
\
" + type + L"\
\
" + amount + L"\
\
" + remark);
}
\u697c\u4e3b\u4f60\u597d\u4f60\u53ef\u4ee5\u628a\u8be6\u7ec6\u7684\u8981\u6c42\u53d1\u51fa\u6765\u6bd4\u5982\u5b9e\u73b0\u54ea\u4e9b\u529f\u80fd\u6709\u4e86\u8be6\u7ec6\u8981\u6c42\u6211\u5c31\u80fd\u5199\u4e00\u4e2a\u4f60\u539f\u521b\u7684\u7ed9\u4f60lookmynameandjiame
#include "stdafx.h"#include "FinanceBook.h"
#include "AccountDaily.h"
// CAccountDaily 对话框
IMPLEMENT_DYNAMIC(CAccountDaily, CDialog)
CAccountDaily::CAccountDaily(CWnd* pParent /*=NULL*/)
: CDialog(CAccountDaily::IDD, pParent)
{
EnableAutomation();
}
CAccountDaily::~CAccountDaily()
{
}
void CAccountDaily::OnFinalRelease()
{
// 释放了对自动化对象的最后一个引用后,将调用
// OnFinalRelease。基类将自动
// 删除该对象。在调用该基类之前,请添加您的
// 对象所需的附加清理代码。
CDialog::OnFinalRelease();
}
void CAccountDaily::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAccountDaily, CDialog)
ON_BN_CLICKED(IDOK, &CAccountDaily::OnBnClickedOk)
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CAccountDaily, CDialog)
END_DISPATCH_MAP()
// 注意: 我们添加 IID_IAccountDaily 支持
// 以支持来自 VBA 的类型安全绑定。此 IID 必须同附加到 .IDL 文件中的
// 调度接口的 GUID 匹配。
// {535CE23C-51E3-4FD9-96FB-DB8A8C13BE92}
static const IID IID_IAccountDaily =
{ 0x535CE23C, 0x51E3, 0x4FD9, { 0x96, 0xFB, 0xDB, 0x8A, 0x8C, 0x13, 0xBE, 0x92 } };
BEGIN_INTERFACE_MAP(CAccountDaily, CDialog)
INTERFACE_PART(CAccountDaily, IID_IAccountDaily, Dispatch)
END_INTERFACE_MAP()
// CAccountDaily 消息处理程序
BOOL CAccountDaily::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 在此添加额外的初始化
CButton *pRadioButton = (CButton*)GetDlgItem(IDC_PAYOUT);
pRadioButton->SetCheck(true);
CButton *pCheckBox = (CButton*)GetDlgItem(IDC_FORMAT_DAILY);
pCheckBox->SetCheck(true);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void CAccountDaily::CheckEnter()
{
//该函数的作用是检查输入格式,判断RadioButton和CheckBox的状态
CButton *pRadioButton = (CButton*)GetDlgItem(IDC_PAYOUT);
CButton *pCheckBox = (CButton*)GetDlgItem(IDC_FORMAT_DAILY);
int IsRadioButtonChecked = pRadioButton->GetCheck(),
IsCheckBox = pCheckBox->GetCheck();
GetDlgItemText(IDC_DATE_DAILY,dateTime);
GetDlgItemText(IDC_RESUME,resume);
GetDlgItemText(IDC_AMOUNT_DAILY,amount);
GetDlgItemText(IDC_REMARK_DAILY,remark);
if(!resume.GetLength())
{
MessageBox(L"费用摘要 不能为空! ",L"重要提示",MB_ICONWARNING);
GetDlgItem(IDC_RESUME)->SetFocus();
}
else if(!amount.GetLength())
{
MessageBox(L"发生金额 不能为空! ",L"重要提示",MB_ICONWARNING);
GetDlgItem(IDC_AMOUNT_DAILY)->SetFocus();
}
else
{
if(IsRadioButtonChecked)
type = L"支出";
else
type = L"收入";
int dot = 0, space = 0, ch = 0;
CString str;
for(int index = 0; index != amount.GetLength(); ++index)
{
if(amount.GetAt(index) == '.')
dot++;
if(amount.GetAt(index) == ' ')
space++;
if(amount.GetAt(index) < '0' || amount.GetAt(index) > '9')
{
str = amount.GetAt(index);
ch++;
}
}
if(ch > 0)
{
/***BUG:当字串中有其他字符,形如“a.6”时,会认为格式正确。***/
if(str != '.' && str != ' ' || (space > 0 || dot > 1) )
{
MessageBox(L"金额格式有误,请您检查输入! ",L"重要提示",MB_ICONWARNING);
amountIsRigth = false;
GetDlgItem(IDC_AMOUNT_DAILY)->SetFocus();
}
else
amountIsRigth = true;
}
if(IsCheckBox)
amount = L"¥" + amount;
}
}
void CAccountDaily::OnBnClickedOk()
{
// TODO: 在此添加控件通知处理程序代码
//OnOK();
CheckEnter();
if(resume.GetLength() && amount.GetLength() && amountIsRigth)
MessageBox(dateTime + L"\n\n" + resume + L"\n\n" + type + L"\n\n" + amount + L"\n\n" + remark);
}
The Associated Press reports that a player in NBA history to the highest, 2 meters of manu, at 31, at the age of 47 years passed,cheap NFL jerseys, he not only for 4 NBA teams played in a decade, is dedicated to helping poor countries in Africa philanthropist.
The club is in Sudan's charlotte Wells local hospital, the doctor was passed in Virginia Tom - Richard said he died in serious kidney and pain of skin diseases. "Sudan and the world lost a hero, to us also lost a example." General Richards says: "manu,The NFL Jersey celtics will receive a championship, we'll miss you and condolences to his family."
In the 10 years boulder career, he has for the Washington wizards, the golden state warriors,Authentic NFL jerseys, the Philadelphia 76ers and Miami heat, career,discount football jerseys, averaging 2.6 points and 4.2 rebounds and 3.3 times, and it is he blocked the 1985-86 season respectively and 1988-89 season in five games and 4.3 shots blocked alliance, lifting the king got "therefore the nickname" block machine.
"For the city's manu, the team and the influence of the basketball game is unable to use words to describe." The Philadelphia 76ers manager Ed - in his stefano statement said: "he is constantly to charity to improve the area around him, however, he will be forever."
In 1985, joining wanderers where the wizards and spent three seasons, and the end of his career in the back of the wizards, the team called him "the brightest true philanthropist and ambassador", "despite his achievements in the stadium for his country, he stayed and contribute to the cities will be forever retained his heritage. Wizards official statement.
In the days of the hospital to boulder, he has had been received three dialysis and mouth infections that he failed to eat and 11 days could hardly speak. Boulder in lifetime will not finish his dream, that is built 41 school in Sudan, but his charity group will continue to help to build the school in southern Sudan.
扩展阅读:学c++哪个培训机构好 ... c++适合多大的孩子学 ... 初中生学c++ ... c++编程可以自学吗 ... c++学习机构哪里最好 ... 小学生学c++ ... c++培训班学费一般多少 ... c++是什么专业 ... 专业c+好不好 ...