Пример #1
0
        }// End CreateNewDonationItem()

        /// <summary>
        /// NAME: Matt Deaton
        /// DATE: 2020-03-14
        /// CHECKED BY: Steven Coonrod
        ///
        /// Method to Edit a Shelter Item in inventory.
        ///
        /// </summary>
        /// <remarks>
        ///
        /// UPDATED BY: Steve Coonrod
        /// UPDATED: 2020-4-25
        /// CHANGE: Changed the result to accomidate for a low inventory trigger
        ///         which will return 3 rows effected rather than 1
        ///
        /// </remarks>
        /// <param name="oldShelterItem"></param>
        /// <param name="newShelterItem"></param>
        /// <returns>bool of result</returns>
        public bool EditShelterItem(Item oldShelterItem, Item newShelterItem)
        {
            bool result = false;

            try
            {
                int rowsEffected = _itemAccessor.UpdateShelterItem(oldShelterItem, newShelterItem);
                if (rowsEffected == 1 || rowsEffected == 3)
                {
                    result = true;
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Failed to Update Shelter Item.", ex);
            }
            return(result);
        }// End EditShelterItem()