fill basket
This commit is contained in:
parent
f315cc81a6
commit
8b534e1229
9 changed files with 62 additions and 18 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue