Browse Source

Merge branch 'development' of

https://git.server47.de/jens/ShoppingList.git into development

Conflicts:
	ShoppingList/src/com/jens/rhasspy/shoppinglist/ShoppingListEntry.java
	ShoppingList/src/com/jens/rhasspy/shoppinglist/Start.java
development
jens 1 year ago
parent
commit
db41fb525f
  1. 3
      ShoppingList/src/com/jens/rhasspy/shoppinglist/ShoppingListEntry.java
  2. 19
      ShoppingList/src/com/jens/rhasspy/shoppinglist/Start.java

3
ShoppingList/src/com/jens/rhasspy/shoppinglist/ShoppingListEntry.java

@ -195,13 +195,14 @@ public class ShoppingListEntry
if(condition)
{
// Update the amount
String updateQuery = "UPDATE listEntries SET amount=? WHERE listId=? AND productId=? AND unit=?";
String updateQuery = "UPDATE listEntries set amount=? WHERE listId=? AND productId=? AND unit=?";
preparedStmt = conn.prepareStatement(updateQuery);
if(delete)
preparedStmt.setFloat(1, currentAmount - this.getAmount());
else
preparedStmt.setFloat(1, currentAmount + this.getAmount());
preparedStmt.setLong(2, this.getParentList().getId());
preparedStmt.setLong(3, this.getProduct().getId());
preparedStmt.setLong(4, this.getUnit().getId());

19
ShoppingList/src/com/jens/rhasspy/shoppinglist/Start.java

@ -128,8 +128,23 @@ public class Start
DatabaseHandler.getInstance().disconnect();
System.exit(0);
}
else
exitWithError(Settings.languageBlock.get("couldNotRemoveProdFromList") + " " + entry.toString());
exitWithError(Settings.languageBlock.get("productNotFound") + " " + productName);
// for(ShoppingListEntry entry : list.getEntries())
// {
// if(entry.getProduct().equals(p))
// {
// if(entry.delete())
// {
// DatabaseHandler.getInstance().disconnect();
// System.exit(0);
// }
// else
// Miscellaneous.logEvent(Settings.languageBlock.get("couldNotRemoveProdFromList") + " " + productName, 2);
// }
// }
// else
// exitWithError(Settings.languageBlock.get("couldNotRemoveProdFromList") + " " + entry.toString());
// for(ShoppingListEntry entry : list.getEntries())
// {

Loading…
Cancel
Save