public CalculateQuantityViewModel(CalculateQuantity open, tblRecipe rec)
 {
     view           = open;
     recipe         = rec;
     allIngredients = service.AllIngredientForRecipe(rec.recipeId);
     list           = new List <Quantity>();
 }
 private void CalculateExecute()
 {
     try
     {
         if (recipe != null)
         {
             CalculateQuantity calc = new CalculateQuantity(recipe);
             calc.ShowDialog();
         }
         else
         {
             MessageBox.Show("Please select the recipe first.");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }