Beispiel #1
0
        /// <summary>
        /// 删除知识库
        /// </summary>
        public bool DeleteKnow(long artId, long userId)
        {
            var timeNow       = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
            var skatDal       = new sdk_kb_article_ticket_dal();
            var skacDal       = new sdk_kb_article_comment_dal();
            var thisArt       = _dal.FindNoDeleteById(artId);
            var thisArtTicket = skatDal.GetArtTicket(artId);
            var thisArtComm   = skacDal.GetCommByArt(artId);

            if (thisArtComm != null && thisArtComm.Count > 0)
            {
                thisArtComm.ForEach(_ => {
                    skacDal.SoftDelete(_, userId);
                    OperLogBLL.OperLogDelete <sdk_kb_article_comment>(_, _.id, userId, OPER_LOG_OBJ_CATE.SDK_KONWLEDGE_COMMENT, "删除知识库评论");
                });
            }
            if (thisArtTicket != null && thisArtTicket.Count > 0)
            {
                thisArtTicket.ForEach(_ => {
                    skatDal.SoftDelete(_, userId);
                    OperLogBLL.OperLogDelete <sdk_kb_article_ticket>(_, _.id, userId, OPER_LOG_OBJ_CATE.SDK_KONWLEDGE_TICKET, "删除知识库关联工单");
                });
            }
            if (thisArt != null)
            {
                _dal.SoftDelete(thisArt, userId);
                OperLogBLL.OperLogDelete <sdk_kb_article>(thisArt, thisArt.id, userId, OPER_LOG_OBJ_CATE.SDK_KONWLEDGE, "删除知识库");
            }

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// 新增评论
        /// </summary>
        public bool SaveComment(long artId, string comment, long userId)
        {
            var thisArt  = _dal.FindNoDeleteById(artId);
            var thisUser = new sys_resource_dal().FindNoDeleteById(userId);

            if (thisArt != null && !string.IsNullOrEmpty(comment) && thisUser != null)
            {
                var skacDal = new sdk_kb_article_comment_dal();
                var timeNow = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
                var comm    = new sdk_kb_article_comment()
                {
                    comment        = comment,
                    create_time    = timeNow,
                    create_user_id = userId,
                    id             = skacDal.GetNextIdCom(),
                    update_time    = timeNow,
                    update_user_id = userId,
                    creator_name   = thisUser.name,
                    kb_article_id  = thisArt.id,
                };
                skacDal.Insert(comm);
                OperLogBLL.OperLogAdd <sdk_kb_article_comment>(comm, comm.id, userId, OPER_LOG_OBJ_CATE.SDK_KONWLEDGE_COMMENT, "新增知识库评论");
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 删除知识库评论
        /// </summary>
        public bool DeleteComment(long artComId, long userId)
        {
            var skacDal = new sdk_kb_article_comment_dal();
            var thisCom = skacDal.FindNoDeleteById(artComId);

            if (thisCom != null)
            {
                skacDal.SoftDelete(thisCom, userId);
                OperLogBLL.OperLogDelete <sdk_kb_article_comment>(thisCom, thisCom.id, userId, OPER_LOG_OBJ_CATE.SDK_KONWLEDGE_COMMENT, "删除知识库评论");
            }

            return(true);
        }