예제 #1
0
        /// <summary>
        /// 更新栏目
        /// </summary>
        /// <param name="category">栏目</param>
        /// <param name="page">单页信息</param>
        /// <returns></returns>
        public Response Update(Category category, CategoryPage page)
        {
            Response _response = new Response()
            {
                Code = 1
            };

            _response = base.Update(category);
            if (_response.Code == 1)
            {
                page.CategoryID = category.CategoryID;
                var _pageManager = new CategoryPageManager();
                if (page.CategoryPageID == 0)
                {
                    _response = _pageManager.Add(page);
                }
                else
                {
                    _response = _pageManager.Update(page);
                }
            }
            if (_response.Code == 1)
            {
                _response.Message = "更新栏目成功!";
            }
            return(_response);
        }
예제 #2
0
        /// <summary>
        /// 添加栏目
        /// </summary>
        /// <param name="category">基本信息</param>
        /// <param name="page">单页栏目信息</param>
        /// <returns></returns>
        public Response Add(Category category, CategoryPage page)
        {
            Response _response = new Response()
            {
                Code = 1
            };

            _response       = base.Add(category);
            page.CategoryID = category.CategoryID;
            var _pageManager = new CategoryPageManager();

            _pageManager.Add(page);
            return(_response);
        }