Exemplo n.º 1
0
        /// <summary>
        /// 添加栏目
        /// </summary>
        /// <param name="category">基本信息</param>
        /// <param name="general">常规栏目信息</param>
        /// <returns></returns>
        public Response Add(Category category, CategoryGeneral general)
        {
            Response _response = new Response()
            {
                Code = 1
            };

            _response          = base.Add(category);
            general.CategoryID = category.CategoryID;
            var _generalManage = new CategoryGeneralManager();

            _generalManage.Add(general);
            return(_response);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新栏目
        /// </summary>
        /// <param name="category">栏目</param>
        /// <param name="general">常规信息</param>
        /// <returns></returns>
        public Response Update(Category category, CategoryGeneral general)
        {
            Response _response = new Response();

            _response = base.Update(category);
            if (_response.Code == 1)
            {
                general.CategoryID = category.CategoryID;
                var _generalManager = new CategoryGeneralManager();
                if (general.CategoryGeneralID == 0)
                {
                    _response = _generalManager.Add(general);
                }
                else
                {
                    _response = _generalManager.Update(general);
                }
            }
            if (_response.Code == 1)
            {
                _response.Message = "更新栏目成功";
            }
            return(_response);
        }