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 /db.vala | |
parent | 1100250ffd1f484ba7f69990170a678aee5d7ffd (diff) | |
download | serial-barcode-scanner-ebe5ee94ef47f74117184175bfd98175d31e558a.tar.bz2 |
use new restock variant
Diffstat (limited to 'db.vala')
-rw-r--r-- | db.vala | 29 |
1 files changed, 0 insertions, 29 deletions
@@ -11,9 +11,7 @@ public class Database { private Sqlite.Statement stock_stmt2; private Sqlite.Statement price_stmt; int32 user = 0; - uint64 product = 0; bool logged_in = false; - bool stock_mode = false; private static string product_query = "SELECT name FROM products WHERE id = ?"; private static string products_query = "SELECT id, name FROM products"; private static string purchase_query1 = "INSERT INTO purchases ('user', 'product', 'timestamp') VALUES (?, ?, ?)"; @@ -93,7 +91,6 @@ public class Database { public bool logout() { this.user = 0; - this.stock_mode = false; this.logged_in = false; return true; } @@ -216,22 +213,6 @@ public class Database { return false; } - public bool choose_stock_product(uint64 id) { - if(is_in_stock_mode()) { - product = id; - return true; - } - return false; - } - - public bool add_stock_product(uint64 amount) { - if(is_in_stock_mode() && product != 0) { - return restock(this.product, amount); - } - - return false; - } - public bool restock(uint64 product, uint64 amount) { if(is_logged_in()) { int rc = 0; @@ -261,17 +242,7 @@ public class Database { return false; } - public bool go_into_stock_mode() { - if(is_logged_in()) - stock_mode = true; - return stock_mode; - } - public bool is_logged_in() { return this.logged_in; } - - public bool is_in_stock_mode() { - return this.stock_mode; - } } |