dkhwang118 / CIS560_F18-Project-RecipeManager

KSU - Fall 2018 - CIS560 - Database Project - ProjectTeam1
GNU General Public License v3.0
1 stars 2 forks source link

Number makeable dev #80

Closed dbramucci closed 5 years ago

dbramucci commented 5 years ago

I added a column showing how many times a recipe can be made given the current pantry.

I added a method to the Query Class that given a recipe, the number is returned. This number is computed as MIN(numberInPantry/numberInRecipe) over the ingredients.

To easily add this to the DataGrid, I made a hack and added the query class to the Recipe Object so I could expose this as a property on the recipe.

This is very inefficient for 2 reasons,

  1. A separate query is made for each recipe
  2. There is no caching, this is recomputed every time we visit the screen