Represents a shopping list. More...
Public Member Functions | |
ShoppingList (Person person) | |
Instantiates a shopping list with the provided owner. | |
IEnumerable< ShoppingListItem > | GetShoppingListItems () |
Loads and returns the shopping list for the current user. | |
bool | AddIngredient (Ingredient ingredient, double quantity) |
Adds the given quantity of an ingredient to the shopping list. If the ingredient is already in the list, the quantity will be added. | |
void | AddRecipe (Recipe recipe, double servings) |
Adds a recipe's ingredient to the shopping list. | |
bool | ContainsIngredient (Ingredient ingredient) |
Determines if the specified ingredient is already in the shopping list. | |
void | RemoveIngredient (Ingredient ingredient) |
Removes the ingredient from the shopping list. | |
void | RemoveRecipe (Recipe recipe) |
Removes the recipe from the shopping list. | |
void | Save () |
Saves the shopping list to the database. | |
void | Clear () |
Deletes all entries in the shopping list from the database. | |
Private Member Functions | |
void | RemoveItem (ShoppingListItem item) |
Removes a given item from the shopping list. | |
Private Attributes | |
Person | owner |
Owner of the shopping list. | |
List< ShoppingListItem > | shoppingList |
The items in the shopping list. |
Represents a shopping list.
Definition at line 12 of file ShoppingList.cs.
Foodolini.BusinessLogic.ShoppingList.ShoppingList | ( | Person | person | ) |
Instantiates a shopping list with the provided owner.
person |
Definition at line 23 of file ShoppingList.cs.
bool Foodolini.BusinessLogic.ShoppingList.AddIngredient | ( | Ingredient | ingredient, | |
double | quantity | |||
) |
Adds the given quantity of an ingredient to the shopping list. If the ingredient is already in the list, the quantity will be added.
ingredient | ||
quantity |
Definition at line 56 of file ShoppingList.cs.
void Foodolini.BusinessLogic.ShoppingList.AddRecipe | ( | Recipe | recipe, | |
double | servings | |||
) |
Adds a recipe's ingredient to the shopping list.
recipe | ||
servings |
Definition at line 74 of file ShoppingList.cs.
void Foodolini.BusinessLogic.ShoppingList.Clear | ( | ) |
Deletes all entries in the shopping list from the database.
Definition at line 142 of file ShoppingList.cs.
bool Foodolini.BusinessLogic.ShoppingList.ContainsIngredient | ( | Ingredient | ingredient | ) |
Determines if the specified ingredient is already in the shopping list.
ingredient | A Ingredient |
Definition at line 89 of file ShoppingList.cs.
IEnumerable<ShoppingListItem> Foodolini.BusinessLogic.ShoppingList.GetShoppingListItems | ( | ) |
Loads and returns the shopping list for the current user.
Definition at line 41 of file ShoppingList.cs.
void Foodolini.BusinessLogic.ShoppingList.RemoveIngredient | ( | Ingredient | ingredient | ) |
Removes the ingredient from the shopping list.
ingredient |
Definition at line 97 of file ShoppingList.cs.
void Foodolini.BusinessLogic.ShoppingList.RemoveItem | ( | ShoppingListItem | item | ) | [private] |
Removes a given item from the shopping list.
item |
Definition at line 107 of file ShoppingList.cs.
void Foodolini.BusinessLogic.ShoppingList.RemoveRecipe | ( | Recipe | recipe | ) |
Removes the recipe from the shopping list.
recipe |
Definition at line 121 of file ShoppingList.cs.
void Foodolini.BusinessLogic.ShoppingList.Save | ( | ) |
Saves the shopping list to the database.
Definition at line 132 of file ShoppingList.cs.
Owner of the shopping list.
Definition at line 17 of file ShoppingList.cs.
List<ShoppingListItem> Foodolini.BusinessLogic.ShoppingList.shoppingList [private] |
The items in the shopping list.
Definition at line 33 of file ShoppingList.cs.