fill basket

This commit is contained in:
Martin Brodbeck 2018-07-21 19:24:56 +02:00
parent f315cc81a6
commit 8b534e1229
9 changed files with 62 additions and 18 deletions

View file

@ -1,6 +1,7 @@
#include "mainwindow.h"
#include "sellerdialog.h"
#include "pricedialog.h"
#include <regex>
@ -58,8 +59,16 @@ void MainWindow::on_sellerNoEdit_checkSellerNo()
auto seller = marketplace_->findSellerWithSellerNo(sellerNo);
if (seller) {
std::cout << "!!! Seller gefunden: " << seller->getFirstName() << "\n";
// TODO: Dialog für Preiseingabe anzeigen
// TODO: Warenkorb füllen
PriceDialog priceDialog(this);
auto dialogResult = priceDialog.exec();
if (dialogResult == QDialog::Accepted)
{
int price = priceDialog.getPrice();
auto article = std::make_unique<Article>(price);
article->setSeller(seller);
std::cout << "!!! Neuer Artikel: " << article->getPrice() << "Cent \n";
marketplace_->addArticleToBasket(std::move(article));
}
}
ui_.sellerNoEdit->clear();