Esempio n. 1
0
        /// <summary>
        /// Saves the specified category.
        /// </summary>
        /// <param name="category">The category.</param>
        /// <returns></returns>
        public int Save(Category category)
        {
            SharePointListItem listItem = CategoryMapper.CreateDto(category);
            int categoryId;

            if (listItem.Id == 0)
            {
                categoryId = provider.AddListItem(ForumConstants.Lists_Category, listItem);
            }
            else
            {
                categoryId = provider.UpdateListItem(ForumConstants.Lists_Category, listItem);
            }

            return(categoryId);
        }