1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/curriculum-design-express_station_system_gui

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
packagein.cpp 2.7 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
怎样 Отправлено 06.01.2021 15:16 af2f1d3
#include "packagein.h"
#include "ui_packagein.h"
#include "express.h"
#include <QDebug>
#include <QDateTime>
#include "date.h"
#include "dataOperation.h"
#include <QMessageBox>
#include "help.h"
packagein::packagein(QWidget *parent) :
QWidget(parent),
ui(new Ui::packagein)
{
ui->setupUi(this);
this->setWindowTitle("快递驿站系统");
ui->number->setPlaceholderText("请输入快递单号");
ui->fahuo->setPlaceholderText("请输入发货人");
ui->shouhuo->setPlaceholderText("请输入收货人");
ui->name->setPlaceholderText("请输入名字");
ui->value->setPlaceholderText("请输入价格");
ui->weight->setPlaceholderText("请输入重量");
ui->volume->setPlaceholderText("请输入体积");
}
packagein::~packagein()
{
delete ui;
}
void packagein::on_clear_clicked()
{
ui->number->clear();
ui->fahuo->clear();
ui->shouhuo->clear();
ui->name->clear();
ui->value->clear();
ui->weight->clear();
ui->volume->clear();
}
void packagein::on_confirm_clicked()
{
if(ui->number->text()==""||ui->fahuo->text()==""||ui->shouhuo->text()==""||ui->name->text()==""
||ui->weight->text()==""||ui->volume->text()==""||ui->value->text()=="")
{
help::msgbox(this,"提示","请填写信息");
return;
}
string courierNumber=ui->number->text().toStdString();
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->volume->text().toFloat();
float value=ui->value->text().toFloat();
package temp=package(courierNumber,consigner,consignee,name, weight,volume,value,help::refreshTime(),dataOperation::allPackage.size());
dataOperation::allPackage.push_back(temp);
shared_ptr<table> packages=tableManager::tablemanager->loadTable("allPackages");
vector<shared_ptr<Basic>> vec={typeHelper::strToBasic("'"+courierNumber+"'"),
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("'"+temp.getPickupCode()+"'"),
typeHelper::strToBasic("false")};
packages->add(vec);
tableManager::tablemanager->doManage();
on_clear_clicked();
help::msgbox(this,"取件码",help::toQStr(temp.getPickupCode()));
}
void packagein::on_pushButton_3_clicked()
{
this->hide();
emit showMain();
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/curriculum-design-express_station_system_gui.git
git@api.gitlife.ru:oschina-mirror/curriculum-design-express_station_system_gui.git
oschina-mirror
curriculum-design-express_station_system_gui
curriculum-design-express_station_system_gui
master