private void NewIngredientAdd_Click(object sender, EventArgs e) { Ingredient ingredient = new Ingredient(this.NewIngredientName.Text, new Quantity((float)Convert.ToDouble(this.NewIngredientQnty.Text), Quantity.GetQuantityMeasurementFromString((string)this.NewIngredientType.SelectedItem))); NewRecipe.AddIngredient(ingredient); this.IngredientsList.DataSource = null; this.IngredientsList.DataSource = NewRecipe.Ingredients.Ingredients; }
public int AddIngredient(Ingredient ingredient) { return Ingredients.AddIngredient(ingredient); }
public int AddIngredient(Ingredient newIngredient) { Ingredients.Add(newIngredient); return Ingredients.Count; }