|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
GiveDlg.cpp内容修改:
void CGiveDlg::OnBnClickedButton1()
{
// TODO: 送出
if ((g_pstGInfoData.stSaveMenuData.uTable == 0) || (g_pstGInfoData.stSaveMenuData.fNumber == 0))
{
CButton *pBtn= (CButton *)GetDlgItem(IDC_BUTTON1); //锁定这个按钮
if(pBtn!=NULL)
{
pBtn->EnableWindow(FALSE); // True or False
}
CString Str;
Str.Format(_T("菜已送完。"));
GetDlgItem(IDC_BUTTON9)->SetWindowText(Str);
}
if ((g_pstGInfoData.stSaveMenuData.uTable != 0) || (g_pstGInfoData.stSaveMenuData.fNumber != 0))
{
CButton *pBtn= (CButton *)GetDlgItem(IDC_BUTTON1); //锁定这个按钮
if(pBtn!=NULL)
{
pBtn->EnableWindow(FALSE); // True or False
}
CMenuDlg.DelTabMenuInfoFun((stMenuInfo *)(g_pstGInfoData.vpRootNode), g_pstGInfoData.stSaveMenuData.uTable, g_pstGInfoData.stSaveMenuData.MenuName);
}
}
void CGiveDlg::OnBnClickedButton18()
{
// TODO: 刷新
CString Str;
CString StrMenu;
CString StrName(g_pstGInfoData.stSaveMenuData.MenuName);
StrMenu.Format(_T("%0.0f个"), g_pstGInfoData.stSaveMenuData.fNumber);
Str.Format(_T("%d桌"), g_pstGInfoData.stSaveMenuData.uTable);
GetDlgItem(IDC_BUTTON9)->SetWindowText(Str + StrMenu + StrName);
if (g_pstGInfoData.stSaveMenuData.uTable != 0)
{
CButton *pBtn= (CButton *)GetDlgItem(IDC_BUTTON1); //锁定这个按钮
if(pBtn!=NULL)
{
pBtn->EnableWindow(TRUE); // True or False
}
}
}
MenuAppDlg.cpp 的修改:
int CMenuAppDlg::RansackNameFun(stMenuInfo *pstRootNode,char *MenuName)
{
stMenuInfo *pstRootNodeTmp = 0ul;
if ((0ul == pstRootNode) || (0ul == MenuName))
{
CString Str("链表参数错误!");
CDialog::MessageBox(Str);
return ~(0);
}
pstRootNodeTmp = pstRootNode;
while(pstRootNodeTmp->Node != 0ul)
{
//遍历链表
pstRootNodeTmp = pstRootNodeTmp->Node;
//判断名字是否相同
if (!strncmp(pstRootNodeTmp->MenuName, MenuName, sizeof(MenuName)))
{
//判断是否送出标志位
if (pstRootNodeTmp->Flag == 1)
{
g_pstGInfoData.stSaveMenuData.fAllCount = pstRootNodeTmp->fAllCount;
g_pstGInfoData.stSaveMenuData.fNumber = pstRootNodeTmp->fNumber;
g_pstGInfoData.stSaveMenuData.uTable = pstRootNodeTmp->uTable;
strncpy(g_pstGInfoData.stSaveMenuData.MenuName, pstRootNodeTmp->MenuName, sizeof(pstRootNodeTmp->MenuName));
break;
}
//标志位为0则清空全局信息
g_pstGInfoData.stSaveMenuData.fAllCount = 0;
g_pstGInfoData.stSaveMenuData.fNumber = 0;
g_pstGInfoData.stSaveMenuData.uTable = 0;
memset(g_pstGInfoData.stSaveMenuData.MenuName, 0, sizeof(g_pstGInfoData.stSaveMenuData.MenuName));
}
}
return 0;
}
//根据桌号删除本桌记录
int CMenuAppDlg:elMenuInfoFun(stMenuInfo *pstRootNode, unsigned int uTable)
{
stMenuInfo *pstRootNodeTmp = 0ul;
stMenuInfo *pstNextRootNode = 0ul;
if ((0ul == pstRootNode) || (0 == uTable))
{
CString Str("链表参数错误!");
CDialog::MessageBox(Str);
return ~(0);
}
pstRootNodeTmp = pstRootNode;
while(pstRootNodeTmp->Node != 0ul)
{
//记录前一节点
pstNextRootNode = pstRootNodeTmp;
pstRootNodeTmp = pstRootNodeTmp->Node;
//判断桌号
if (pstRootNodeTmp->uTable == uTable)
{
//释放删除的节点
free(pstNextRootNode->Node);
pstNextRootNode->Node = 0ul;
pstNextRootNode->Node = pstRootNodeTmp->Node;
}
}
return 0;
}
void CMenuAppDlg::OnBnClickedButton33()
{
// TODO: 结账
m_JzDlg = new CJz();
m_JzDlg->Create(IDD_DIALOG5, this);
m_JzDlg->ShowWindow(SW_SHOW);
} |
|