Exemplo n.º 1
0
        /// <summary>
        /// 更新栏目
        /// </summary>
        /// <param name="category">栏目</param>
        /// <param name="link">链接信息</param>
        /// <returns></returns>
        public Response Update(ContentManageSystem.Entity.Models.Category.Category category, CategoryLink link)
        {
            Response _response = new Response()
            {
                Code = 1
            };

            _response = base.Update(category);
            if (_response.Code == 1)
            {
                link.CategoryID = category.CategoryID;
                var _linkManager = new CategoryLinkServices();
                if (link.CategoryLinkID == 0)
                {
                    _response = _linkManager.Add(link);
                }
                else
                {
                    _response = _linkManager.Update(link);
                }
            }
            if (_response.Code == 1)
            {
                _response.Message = "更新栏目成功!";
            }
            return(_response);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加栏目
        /// </summary>
        /// <param name="category">基本信息</param>
        /// <param name="link">链接栏目信息</param>
        /// <returns></returns>
        public Response Add(ContentManageSystem.Entity.Models.Category.Category category, CategoryLink link)
        {
            Response _response = new Response()
            {
                Code = 1
            };

            _response       = base.Add(category);
            link.CategoryID = category.CategoryID;
            var _linkManager = new CategoryLinkServices();

            _linkManager.Add(link);
            return(_response);
        }