importing sales started
This commit is contained in:
parent
c82378dfa9
commit
0a91de4d86
5 changed files with 54 additions and 2 deletions
|
@ -86,4 +86,19 @@ void JsonUtil::exportSales(const std::string& filename, Marketplace* market, int
|
|||
}
|
||||
|
||||
writer->write(root, &file);
|
||||
}
|
||||
|
||||
void JsonUtil::importSales(const std::string& filename, Marketplace* market, int cashPointNo)
|
||||
{
|
||||
Json::Value jsonValues;
|
||||
std::ifstream file(filename);
|
||||
file >> jsonValues;
|
||||
|
||||
int source_no = jsonValues["source_no"].asInt();
|
||||
if (source_no == cashPointNo) {
|
||||
throw std::runtime_error("Die Kassen-Nr. der zu imporierenden Daten wird von dieser Kasse "
|
||||
"hier bereits verwendet.");
|
||||
}
|
||||
|
||||
// TODO: Import sales
|
||||
}
|
|
@ -11,6 +11,7 @@ class JsonUtil
|
|||
static void exportSellers(const std::string& filename, Marketplace* market);
|
||||
static void importSellers(const std::string& filename, Marketplace* market);
|
||||
static void exportSales(const std::string& filename, Marketplace* market, int cashPointNo);
|
||||
static void importSales(const std::string& filename, Marketplace* market, int cashPointNo);
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue