5 Star 12 Fork 3

curriculum-design / 快递驿站系统GUI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
expressmail.cpp 2.67 KB
一键复制 编辑 原始数据 按行查看 历史
怎样 提交于 2021-01-06 20:16 . 使用SG-DataBase的版本
#include "expressmail.h"
#include "ui_expressmail.h"
#include "packagein.h"
#include "express.h"
#include "dataOperation.h"
#include <QMessageBox>
#include "payment.h"
#include "text.h"
#include "help.h"
expressmail::expressmail(QWidget *parent) :
QWidget(parent),
ui(new Ui::expressmail)
{
displayBill=new text;
zhifu=new payment;
ui->setupUi(this);
connect(displayBill,SIGNAL(showpay()),this,SLOT(_showpay()));
ui->fahuo->setPlaceholderText("输入发货人");
ui->shouhuo->setPlaceholderText("输入收货人");
ui->name->setPlaceholderText("输入名字");
ui->value->setPlaceholderText("输入价格");
ui->volum->setPlaceholderText("输入体积");
ui->weight->setPlaceholderText("输入重量");
this->setWindowTitle("快递驿站系统");
}
expressmail::~expressmail()
{
delete ui;
}
void expressmail::on_clear_clicked()
{
ui->fahuo->clear();
ui->shouhuo->clear();
ui->name->clear();
ui->value->clear();
ui->volum->clear();
ui->weight->clear();
}
void expressmail::on_pushButton_3_clicked()
{
this->hide();
emit showMain();
}
void expressmail::on_confirm_clicked()
{
if(ui->fahuo->text()==""||ui->shouhuo->text()==""||ui->name->text()==""||ui->weight->text()==""
||ui->volum->text()==""||ui->value->text()=="")
{
help::msgbox(this,"提示","请填写信息");
return;
}
string consigner=ui->fahuo->text().toStdString();
string consignee=ui->shouhuo->text().toStdString();
string name=ui->name->text().toStdString();
float weight=ui->weight->text().toFloat();
float volume=ui->volum->text().toFloat();
float value=ui->value->text().toFloat();
express tmp=express(consigner,consignee,name, weight,volume,value,help::refreshTime());
dataOperation::allExpress.push_back(tmp);
shared_ptr<table> expresses=tableManager::tablemanager->loadTable("allExpress");
expresses->add({typeHelper::strToBasic("'"+tmp.getCourierNumber()+"'"),
typeHelper::strToBasic("'"+consigner+"'"),
typeHelper::strToBasic("'"+consignee+"'"),
typeHelper::strToBasic("'"+name+"'"),
typeHelper::strToBasic(to_string(weight)),
typeHelper::strToBasic(to_string(volume)),
typeHelper::strToBasic(to_string(value)),
typeHelper::strToBasic("false")});
tableManager::tablemanager->doManage();
on_clear_clicked();
express *e=&dataOperation::allExpress.back();
zhifu->setSelectExpress(e);
string expbill=e->getExpressBill();
displayBill->show(QString::fromStdString(expbill));
}
void expressmail::_showpay()
{
zhifu->QWidget::show();
}
C++
1
https://gitee.com/curriculum-design/express_station_system_gui.git
git@gitee.com:curriculum-design/express_station_system_gui.git
curriculum-design
express_station_system_gui
快递驿站系统GUI
master

搜索帮助