forbid adding sellers if there are already sold articles
This commit is contained in:
parent
fb1f0cdba7
commit
d784a26872
1 changed files with 11 additions and 1 deletions
|
@ -24,6 +24,16 @@ SellerDialog::SellerDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(parent,
|
||||||
|
|
||||||
void SellerDialog::on_newButton_clicked()
|
void SellerDialog::on_newButton_clicked()
|
||||||
{
|
{
|
||||||
|
// Don't allow new seller if market has already started
|
||||||
|
if (market_->getSales().size() > 0) {
|
||||||
|
QMessageBox(QMessageBox::Icon::Warning, "Hinweis",
|
||||||
|
"Da die Verkaufsphase schon begonnen hat (Artikel wurden bereits verkauft) "
|
||||||
|
"können Sie keine Verkäufer mehr hinzufügen.",
|
||||||
|
QMessageBox::StandardButton::Ok, this)
|
||||||
|
.exec();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ui_.tableView->reset();
|
ui_.tableView->reset();
|
||||||
ui_.tableView->model()->insertRows(ui_.tableView->model()->rowCount(), 1);
|
ui_.tableView->model()->insertRows(ui_.tableView->model()->rowCount(), 1);
|
||||||
ui_.tableView->scrollToBottom();
|
ui_.tableView->scrollToBottom();
|
||||||
|
|
Loading…
Reference in a new issue