public void Update(int itemId)
 {
     // Added Ingredients
     foreach (ItemIngredient itemIngredient in _itemIngredientsAdded)
     {
         itemIngredient.SetItemId(itemId);
         itemIngredient.Update();
         ItemIngredientAdjustment.Add(SessionManager.ActiveEmployee.Id,
                                      itemId, itemIngredient.IngredientId, null,
                                      itemIngredient.Amount, itemIngredient.MeasurementUnit);
     }
     // Changed Ingredients
     foreach (ItemIngredient itemIngredient in _itemIngredientsNeedingUpdate)
     {
         ItemIngredient original  = ItemIngredient.Get(itemIngredient.Id);
         double         oldAmount = UnitConversion.Convert(original.Amount, original.MeasurementUnit,
                                                           itemIngredient.MeasurementUnit);
         itemIngredient.Update();
         ItemIngredientAdjustment.Add(SessionManager.ActiveEmployee.Id,
                                      itemId, itemIngredient.IngredientId, oldAmount, itemIngredient.Amount,
                                      itemIngredient.MeasurementUnit);
     }
     // Removed Ingredients
     foreach (ItemIngredient itemIngredient in _itemIngredientsRemoved)
     {
         ItemIngredient.Delete(itemIngredient.Id);
         ItemIngredientAdjustment.Add(SessionManager.ActiveEmployee.Id,
                                      itemId, itemIngredient.IngredientId, itemIngredient.Amount, null,
                                      itemIngredient.MeasurementUnit);
     }
     _itemIngredientsAdded.Clear();
     _itemIngredientsNeedingUpdate.Clear();
     _itemIngredientsRemoved.Clear();
 }
        public void Cancel()
        {
            foreach (ItemIngredient itemIngredient in _itemIngredientsAdded)
            {
                ItemIngredient.Delete(itemIngredient.Id);
            }
            _itemIngredientsAdded.Clear();
            _itemIngredientsNeedingUpdate.Clear();
            _itemIngredientsRemoved.Clear();

            // Reset UI
            InitializeFields();
        }