Foodolini.BusinessLogic.ShoppingList Class Reference

Represents a shopping list. More...

Collaboration diagram for Foodolini.BusinessLogic.ShoppingList:
Collaboration graph

List of all members.

Public Member Functions

 ShoppingList (Person person)
 Instantiates a shopping list with the provided owner.
IEnumerable< ShoppingListItemGetShoppingListItems ()
 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< ShoppingListItemshoppingList
 The items in the shopping list.

Detailed Description

Represents a shopping list.

Definition at line 12 of file ShoppingList.cs.


Constructor & Destructor Documentation

Foodolini.BusinessLogic.ShoppingList.ShoppingList ( Person  person  ) 

Instantiates a shopping list with the provided owner.

Parameters:
person 

Definition at line 23 of file ShoppingList.cs.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
ingredient A Ingredient
Returns:
A System.Boolean

Definition at line 89 of file ShoppingList.cs.

IEnumerable<ShoppingListItem> Foodolini.BusinessLogic.ShoppingList.GetShoppingListItems (  ) 

Loads and returns the shopping list for the current user.

Returns:
A IEnumerable<ShoppingListItem>

Definition at line 41 of file ShoppingList.cs.

void Foodolini.BusinessLogic.ShoppingList.RemoveIngredient ( Ingredient  ingredient  ) 

Removes the ingredient from the shopping list.

Parameters:
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.

Parameters:
item 

Definition at line 107 of file ShoppingList.cs.

void Foodolini.BusinessLogic.ShoppingList.RemoveRecipe ( Recipe  recipe  ) 

Removes the recipe from the shopping list.

Parameters:
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.


Member Data Documentation

Owner of the shopping list.

Definition at line 17 of file ShoppingList.cs.

The items in the shopping list.

Definition at line 33 of file ShoppingList.cs.


The documentation for this class was generated from the following file:

Foodolini 1.0.0 Documentation, generated with DoxyGen.