Ejemplo n.º 1
0
        /// <summary>
        /// 知识库管理
        /// </summary>
        public bool KnowManage(KnowledgeManageDto param, long userId)
        {
            try
            {
                var timeNow = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
                if (param.thisArt.id == 0)
                {
                    AddKnow(param.thisArt, userId);
                }
                else
                {
                    UpdateKnow(param.thisArt, userId);
                }

                KnowTicketManage(param.thisArt.id, param.ticketId, userId);

                KnowAttManage(param.thisArt.id, param.attIds, param.filtList, userId);
            }
            catch (Exception msg)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取相关参数
        /// </summary>
        public KnowledgeManageDto GetParam()
        {
            KnowledgeManageDto param = new KnowledgeManageDto();
            var pageArt  = AssembleModel <sdk_kb_article>();
            var isActive = Request.Form["Active"];

            if (!string.IsNullOrEmpty(isActive) && isActive.Equals("on"))
            {
                pageArt.is_active = 1;
            }
            else
            {
                pageArt.is_active = 0;
            }
            //var articleBody = Request.Form["articleBody"];
            //pageArt.article_body = articleBody;
            if (string.IsNullOrEmpty(pageArt.keywords))
            {
                pageArt.keywords = "";
            }
            if (string.IsNullOrEmpty(pageArt.error_code))
            {
                pageArt.error_code = "";
            }
            if (pageArt.publish_to_type_id == (int)DTO.DicEnum.KB_PUBLISH_TYPE.INTER_USER_ACCOUNT)
            {
                pageArt.classification_id = null;
                pageArt.territory_id      = null;
            }
            else if (pageArt.publish_to_type_id == (int)DTO.DicEnum.KB_PUBLISH_TYPE.INTER_USER_CLASS)
            {
                pageArt.account_id   = null;
                pageArt.territory_id = null;
            }
            else if (pageArt.publish_to_type_id == (int)DTO.DicEnum.KB_PUBLISH_TYPE.INTER_USER_TERR)
            {
                pageArt.classification_id = null;
                pageArt.account_id        = null;
            }
            else
            {
                pageArt.classification_id = null;
                pageArt.account_id        = null;
                pageArt.territory_id      = null;
            }
            if (isAdd)
            {
                param.thisArt = pageArt;
            }
            else
            {
                thisArt.is_active              = pageArt.is_active;
                thisArt.kb_category_id         = pageArt.kb_category_id;
                thisArt.title                  = pageArt.title;
                thisArt.keywords               = pageArt.keywords;
                thisArt.error_code             = pageArt.error_code;
                thisArt.article_body           = pageArt.article_body;
                thisArt.article_body_no_markup = pageArt.article_body_no_markup;
                thisArt.view_count             = pageArt.view_count;
                thisArt.publish_to_type_id     = pageArt.publish_to_type_id;
                thisArt.account_id             = pageArt.account_id;
                thisArt.classification_id      = pageArt.classification_id;
                thisArt.territory_id           = pageArt.territory_id;
                param.thisArt                  = thisArt;
            }
            param.attIds   = Request.Form["attIds"];
            param.filtList = GetSessAttList(objectId);
            param.ticketId = Request.Form["TicketIds"];
            return(param);
        }