#include "diningtable.h"
#include "ui_diningtable.h"
#include<QMessageBox>
#include<QtSql/QSqlQuery>
#include<QtSql/QSqlDatabase>
#include<QDebug>
#include<QString>
diningTable::diningTable(QWidget *parent) :
QWidget(parent),
ui(new Ui::diningTable)
{
ui->setupUi(this);
}
diningTable::~diningTable()
{
delete ui;
}
void diningTable::on_t_order1_clicked()
{
o=new OrderDish;
o->show();
connect(this,SIGNAL(sendStr(QString)),o,SLOT(getStr(QString)));
QString oldStr ="1"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(o,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_return_clicked()
{
emit sendsignal();
delete this;
}
void diningTable::reshow(){
this->show();
}
void diningTable::on_t_order2_clicked()
{
o=new OrderDish;
o->show();
connect(this,SIGNAL(sendStr(QString)),o,SLOT(getStr(QString)));
QString oldStr ="2"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(o,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_order3_clicked()
{
o=new OrderDish;
o->show();
connect(this,SIGNAL(sendStr(QString)),o,SLOT(getStr(QString)));
QString oldStr ="3"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(o,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_order4_clicked()
{
o=new OrderDish;
o->show();
connect(this,SIGNAL(sendStr(QString)),o,SLOT(getStr(QString)));
QString oldStr ="4"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(o,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_order5_clicked()
{
o=new OrderDish;
o->show();
connect(this,SIGNAL(sendStr(QString)),o,SLOT(getStr(QString)));
QString oldStr ="5"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(o,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_order6_clicked()
{
o=new OrderDish;
o->show();
connect(this,SIGNAL(sendStr(QString)),o,SLOT(getStr(QString)));
QString oldStr ="6"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(o,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_book1_clicked()
{
b=new book;
b->show();
this->hide();
connect(b,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_book2_clicked()
{
b=new book;
b->show();
this->hide();
connect(b,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_book3_clicked()
{
b=new book;
b->show();
this->hide();
connect(b,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_book4_clicked()
{
b=new book;
b->show();
this->hide();
connect(b,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_book5_clicked()
{
b=new book;
b->show();
this->hide();
connect(b,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_book6_clicked()
{
b=new book;
b->show();
this->hide();
connect(b,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_add1_clicked()
{
ad=new addOrder;
ad->show();
connect(this,SIGNAL(sendStr(QString)),ad,SLOT(getStr(QString)));
QString oldStr ="1"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(ad,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_account1_clicked()
{
p=new pay;
p->show();
connect(this,SIGNAL(sendStr(QString)),p,SLOT(getStr(QString)));
QString oldStr ="1"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(p,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_account2_clicked()
{
p=new pay;
p->show();
connect(this,SIGNAL(sendStr(QString)),p,SLOT(getStr(QString)));
QString oldStr ="2"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(p,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_account3_clicked()
{
p=new pay;
p->show();
connect(this,SIGNAL(sendStr(QString)),p,SLOT(getStr(QString)));
QString oldStr ="3"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(p,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_account4_clicked()
{
p=new pay;
p->show();
connect(this,SIGNAL(sendStr(QString)),p,SLOT(getStr(QString)));
QString oldStr ="4"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(p,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_account5_clicked()
{
p=new pay;
p->show();
connect(this,SIGNAL(sendStr(QString)),p,SLOT(getStr(QString)));
QString oldStr ="5"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(p,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_account6_clicked()
{
p=new pay;
p->show();
connect(this,SIGNAL(sendStr(QString)),p,SLOT(getStr(QString)));
QString oldStr ="6"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(p,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_add2_clicked()
{
ad=new addOrder;
ad->show();
connect(this,SIGNAL(sendStr(QString)),ad,SLOT(getStr(QString)));
QString oldStr ="2"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(ad,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_add3_clicked()
{
ad=new addOrder;
ad->show();
connect(this,SIGNAL(sendStr(QString)),ad,SLOT(getStr(QString)));
QString oldStr ="3"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(ad,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_add4_clicked()
{
ad=new addOrder;
ad->show();
connect(this,SIGNAL(sendStr(QString)),ad,SLOT(getStr(QString)));
QString oldStr ="4"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(ad,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void diningTable::on_t_add5_clicked()
{
ad=new addOrder;
ad->show();
connect(this,SIGNAL(sendStr(QString)),ad,SLOT(getStr(QString)));
QString oldStr ="5"; //向newDialog传当前节点名字
emit sendStr(oldStr);
this->hide();
connect(ad,SIGNAL(sendsignal()),this,SLOT(reshow()));//当点击子界面时,调用主界面的reshow()函数
}
void dini