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
This commit is contained in:
jens 2021-04-29 15:51:45 +02:00
commit db41fb525f
2 changed files with 19 additions and 3 deletions

View File

@ -195,13 +195,14 @@ public class ShoppingListEntry
if(condition) if(condition)
{ {
// Update the amount // 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); preparedStmt = conn.prepareStatement(updateQuery);
if(delete) if(delete)
preparedStmt.setFloat(1, currentAmount - this.getAmount()); preparedStmt.setFloat(1, currentAmount - this.getAmount());
else else
preparedStmt.setFloat(1, currentAmount + this.getAmount()); preparedStmt.setFloat(1, currentAmount + this.getAmount());
preparedStmt.setLong(2, this.getParentList().getId()); preparedStmt.setLong(2, this.getParentList().getId());
preparedStmt.setLong(3, this.getProduct().getId()); preparedStmt.setLong(3, this.getProduct().getId());
preparedStmt.setLong(4, this.getUnit().getId()); preparedStmt.setLong(4, this.getUnit().getId());

View File

@ -128,8 +128,23 @@ public class Start
DatabaseHandler.getInstance().disconnect(); DatabaseHandler.getInstance().disconnect();
System.exit(0); System.exit(0);
} }
else exitWithError(Settings.languageBlock.get("productNotFound") + " " + productName);
exitWithError(Settings.languageBlock.get("couldNotRemoveProdFromList") + " " + entry.toString());
// 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()) // for(ShoppingListEntry entry : list.getEntries())
// { // {