diff options
author | Sebastian Reichel <sre@ring0.de> | 2012-08-06 21:52:27 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2012-08-06 21:52:27 +0200 |
commit | ebe5ee94ef47f74117184175bfd98175d31e558a (patch) | |
tree | 517c56fc605ebffc7852401274b2d4f76328afdd /main.vala | |
parent | 1100250ffd1f484ba7f69990170a678aee5d7ffd (diff) | |
download | serial-barcode-scanner-ebe5ee94ef47f74117184175bfd98175d31e558a.tar.bz2 |
use new restock variant
Diffstat (limited to 'main.vala')
-rw-r--r-- | main.vala | 30 |
1 files changed, 2 insertions, 28 deletions
@@ -77,34 +77,8 @@ public static bool interpret(string data) { stdout.printf("[%lld] You must be logged in to go into the stock mode\n", timestamp); return false; } else { - stdout.printf("[%lld] Going into stock mode!\n", timestamp); - return db.go_into_stock_mode(); - } - } else if(db.is_in_stock_mode()) { - if(!data.has_prefix("AMOUNT")) { - uint64 id = uint64.parse(data); - - /* check if data has valid format */ - if(data != "%llu".printf(id)) { - stdout.printf("[%lld] ungültiges Produkt: %s\n", timestamp, data); - return false; - } - - stdout.printf("[%lld] wähle Produkt: %s\n", timestamp, db.get_product_name(id)); - - return db.choose_stock_product(id); - } else { - uint64 amount = uint64.parse(data.substring(7)); - - /* check if data has valid format */ - if(data != "AMOUNT %llu".printf(amount)) { - stdout.printf("[%lld] ungültiges Produkt: %s\n", timestamp, data); - return false; - } - - stdout.printf("[%lld] zum Bestand hinzufügen: %llu\n", timestamp, amount); - - return db.add_stock_product(amount); + restock_dialog(); + return true; } } else { uint64 id = uint64.parse(data); |