more on sellerdialog
This commit is contained in:
parent
31d46866f2
commit
207edb27ba
13 changed files with 168 additions and 17 deletions
|
@ -19,6 +19,7 @@ class Entity
|
|||
void setSourceNo(int sourceNo);
|
||||
|
||||
const boost::uuids::uuid& getUuid() const { return uuid_; };
|
||||
std::string getUuidAsString() const { return boost::uuids::to_string(uuid_); }
|
||||
virtual State getState() const;
|
||||
virtual int getSourceNo() const;
|
||||
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
#include "marketplace.h"
|
||||
#include "database.h"
|
||||
|
||||
void Marketplace::storeToDb() {
|
||||
Marketplace::Marketplace()
|
||||
{
|
||||
auto seller = std::make_shared<Seller>("Max", "Mustermann");
|
||||
sellers_.push_back(seller);
|
||||
}
|
||||
|
||||
void Marketplace::storeToDb()
|
||||
{
|
||||
const std::string DB_PATH{"/tmp/kima2.db"};
|
||||
|
||||
Database db(DB_PATH);
|
||||
db.storeSellers(sellers_);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<Seller>>& Marketplace::getSellers() { return sellers_; }
|
|
@ -10,8 +10,11 @@
|
|||
class Marketplace
|
||||
{
|
||||
public:
|
||||
Marketplace();
|
||||
void storeToDb();
|
||||
void loadFromDb();
|
||||
std::vector<std::shared_ptr<Seller>>& getSellers();
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<Seller>> sellers_;
|
||||
std::vector<std::shared_ptr<Sale>> sales_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue